OLD | NEW |
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 Loading... |
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 | |
OLD | NEW |