Changeset 51967 in webkit


Ignore:
Timestamp:
Dec 10, 2009 3:33:23 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-10 Mike Belshe <mike@belshe.com>

Reviewed by Darin Fisher.

Fix FrameLoader to use the new ResourceTypes properly.

https://bugs.webkit.org/show_bug.cgi?id=32336

  • public/WebURLRequest.h: (WebKit::WebURLRequest::):
  • src/FrameLoaderClientImpl.cpp: (WebKit::setTargetTypeFromLoader): (WebKit::FrameLoaderClientImpl::dispatchWillSendRequest):
Location:
trunk/WebKit/chromium
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r51949 r51967  
     12009-12-10  Mike Belshe  <mike@belshe.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Fix FrameLoader to use the new ResourceTypes properly.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=32336
     8
     9        * public/WebURLRequest.h:
     10        (WebKit::WebURLRequest::):
     11        * src/FrameLoaderClientImpl.cpp:
     12        (WebKit::setTargetTypeFromLoader):
     13        (WebKit::FrameLoaderClientImpl::dispatchWillSendRequest):
     14
    1152009-12-10  Ilya Tikhonovsky <loislo@google.com>
    216
  • trunk/WebKit/chromium/public/WebURLRequest.h

    r50697 r51967  
    5858
    5959    enum TargetType {
    60         TargetIsMainFrame,
    61         TargetIsSubFrame,
    62         TargetIsSubResource,
    63         TargetIsObject,
    64         TargetIsMedia
     60        TargetIsMainFrame = 0,
     61        TargetIsSubFrame = 1,   // Temporary for backward compatibility.
     62        TargetIsSubframe = 1,
     63        TargetIsSubResource = 2,  // Temporary for backward comptibility.
     64        TargetIsSubresource = 2,
     65        TargetIsStyleSheet = 3,
     66        TargetIsScript = 4,
     67        TargetIsFontResource = 5,
     68        TargetIsImage = 6,
     69        TargetIsObject = 7,
     70        TargetIsMedia = 8
    6571    };
    6672
  • trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp

    r51917 r51967  
    238238}
    239239
    240 // Determines whether the request being loaded by |loader| is a frame or a
    241 // subresource. A subresource in this context is anything other than a frame --
     240// If the request being loaded by |loader| is a frame, update the ResourceType.
     241// A subresource in this context is anything other than a frame --
    242242// this includes images and xmlhttp requests.  It is important to note that a
    243243// subresource is NOT limited to stuff loaded through the frame's subresource
     
    247247// The important edge cases to consider when modifying this function are
    248248// how synchronous resource loads are treated during load/unload threshold.
    249 static ResourceRequest::TargetType determineTargetTypeFromLoader(DocumentLoader* loader)
     249static void setTargetTypeFromLoader(ResourceRequest& request, DocumentLoader* loader)
    250250{
    251251    if (loader == loader->frameLoader()->provisionalDocumentLoader()) {
     252        ResourceRequest::TargetType type;
    252253        if (loader->frameLoader()->isLoadingMainFrame())
    253             return ResourceRequest::TargetIsMainFrame;
    254         return ResourceRequest::TargetIsSubframe;
    255     }
    256     return ResourceRequest::TargetIsSubresource;
     254            type = ResourceRequest::TargetIsMainFrame;
     255        else
     256            type = ResourceRequest::TargetIsSubframe;
     257        request.setTargetType(type);
     258    }
    257259}
    258260
     
    264266        // We want to distinguish between a request for a document to be loaded into
    265267        // the main frame, a sub-frame, or the sub-objects in that document.
    266         request.setTargetType(determineTargetTypeFromLoader(loader));
     268        setTargetTypeFromLoader(request, loader));
    267269
    268270        // Avoid repeating a form submission when navigating back or forward.
Note: See TracChangeset for help on using the changeset viewer.