Commit 4c5494ab authored by haraken's avatar haraken Committed by Commit bot

Use a new Supplement constructor for LocalFrame's supplements

This is one of the steps to deprecate the default constructor of Supplement.

BUG=610176

Review-Url: https://codereview.chromium.org/2614143002
Cr-Commit-Position: refs/heads/master@{#441943}
parent 8b6b77e8
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
namespace blink { namespace blink {
AudioOutputDeviceClient::AudioOutputDeviceClient(LocalFrame& frame)
: Supplement<LocalFrame>(frame) {}
const char* AudioOutputDeviceClient::supplementName() { const char* AudioOutputDeviceClient::supplementName() {
return "AudioOutputDeviceClient"; return "AudioOutputDeviceClient";
} }
...@@ -29,7 +32,8 @@ AudioOutputDeviceClient* AudioOutputDeviceClient::from( ...@@ -29,7 +32,8 @@ AudioOutputDeviceClient* AudioOutputDeviceClient::from(
void provideAudioOutputDeviceClientTo(LocalFrame& frame, void provideAudioOutputDeviceClientTo(LocalFrame& frame,
AudioOutputDeviceClient* client) { AudioOutputDeviceClient* client) {
frame.provideSupplement(AudioOutputDeviceClient::supplementName(), client); Supplement<LocalFrame>::provideTo(
frame, AudioOutputDeviceClient::supplementName(), client);
} }
DEFINE_TRACE(AudioOutputDeviceClient) { DEFINE_TRACE(AudioOutputDeviceClient) {
......
...@@ -18,6 +18,7 @@ class WebString; ...@@ -18,6 +18,7 @@ class WebString;
class MODULES_EXPORT AudioOutputDeviceClient : public Supplement<LocalFrame> { class MODULES_EXPORT AudioOutputDeviceClient : public Supplement<LocalFrame> {
public: public:
explicit AudioOutputDeviceClient(LocalFrame&);
virtual ~AudioOutputDeviceClient() {} virtual ~AudioOutputDeviceClient() {}
// Checks that a given sink exists and has permissions to be used from the // Checks that a given sink exists and has permissions to be used from the
......
...@@ -72,11 +72,6 @@ class CallbackWrapper final ...@@ -72,11 +72,6 @@ class CallbackWrapper final
std::unique_ptr<AsyncFileSystemCallbacks> m_callbacks; std::unique_ptr<AsyncFileSystemCallbacks> m_callbacks;
}; };
LocalFileSystem* LocalFileSystem::create(
std::unique_ptr<FileSystemClient> client) {
return new LocalFileSystem(std::move(client));
}
LocalFileSystem::~LocalFileSystem() {} LocalFileSystem::~LocalFileSystem() {}
void LocalFileSystem::resolveURL( void LocalFileSystem::resolveURL(
...@@ -214,8 +209,13 @@ void LocalFileSystem::deleteFileSystemInternal(ExecutionContext* context, ...@@ -214,8 +209,13 @@ void LocalFileSystem::deleteFileSystemInternal(ExecutionContext* context,
callbacks->release()); callbacks->release());
} }
LocalFileSystem::LocalFileSystem(std::unique_ptr<FileSystemClient> client) LocalFileSystem::LocalFileSystem(LocalFrame& frame,
: m_client(std::move(client)) {} std::unique_ptr<FileSystemClient> client)
: Supplement<LocalFrame>(frame), m_client(std::move(client)) {}
LocalFileSystem::LocalFileSystem(WorkerClients& workerClients,
std::unique_ptr<FileSystemClient> client)
: Supplement<WorkerClients>(workerClients), m_client(std::move(client)) {}
DEFINE_TRACE(LocalFileSystem) { DEFINE_TRACE(LocalFileSystem) {
Supplement<LocalFrame>::trace(visitor); Supplement<LocalFrame>::trace(visitor);
...@@ -227,26 +227,33 @@ const char* LocalFileSystem::supplementName() { ...@@ -227,26 +227,33 @@ const char* LocalFileSystem::supplementName() {
} }
LocalFileSystem* LocalFileSystem::from(ExecutionContext& context) { LocalFileSystem* LocalFileSystem::from(ExecutionContext& context) {
if (context.isDocument()) if (context.isDocument()) {
return static_cast<LocalFileSystem*>(Supplement<LocalFrame>::from( LocalFileSystem* fileSystem =
toDocument(context).frame(), supplementName())); static_cast<LocalFileSystem*>(Supplement<LocalFrame>::from(
toDocument(context).frame(), supplementName()));
DCHECK(fileSystem);
return fileSystem;
}
WorkerClients* clients = toWorkerGlobalScope(context).clients(); WorkerClients* clients = toWorkerGlobalScope(context).clients();
ASSERT(clients); ASSERT(clients);
return static_cast<LocalFileSystem*>( LocalFileSystem* fileSystem = static_cast<LocalFileSystem*>(
Supplement<WorkerClients>::from(clients, supplementName())); Supplement<WorkerClients>::from(clients, supplementName()));
DCHECK(fileSystem);
return fileSystem;
} }
void provideLocalFileSystemTo(LocalFrame& frame, void provideLocalFileSystemTo(LocalFrame& frame,
std::unique_ptr<FileSystemClient> client) { std::unique_ptr<FileSystemClient> client) {
frame.provideSupplement(LocalFileSystem::supplementName(), frame.provideSupplement(LocalFileSystem::supplementName(),
LocalFileSystem::create(std::move(client))); new LocalFileSystem(frame, std::move(client)));
} }
void provideLocalFileSystemToWorker(WorkerClients* clients, void provideLocalFileSystemToWorker(WorkerClients* workerClients,
std::unique_ptr<FileSystemClient> client) { std::unique_ptr<FileSystemClient> client) {
clients->provideSupplement(LocalFileSystem::supplementName(), Supplement<WorkerClients>::provideTo(
LocalFileSystem::create(std::move(client))); *workerClients, LocalFileSystem::supplementName(),
new LocalFileSystem(*workerClients, std::move(client)));
} }
} // namespace blink } // namespace blink
...@@ -56,7 +56,8 @@ class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>, ...@@ -56,7 +56,8 @@ class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>,
WTF_MAKE_NONCOPYABLE(LocalFileSystem); WTF_MAKE_NONCOPYABLE(LocalFileSystem);
public: public:
static LocalFileSystem* create(std::unique_ptr<FileSystemClient>); LocalFileSystem(LocalFrame&, std::unique_ptr<FileSystemClient>);
LocalFileSystem(WorkerClients&, std::unique_ptr<FileSystemClient>);
~LocalFileSystem(); ~LocalFileSystem();
void resolveURL(ExecutionContext*, void resolveURL(ExecutionContext*,
...@@ -78,8 +79,6 @@ class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>, ...@@ -78,8 +79,6 @@ class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>,
DECLARE_VIRTUAL_TRACE(); DECLARE_VIRTUAL_TRACE();
private: private:
explicit LocalFileSystem(std::unique_ptr<FileSystemClient>);
WebFileSystem* getFileSystem() const; WebFileSystem* getFileSystem() const;
void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*); void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*);
......
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
namespace blink { namespace blink {
IndexedDBClient::IndexedDBClient() {} IndexedDBClient::IndexedDBClient(LocalFrame& frame)
: Supplement<LocalFrame>(frame) {}
IndexedDBClient::IndexedDBClient(WorkerClients& clients)
: Supplement<WorkerClients>(clients) {}
IndexedDBClient* IndexedDBClient::from(ExecutionContext* context) { IndexedDBClient* IndexedDBClient::from(ExecutionContext* context) {
if (context->isDocument()) if (context->isDocument())
...@@ -35,7 +39,8 @@ DEFINE_TRACE(IndexedDBClient) { ...@@ -35,7 +39,8 @@ DEFINE_TRACE(IndexedDBClient) {
} }
void provideIndexedDBClientTo(LocalFrame& frame, IndexedDBClient* client) { void provideIndexedDBClientTo(LocalFrame& frame, IndexedDBClient* client) {
frame.provideSupplement(IndexedDBClient::supplementName(), client); Supplement<LocalFrame>::provideTo(frame, IndexedDBClient::supplementName(),
client);
} }
void provideIndexedDBClientToWorker(WorkerClients* clients, void provideIndexedDBClientToWorker(WorkerClients* clients,
......
...@@ -49,7 +49,8 @@ class MODULES_EXPORT IndexedDBClient ...@@ -49,7 +49,8 @@ class MODULES_EXPORT IndexedDBClient
WTF_MAKE_NONCOPYABLE(IndexedDBClient); WTF_MAKE_NONCOPYABLE(IndexedDBClient);
public: public:
IndexedDBClient(); explicit IndexedDBClient(LocalFrame&);
explicit IndexedDBClient(WorkerClients&);
virtual ~IndexedDBClient() {} virtual ~IndexedDBClient() {}
DECLARE_VIRTUAL_TRACE(); DECLARE_VIRTUAL_TRACE();
......
...@@ -33,7 +33,9 @@ InstalledAppController* InstalledAppController::from(LocalFrame& frame) { ...@@ -33,7 +33,9 @@ InstalledAppController* InstalledAppController::from(LocalFrame& frame) {
InstalledAppController::InstalledAppController(LocalFrame& frame, InstalledAppController::InstalledAppController(LocalFrame& frame,
WebInstalledAppClient* client) WebInstalledAppClient* client)
: ContextLifecycleObserver(frame.document()), m_client(client) {} : Supplement<LocalFrame>(frame),
ContextLifecycleObserver(frame.document()),
m_client(client) {}
const char* InstalledAppController::supplementName() { const char* InstalledAppController::supplementName() {
return "InstalledAppController"; return "InstalledAppController";
......
...@@ -31,23 +31,19 @@ const char* UserMediaController::supplementName() { ...@@ -31,23 +31,19 @@ const char* UserMediaController::supplementName() {
} }
UserMediaController::UserMediaController( UserMediaController::UserMediaController(
LocalFrame& frame,
std::unique_ptr<UserMediaClient> client) std::unique_ptr<UserMediaClient> client)
: m_client(std::move(client)) {} : Supplement<LocalFrame>(frame), m_client(std::move(client)) {}
DEFINE_TRACE(UserMediaController) { DEFINE_TRACE(UserMediaController) {
Supplement<LocalFrame>::trace(visitor); Supplement<LocalFrame>::trace(visitor);
} }
UserMediaController* UserMediaController::create(
std::unique_ptr<UserMediaClient> client) {
return new UserMediaController(std::move(client));
}
void provideUserMediaTo(LocalFrame& frame, void provideUserMediaTo(LocalFrame& frame,
std::unique_ptr<UserMediaClient> client) { std::unique_ptr<UserMediaClient> client) {
UserMediaController::provideTo( UserMediaController::provideTo(
frame, UserMediaController::supplementName(), frame, UserMediaController::supplementName(),
UserMediaController::create(std::move(client))); new UserMediaController(frame, std::move(client)));
} }
} // namespace blink } // namespace blink
...@@ -40,8 +40,7 @@ class UserMediaController final ...@@ -40,8 +40,7 @@ class UserMediaController final
USING_GARBAGE_COLLECTED_MIXIN(UserMediaController); USING_GARBAGE_COLLECTED_MIXIN(UserMediaController);
public: public:
static UserMediaController* create(std::unique_ptr<UserMediaClient>); UserMediaController(LocalFrame&, std::unique_ptr<UserMediaClient>);
DECLARE_VIRTUAL_TRACE(); DECLARE_VIRTUAL_TRACE();
UserMediaClient* client() const { return m_client.get(); } UserMediaClient* client() const { return m_client.get(); }
...@@ -58,8 +57,6 @@ class UserMediaController final ...@@ -58,8 +57,6 @@ class UserMediaController final
} }
private: private:
explicit UserMediaController(std::unique_ptr<UserMediaClient>);
std::unique_ptr<UserMediaClient> m_client; std::unique_ptr<UserMediaClient> m_client;
}; };
......
...@@ -15,7 +15,9 @@ namespace blink { ...@@ -15,7 +15,9 @@ namespace blink {
PresentationController::PresentationController(LocalFrame& frame, PresentationController::PresentationController(LocalFrame& frame,
WebPresentationClient* client) WebPresentationClient* client)
: ContextLifecycleObserver(frame.document()), m_client(client) { : Supplement<LocalFrame>(frame),
ContextLifecycleObserver(frame.document()),
m_client(client) {
if (m_client) if (m_client)
m_client->setController(this); m_client->setController(this);
} }
......
...@@ -9,11 +9,8 @@ ...@@ -9,11 +9,8 @@
namespace blink { namespace blink {
PushController::PushController(WebPushClient* client) : m_client(client) {} PushController::PushController(LocalFrame& frame, WebPushClient* client)
: Supplement<LocalFrame>(frame), m_client(client) {}
PushController* PushController::create(WebPushClient* client) {
return new PushController(client);
}
WebPushClient& PushController::clientFrom(LocalFrame* frame) { WebPushClient& PushController::clientFrom(LocalFrame* frame) {
PushController* controller = PushController::from(frame); PushController* controller = PushController::from(frame);
...@@ -29,7 +26,7 @@ const char* PushController::supplementName() { ...@@ -29,7 +26,7 @@ const char* PushController::supplementName() {
void providePushControllerTo(LocalFrame& frame, WebPushClient* client) { void providePushControllerTo(LocalFrame& frame, WebPushClient* client) {
PushController::provideTo(frame, PushController::supplementName(), PushController::provideTo(frame, PushController::supplementName(),
PushController::create(client)); new PushController(frame, client));
} }
} // namespace blink } // namespace blink
...@@ -21,7 +21,8 @@ class PushController final : public GarbageCollected<PushController>, ...@@ -21,7 +21,8 @@ class PushController final : public GarbageCollected<PushController>,
WTF_MAKE_NONCOPYABLE(PushController); WTF_MAKE_NONCOPYABLE(PushController);
public: public:
static PushController* create(WebPushClient*); PushController(LocalFrame&, WebPushClient*);
static const char* supplementName(); static const char* supplementName();
static PushController* from(LocalFrame* frame) { static PushController* from(LocalFrame* frame) {
return static_cast<PushController*>( return static_cast<PushController*>(
...@@ -32,8 +33,6 @@ class PushController final : public GarbageCollected<PushController>, ...@@ -32,8 +33,6 @@ class PushController final : public GarbageCollected<PushController>,
DEFINE_INLINE_VIRTUAL_TRACE() { Supplement<LocalFrame>::trace(visitor); } DEFINE_INLINE_VIRTUAL_TRACE() { Supplement<LocalFrame>::trace(visitor); }
private: private:
explicit PushController(WebPushClient*);
WebPushClient* client() const { return m_client; } WebPushClient* client() const { return m_client; }
WebPushClient* m_client; WebPushClient* m_client;
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
namespace blink { namespace blink {
// SensorProviderProxy // SensorProviderProxy
SensorProviderProxy::SensorProviderProxy(LocalFrame* frame) { SensorProviderProxy::SensorProviderProxy(LocalFrame& frame)
initialize(frame); : Supplement<LocalFrame>(frame) {}
}
void SensorProviderProxy::initialize(LocalFrame* frame) { void SensorProviderProxy::initializeIfNeeded(LocalFrame* frame) {
DCHECK(!isInitialized()); if (isInitialized())
return;
frame->interfaceProvider()->getInterface( frame->interfaceProvider()->getInterface(
mojo::MakeRequest(&m_sensorProvider)); mojo::MakeRequest(&m_sensorProvider));
...@@ -37,13 +37,10 @@ SensorProviderProxy* SensorProviderProxy::from(LocalFrame* frame) { ...@@ -37,13 +37,10 @@ SensorProviderProxy* SensorProviderProxy::from(LocalFrame* frame) {
SensorProviderProxy* providerProxy = static_cast<SensorProviderProxy*>( SensorProviderProxy* providerProxy = static_cast<SensorProviderProxy*>(
Supplement<LocalFrame>::from(*frame, supplementName())); Supplement<LocalFrame>::from(*frame, supplementName()));
if (!providerProxy) { if (!providerProxy) {
providerProxy = new SensorProviderProxy(frame); providerProxy = new SensorProviderProxy(*frame);
Supplement<LocalFrame>::provideTo(*frame, supplementName(), providerProxy); Supplement<LocalFrame>::provideTo(*frame, supplementName(), providerProxy);
} }
providerProxy->initializeIfNeeded(frame);
if (!providerProxy->isInitialized())
providerProxy->initialize(frame);
return providerProxy; return providerProxy;
} }
......
...@@ -41,9 +41,9 @@ class SensorProviderProxy final ...@@ -41,9 +41,9 @@ class SensorProviderProxy final
private: private:
friend class SensorProxy; // To call getSensorProvider(). friend class SensorProxy; // To call getSensorProvider().
explicit SensorProviderProxy(LocalFrame*); explicit SensorProviderProxy(LocalFrame&);
static const char* supplementName(); static const char* supplementName();
void initialize(LocalFrame*); void initializeIfNeeded(LocalFrame*);
bool isInitialized() const { return m_sensorProvider; } bool isInitialized() const { return m_sensorProvider; }
device::mojom::blink::SensorProvider* getSensorProvider() const { device::mojom::blink::SensorProvider* getSensorProvider() const {
......
...@@ -62,7 +62,8 @@ DEFINE_TRACE(ScreenWakeLock) { ...@@ -62,7 +62,8 @@ DEFINE_TRACE(ScreenWakeLock) {
} }
ScreenWakeLock::ScreenWakeLock(LocalFrame& frame) ScreenWakeLock::ScreenWakeLock(LocalFrame& frame)
: ContextLifecycleObserver(frame.document()), : Supplement<LocalFrame>(frame),
ContextLifecycleObserver(frame.document()),
PageVisibilityObserver(frame.page()), PageVisibilityObserver(frame.page()),
m_keepAwake(false) { m_keepAwake(false) {
DCHECK(!m_service.is_bound()); DCHECK(!m_service.is_bound());
......
...@@ -12,11 +12,8 @@ ...@@ -12,11 +12,8 @@
namespace blink { namespace blink {
AudioOutputDeviceClientImpl* AudioOutputDeviceClientImpl::create() { AudioOutputDeviceClientImpl::AudioOutputDeviceClientImpl(LocalFrame& frame)
return new AudioOutputDeviceClientImpl(); : AudioOutputDeviceClient(frame) {}
}
AudioOutputDeviceClientImpl::AudioOutputDeviceClientImpl() {}
AudioOutputDeviceClientImpl::~AudioOutputDeviceClientImpl() {} AudioOutputDeviceClientImpl::~AudioOutputDeviceClientImpl() {}
......
...@@ -18,7 +18,7 @@ class AudioOutputDeviceClientImpl ...@@ -18,7 +18,7 @@ class AudioOutputDeviceClientImpl
WTF_MAKE_NONCOPYABLE(AudioOutputDeviceClientImpl); WTF_MAKE_NONCOPYABLE(AudioOutputDeviceClientImpl);
public: public:
static AudioOutputDeviceClientImpl* create(); explicit AudioOutputDeviceClientImpl(LocalFrame&);
~AudioOutputDeviceClientImpl() override; ~AudioOutputDeviceClientImpl() override;
......
...@@ -1142,7 +1142,7 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame) { ...@@ -1142,7 +1142,7 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame) {
providePushControllerTo(frame, client->pushClient()); providePushControllerTo(frame, client->pushClient());
provideUserMediaTo(frame, provideUserMediaTo(frame,
UserMediaClientImpl::create(client->userMediaClient())); UserMediaClientImpl::create(client->userMediaClient()));
provideIndexedDBClientTo(frame, IndexedDBClientImpl::create()); provideIndexedDBClientTo(frame, IndexedDBClientImpl::create(frame));
provideLocalFileSystemTo(frame, LocalFileSystemClient::create()); provideLocalFileSystemTo(frame, LocalFileSystemClient::create());
provideNavigatorContentUtilsTo( provideNavigatorContentUtilsTo(
frame, NavigatorContentUtilsClientImpl::create(webFrame)); frame, NavigatorContentUtilsClientImpl::create(webFrame));
...@@ -1151,9 +1151,10 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame) { ...@@ -1151,9 +1151,10 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame) {
frame, client->webScreenOrientationClient()); frame, client->webScreenOrientationClient());
if (RuntimeEnabledFeatures::presentationEnabled()) if (RuntimeEnabledFeatures::presentationEnabled())
PresentationController::provideTo(frame, client->presentationClient()); PresentationController::provideTo(frame, client->presentationClient());
if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) {
provideAudioOutputDeviceClientTo(frame, provideAudioOutputDeviceClientTo(frame,
AudioOutputDeviceClientImpl::create()); new AudioOutputDeviceClientImpl(frame));
}
if (RuntimeEnabledFeatures::installedAppEnabled()) if (RuntimeEnabledFeatures::installedAppEnabled())
InstalledAppController::provideTo(frame, client->installedAppClient()); InstalledAppController::provideTo(frame, client->installedAppClient());
} }
......
...@@ -56,7 +56,7 @@ DedicatedWorkerMessagingProxyProviderImpl::createWorkerMessagingProxy( ...@@ -56,7 +56,7 @@ DedicatedWorkerMessagingProxyProviderImpl::createWorkerMessagingProxy(
WebLocalFrameImpl::fromFrame(document->frame()); WebLocalFrameImpl::fromFrame(document->frame());
WorkerClients* workerClients = WorkerClients::create(); WorkerClients* workerClients = WorkerClients::create();
provideIndexedDBClientToWorker(workerClients, provideIndexedDBClientToWorker(workerClients,
IndexedDBClientImpl::create()); IndexedDBClientImpl::create(*workerClients));
provideLocalFileSystemToWorker(workerClients, provideLocalFileSystemToWorker(workerClients,
LocalFileSystemClient::create()); LocalFileSystemClient::create());
provideContentSettingsClientToWorker( provideContentSettingsClientToWorker(
......
...@@ -41,10 +41,20 @@ ...@@ -41,10 +41,20 @@
namespace blink { namespace blink {
IndexedDBClient* IndexedDBClientImpl::create() { IndexedDBClient* IndexedDBClientImpl::create(LocalFrame& frame) {
return new IndexedDBClientImpl(); return new IndexedDBClientImpl(frame);
} }
IndexedDBClient* IndexedDBClientImpl::create(WorkerClients& workerClients) {
return new IndexedDBClientImpl(workerClients);
}
IndexedDBClientImpl::IndexedDBClientImpl(LocalFrame& frame)
: IndexedDBClient(frame) {}
IndexedDBClientImpl::IndexedDBClientImpl(WorkerClients& workerClients)
: IndexedDBClient(workerClients) {}
bool IndexedDBClientImpl::allowIndexedDB(ExecutionContext* context, bool IndexedDBClientImpl::allowIndexedDB(ExecutionContext* context,
const String& name) { const String& name) {
DCHECK(context->isContextThread()); DCHECK(context->isContextThread());
......
...@@ -42,12 +42,14 @@ class ExecutionContext; ...@@ -42,12 +42,14 @@ class ExecutionContext;
// for the main thread. // for the main thread.
class IndexedDBClientImpl final : public IndexedDBClient { class IndexedDBClientImpl final : public IndexedDBClient {
public: public:
static IndexedDBClient* create(); static IndexedDBClient* create(LocalFrame&);
static IndexedDBClient* create(WorkerClients&);
bool allowIndexedDB(ExecutionContext*, const String& name) override; bool allowIndexedDB(ExecutionContext*, const String& name) override;
private: private:
IndexedDBClientImpl() {} explicit IndexedDBClientImpl(LocalFrame&);
explicit IndexedDBClientImpl(WorkerClients&);
}; };
} // namespace blink } // namespace blink
......
...@@ -425,7 +425,8 @@ void WebEmbeddedWorkerImpl::startWorkerThread() { ...@@ -425,7 +425,8 @@ void WebEmbeddedWorkerImpl::startWorkerThread() {
WorkerClients* workerClients = WorkerClients::create(); WorkerClients* workerClients = WorkerClients::create();
provideContentSettingsClientToWorker(workerClients, provideContentSettingsClientToWorker(workerClients,
std::move(m_contentSettingsClient)); std::move(m_contentSettingsClient));
provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create()); provideIndexedDBClientToWorker(workerClients,
IndexedDBClientImpl::create(*workerClients));
provideServiceWorkerGlobalScopeClientToWorker( provideServiceWorkerGlobalScopeClientToWorker(
workerClients, workerClients,
ServiceWorkerGlobalScopeClientImpl::create(*m_workerContextClient)); ServiceWorkerGlobalScopeClientImpl::create(*m_workerContextClient));
......
...@@ -386,7 +386,8 @@ void WebSharedWorkerImpl::onScriptLoaderFinished() { ...@@ -386,7 +386,8 @@ void WebSharedWorkerImpl::onScriptLoaderFinished() {
workerClients, workerClients,
WTF::wrapUnique( WTF::wrapUnique(
m_client->createWorkerContentSettingsClientProxy(webSecurityOrigin))); m_client->createWorkerContentSettingsClientProxy(webSecurityOrigin)));
provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create()); provideIndexedDBClientToWorker(workerClients,
IndexedDBClientImpl::create(*workerClients));
ContentSecurityPolicy* contentSecurityPolicy = ContentSecurityPolicy* contentSecurityPolicy =
m_mainScriptLoader->releaseContentSecurityPolicy(); m_mainScriptLoader->releaseContentSecurityPolicy();
WorkerThreadStartMode startMode = WorkerThreadStartMode startMode =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment