Changeset 220922 in webkit


Ignore:
Timestamp:
Aug 18, 2017 10:58:41 AM (7 years ago)
Author:
Chris Dumez
Message:

[Beacon] Add support for quota limitation
https://bugs.webkit.org/show_bug.cgi?id=175443
<rdar://problem/33729002>

Reviewed by Youenn Fablet.

Source/WebCore:

LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
in-flight.

No new tests, updated existing test.

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

(WebCore::PingLoader::startPingLoad):

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::load):

  • platform/network/PingHandle.h:

Source/WebKit:

WebLoaderStrategy now generates an identifier for ping loads and keep
the completion handler in a local HashMap. Once the ping load is done,
the network process sends an IPC message back to the WebContent process
so that WebLoaderStrategy can look up the completion handler for the
ping load and call it.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/PingLoad.cpp:

(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::~PingLoad):

  • NetworkProcess/PingLoad.h:
  • WebProcess/Network/NetworkProcessConnection.cpp:

(WebKit::NetworkProcessConnection::didFinishPingLoad):

  • WebProcess/Network/NetworkProcessConnection.h:
  • WebProcess/Network/NetworkProcessConnection.messages.in:
  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::generatePingLoadIdentifier):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::didFinishPingLoad):

  • WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

  • WebCoreSupport/WebResourceLoadScheduler.cpp:

(WebResourceLoadScheduler::startPingLoad):

  • WebCoreSupport/WebResourceLoadScheduler.h:

LayoutTests:

Extend layout test coverage and rebaseline test.

  • http/wpt/beacon/beacon-quota-expected.txt:
  • http/wpt/beacon/beacon-quota.html:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r220920 r220922  
     12017-08-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Add support for quota limitation
     4        https://bugs.webkit.org/show_bug.cgi?id=175443
     5        <rdar://problem/33729002>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Extend layout test coverage and rebaseline test.
     10
     11        * http/wpt/beacon/beacon-quota-expected.txt:
     12        * http/wpt/beacon/beacon-quota.html:
     13
    1142017-08-18  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/LayoutTests/http/wpt/beacon/beacon-quota-expected.txt

    r220751 r220922  
    1 CONSOLE MESSAGE: line 14: Reached maximum amount of queued data of 64Kb for keepalive requests
     1CONSOLE MESSAGE: line 44: Reached maximum amount of queued data of 64Kb for keepalive requests
     2CONSOLE MESSAGE: line 52: Reached maximum amount of queued data of 64Kb for keepalive requests
    23
    34PASS Beacon with a body above the Quota Limit should fail.
    4 FAIL Multiple Beacons Quota Limit assert_false: Second beacon should not be sent because we reached the quota expected false got true
     5PASS Multiple Beacons Quota Limit
    56
  • trunk/LayoutTests/http/wpt/beacon/beacon-quota.html

    r220751 r220922  
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
     4<script src="/common/utils.js"></script>
    45<script>
     6    const RESOURCES_DIR = "/WebKit/beacon/resources/";
     7
    58    // We should expect 64KiB of rolling quota for any type of keep-alive request sent.
    69    var expectedQuota = 65536;
     10
     11    function checkBeaconReceived(id)
     12    {
     13        return new Promise(function(resolve, reject) {
     14            var checkUrl = RESOURCES_DIR + "beacon-preflight.py?cmd=get&id=" + id;
     15            fetch(checkUrl).then(response => {
     16                response.json().then(result => {
     17                    resolve(result['beacon'] == 1);
     18                });
     19            }, reject);
     20        });
     21    }
     22
     23    function waitForBeacon(id)
     24    {
     25        return new Promise(function(resolve, reject) {
     26            checkBeaconReceived(id).then(wasReceived => {
     27                if (wasReceived) {
     28                    resolve();
     29                    return;
     30                }
     31                setTimeout(function() {
     32                    waitForBeacon(id).then(resolve, reject);
     33                }, 10);
     34            });
     35        });
     36    }
    737
    838    function createPayload(payloadSize)
     
    1545    }, "Beacon with a body above the Quota Limit should fail.");
    1646
    17     test(function() {
    18         assert_true(navigator.sendBeacon("/", createPayload(expectedQuota)), "Beacon with a body at the Quota Limit should succeed.");
    19         assert_false(navigator.sendBeacon("/", createPayload(1)), "Second beacon should not be sent because we reached the quota");
     47    promise_test(function() {
     48        var id = self.token();
     49        var target = RESOURCES_DIR + "beacon-preflight.py?allowCors=1&cmd=put&id=" + id;
     50
     51        assert_true(navigator.sendBeacon(target, createPayload(expectedQuota)), "Beacon with a body at the Quota Limit should succeed.");
     52        assert_false(navigator.sendBeacon(target, createPayload(1)), "Second beacon should not be sent because we reached the quota");
     53        return waitForBeacon(id).then(function() {
     54            assert_true(navigator.sendBeacon(target, createPayload(1)), "Allocated quota should be returned once the beacon is no longer in flight");
     55        });
    2056    }, "Multiple Beacons Quota Limit");
    2157</script>
  • trunk/Source/WebCore/ChangeLog

    r220917 r220922  
     12017-08-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Add support for quota limitation
     4        https://bugs.webkit.org/show_bug.cgi?id=175443
     5        <rdar://problem/33729002>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
     10        to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
     11        quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
     12        order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
     13        in-flight.
     14
     15        No new tests, updated existing test.
     16
     17        * loader/LoaderStrategy.h:
     18        * loader/PingLoader.cpp:
     19        (WebCore::PingLoader::startPingLoad):
     20        * loader/cache/CachedResource.cpp:
     21        (WebCore::CachedResource::load):
     22        * platform/network/PingHandle.h:
     23
    1242017-08-18  Youenn Fablet  <youenn@apple.com>
    225
  • trunk/Source/WebCore/loader/LoaderStrategy.h

    r220888 r220922  
    6565    virtual void resumePendingRequests() = 0;
    6666
    67     virtual void createPingHandle(NetworkingContext*, ResourceRequest&, const HTTPHeaderMap& originalRequestHeaders, Ref<SecurityOrigin>&& sourceOrigin, ContentSecurityPolicy*, const FetchOptions&) = 0;
     67    virtual void startPingLoad(NetworkingContext*, ResourceRequest&, const HTTPHeaderMap& originalRequestHeaders, Ref<SecurityOrigin>&& sourceOrigin, ContentSecurityPolicy*, const FetchOptions&, WTF::Function<void()>&& completionHandler = { }) = 0;
    6868
    6969    virtual void storeDerivedDataToCache(const SHA1::Digest& bodyKey, const String& type, const String& partition, WebCore::SharedBuffer&) = 0;
  • trunk/Source/WebCore/loader/PingLoader.cpp

    r220817 r220922  
    204204
    205205    auto* contentSecurityPolicy = document.shouldBypassMainWorldContentSecurityPolicy() ? nullptr : document.contentSecurityPolicy();
    206     platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, WTFMove(originalRequestHeaders), document.securityOrigin(), contentSecurityPolicy, options);
    207 }
    208 
    209 }
     206    platformStrategies()->loaderStrategy()->startPingLoad(frame.loader().networkingContext(), request, WTFMove(originalRequestHeaders), document.securityOrigin(), contentSecurityPolicy, options);
     207}
     208
     209}
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r220888 r220922  
    269269        // FIXME: We should not special-case Beacon here.
    270270        if (shouldUsePingLoad(type())) {
    271         ASSERT(m_origin);
     271            ASSERT(m_origin);
    272272            // Beacon is not exposed to workers so it is safe to rely on the document here.
    273273            auto* document = cachedResourceLoader.document();
    274274            auto* contentSecurityPolicy = document && !document->shouldBypassMainWorldContentSecurityPolicy() ? document->contentSecurityPolicy() : nullptr;
    275275            ASSERT(m_originalRequestHeaders);
    276             platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, *m_originalRequestHeaders, *m_origin, contentSecurityPolicy, m_options);
    277             // FIXME: We currently do not get notified when ping loads finish so we treat them as finishing right away.
    278             finishLoading(nullptr);
     276            CachedResourceHandle<CachedResource> protectedThis(this);
     277            platformStrategies()->loaderStrategy()->startPingLoad(frame.loader().networkingContext(), request, *m_originalRequestHeaders, *m_origin, contentSecurityPolicy, m_options, [this, protectedThis = WTFMove(protectedThis)] {
     278                finishLoading(nullptr);
     279            });
    279280            return;
    280281        }
  • trunk/Source/WebCore/platform/network/PingHandle.h

    r215173 r220922  
    4444    };
    4545   
    46     PingHandle(NetworkingContext* networkingContext, const ResourceRequest& request, bool shouldUseCredentialStorage, UsesAsyncCallbacks useAsyncCallbacks, bool shouldFollowRedirects)
     46    PingHandle(NetworkingContext* networkingContext, const ResourceRequest& request, bool shouldUseCredentialStorage, UsesAsyncCallbacks useAsyncCallbacks, bool shouldFollowRedirects, WTF::Function<void()>&& completionHandler)
    4747        : m_timeoutTimer(*this, &PingHandle::timeoutTimerFired)
    4848        , m_shouldUseCredentialStorage(shouldUseCredentialStorage)
    4949        , m_shouldFollowRedirects(shouldFollowRedirects)
    5050        , m_usesAsyncCallbacks(useAsyncCallbacks)
     51        , m_completionHandler(WTFMove(completionHandler))
    5152    {
    5253        m_handle = ResourceHandle::create(networkingContext, request, this, false, false);
     
    8081    virtual ~PingHandle()
    8182    {
     83        if (m_completionHandler)
     84            m_completionHandler();
     85
    8286        if (m_handle) {
    8387            ASSERT(m_handle->client() == this);
     
    9296    bool m_shouldFollowRedirects;
    9397    UsesAsyncCallbacks m_usesAsyncCallbacks;
     98    WTF::Function<void()> m_completionHandler;
    9499};
    95100
  • trunk/Source/WebKit/ChangeLog

    r220917 r220922  
     12017-08-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Add support for quota limitation
     4        https://bugs.webkit.org/show_bug.cgi?id=175443
     5        <rdar://problem/33729002>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        WebLoaderStrategy now generates an identifier for ping loads and keep
     10        the completion handler in a local HashMap. Once the ping load is done,
     11        the network process sends an IPC message back to the WebContent process
     12        so that WebLoaderStrategy can look up the completion handler for the
     13        ping load and call it.
     14
     15        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     16        (WebKit::NetworkConnectionToWebProcess::loadPing):
     17        (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
     18        * NetworkProcess/NetworkConnectionToWebProcess.h:
     19        * NetworkProcess/PingLoad.cpp:
     20        (WebKit::PingLoad::PingLoad):
     21        (WebKit::PingLoad::~PingLoad):
     22        * NetworkProcess/PingLoad.h:
     23        * WebProcess/Network/NetworkProcessConnection.cpp:
     24        (WebKit::NetworkProcessConnection::didFinishPingLoad):
     25        * WebProcess/Network/NetworkProcessConnection.h:
     26        * WebProcess/Network/NetworkProcessConnection.messages.in:
     27        * WebProcess/Network/WebLoaderStrategy.cpp:
     28        (WebKit::generatePingLoadIdentifier):
     29        (WebKit::WebLoaderStrategy::startPingLoad):
     30        (WebKit::WebLoaderStrategy::didFinishPingLoad):
     31        * WebProcess/Network/WebLoaderStrategy.h:
     32
    1332017-08-18  Youenn Fablet  <youenn@apple.com>
    234
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r220917 r220922  
    240240#if USE(NETWORK_SESSION)
    241241    // PingLoad manages its own lifetime, deleting itself when its purpose has been fulfilled.
    242     new PingLoad(WTFMove(loadParameters), WTFMove(originalRequestHeaders));
     242    new PingLoad(WTFMove(loadParameters), WTFMove(originalRequestHeaders), *this);
    243243#else
    244244    UNUSED_PARAM(originalRequestHeaders);
     
    246246
    247247    // PingHandle manages its own lifetime, deleting itself when its purpose has been fulfilled.
    248     new PingHandle(context.get(), loadParameters.request, loadParameters.allowStoredCredentials == AllowStoredCredentials, PingHandle::UsesAsyncCallbacks::Yes, loadParameters.shouldFollowRedirects);
    249 #endif
     248    new PingHandle(context.get(), loadParameters.request, loadParameters.allowStoredCredentials == AllowStoredCredentials, PingHandle::UsesAsyncCallbacks::Yes, loadParameters.shouldFollowRedirects, [this, protectedThis = makeRef(*this), identifier = loadParameters.identifier] {
     249        didFinishPingLoad(identifier);
     250    });
     251#endif
     252}
     253
     254void NetworkConnectionToWebProcess::didFinishPingLoad(uint64_t pingLoadIdentifier)
     255{
     256    if (!m_connection->isValid())
     257        return;
     258
     259    m_connection->send(Messages::NetworkProcessConnection::DidFinishPingLoad(pingLoadIdentifier), 0);
    250260}
    251261
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r220917 r220922  
    6262
    6363    void didCleanupResourceLoader(NetworkResourceLoader&);
     64    void didFinishPingLoad(uint64_t pingLoadIdentifier);
    6465
    6566    bool captureExtraNetworkLoadMetricsEnabled() const { return m_captureExtraNetworkLoadMetricsEnabled; }
  • trunk/Source/WebKit/NetworkProcess/PingLoad.cpp

    r220888 r220922  
    3232#include "Logging.h"
    3333#include "NetworkCORSPreflightChecker.h"
     34#include "NetworkConnectionToWebProcess.h"
    3435#include "SessionTracker.h"
    3536#include <WebCore/ContentSecurityPolicy.h>
     
    4344using namespace WebCore;
    4445
    45 PingLoad::PingLoad(NetworkResourceLoadParameters&& parameters, HTTPHeaderMap&& originalRequestHeaders)
     46PingLoad::PingLoad(NetworkResourceLoadParameters&& parameters, HTTPHeaderMap&& originalRequestHeaders, Ref<NetworkConnectionToWebProcess>&& connection)
    4647    : m_parameters(WTFMove(parameters))
    4748    , m_originalRequestHeaders(WTFMove(originalRequestHeaders))
     49    , m_connection(WTFMove(connection))
    4850    , m_timeoutTimer(*this, &PingLoad::timeoutTimerFired)
    4951    , m_isSameOriginRequest(securityOrigin().canRequest(m_parameters.request.url()))
     
    6567PingLoad::~PingLoad()
    6668{
     69    m_connection->didFinishPingLoad(m_parameters.identifier);
     70
    6771    if (m_redirectHandler)
    6872        m_redirectHandler({ });
  • trunk/Source/WebKit/NetworkProcess/PingLoad.h

    r220888 r220922  
    4040
    4141class NetworkCORSPreflightChecker;
     42class NetworkConnectionToWebProcess;
    4243
    4344class PingLoad final : private NetworkDataTaskClient {
    4445public:
    45     PingLoad(NetworkResourceLoadParameters&&, WebCore::HTTPHeaderMap&& originalRequestHeaders);
     46    PingLoad(NetworkResourceLoadParameters&&, WebCore::HTTPHeaderMap&& originalRequestHeaders, Ref<NetworkConnectionToWebProcess>&&);
    4647   
    4748private:
     
    7172    NetworkResourceLoadParameters m_parameters;
    7273    WebCore::HTTPHeaderMap m_originalRequestHeaders; // Needed for CORS checks.
     74    Ref<NetworkConnectionToWebProcess> m_connection;
    7375    RefPtr<NetworkDataTask> m_task;
    7476    WebCore::Timer m_timeoutTimer;
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp

    r220917 r220922  
    136136}
    137137
     138void NetworkProcessConnection::didFinishPingLoad(uint64_t pingLoadIdentifier)
     139{
     140    WebProcess::singleton().webLoaderStrategy().didFinishPingLoad(pingLoadIdentifier);
     141}
     142
    138143#if ENABLE(SHAREABLE_RESOURCE)
    139144void NetworkProcessConnection::didCacheResource(const ResourceRequest& request, const ShareableResource::Handle& handle, PAL::SessionID sessionID)
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h

    r220857 r220922  
    7474
    7575    void didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames);
     76    void didFinishPingLoad(uint64_t pingLoadIdentifier);
    7677
    7778#if ENABLE(SHAREABLE_RESOURCE)
  • trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.messages.in

    r220857 r220922  
    2828
    2929    DidWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, Vector<String> filenames)
     30    DidFinishPingLoad(uint64_t pingLoadIdentifier)
    3031}
  • trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

    r220888 r220922  
    351351
    352352    m_webResourceLoaders.clear();
     353
     354    auto pingLoadCompletionHandlers = WTFMove(m_pingLoadCompletionHandlers);
     355    for (auto& pingLoadCompletionHandler : pingLoadCompletionHandlers.values())
     356        pingLoadCompletionHandler();
    353357}
    354358
     
    387391}
    388392
    389 void WebLoaderStrategy::createPingHandle(NetworkingContext* networkingContext, ResourceRequest& request, const HTTPHeaderMap& originalRequestHeaders, Ref<SecurityOrigin>&& sourceOrigin, ContentSecurityPolicy* contentSecurityPolicy, const FetchOptions& options)
     393static uint64_t generatePingLoadIdentifier()
     394{
     395    static uint64_t identifier = 0;
     396    return ++identifier;
     397}
     398
     399void WebLoaderStrategy::startPingLoad(NetworkingContext* networkingContext, ResourceRequest& request, const HTTPHeaderMap& originalRequestHeaders, Ref<SecurityOrigin>&& sourceOrigin, ContentSecurityPolicy* contentSecurityPolicy, const FetchOptions& options, WTF::Function<void()>&& completionHandler)
    390400{
    391401    // It's possible that call to createPingHandle might be made during initial empty Document creation before a NetworkingContext exists.
    392402    // It is not clear that we should send ping loads during that process anyways.
    393     if (!networkingContext)
    394         return;
     403    if (!networkingContext) {
     404        if (completionHandler)
     405            completionHandler();
     406        return;
     407    }
    395408
    396409    WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(networkingContext);
     
    400413   
    401414    NetworkResourceLoadParameters loadParameters;
     415    loadParameters.identifier = generatePingLoadIdentifier();
    402416    loadParameters.request = request;
    403417    loadParameters.sourceOrigin = WTFMove(sourceOrigin);
     
    410424        loadParameters.cspResponseHeaders = contentSecurityPolicy->responseHeaders();
    411425
     426    if (completionHandler)
     427        m_pingLoadCompletionHandlers.add(loadParameters.identifier, WTFMove(completionHandler));
     428
    412429    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::LoadPing(WTFMove(loadParameters), originalRequestHeaders), 0);
     430}
     431
     432void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier)
     433{
     434    if (auto completionHandler = m_pingLoadCompletionHandlers.take(pingLoadIdentifier))
     435        completionHandler();
    413436}
    414437
  • trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h

    r220888 r220922  
    6060    void resumePendingRequests() final;
    6161
    62     void createPingHandle(WebCore::NetworkingContext*, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap& originalRequestHeaders, Ref<WebCore::SecurityOrigin>&& sourceOrigin, WebCore::ContentSecurityPolicy*, const WebCore::FetchOptions&) final;
     62    void startPingLoad(WebCore::NetworkingContext*, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap& originalRequestHeaders, Ref<WebCore::SecurityOrigin>&& sourceOrigin, WebCore::ContentSecurityPolicy*, const WebCore::FetchOptions&, WTF::Function<void()>&& completionHandler) final;
     63    void didFinishPingLoad(uint64_t pingLoadIdentifier);
    6364
    6465    void storeDerivedDataToCache(const SHA1::Digest& bodyHash, const String& type, const String& partition, WebCore::SharedBuffer&) final;
     
    8586    HashMap<unsigned long, RefPtr<WebResourceLoader>> m_webResourceLoaders;
    8687    HashMap<unsigned long, WebURLSchemeTaskProxy*> m_urlSchemeTasks;
     88    HashMap<unsigned long, WTF::Function<void()>> m_pingLoadCompletionHandlers;
    8789};
    8890
  • trunk/Source/WebKitLegacy/ChangeLog

    r220888 r220922  
     12017-08-18  Chris Dumez  <cdumez@apple.com>
     2
     3        [Beacon] Add support for quota limitation
     4        https://bugs.webkit.org/show_bug.cgi?id=175443
     5        <rdar://problem/33729002>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * WebCoreSupport/WebResourceLoadScheduler.cpp:
     10        (WebResourceLoadScheduler::startPingLoad):
     11        * WebCoreSupport/WebResourceLoadScheduler.h:
     12
    1132017-08-17  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp

    r220888 r220922  
    364364}
    365365
    366 void WebResourceLoadScheduler::createPingHandle(NetworkingContext* networkingContext, ResourceRequest& request, const HTTPHeaderMap&, Ref<SecurityOrigin>&&, WebCore::ContentSecurityPolicy*, const FetchOptions& options)
     366void WebResourceLoadScheduler::startPingLoad(NetworkingContext* networkingContext, ResourceRequest& request, const HTTPHeaderMap&, Ref<SecurityOrigin>&&, WebCore::ContentSecurityPolicy*, const FetchOptions& options, WTF::Function<void()>&& completionHandler)
    367367{
    368368    // PingHandle manages its own lifetime, deleting itself when its purpose has been fulfilled.
    369     new PingHandle(networkingContext, request, options.credentials != FetchOptions::Credentials::Omit, PingHandle::UsesAsyncCallbacks::No, options.redirect == FetchOptions::Redirect::Follow);
    370 }
    371 
     369    new PingHandle(networkingContext, request, options.credentials != FetchOptions::Credentials::Omit, PingHandle::UsesAsyncCallbacks::No, options.redirect == FetchOptions::Redirect::Follow, WTFMove(completionHandler));
     370}
     371
  • trunk/Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h

    r220888 r220922  
    4545WebResourceLoadScheduler& webResourceLoadScheduler();
    4646
    47 class WebResourceLoadScheduler : public WebCore::LoaderStrategy {
     47class WebResourceLoadScheduler final : public WebCore::LoaderStrategy {
    4848    WTF_MAKE_NONCOPYABLE(WebResourceLoadScheduler); WTF_MAKE_FAST_ALLOCATED;
    4949public:
    5050    WebResourceLoadScheduler();
    5151
    52     RefPtr<WebCore::SubresourceLoader> loadResource(WebCore::Frame&, WebCore::CachedResource&, const WebCore::ResourceRequest&, const WebCore::ResourceLoaderOptions&) override;
    53     void loadResourceSynchronously(WebCore::NetworkingContext*, unsigned long, const WebCore::ResourceRequest&, WebCore::StoredCredentials, WebCore::ClientCredentialPolicy, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>&) override;
    54     void remove(WebCore::ResourceLoader*) override;
    55     void setDefersLoading(WebCore::ResourceLoader*, bool) override;
    56     void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) override;
     52    RefPtr<WebCore::SubresourceLoader> loadResource(WebCore::Frame&, WebCore::CachedResource&, const WebCore::ResourceRequest&, const WebCore::ResourceLoaderOptions&) final;
     53    void loadResourceSynchronously(WebCore::NetworkingContext*, unsigned long, const WebCore::ResourceRequest&, WebCore::StoredCredentials, WebCore::ClientCredentialPolicy, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>&) final;
     54    void remove(WebCore::ResourceLoader*) final;
     55    void setDefersLoading(WebCore::ResourceLoader*, bool) final;
     56    void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) final;
    5757   
    58     void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority = WebCore::ResourceLoadPriority::VeryLow) override;
    59     void suspendPendingRequests() override;
    60     void resumePendingRequests() override;
     58    void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority = WebCore::ResourceLoadPriority::VeryLow) final;
     59    void suspendPendingRequests() final;
     60    void resumePendingRequests() final;
    6161
    62     void createPingHandle(WebCore::NetworkingContext*, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap&, Ref<WebCore::SecurityOrigin>&& sourceOrigin, WebCore::ContentSecurityPolicy*, const WebCore::FetchOptions&) override;
     62    void startPingLoad(WebCore::NetworkingContext*, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap&, Ref<WebCore::SecurityOrigin>&& sourceOrigin, WebCore::ContentSecurityPolicy*, const WebCore::FetchOptions&, WTF::Function<void()>&& completionHandler) final;
    6363
    64     void storeDerivedDataToCache(const SHA1::Digest&, const String&, const String&, WebCore::SharedBuffer&) override { }
     64    void storeDerivedDataToCache(const SHA1::Digest&, const String&, const String&, WebCore::SharedBuffer&) final { }
    6565
    66     void setCaptureExtraNetworkLoadMetricsEnabled(bool) override { }
     66    void setCaptureExtraNetworkLoadMetricsEnabled(bool) final { }
    6767
    6868    bool isSerialLoadingEnabled() const { return m_isSerialLoadingEnabled; }
Note: See TracChangeset for help on using the changeset viewer.