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

Side by Side Diff: sky/viewer/services/inspector_impl.cc

Issue 727593004: Wire up the Inspector V8 Debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Actually works 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 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/viewer/services/inspector_impl.h" 5 #include "sky/viewer/services/inspector_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "sky/engine/public/web/WebDocument.h" 8 #include "sky/engine/public/web/WebDocument.h"
9 #include "sky/engine/public/web/WebElement.h" 9 #include "sky/engine/public/web/WebElement.h"
10 #include "sky/engine/public/web/WebFrame.h" 10 #include "sky/engine/public/web/WebFrame.h"
11 #include "sky/engine/public/web/WebView.h" 11 #include "sky/engine/public/web/WebView.h"
12 #include "sky/services/inspector/inspector.mojom.h" 12 #include "sky/services/inspector/inspector.mojom.h"
13 #include "sky/viewer/document_view.h" 13 #include "sky/viewer/document_view.h"
14 14
15 namespace sky { 15 namespace sky {
16 16
17 InspectorServiceImpl::InspectorServiceImpl(DocumentView* view) 17 InspectorServiceImpl::InspectorServiceImpl(DocumentView* view)
18 : view_(view->GetWeakPtr()) { 18 : view_(view->GetWeakPtr()) {
19 } 19 }
20 20
21 InspectorServiceImpl::~InspectorServiceImpl() { 21 InspectorServiceImpl::~InspectorServiceImpl() {
22 } 22 }
23 23
24 void Ignored() {} 24 void Ignored() {}
25 25
26 void InspectorServiceImpl::Inject() { 26 void InspectorServiceImpl::Inject() {
27 if (!view_) 27 if (!view_)
28 return; 28 return;
29 29
30 mojo::ServiceProviderPtr inpector_service_provider; 30 mojo::ServiceProviderPtr inspector_service_provider;
31 view_->shell()->ConnectToApplication("mojo:sky_inspector_server", 31 view_->shell()->ConnectToApplication("mojo:sky_inspector_server",
32 GetProxy(&inpector_service_provider)); 32 GetProxy(&inspector_service_provider));
33 InspectorServerPtr inspector; 33 InspectorServerPtr inspector;
34 ConnectToService(inpector_service_provider.get(), &inspector); 34 mojo::ConnectToService(inspector_service_provider.get(), &inspector);
35 inspector->Listen(9898, base::Bind(&Ignored)); 35 inspector->Listen(9898, base::Bind(&Ignored));
36 // Listen drops existing agents/backends, wait before registering new ones. 36 // Listen drops existing agents/backends, wait before registering new ones.
37 inspector.WaitForIncomingMethodCall(); 37 inspector.WaitForIncomingMethodCall();
38 38
39 view_->web_view()->injectModule("/sky/framework/inspector/inspector.sky"); 39 view_->web_view()->injectModule("/sky/framework/inspector/inspector.sky");
40 view_->web_view()->connectInspectorBackend();
40 } 41 }
41 42
42 } // namespace sky 43 } // namespace sky
OLDNEW
« sky/viewer/platform/platform_impl.cc ('K') | « sky/viewer/platform/platform_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698