source: webkit/trunk/Source/WebCore/loader/ThreadableLoaderClient.h

Last change on this file was 289483, checked in by Chris Dumez, 3 years ago

self.location.href is incorrect in shared workers in case of redirects
https://bugs.webkit.org/show_bug.cgi?id=236340

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

  • web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker-expected.txt:
  • web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker-expected.txt:
  • web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker-expected.txt:

Source/WebCore:

self.location.href is incorrect in shared workers in case of redirects. It should be
the URL of the last request, not the first one.

No new tests, rebaselined existing tests.

  • loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::redirectReceived):

  • loader/ThreadableLoaderClient.h:

(WebCore::ThreadableLoaderClient::redirectReceived):

  • loader/ThreadableLoaderClientWrapper.h:

(WebCore::ThreadableLoaderClientWrapper::redirectReceived):

  • loader/WorkerThreadableLoader.cpp:

(WebCore::WorkerThreadableLoader::MainThreadBridge::redirectReceived):

  • loader/WorkerThreadableLoader.h:
  • workers/Worker.cpp:

(WebCore::Worker::notifyFinished):

  • workers/WorkerFetchResult.h:

(WebCore::WorkerFetchResult::isolatedCopy const):
(WebCore::workerFetchError):
(WebCore::WorkerFetchResult::encode const):
(WebCore::WorkerFetchResult::decode):

  • workers/WorkerScriptLoader.cpp:

(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::redirectReceived):
(WebCore::WorkerScriptLoader::fetchResult const):

  • workers/WorkerScriptLoader.h:

(WebCore::WorkerScriptLoader::script const):
(WebCore::WorkerScriptLoader::lastRequestURL const):
(WebCore::WorkerScriptLoader::script): Deleted.

  • workers/service/ServiceWorkerContainer.cpp:

(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):

  • workers/service/ServiceWorkerContainer.h:
  • workers/service/ServiceWorkerJob.cpp:

(WebCore::ServiceWorkerJob::notifyFinished):

  • workers/service/ServiceWorkerJobClient.h:
  • workers/shared/SharedWorkerScriptLoader.cpp:

(WebCore::SharedWorkerScriptLoader::notifyFinished):

  • workers/shared/context/SharedWorkerThreadProxy.cpp:

(WebCore::generateWorkerParameters):
(WebCore::SharedWorkerThreadProxy::SharedWorkerThreadProxy):

  • workers/shared/context/SharedWorkerThreadProxy.h:

Source/WebKit:

self.location.href is incorrect in shared workers in case of redirects. It should be the URL of
the last request, not the first one.

  • NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:

(WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading):

  • NetworkProcess/SharedWorker/WebSharedWorkerServerToContextConnection.cpp:

(WebKit::WebSharedWorkerServerToContextConnection::launchSharedWorker):

  • WebProcess/Storage/WebSharedWorkerContextManagerConnection.cpp:

(WebKit::WebSharedWorkerContextManagerConnection::launchSharedWorker):

  • WebProcess/Storage/WebSharedWorkerContextManagerConnection.h:
  • WebProcess/Storage/WebSharedWorkerContextManagerConnection.messages.in:
  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1/*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#pragma once
32
33#include "ResourceLoaderIdentifier.h"
34
35namespace WebCore {
36
37class NetworkLoadMetrics;
38class ResourceError;
39class ResourceResponse;
40class ResourceTiming;
41class SharedBuffer;
42
43class ThreadableLoaderClient {
44 WTF_MAKE_NONCOPYABLE(ThreadableLoaderClient); WTF_MAKE_FAST_ALLOCATED;
45public:
46 virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/) { }
47
48 virtual void redirectReceived(const URL& /*redirectURL*/) { }
49 virtual void didReceiveResponse(ResourceLoaderIdentifier, const ResourceResponse&) { }
50 virtual void didReceiveData(const SharedBuffer&) { }
51 virtual void didFinishLoading(ResourceLoaderIdentifier, const NetworkLoadMetrics&) { }
52 virtual void didFail(const ResourceError&) { }
53 virtual void didFinishTiming(const ResourceTiming&) { }
54 virtual void notifyIsDone(bool) { ASSERT_NOT_REACHED(); }
55
56protected:
57 ThreadableLoaderClient() = default;
58 virtual ~ThreadableLoaderClient() = default;
59};
60
61} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.