Changeset 112940 in webkit


Ignore:
Timestamp:
Apr 2, 2012 2:15:23 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Set ResourceRequest TargetType in WebPagePrivate::load()
https://bugs.webkit.org/show_bug.cgi?id=80519

Source/WebCore:

Stop asserting in platformCachePolicyForRequest() as now it is expected
that the ResourceRequest might not have the right TargetType setup at
this time for main loads.

Patch by Lianghui Chen <liachen@rim.com> on 2012-04-02
Reviewed by Rob Buis.

No new tests as no change in behaviour.

  • platform/network/blackberry/ResourceRequestBlackBerry.cpp:

(WebCore::platformCachePolicyForRequest):

Source/WebKit/blackberry:

Set the right TargetType for main loads if they are not already set in
dispatchWillSendRequest().

Also adjust NetworkRequest TargetType for decidePolicyForExternalLoad()
and dispatchDecidePolicyForNavigationAction() as they are called before
dispatchWillSendRequest() is called. Patch to change ResourceRequest
TargetType earlier has been rejected as in WebKit bug
https://bugs.webkit.org/show_bug.cgi?id=80713

Patch by Lianghui Chen <liachen@rim.com> on 2012-04-02
Reviewed by Rob Buis.

  • WebCoreSupport/FrameLoaderClientBlackBerry.cpp:

(WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction):
(WebCore::FrameLoaderClientBlackBerry::dispatchWillSendRequest):
(WebCore::FrameLoaderClientBlackBerry::decidePolicyForExternalLoad):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112939 r112940  
     12012-04-02  Lianghui Chen  <liachen@rim.com>
     2
     3        [BlackBerry] Set ResourceRequest TargetType in WebPagePrivate::load()
     4        https://bugs.webkit.org/show_bug.cgi?id=80519
     5
     6        Stop asserting in platformCachePolicyForRequest() as now it is expected
     7        that the ResourceRequest might not have the right TargetType setup at
     8        this time for main loads.
     9
     10        Reviewed by Rob Buis.
     11
     12        No new tests as no change in behaviour.
     13
     14        * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
     15        (WebCore::platformCachePolicyForRequest):
     16
    1172012-04-02  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp

    r112764 r112940  
    4747        return NetworkRequest::ReturnCacheDataDontLoad;
    4848    default:
    49         ASSERT_NOT_REACHED();
    5049        return NetworkRequest::UseProtocolCachePolicy;
    5150    }
  • trunk/Source/WebKit/blackberry/ChangeLog

    r112819 r112940  
     12012-04-02  Lianghui Chen  <liachen@rim.com>
     2
     3        [BlackBerry] Set ResourceRequest TargetType in WebPagePrivate::load()
     4        https://bugs.webkit.org/show_bug.cgi?id=80519
     5
     6        Set the right TargetType for main loads if they are not already set in
     7        dispatchWillSendRequest().
     8
     9        Also adjust NetworkRequest TargetType for decidePolicyForExternalLoad()
     10        and dispatchDecidePolicyForNavigationAction() as they are called before
     11        dispatchWillSendRequest() is called. Patch to change ResourceRequest
     12        TargetType earlier has been rejected as in WebKit bug
     13        https://bugs.webkit.org/show_bug.cgi?id=80713
     14
     15        Reviewed by Rob Buis.
     16
     17        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
     18        (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction):
     19        (WebCore::FrameLoaderClientBlackBerry::dispatchWillSendRequest):
     20        (WebCore::FrameLoaderClientBlackBerry::decidePolicyForExternalLoad):
     21
    1222012-04-01  Arvid Nilsson  <anilsson@rim.com>
    223
  • trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp

    r112252 r112940  
    7373using namespace WebCore;
    7474using namespace BlackBerry::WebKit;
     75using BlackBerry::Platform::NetworkRequest;
    7576
    7677// This was copied from file "WebKit/Source/WebKit/mac/Misc/WebKitErrors.h".
     
    210211        // Let the client have a chance to say whether this navigation should
    211212        // be ignored or not.
    212         BlackBerry::Platform::NetworkRequest platformRequest;
     213        NetworkRequest platformRequest;
    213214        request.initializePlatformRequest(platformRequest, cookiesEnabled());
     215        if (platformRequest.getTargetType() == NetworkRequest::TargetIsUnknown)
     216            platformRequest.setTargetType(isMainFrame() ? NetworkRequest::TargetIsMainFrame : NetworkRequest::TargetIsSubframe);
     217
    214218        if (isMainFrame() && !m_webPagePrivate->m_client->acceptNavigationRequest(
    215219            platformRequest, BlackBerry::Platform::NavigationType(action.type()))) {
     
    932936    bool isMainResourceLoad = docLoader && docLoader == docLoader->frameLoader()->provisionalDocumentLoader();
    933937
     938    // TargetType for subresource loads should have been set in CachedResource::load().
     939    if (isMainResourceLoad && request.targetType() == ResourceRequest::TargetIsUnspecified)
     940        request.setTargetType(isMainFrame() ? ResourceRequest::TargetIsMainFrame : ResourceRequest::TargetIsSubframe);
     941
    934942    // Any processing which is done for all loads (both main and subresource) should go here.
    935     BlackBerry::Platform::NetworkRequest platformRequest;
     943    NetworkRequest platformRequest;
    936944    request.initializePlatformRequest(platformRequest, cookiesEnabled());
    937945    m_webPagePrivate->m_client->populateCustomHeaders(platformRequest);
    938     const BlackBerry::Platform::NetworkRequest::HeaderList& headerLists = platformRequest.getHeaderListRef();
    939     for (BlackBerry::Platform::NetworkRequest::HeaderList::const_iterator it = headerLists.begin(); it != headerLists.end(); ++it) {
     946    const NetworkRequest::HeaderList& headerLists = platformRequest.getHeaderListRef();
     947    for (NetworkRequest::HeaderList::const_iterator it = headerLists.begin(); it != headerLists.end(); ++it) {
    940948        std::string headerString = it->first;
    941949        std::string headerValueString = it->second;
     
    10921100            && !request.mustHandleInternally()
    10931101            && !isFragmentScroll) {
    1094         BlackBerry::Platform::NetworkRequest platformRequest;
     1102        NetworkRequest platformRequest;
    10951103        request.initializePlatformRequest(platformRequest, cookiesEnabled());
     1104        if (platformRequest.getTargetType() == NetworkRequest::TargetIsUnknown)
     1105            platformRequest.setTargetType(isMainFrame() ? NetworkRequest::TargetIsMainFrame : NetworkRequest::TargetIsSubframe);
     1106
    10961107        m_webPagePrivate->m_client->handleExternalLink(platformRequest, request.anchorText().characters(), request.anchorText().length(), m_clientRedirectIsPending);
    10971108        return PolicyIgnore;
     
    11601171{
    11611172    // FIXME: use the suggestedName?
    1162     m_webPagePrivate->load(request.url().string().utf8().data(), 0, "GET", BlackBerry::Platform::NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, true, "");
     1173    m_webPagePrivate->load(request.url().string().utf8().data(), 0, "GET", NetworkRequest::UseProtocolCachePolicy, 0, 0, 0, 0, false, false, true, "");
    11631174}
    11641175
Note: See TracChangeset for help on using the changeset viewer.