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

Unified Diff: sky/viewer/services/inspector_impl.cc

Issue 710043004: Make it possible to have multiple InspectorBackends (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Make possible multiple ServerImpls per aa's review to close a potential leak Created 6 years, 1 month 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
« sky/services/inspector/server.cc ('K') | « sky/viewer/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/services/inspector_impl.cc
diff --git a/sky/viewer/services/inspector_impl.cc b/sky/viewer/services/inspector_impl.cc
index a5343fa9600723ac64b2513f202966330e1700ab..4c8d086f3ed98ed58d565e0bcd090da8482667ae 100644
--- a/sky/viewer/services/inspector_impl.cc
+++ b/sky/viewer/services/inspector_impl.cc
@@ -4,10 +4,12 @@
#include "sky/viewer/services/inspector_impl.h"
+#include "base/bind.h"
#include "sky/engine/public/web/WebDocument.h"
#include "sky/engine/public/web/WebElement.h"
#include "sky/engine/public/web/WebFrame.h"
#include "sky/engine/public/web/WebView.h"
+#include "sky/services/inspector/inspector.mojom.h"
#include "sky/viewer/document_view.h"
namespace sky {
@@ -19,9 +21,21 @@ InspectorServiceImpl::InspectorServiceImpl(DocumentView* view)
InspectorServiceImpl::~InspectorServiceImpl() {
}
+void Ignored() {}
abarth-chromium 2014/11/11 02:53:57 Can you move this to around line 15 and put it in
+
void InspectorServiceImpl::Inject() {
if (!view_)
return;
+
+ mojo::ServiceProviderPtr inpector_service_provider;
abarth-chromium 2014/11/11 02:53:57 s/inpector_service_provider/inspector_service_prov
+ view_->shell()->ConnectToApplication("mojo:sky_inspector_server",
+ GetProxy(&inpector_service_provider));
+ InspectorServerPtr inspector;
+ ConnectToService(inpector_service_provider.get(), &inspector);
+ inspector->Listen(9898, base::Bind(&Ignored));
+ // Listen drops existing agents/backends, wait before registering new ones.
+ inspector.WaitForIncomingMethodCall();
+
view_->web_view()->injectModule("/sky/framework/inspector/inspector.sky");
}
« sky/services/inspector/server.cc ('K') | « sky/viewer/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698