| OLD | NEW |
| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 inspector::InspectorHost* host) | 99 inspector::InspectorHost* host) |
| 100 : host_(host), binding_(this) { | 100 : host_(host), binding_(this) { |
| 101 inspector_service_provider_.AddService(this); | 101 inspector_service_provider_.AddService(this); |
| 102 } | 102 } |
| 103 | 103 |
| 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 |
| 110 mojo::MessagePipe pipe; | 110 mojo::ServiceProviderPtr services; |
| 111 service_provider_request.Bind(pipe.handle0.Pass()); | 111 mojo::ServiceProviderPtr exposed_services; |
| 112 inspector_service_provider_.BindToHandle(pipe.handle1.Pass()); | 112 inspector_service_provider_.Bind(GetProxy(&exposed_services)); |
| 113 shell->ConnectToApplication("mojo:sky_inspector_server", | 113 shell->ConnectToApplication("mojo:sky_inspector_server", GetProxy(&services), |
| 114 service_provider_request.Pass(), nullptr); | 114 exposed_services.Pass()); |
| 115 mojo::ConnectToService(&inspector_service_provider_, &frontend_); | 115 mojo::ConnectToService(services.get(), &frontend_); |
| 116 | 116 |
| 117 // Theoretically we should load our state from the inspector cookie. | 117 // Theoretically we should load our state from the inspector cookie. |
| 118 inspector_state_ = | 118 inspector_state_ = |
| 119 adoptPtr(new InspectorState(nullptr, JSONObject::create())); | 119 adoptPtr(new InspectorState(nullptr, JSONObject::create())); |
| 120 old_frontend_ = adoptPtr(new InspectorFrontend(this)); | 120 old_frontend_ = adoptPtr(new InspectorFrontend(this)); |
| 121 | 121 |
| 122 PageScriptDebugServer::setMainThreadIsolate(host_->GetIsolate()); | 122 PageScriptDebugServer::setMainThreadIsolate(host_->GetIsolate()); |
| 123 OwnPtr<MessageLoopAdaptor> message_loop = adoptPtr(new MessageLoopAdaptor); | 123 OwnPtr<MessageLoopAdaptor> message_loop = adoptPtr(new MessageLoopAdaptor); |
| 124 PageScriptDebugServer::shared().setClientMessageLoop(message_loop.release()); | 124 PageScriptDebugServer::shared().setClientMessageLoop(message_loop.release()); |
| 125 OwnPtr<InspectorHostResolverImpl> host_resolver = | 125 OwnPtr<InspectorHostResolverImpl> host_resolver = |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 InspectorBackendMojo::~InspectorBackendMojo() { | 178 InspectorBackendMojo::~InspectorBackendMojo() { |
| 179 } | 179 } |
| 180 | 180 |
| 181 void InspectorBackendMojo::Connect() { | 181 void InspectorBackendMojo::Connect() { |
| 182 impl_->Connect(); | 182 impl_->Connect(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace inspector | 185 } // namespace inspector |
| OLD | NEW |