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

Side by Side Diff: sky/engine/v8_inspector/inspector_backend_mojo.cc

Issue 845593003: Pass ServiceProvider and ServiceProvider& params in Connect (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: services & exposed_services Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/v8_inspector/inspector_backend_mojo.h" 6 #include "sky/engine/v8_inspector/inspector_backend_mojo.h"
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "gen/v8_inspector/InspectorBackendDispatcher.h" 10 #include "gen/v8_inspector/InspectorBackendDispatcher.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 InspectorBackendMojoImpl::~InspectorBackendMojoImpl() { 104 InspectorBackendMojoImpl::~InspectorBackendMojoImpl() {
105 } 105 }
106 106
107 void InspectorBackendMojoImpl::Connect() { 107 void InspectorBackendMojoImpl::Connect() {
108 mojo::Shell* shell = host_->GetShell(); 108 mojo::Shell* shell = host_->GetShell();
109 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request; 109 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request;
110 mojo::MessagePipe pipe; 110 mojo::MessagePipe pipe;
111 service_provider_request.Bind(pipe.handle0.Pass()); 111 service_provider_request.Bind(pipe.handle0.Pass());
112 inspector_service_provider_.BindToHandle(pipe.handle1.Pass()); 112 inspector_service_provider_.BindToHandle(pipe.handle1.Pass());
113 shell->ConnectToApplication("mojo:sky_inspector_server", 113 shell->ConnectToApplication("mojo:sky_inspector_server",
114 service_provider_request.Pass()); 114 service_provider_request.Pass(),
115 mojo::ServiceProviderPtr());
115 mojo::ConnectToService(&inspector_service_provider_, &frontend_); 116 mojo::ConnectToService(&inspector_service_provider_, &frontend_);
116 117
117 // Theoretically we should load our state from the inspector cookie. 118 // Theoretically we should load our state from the inspector cookie.
118 inspector_state_ = 119 inspector_state_ =
119 adoptPtr(new InspectorState(nullptr, JSONObject::create())); 120 adoptPtr(new InspectorState(nullptr, JSONObject::create()));
120 old_frontend_ = adoptPtr(new InspectorFrontend(this)); 121 old_frontend_ = adoptPtr(new InspectorFrontend(this));
121 122
122 PageScriptDebugServer::setMainThreadIsolate(host_->GetIsolate()); 123 PageScriptDebugServer::setMainThreadIsolate(host_->GetIsolate());
123 OwnPtr<MessageLoopAdaptor> message_loop = adoptPtr(new MessageLoopAdaptor); 124 OwnPtr<MessageLoopAdaptor> message_loop = adoptPtr(new MessageLoopAdaptor);
124 PageScriptDebugServer::shared().setClientMessageLoop(message_loop.release()); 125 PageScriptDebugServer::shared().setClientMessageLoop(message_loop.release());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 177 }
177 178
178 InspectorBackendMojo::~InspectorBackendMojo() { 179 InspectorBackendMojo::~InspectorBackendMojo() {
179 } 180 }
180 181
181 void InspectorBackendMojo::Connect() { 182 void InspectorBackendMojo::Connect() {
182 impl_->Connect(); 183 impl_->Connect();
183 } 184 }
184 185
185 } // namespace inspector 186 } // namespace inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698