Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/frame/LocalFrame.h" | |
| 11 #include "core/html/HTMLCanvasElement.h" | 12 #include "core/html/HTMLCanvasElement.h" |
| 12 #include "core/offscreencanvas/OffscreenCanvas.h" | 13 #include "core/offscreencanvas/OffscreenCanvas.h" |
| 13 #include "modules/EventModulesFactory.h" | 14 #include "modules/EventModulesFactory.h" |
| 14 #include "modules/EventModulesNames.h" | 15 #include "modules/EventModulesNames.h" |
| 15 #include "modules/EventTargetModulesNames.h" | 16 #include "modules/EventTargetModulesNames.h" |
| 16 #include "modules/IndexedDBNames.h" | 17 #include "modules/IndexedDBNames.h" |
| 17 #include "modules/accessibility/AXObjectCacheImpl.h" | 18 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 19 #include "modules/app_banner/AppBannerController.h" | |
| 18 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 20 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 19 #include "modules/compositorworker/CompositorWorkerThread.h" | 21 #include "modules/compositorworker/CompositorWorkerThread.h" |
| 20 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" | 22 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" |
| 21 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" | 23 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" |
| 22 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" | 24 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" |
| 25 #include "modules/installation/InstallationServiceImpl.h" | |
| 23 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" | 26 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" |
| 24 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h" | 27 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h" |
| 25 #include "modules/webdatabase/DatabaseManager.h" | 28 #include "modules/webdatabase/DatabaseManager.h" |
| 26 #include "modules/webgl/WebGL2RenderingContext.h" | 29 #include "modules/webgl/WebGL2RenderingContext.h" |
| 27 #include "modules/webgl/WebGLRenderingContext.h" | 30 #include "modules/webgl/WebGLRenderingContext.h" |
| 28 #include "platform/mojo/MojoHelper.h" | 31 #include "platform/mojo/MojoHelper.h" |
| 32 #include "public/platform/InterfaceRegistry.h" | |
| 29 #include "wtf/PtrUtil.h" | 33 #include "wtf/PtrUtil.h" |
| 30 | 34 |
| 31 namespace blink { | 35 namespace blink { |
| 32 | 36 |
| 33 void ModulesInitializer::initialize() { | 37 void ModulesInitializer::initialize() { |
| 34 ASSERT(!isInitialized()); | 38 ASSERT(!isInitialized()); |
| 35 | 39 |
| 36 // Strings must be initialized before calling CoreInitializer::init(). | 40 // Strings must be initialized before calling CoreInitializer::init(). |
| 37 const unsigned modulesStaticStringsCount = | 41 const unsigned modulesStaticStringsCount = |
| 38 EventNames::EventModulesNamesCount + | 42 EventNames::EventModulesNamesCount + |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 68 WTF::makeUnique<ImageBitmapRenderingContext::Factory>()); | 72 WTF::makeUnique<ImageBitmapRenderingContext::Factory>()); |
| 69 | 73 |
| 70 // OffscreenCanvas context types must be registered with the OffscreenCanvas. | 74 // OffscreenCanvas context types must be registered with the OffscreenCanvas. |
| 71 OffscreenCanvas::registerRenderingContextFactory( | 75 OffscreenCanvas::registerRenderingContextFactory( |
| 72 WTF::makeUnique<OffscreenCanvasRenderingContext2D::Factory>()); | 76 WTF::makeUnique<OffscreenCanvasRenderingContext2D::Factory>()); |
| 73 OffscreenCanvas::registerRenderingContextFactory( | 77 OffscreenCanvas::registerRenderingContextFactory( |
| 74 WTF::makeUnique<WebGLRenderingContext::Factory>()); | 78 WTF::makeUnique<WebGLRenderingContext::Factory>()); |
| 75 OffscreenCanvas::registerRenderingContextFactory( | 79 OffscreenCanvas::registerRenderingContextFactory( |
| 76 WTF::makeUnique<WebGL2RenderingContext::Factory>()); | 80 WTF::makeUnique<WebGL2RenderingContext::Factory>()); |
| 77 | 81 |
| 82 // Mojo Interfaces registered with LocalFrame | |
| 83 LocalFrame::registerInitializationCallback([](LocalFrame* frame) { | |
| 84 frame->interfaceRegistry()->addInterface( | |
| 85 WTF::bind(&InstallationServiceImpl::create, wrapWeakPersistent(frame))); | |
| 86 }); | |
| 87 | |
| 88 // TODO(dominickn): This interface should be document-scoped rather than | |
| 89 // frame-scoped, as the resulting banner event is dispatched to | |
| 90 // frame()->document(). | |
| 91 LocalFrame::registerInitializationCallback([](LocalFrame* frame) { | |
|
sashab
2017/03/29 00:33:23
I can't read this code. Is this lambdas?
I believ
slangley
2017/03/29 02:27:08
lambdas - so hot right now
| |
| 92 frame->interfaceRegistry()->addInterface(WTF::bind( | |
| 93 &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame))); | |
| 94 }); | |
| 78 ASSERT(isInitialized()); | 95 ASSERT(isInitialized()); |
| 79 } | 96 } |
| 80 | 97 |
| 81 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |