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

Unified Diff: third_party/WebKit/Source/modules/ModulesInitializer.cpp

Issue 2783543004: Move registration of LocalFrame mojo interfaces to ModulesInitializer. (Closed)
Patch Set: Move modules initialization to the first operation in LocalFrame::Init as the loader can actually d… Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/ModulesInitializer.cpp
diff --git a/third_party/WebKit/Source/modules/ModulesInitializer.cpp b/third_party/WebKit/Source/modules/ModulesInitializer.cpp
index 45667466ed717a95b9807b2554952e3250975966..05567be42fef8daa534100dfc63b021aa72f09c0 100644
--- a/third_party/WebKit/Source/modules/ModulesInitializer.cpp
+++ b/third_party/WebKit/Source/modules/ModulesInitializer.cpp
@@ -8,6 +8,7 @@
#include "core/EventTypeNames.h"
#include "core/css/CSSPaintImageGenerator.h"
#include "core/dom/Document.h"
+#include "core/frame/LocalFrame.h"
#include "core/html/HTMLCanvasElement.h"
#include "core/offscreencanvas/OffscreenCanvas.h"
#include "modules/EventModulesFactory.h"
@@ -15,17 +16,20 @@
#include "modules/EventTargetModulesNames.h"
#include "modules/IndexedDBNames.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
+#include "modules/app_banner/AppBannerController.h"
#include "modules/canvas2d/CanvasRenderingContext2D.h"
#include "modules/compositorworker/CompositorWorkerThread.h"
#include "modules/csspaint/CSSPaintImageGeneratorImpl.h"
#include "modules/filesystem/DraggedIsolatedFileSystemImpl.h"
#include "modules/imagebitmap/ImageBitmapRenderingContext.h"
+#include "modules/installation/InstallationServiceImpl.h"
#include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
#include "modules/time_zone_monitor/TimeZoneMonitorClient.h"
#include "modules/webdatabase/DatabaseManager.h"
#include "modules/webgl/WebGL2RenderingContext.h"
#include "modules/webgl/WebGLRenderingContext.h"
#include "platform/mojo/MojoHelper.h"
+#include "public/platform/InterfaceRegistry.h"
#include "wtf/PtrUtil.h"
namespace blink {
@@ -75,6 +79,16 @@ void ModulesInitializer::initialize() {
OffscreenCanvas::registerRenderingContextFactory(
WTF::makeUnique<WebGL2RenderingContext::Factory>());
+ // Mojo Interfaces registered with LocalFrame
+ LocalFrame::registerInitializationCallback([](LocalFrame* frame) {
+ frame->interfaceRegistry()->addInterface(
+ WTF::bind(&InstallationServiceImpl::create, wrapWeakPersistent(frame)));
+ // TODO(dominickn): This interface should be document-scoped rather than
+ // frame-scoped, as the resulting banner event is dispatched to
+ // frame()->document().
+ frame->interfaceRegistry()->addInterface(WTF::bind(
+ &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame)));
+ });
ASSERT(isInitialized());
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698