Changeset 220303 in webkit


Ignore:
Timestamp:
Aug 4, 2017 4:09:24 PM (7 years ago)
Author:
Chris Dumez
Message:

[Beacon] Update sendBeacon to use the CachedResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=175192
<rdar://problem/33725923>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline test as our Content-Type header has changed for ArrayBuffer / ArrayBufferView
payloads.

  • web-platform-tests/beacon/headers/header-content-type-expected.txt:

Source/WebCore:

Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
the PingLoader. This gets us closer to the specification which is based on
Fetch and reduces code duplication. This also fixes an issue where our
Origin header was not properly set on Beacon resquests.

In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
inflight keepalive requests which is needed to fully support sendBeacon().

  • Modules/beacon/NavigatorBeacon.cpp:

(WebCore::NavigatorBeacon::sendBeacon):

  • Modules/beacon/NavigatorBeacon.h:
  • loader/LinkLoader.cpp:

(WebCore::createLinkPreloadResourceClient):

  • loader/PingLoader.cpp:
  • loader/PingLoader.h:
  • loader/ResourceLoadInfo.cpp:

(WebCore::toResourceType):

  • loader/SubresourceLoader.cpp:

(WebCore::logResourceLoaded):

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::defaultPriorityForResourceType):
(WebCore::CachedResource::load):

  • loader/cache/CachedResource.h:
  • loader/cache/CachedResourceLoader.cpp:

(WebCore::createResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::contentTypeFromResourceType):
(WebCore::CachedResourceLoader::checkInsecureContent const):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
(WebCore::isResourceSuitableForDirectReuse):

  • loader/cache/CachedResourceLoader.h:

Source/WebKit:

Deal with new Beacon CachedResource type.

  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::maximumBufferingTime):

LayoutTests:

Rebaseline a few tests now that the Origin header is properly set of our Beacon
requests. This is a progression and matches the results from Blink.

Our Content-Type header for ArrayBuffer / ArrayBufferView payloads has also
changed. It is unclear which one is best but at least we are now consistent
with Fetch.

  • http/tests/blink/sendbeacon/beacon-cookie-expected.txt:
  • http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt:
  • http/tests/blink/sendbeacon/beacon-same-origin-expected.txt:
  • http/wpt/beacon/headers/header-content-type-same-origin.html:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r220302 r220303  
     12017-08-04  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Update sendBeacon to use the CachedResourceLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=175192
     5        <rdar://problem/33725923>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Rebaseline a few tests now that the Origin header is properly set of our Beacon
     10        requests. This is a progression and matches the results from Blink.
     11
     12        Our Content-Type header for ArrayBuffer / ArrayBufferView payloads has also
     13        changed. It is unclear which one is best but at least we are now consistent
     14        with Fetch.
     15
     16        * http/tests/blink/sendbeacon/beacon-cookie-expected.txt:
     17        * http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt:
     18        * http/tests/blink/sendbeacon/beacon-same-origin-expected.txt:
     19        * http/wpt/beacon/headers/header-content-type-same-origin.html:
     20
    1212017-08-04  John Wilander  <wilander@apple.com>
    222
  • trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cookie-expected.txt

    r220121 r220303  
    88PASS Content-Type: text/plain;charset=UTF-8
    99PASS Cookie: hello=world
    10 PASS Origin: null
     10PASS Origin: http://127.0.0.1:8000
    1111PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-cookie.html
    1212PASS Request-Method: POST
  • trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt

    r220121 r220303  
    77PASS Beacon sent successfully
    88PASS Content-Type: text/plain;charset=UTF-8
    9 PASS Origin: null
     9PASS Origin: http://127.0.0.1:8000
    1010PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-cross-origin.html
    1111PASS Request-Method: POST
  • trunk/LayoutTests/http/tests/blink/sendbeacon/beacon-same-origin-expected.txt

    r220121 r220303  
    88PASS Beacon sent successfully
    99PASS Content-Type: text/plain;charset=UTF-8
    10 PASS Origin: null
     10PASS Origin: http://127.0.0.1:8000
    1111PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html
    1212PASS Request-Method: POST
     
    1717PASS navigator.sendBeacon("resources/save-beacon.php?name=same-origin", payload); is true
    1818PASS Beacon sent successfully
    19 PASS Content-Type: application/octet-stream
    20 PASS Origin: null
     19PASS Content-Type: application/x-www-form-urlencoded
     20PASS Origin: http://127.0.0.1:8000
    2121PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html
    2222PASS Request-Method: POST
     
    2828PASS Beacon sent successfully
    2929PASS Content-Type: text/plain;from-beacon=true
    30 PASS Origin: null
     30PASS Origin: http://127.0.0.1:8000
    3131PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html
    3232PASS Request-Method: POST
     
    3838PASS Beacon sent successfully
    3939PASS Content-Type: multipart/form-data;
    40 PASS Origin: null
     40PASS Origin: http://127.0.0.1:8000
    4141PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html
    4242PASS Request-Method: POST
     
    4848PASS Beacon sent successfully
    4949PASS Content-Type: application/x-www-form-urlencoded;charset=UTF-8
    50 PASS Origin: null
     50PASS Origin: http://127.0.0.1:8000
    5151PASS Referer: http://127.0.0.1:8000/blink/sendbeacon/beacon-same-origin.html
    5252PASS Request-Method: POST
  • trunk/LayoutTests/http/wpt/beacon/headers/header-content-type-same-origin.html

    r220121 r220303  
    7878
    7979testContentTypeHeader("hi!", "text/plain;charset=UTF-8", "string");
    80 testContentTypeHeader(stringToArrayBufferView("123"), "application/octet-stream", "ArrayBufferView"); // Specification says no content-type but browsers seem to use "application/octet-stream".
    81 testContentTypeHeader(stringToArrayBuffer("123"), "application/octet-stream", "ArrayBuffer"); // Specification says no content-type but browsers seem to use "application/octet-stream".
     80testContentTypeHeader(stringToArrayBufferView("123"), "application/x-www-form-urlencoded", "ArrayBufferView"); // FIXME: It is unclear what the Content-Type should be here or if it should be present at all.
     81testContentTypeHeader(stringToArrayBuffer("123"), "application/x-www-form-urlencoded", "ArrayBuffer"); // FIXME: It is unclear what the Content-Type should be here or if it should be present at all.
    8282testContentTypeHeader(stringToBlob("123"), "text/plain", "Blob");
    8383testContentTypeHeader(stringToFormData("qwerty"), "multipart/form-data", "FormData");
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r220290 r220303  
     12017-08-04  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Update sendBeacon to use the CachedResourceLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=175192
     5        <rdar://problem/33725923>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Rebaseline test as our Content-Type header has changed for ArrayBuffer / ArrayBufferView
     10        payloads.
     11
     12        * web-platform-tests/beacon/headers/header-content-type-expected.txt:
     13
    1142017-08-04  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type-expected.txt

    r220121 r220303  
    1 CONSOLE MESSAGE: line 35: This requests requires a CORS preflight but this is not supported yet.
    21
    32PASS Test content-type header for a body string
    4 FAIL Test content-type header for a body ArrayBuffer assert_true: SendBeacon Succeeded expected true got false
     3PASS Test content-type header for a body ArrayBuffer
    54PASS Test content-type header for a body FormData
    65
  • trunk/Source/WebCore/ChangeLog

    r220302 r220303  
     12017-08-04  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Update sendBeacon to use the CachedResourceLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=175192
     5        <rdar://problem/33725923>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
     10        the PingLoader. This gets us closer to the specification which is based on
     11        Fetch and reduces code duplication. This also fixes an issue where our
     12        Origin header was not properly set on Beacon resquests.
     13
     14        In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
     15        inflight keepalive requests which is needed to fully support sendBeacon().
     16
     17        * Modules/beacon/NavigatorBeacon.cpp:
     18        (WebCore::NavigatorBeacon::sendBeacon):
     19        * Modules/beacon/NavigatorBeacon.h:
     20        * loader/LinkLoader.cpp:
     21        (WebCore::createLinkPreloadResourceClient):
     22        * loader/PingLoader.cpp:
     23        * loader/PingLoader.h:
     24        * loader/ResourceLoadInfo.cpp:
     25        (WebCore::toResourceType):
     26        * loader/SubresourceLoader.cpp:
     27        (WebCore::logResourceLoaded):
     28        * loader/cache/CachedResource.cpp:
     29        (WebCore::CachedResource::defaultPriorityForResourceType):
     30        (WebCore::CachedResource::load):
     31        * loader/cache/CachedResource.h:
     32        * loader/cache/CachedResourceLoader.cpp:
     33        (WebCore::createResource):
     34        (WebCore::CachedResourceLoader::requestBeaconResource):
     35        (WebCore::contentTypeFromResourceType):
     36        (WebCore::CachedResourceLoader::checkInsecureContent const):
     37        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
     38        (WebCore::isResourceSuitableForDirectReuse):
     39        * loader/cache/CachedResourceLoader.h:
     40
    1412017-08-04  John Wilander  <wilander@apple.com>
    242
  • trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp

    r220121 r220303  
    2727#include "NavigatorBeacon.h"
    2828
     29#include "CachedResourceLoader.h"
    2930#include "Document.h"
     31#include "FetchRequest.h"
    3032#include "Navigator.h"
    3133#include "URL.h"
     34#include <runtime/JSCJSValue.h>
    3235
    3336namespace WebCore {
    3437
    35 ExceptionOr<bool> NavigatorBeacon::sendBeacon(Navigator&, Document& document, const String& url, std::optional<BodyInit>&& data)
     38ExceptionOr<bool> NavigatorBeacon::sendBeacon(Navigator&, Document& document, const String& url, std::optional<FetchBody::Init>&& body)
    3639{
    3740    URL parsedUrl = document.completeURL(url);
     
    4447        return Exception { TypeError, ASCIILiteral("Beacons can only be sent over HTTP(S)") };
    4548
    46     auto* frame = document.frame();
    47     if (!frame)
     49    if (!document.frame())
    4850        return false;
    4951
    50     return PingLoader::sendBeacon(*frame, document, parsedUrl, WTFMove(data));
     52    auto& contentSecurityPolicy = *document.contentSecurityPolicy();
     53    if (!document.shouldBypassMainWorldContentSecurityPolicy() && !contentSecurityPolicy.allowConnectToSource(parsedUrl)) {
     54        // We simulate a network error so we return true here. This is consistent with Blink.
     55        return true;
     56    }
     57
     58    FetchRequestInit init;
     59    init.method = ASCIILiteral("POST");
     60    init.body = WTFMove(body);
     61    init.credentials = FetchOptions::Credentials::Include;
     62    init.cache = FetchOptions::Cache::NoCache;
     63    init.redirect = FetchOptions::Redirect::Follow;
     64    init.keepalive = true;
     65    init.window = JSC::jsNull();
     66
     67    auto fetchRequestResult = FetchRequest::create(document, parsedUrl.string(), WTFMove(init));
     68    if (fetchRequestResult.hasException())
     69        return fetchRequestResult.releaseException();
     70
     71    auto fetchRequest = fetchRequestResult.releaseReturnValue();
     72    document.cachedResourceLoader().requestBeaconResource({ fetchRequest->internalRequest(), fetchRequest->fetchOptions() });
     73    return true;
    5174}
    5275
  • trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.h

    r220121 r220303  
    2727
    2828#include "ExceptionOr.h"
    29 #include "PingLoader.h"
     29#include "FetchBody.h"
    3030#include <wtf/Forward.h>
    3131
     
    3737class NavigatorBeacon {
    3838public:
    39     static ExceptionOr<bool> sendBeacon(Navigator&, Document&, const String& url, std::optional<BodyInit>&&);
     39    static ExceptionOr<bool> sendBeacon(Navigator&, Document&, const String& url, std::optional<FetchBody::Init>&&);
    4040};
    4141
  • trunk/Source/WebCore/loader/LinkLoader.cpp

    r219051 r220303  
    163163    case CachedResource::XSLStyleSheet:
    164164#endif
     165    case CachedResource::Beacon:
    165166#if ENABLE(LINK_PREFETCH)
    166167    case CachedResource::LinkSubresource:
  • trunk/Source/WebCore/loader/PingLoader.cpp

    r220208 r220303  
    3535#include "PingLoader.h"
    3636
    37 #include "Blob.h"
    3837#include "ContentSecurityPolicy.h"
    39 #include "DOMFormData.h"
    4038#include "Document.h"
    41 #include "FormData.h"
    4239#include "Frame.h"
    4340#include "FrameLoader.h"
    4441#include "FrameLoaderClient.h"
    45 #include "HTTPHeaderNames.h"
    46 #include "HTTPHeaderValues.h"
    47 #include "HTTPParsers.h"
    4842#include "InspectorInstrumentation.h"
    4943#include "LoaderStrategy.h"
    5044#include "Page.h"
    51 #include "ParsedContentType.h"
    5245#include "PlatformStrategies.h"
    5346#include "ProgressTracker.h"
     
    5851#include "SecurityOrigin.h"
    5952#include "SecurityPolicy.h"
    60 #include "URLSearchParams.h"
    6153#include "UserContentController.h"
    62 #include <runtime/ArrayBuffer.h>
    63 #include <runtime/ArrayBufferView.h>
    64 #include <runtime/JSCInlines.h>
    6554#include <wtf/text/CString.h>
    6655
     
    191180}
    192181
    193 bool PingLoader::sendBeacon(Frame& frame, Document& document, const URL& url, std::optional<BodyInit>&& data)
    194 {
    195     ResourceRequest request(url);
    196     if (processContentExtensionRulesForLoad(frame, request, ResourceType::Raw))
    197         return false;
    198 
    199     auto& contentSecurityPolicy = *document.contentSecurityPolicy();
    200     if (!document.shouldBypassMainWorldContentSecurityPolicy() && !contentSecurityPolicy.allowConnectToSource(url)) {
    201         // We simulate a network error so we return true here. This is consistent with Blink.
    202         return true;
    203     }
    204 
    205     bool noCors = true;
    206     request.setHTTPMethod(ASCIILiteral("POST"));
    207     // FIXME: We should restrict the size of payloads.
    208     if (data) {
    209         String mimeType;
    210         WTF::switchOn(data.value(),
    211             [&] (RefPtr<Blob>& blob) {
    212                 auto& blobType = blob->type();
    213                 if (!blobType.isEmpty() && isValidContentType(blobType))
    214                     mimeType = blobType;
    215                 else
    216                     mimeType = ASCIILiteral("application/octet-stream");
    217                 auto formData = FormData::create();
    218                 formData->appendBlob(blob->url());
    219                 request.setHTTPBody(WTFMove(formData));
    220             },
    221             [&] (RefPtr<JSC::ArrayBuffer>& buffer) {
    222                 mimeType = ASCIILiteral("application/octet-stream");
    223                 request.setHTTPBody(FormData::create(buffer->data(), buffer->byteLength()));
    224             },
    225             [&] (RefPtr<JSC::ArrayBufferView>& buffer) {
    226                 mimeType = ASCIILiteral("application/octet-stream");
    227                 request.setHTTPBody(FormData::create(buffer->baseAddress(), buffer->byteLength()));
    228             },
    229             [&] (RefPtr<DOMFormData>& domFormData) {
    230                 auto formData = FormData::createMultiPart(*domFormData, domFormData->encoding(), &document);
    231                 formData->generateFiles(&document);
    232                 mimeType = makeString("multipart/form-data; boundary=", formData->boundary().data());
    233                 request.setHTTPBody(WTFMove(formData));
    234             },
    235             [&] (RefPtr<URLSearchParams>& searchParams) {
    236                 mimeType = HTTPHeaderValues::formURLEncodedContentType();
    237                 request.setHTTPBody(FormData::create(searchParams->toString().utf8()));
    238             },
    239             [&] (String& string) {
    240                 mimeType = HTTPHeaderValues::textPlainContentType();
    241                 request.setHTTPBody(FormData::create(string.utf8()));
    242             }
    243         );
    244         noCors = false;
    245         if (!mimeType.isEmpty()) {
    246             // If mimeType value is a CORS-safelisted request-header value for the Content-Type header, set corsMode to "no-cors".
    247             if (isCrossOriginSafeRequestHeader(HTTPHeaderName::ContentType, mimeType))
    248                 noCors = true;
    249             request.setHTTPContentType(mimeType);
    250         }
    251     }
    252     request.setHTTPHeaderField(HTTPHeaderName::CacheControl, "max-age=0");
    253     frame.loader().addExtraFieldsToSubresourceRequest(request);
    254 
    255     auto& sourceOrigin = document.securityOrigin();
    256     bool isCrossOriginRequest = !sourceOrigin.canRequest(url);
    257 
    258     // FIXME: We are supposed to do a preflight in this case but this is not supported yet.
    259     if (isCrossOriginRequest && !noCors) {
    260         document.addConsoleMessage(MessageSource::Security, MessageLevel::Error, ASCIILiteral("This requests requires a CORS preflight but this is not supported yet."));
    261         return false;
    262     }
    263 
    264     FrameLoader::addHTTPOriginIfNeeded(request, sourceOrigin.toString());
    265     String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), url, frame.loader().outgoingReferrer());
    266     if (!referrer.isEmpty())
    267         request.setHTTPReferrer(referrer);
    268 
    269     request.setAllowCookies(true); // Credentials mode: include.
    270     startPingLoad(frame, request, ShouldFollowRedirects::Yes);
    271     return true;
    272 }
    273 
    274182void PingLoader::startPingLoad(Frame& frame, ResourceRequest& request, ShouldFollowRedirects shouldFollowRedirects)
    275183{
  • trunk/Source/WebCore/loader/PingLoader.h

    r220121 r220303  
    3535#include <wtf/Forward.h>
    3636#include <wtf/Ref.h>
    37 #include <wtf/Variant.h>
    38 
    39 namespace JSC {
    40 
    41 class ArrayBuffer;
    42 class ArrayBufferView;
    43 
    44 }
    4537
    4638namespace WebCore {
    4739
    48 class Blob;
    49 class DOMFormData;
    50 class Document;
    5140class FormData;
    5241class Frame;
    5342class URL;
    54 class URLSearchParams;
    5543class ResourceRequest;
    5644
     
    6048};
    6149
    62 using BodyInit = Variant<RefPtr<Blob>, RefPtr<JSC::ArrayBufferView>, RefPtr<JSC::ArrayBuffer>, RefPtr<DOMFormData>, RefPtr<URLSearchParams>, String>;
    63 
    6450class PingLoader {
    6551public:
    6652    static void loadImage(Frame&, const URL&);
    67     static bool sendBeacon(Frame&, Document&, const URL&, std::optional<BodyInit>&&);
    6853    static void sendPing(Frame&, const URL& pingURL, const URL& destinationURL);
    6954    static void sendViolationReport(Frame&, const URL& reportURL, Ref<FormData>&& report, ViolationReportType);
  • trunk/Source/WebCore/loader/ResourceLoadInfo.cpp

    r218393 r220303  
    5656        return ResourceType::Font;
    5757
     58    case CachedResource::Beacon:
    5859    case CachedResource::MediaResource:
    5960    case CachedResource::Icon:
     
    7172#endif
    7273    };
     74    return ResourceType::Raw;
    7375}
    7476
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r219954 r220303  
    448448        resourceType = DiagnosticLoggingKeys::fontKey();
    449449        break;
     450    case CachedResource::Beacon:
     451        ASSERT_NOT_REACHED();
     452        break;
    450453    case CachedResource::MediaResource:
    451454    case CachedResource::Icon:
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r218393 r220303  
    8989    case CachedResource::SVGDocumentResource:
    9090        return ResourceLoadPriority::Low;
     91    case CachedResource::Beacon:
     92        return ResourceLoadPriority::VeryLow;
    9193#if ENABLE(LINK_PREFETCH)
    9294    case CachedResource::LinkPrefetch:
     
    256258        request.setURL(url);
    257259        m_fragmentIdentifierForRequest = String();
     260    }
     261
     262    // FIXME: We should not special-case Beacon here.
     263    if (m_options.keepAlive && type() == CachedResource::Beacon) {
     264        platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, m_options.credentials == FetchOptions::Credentials::Include, m_options.redirect == FetchOptions::Redirect::Follow);
     265        return;
    258266    }
    259267
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r218393 r220303  
    7373        RawResource,
    7474        Icon,
     75        Beacon,
    7576        SVGDocumentResource
    7677#if ENABLE(XSLT)
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r220208 r220303  
    109109    case CachedResource::MainResource:
    110110        return new CachedRawResource(WTFMove(request), type, sessionID);
     111    case CachedResource::Beacon:
     112        return new CachedResource(WTFMove(request), CachedResource::Beacon, sessionID);
    111113#if ENABLE(XSLT)
    112114    case CachedResource::XSLStyleSheet:
     
    288290}
    289291
     292CachedResourceHandle<CachedResource> CachedResourceLoader::requestBeaconResource(CachedResourceRequest&& request)
     293{
     294    return requestResource(CachedResource::Beacon, WTFMove(request)).get();
     295}
     296
    290297CachedResourceHandle<CachedRawResource> CachedResourceLoader::requestMainResource(CachedResourceRequest&& request)
    291298{
     
    313320#endif
    314321
     322    case CachedResource::Beacon:
    315323    case CachedResource::RawResource:
    316324    case CachedResource::Icon:
     
    382390    }
    383391    case CachedResource::MainResource:
     392    case CachedResource::Beacon:
    384393#if ENABLE(LINK_PREFETCH)
    385394    case CachedResource::LinkPrefetch:
     
    432441            return false;
    433442        break;
     443    case CachedResource::Beacon:
    434444    case CachedResource::RawResource:
    435445        return true;
     
    625635    // FIXME: Implement reuse of cached raw resources.
    626636    if (resource.type() == CachedResource::Type::RawResource || resource.type() == CachedResource::Type::MediaResource)
     637        return false;
     638
     639    if (resource.type() == CachedResource::Beacon)
    627640        return false;
    628641
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.h

    r219954 r220303  
    7979    CachedResourceHandle<CachedRawResource> requestMedia(CachedResourceRequest&&);
    8080    CachedResourceHandle<CachedRawResource> requestIcon(CachedResourceRequest&&);
     81    CachedResourceHandle<CachedResource> requestBeaconResource(CachedResourceRequest&&);
    8182    CachedResourceHandle<CachedRawResource> requestRawResource(CachedResourceRequest&&);
    8283    CachedResourceHandle<CachedRawResource> requestMainResource(CachedResourceRequest&&);
  • trunk/Source/WebKit/ChangeLog

    r220302 r220303  
     12017-08-04  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Update sendBeacon to use the CachedResourceLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=175192
     5        <rdar://problem/33725923>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Deal with new Beacon CachedResource type.
     10
     11        * WebProcess/Network/WebLoaderStrategy.cpp:
     12        (WebKit::maximumBufferingTime):
     13
    1142017-08-04  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

    r220208 r220303  
    106106
    107107    switch (resource->type()) {
     108    case CachedResource::Beacon:
    108109    case CachedResource::CSSStyleSheet:
    109110    case CachedResource::Script:
Note: See TracChangeset for help on using the changeset viewer.