Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: third_party/WebKit/Source/modules/ModulesInitializer.cpp

Issue 2939623002: [DONT COMMIT] WIP: WorkerClientsInitializer (Closed)
Patch Set: finalize2 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ModulesInitializer.h" 5 #include "ModulesInitializer.h"
6 6
7 #include "bindings/modules/v8/ModuleBindingsInitializer.h" 7 #include "bindings/modules/v8/ModuleBindingsInitializer.h"
8 #include "core/EventTypeNames.h" 8 #include "core/EventTypeNames.h"
9 #include "core/css/CSSPaintImageGenerator.h" 9 #include "core/css/CSSPaintImageGenerator.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
11 #include "core/exported/WebSharedWorkerImpl.h" 11 #include "core/exported/WebSharedWorkerImpl.h"
12 #include "core/frame/LocalFrame.h" 12 #include "core/frame/LocalFrame.h"
13 #include "core/frame/WebLocalFrameBase.h" 13 #include "core/frame/WebLocalFrameBase.h"
14 #include "core/html/HTMLCanvasElement.h" 14 #include "core/html/HTMLCanvasElement.h"
15 #include "core/html/HTMLMediaElement.h" 15 #include "core/html/HTMLMediaElement.h"
16 #include "core/offscreencanvas/OffscreenCanvas.h" 16 #include "core/offscreencanvas/OffscreenCanvas.h"
17 #include "core/page/ChromeClient.h" 17 #include "core/page/ChromeClient.h"
18 #include "core/workers/Worker.h"
19 #include "core/workers/WorkerClients.h"
18 #include "core/workers/WorkerContentSettingsClient.h" 20 #include "core/workers/WorkerContentSettingsClient.h"
19 #include "modules/EventModulesFactory.h" 21 #include "modules/EventModulesFactory.h"
20 #include "modules/EventModulesNames.h" 22 #include "modules/EventModulesNames.h"
21 #include "modules/EventTargetModulesNames.h" 23 #include "modules/EventTargetModulesNames.h"
22 #include "modules/IndexedDBNames.h" 24 #include "modules/IndexedDBNames.h"
23 #include "modules/accessibility/AXObjectCacheImpl.h" 25 #include "modules/accessibility/AXObjectCacheImpl.h"
24 #include "modules/app_banner/AppBannerController.h" 26 #include "modules/app_banner/AppBannerController.h"
25 #include "modules/audio_output_devices/AudioOutputDeviceClient.h" 27 #include "modules/audio_output_devices/AudioOutputDeviceClient.h"
26 #include "modules/audio_output_devices/AudioOutputDeviceClientImpl.h" 28 #include "modules/audio_output_devices/AudioOutputDeviceClientImpl.h"
27 #include "modules/canvas2d/CanvasRenderingContext2D.h" 29 #include "modules/canvas2d/CanvasRenderingContext2D.h"
28 #include "modules/compositorworker/CompositorWorkerThread.h" 30 #include "modules/compositorworker/CompositorWorkerThread.h"
29 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" 31 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h"
30 #include "modules/document_metadata/CopylessPasteServer.h" 32 #include "modules/document_metadata/CopylessPasteServer.h"
33 #include "modules/exported/WebEmbeddedWorkerImpl.h"
31 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" 34 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h"
32 #include "modules/filesystem/LocalFileSystemClient.h" 35 #include "modules/filesystem/LocalFileSystemClient.h"
33 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" 36 #include "modules/imagebitmap/ImageBitmapRenderingContext.h"
34 #include "modules/indexeddb/IndexedDBClientImpl.h" 37 #include "modules/indexeddb/IndexedDBClientImpl.h"
35 #include "modules/installation/InstallationServiceImpl.h" 38 #include "modules/installation/InstallationServiceImpl.h"
36 #include "modules/installedapp/InstalledAppController.h" 39 #include "modules/installedapp/InstalledAppController.h"
37 #include "modules/media_controls/MediaControlsImpl.h" 40 #include "modules/media_controls/MediaControlsImpl.h"
38 #include "modules/mediastream/UserMediaClientImpl.h" 41 #include "modules/mediastream/UserMediaClientImpl.h"
39 #include "modules/mediastream/UserMediaController.h" 42 #include "modules/mediastream/UserMediaController.h"
40 #include "modules/navigatorcontentutils/NavigatorContentUtils.h" 43 #include "modules/navigatorcontentutils/NavigatorContentUtils.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 frame, client->GetWebScreenOrientationClient()); 136 frame, client->GetWebScreenOrientationClient());
134 if (RuntimeEnabledFeatures::PresentationEnabled()) 137 if (RuntimeEnabledFeatures::PresentationEnabled())
135 PresentationController::ProvideTo(frame, client->PresentationClient()); 138 PresentationController::ProvideTo(frame, client->PresentationClient());
136 if (RuntimeEnabledFeatures::AudioOutputDevicesEnabled()) { 139 if (RuntimeEnabledFeatures::AudioOutputDevicesEnabled()) {
137 ProvideAudioOutputDeviceClientTo(frame, 140 ProvideAudioOutputDeviceClientTo(frame,
138 new AudioOutputDeviceClientImpl(frame)); 141 new AudioOutputDeviceClientImpl(frame));
139 } 142 }
140 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher()); 143 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher());
141 }); 144 });
142 145
143 // WebSharedWorkerImpl callbacks for modules initialization. 146 // DedicatedWorker callbacks for modules initialization.
144 // TODO(nhiroki): Implement a common mechanism to set up WorkerClients 147 WorkerClientsInitializer<Worker>::Register(
145 // (https://crbug.com/729500).
146 WebSharedWorkerImpl::RegisterWorkerClientsCreatedCallback(
147 [](WorkerClients* worker_clients) { 148 [](WorkerClients* worker_clients) {
148 ProvideLocalFileSystemToWorker(worker_clients, 149 ProvideLocalFileSystemToWorker(worker_clients,
149 LocalFileSystemClient::Create()); 150 LocalFileSystemClient::Create());
150 ProvideIndexedDBClientToWorker( 151 ProvideIndexedDBClientToWorker(
151 worker_clients, IndexedDBClientImpl::Create(*worker_clients)); 152 worker_clients, IndexedDBClientImpl::Create(*worker_clients));
152 }); 153 });
153 154
155 // SharedWorker callbacks for modules initialization.
156 WorkerClientsInitializer<WebSharedWorkerImpl>::Register(
157 [](WorkerClients* worker_clients) {
158 ProvideLocalFileSystemToWorker(worker_clients,
159 LocalFileSystemClient::Create());
160 ProvideIndexedDBClientToWorker(
161 worker_clients, IndexedDBClientImpl::Create(*worker_clients));
162 });
163
164 // ServiceWorker callbacks for modules initialization.
165 WorkerClientsInitializer<WebEmbeddedWorkerImpl>::Register(
166 [](WorkerClients* worker_clients) {
167 ProvideIndexedDBClientToWorker(
168 worker_clients, IndexedDBClientImpl::Create(*worker_clients));
169 });
170
154 HTMLMediaElement::RegisterMediaControlsFactory( 171 HTMLMediaElement::RegisterMediaControlsFactory(
155 WTF::MakeUnique<MediaControlsImpl::Factory>()); 172 WTF::MakeUnique<MediaControlsImpl::Factory>());
156 173
157 DCHECK(IsInitialized()); 174 DCHECK(IsInitialized());
158 } 175 }
159 176
160 } // namespace blink 177 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698