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

Side by Side Diff: components/ui_devtools/devtools_server.cc

Issue 2899783002: Move DevTools out of ash and turn it to a component. (Closed)
Patch Set: add README.md Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/ui_devtools/devtools_server.h" 5 #include "components/ui_devtools/devtools_server.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "components/ui_devtools/switches.h" 17 #include "components/ui_devtools/switches.h"
18 #include "net/base/net_errors.h" 18 #include "net/base/net_errors.h"
19 #include "net/log/net_log.h" 19 #include "net/log/net_log.h"
20 #include "net/server/http_server_request_info.h" 20 #include "net/server/http_server_request_info.h"
21 #include "net/socket/server_socket.h" 21 #include "net/socket/server_socket.h"
22 #include "net/socket/tcp_server_socket.h" 22 #include "net/socket/tcp_server_socket.h"
23 23
24 namespace ui { 24 namespace ui_devtools {
25 namespace devtools {
26 25
27 namespace { 26 namespace {
28 const char kChromeDeveloperToolsPrefix[] = 27 const char kChromeDeveloperToolsPrefix[] =
29 "chrome-devtools://devtools/bundled/inspector.html?ws="; 28 "chrome-devtools://devtools/bundled/inspector.html?ws=";
30 29
31 bool IsUiDevToolsEnabled() { 30 bool IsUiDevToolsEnabled() {
32 return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableUiDevTools); 31 return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableUiDevTools);
33 } 32 }
34 33
35 int GetUiDevToolsPort() { 34 int GetUiDevToolsPort() {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (it == connections_.end()) 174 if (it == connections_.end())
176 return; 175 return;
177 UiDevToolsClient* client = it->second; 176 UiDevToolsClient* client = it->second;
178 DCHECK(client); 177 DCHECK(client);
179 main_thread_task_runner_->PostTask( 178 main_thread_task_runner_->PostTask(
180 FROM_HERE, 179 FROM_HERE,
181 base::Bind(&UiDevToolsClient::Disconnect, base::Unretained(client))); 180 base::Bind(&UiDevToolsClient::Disconnect, base::Unretained(client)));
182 connections_.erase(it); 181 connections_.erase(it);
183 } 182 }
184 183
185 } // namespace devtools 184 } // namespace ui_devtools
186 } // namespace ui
OLDNEW
« no previous file with comments | « components/ui_devtools/devtools_server.h ('k') | components/ui_devtools/inspector_protocol_config.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698