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

Unified Diff: sky/engine/v8_inspector/inspector_backend_mojo.cc

Issue 764573002: Parametrize PageScriptDebugServer with v8::Context -> InspectorHost resolver (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed Page::m_inspectorHost 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
« no previous file with comments | « sky/engine/v8_inspector/PageScriptDebugServer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/v8_inspector/inspector_backend_mojo.cc
diff --git a/sky/engine/v8_inspector/inspector_backend_mojo.cc b/sky/engine/v8_inspector/inspector_backend_mojo.cc
index 9ab141afa3cf6aeb261ac56f2e3ac928bb9ccdbb..46ee3c12eb56906ebe4f5813419beaf30d0c31bf 100644
--- a/sky/engine/v8_inspector/inspector_backend_mojo.cc
+++ b/sky/engine/v8_inspector/inspector_backend_mojo.cc
@@ -72,6 +72,19 @@ class MessageLoopAdaptor : public PageScriptDebugServer::ClientMessageLoop {
scoped_ptr<base::RunLoop> run_loop_;
};
+class InspectorHostResolverImpl : public PageScriptDebugServer::InspectorHostResolver {
+ public:
+ explicit InspectorHostResolverImpl(inspector::InspectorHost* host) : host_(host) { }
+ ~InspectorHostResolverImpl() override { }
+ inspector::InspectorHost* inspectorHostFor(v8::Handle<v8::Context> context) override {
+ if (context == host_->GetContext())
+ return host_;
+ return nullptr;
+ }
+ private:
+ inspector::InspectorHost* host_;
+};
+
InspectorBackendMojoImpl::InspectorBackendMojoImpl(
inspector::InspectorHost* host)
: host_(host) {
@@ -96,6 +109,9 @@ void InspectorBackendMojoImpl::Connect() {
PageScriptDebugServer::setMainThreadIsolate(host_->GetIsolate());
OwnPtr<MessageLoopAdaptor> message_loop = adoptPtr(new MessageLoopAdaptor);
PageScriptDebugServer::shared().setClientMessageLoop(message_loop.release());
+ OwnPtr<InspectorHostResolverImpl> host_resolver =
+ adoptPtr(new InspectorHostResolverImpl(host_));
+ PageScriptDebugServer::shared().setInspectorHostResolver(host_resolver.release());
// AgentRegistry used to do this, but we don't need it for one agent.
script_manager_ = InjectedScriptManager::createForPage();
« no previous file with comments | « sky/engine/v8_inspector/PageScriptDebugServer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698