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

Side by Side Diff: chrome/browser/debugger/devtools_protocol_handler.cc

Issue 6356015: DevTools: enable remote debugging with front-end served from the cloud. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Lint Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/debugger/devtools_protocol_handler.h ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/debugger/devtools_protocol_handler.h" 5 #include "chrome/browser/debugger/devtools_protocol_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/browser_thread.h" 8 #include "chrome/browser/browser_thread.h"
9 #include "chrome/browser/debugger/inspectable_tab_proxy.h" 9 #include "chrome/browser/debugger/inspectable_tab_proxy.h"
10 #include "chrome/browser/debugger/debugger_remote_service.h"
10 #include "chrome/browser/debugger/devtools_remote_message.h" 11 #include "chrome/browser/debugger/devtools_remote_message.h"
11 #include "chrome/browser/debugger/devtools_remote_listen_socket.h" 12 #include "chrome/browser/debugger/devtools_remote_listen_socket.h"
13 #include "chrome/browser/debugger/devtools_remote_service.h"
14 #include "chrome/browser/debugger/extension_ports_remote_service.h"
15
16 // static
17 scoped_refptr<DevToolsProtocolHandler> DevToolsProtocolHandler::Start(
18 int port) {
19 scoped_refptr<DevToolsProtocolHandler> proto_handler =
20 new DevToolsProtocolHandler(port);
21 proto_handler->RegisterDestination(
22 new DevToolsRemoteService(proto_handler),
23 DevToolsRemoteService::kToolName);
24 proto_handler->RegisterDestination(
25 new DebuggerRemoteService(proto_handler),
26 DebuggerRemoteService::kToolName);
27 proto_handler->RegisterDestination(
28 new ExtensionPortsRemoteService(proto_handler),
29 ExtensionPortsRemoteService::kToolName);
30 proto_handler->Start();
31 return proto_handler;
32 }
12 33
13 DevToolsProtocolHandler::DevToolsProtocolHandler(int port) 34 DevToolsProtocolHandler::DevToolsProtocolHandler(int port)
14 : port_(port), 35 : port_(port),
15 connection_(NULL), 36 connection_(NULL),
16 server_(NULL) { 37 server_(NULL) {
17 inspectable_tab_proxy_.reset(new InspectableTabProxy); 38 inspectable_tab_proxy_.reset(new InspectableTabProxy);
18 } 39 }
19 40
20 DevToolsProtocolHandler::~DevToolsProtocolHandler() { 41 DevToolsProtocolHandler::~DevToolsProtocolHandler() {
21 // Stop() must be called prior to this being called 42 // Stop() must be called prior to this being called
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 for (ToolToListenerMap::const_iterator it = tool_to_listener_map_.begin(), 116 for (ToolToListenerMap::const_iterator it = tool_to_listener_map_.begin(),
96 end = tool_to_listener_map_.end(); 117 end = tool_to_listener_map_.end();
97 it != end; 118 it != end;
98 ++it) { 119 ++it) {
99 BrowserThread::PostTask( 120 BrowserThread::PostTask(
100 BrowserThread::UI, FROM_HERE, 121 BrowserThread::UI, FROM_HERE,
101 NewRunnableMethod( 122 NewRunnableMethod(
102 it->second.get(), &DevToolsRemoteListener::OnConnectionLost)); 123 it->second.get(), &DevToolsRemoteListener::OnConnectionLost));
103 } 124 }
104 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_protocol_handler.h ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698