Changeset 97633 in webkit


Ignore:
Timestamp:
Oct 17, 2011 10:55:31 AM (13 years ago)
Author:
adachan@apple.com
Message:

Source/WebCore: Export KURL::baseAsString() so it can be called in WebProcessProxy::assumeReadAccessToBaseURL() in WebKit2.
https://bugs.webkit.org/show_bug.cgi?id=70168

Reviewed by Alexey Proskuryakov.

No new tests. There is no change in functionality.

  • WebCore.exp.in: Export KURL::baseAsString().

Source/WebKit2: Calling WKPageLoadAlternateHTMLString() where baseURL does not point to a directory causes an invalid message to be returned from WebProcess
https://bugs.webkit.org/show_bug.cgi?id=70168

Reviewed by Alexey Proskuryakov.

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::assumeReadAccessToBaseURL): Add the file path of url's base URL to m_localPathsWithAssumedReadAccess,
since url may not point to a directory.

Tools: Add a test to call WKPageLoadAlternateHTMLString() with a non-directory URL.
https://bugs.webkit.org/show_bug.cgi?id=70168

Reviewed by Alexey Proskuryakov.

  • TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: Added.

(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST): Call WKPageLoadAlternateHTMLString() with a file URL and make sure it finishes loading.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/win/TestWebKitAPI.vcproj:

Add the new file.

Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r97632 r97633  
     12011-10-17  Ada Chan  <adachan@apple.com>
     2
     3        Export KURL::baseAsString() so it can be called in WebProcessProxy::assumeReadAccessToBaseURL() in WebKit2.
     4        https://bugs.webkit.org/show_bug.cgi?id=70168
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        No new tests. There is no change in functionality.
     9
     10        * WebCore.exp.in: Export KURL::baseAsString().
     11
    1122011-10-17  Ryosuke Niwa  <rniwa@webkit.org>
    213
  • trunk/Source/WebCore/WebCore.exp.in

    r97587 r97633  
    12861286__ZNK7WebCore4KURL11createCFURLEv
    12871287__ZNK7WebCore4KURL11isLocalFileEv
     1288__ZNK7WebCore4KURL12baseAsStringEv
    12881289__ZNK7WebCore4KURL14fileSystemPathEv
    12891290__ZNK7WebCore4KURL17lastPathComponentEv
  • trunk/Source/WebKit2/ChangeLog

    r97624 r97633  
     12011-10-17  Ada Chan  <adachan@apple.com>
     2
     3        Calling WKPageLoadAlternateHTMLString() where baseURL does not point to a directory causes an invalid message to be returned from WebProcess
     4        https://bugs.webkit.org/show_bug.cgi?id=70168
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * UIProcess/WebProcessProxy.cpp:
     9        (WebKit::WebProcessProxy::assumeReadAccessToBaseURL): Add the file path of url's base URL to m_localPathsWithAssumedReadAccess,
     10        since url may not point to a directory.
     11
    1122011-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r96014 r97633  
    210210        return;
    211211
     212    // There's a chance that urlString does not point to a directory.
     213    // Get url's base URL to add to m_localPathsWithAssumedReadAccess.
     214    KURL baseURL(KURL(), url.baseAsString());
     215   
    212216    // Client loads an alternate string. This doesn't grant universal file read, but the web process is assumed
    213217    // to have read access to this directory already.
    214     m_localPathsWithAssumedReadAccess.add(url.fileSystemPath());
     218    m_localPathsWithAssumedReadAccess.add(baseURL.fileSystemPath());
    215219}
    216220
  • trunk/Tools/ChangeLog

    r97626 r97633  
     12011-10-17  Ada Chan  <adachan@apple.com>
     2
     3        Add a test to call WKPageLoadAlternateHTMLString() with a non-directory URL.
     4        https://bugs.webkit.org/show_bug.cgi?id=70168
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: Added.
     9        (TestWebKitAPI::didFinishLoadForFrame):
     10        (TestWebKitAPI::TEST): Call WKPageLoadAlternateHTMLString() with a file URL and make sure it finishes loading.
     11
     12        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     13        * TestWebKitAPI/win/TestWebKitAPI.vcproj:
     14        Add the new file.
     15
    1162011-10-17  Darin Adler  <darin@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r97187 r97633  
    3232                520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */; };
    3333                520BCF4D141EB09E00937EA8 /* WebArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 520BCF4B141EB09E00937EA8 /* WebArchive.cpp */; };
     34                52CB47411448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52CB47401448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp */; };
    3435                81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81B50192140F232300D9EB58 /* StringBuilder.cpp */; };
    3536                939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */ = {isa = PBXBuildFile; fileRef = 939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */; };
     
    163164                520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebArchive_Bundle.cpp; sourceTree = "<group>"; };
    164165                520BCF4B141EB09E00937EA8 /* WebArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebArchive.cpp; sourceTree = "<group>"; };
     166                52CB47401448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadAlternateHTMLStringWithNonDirectoryURL.cpp; sourceTree = "<group>"; };
    165167                81B50192140F232300D9EB58 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringBuilder.cpp; path = WTF/StringBuilder.cpp; sourceTree = "<group>"; };
    166168                8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
     
    364366                                BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
    365367                                BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */,
     368                                52CB47401448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp */,
    366369                                33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
    367370                                33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
     
    622625                                F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
    623626                                C0991C51143C7D68007998F2 /* RetainPtrHashing.cpp in Sources */,
     627                                52CB47411448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
    624628                        );
    625629                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj

    r96757 r97633  
    490490                                <File
    491491                                        RelativePath="..\Tests\WebKit2\InjectedBundleBasic.cpp"
     492                                        >
     493                                </File>
     494                                <File
     495                                        RelativePath="..\Tests\WebKit2\LoadAlternateHTMLStringWithNonDirectoryURL.cpp"
    492496                                        >
    493497                                </File>
Note: See TracChangeset for help on using the changeset viewer.