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

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

Issue 2928973003: Added --enable-ui-devtools to chrome://flags. (Closed)
Patch Set: Updated url in description. 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
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/ui_devtools/switches.h » ('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 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"
(...skipping 16 matching lines...) Expand all
27 namespace { 27 namespace {
28 const char kChromeDeveloperToolsPrefix[] = 28 const char kChromeDeveloperToolsPrefix[] =
29 "chrome-devtools://devtools/bundled/inspector.html?ws="; 29 "chrome-devtools://devtools/bundled/inspector.html?ws=";
30 30
31 bool IsUiDevToolsEnabled() { 31 bool IsUiDevToolsEnabled() {
32 return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableUiDevTools); 32 return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableUiDevTools);
33 } 33 }
34 34
35 int GetUiDevToolsPort() { 35 int GetUiDevToolsPort() {
36 DCHECK(IsUiDevToolsEnabled()); 36 DCHECK(IsUiDevToolsEnabled());
37 // This value is duplicated in the chrome://flags description.
37 constexpr int kDefaultPort = 9223; 38 constexpr int kDefaultPort = 9223;
38 int port; 39 int port;
39 if (!base::StringToInt( 40 if (!base::StringToInt(
40 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 41 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
41 kEnableUiDevTools), 42 kEnableUiDevTools),
42 &port)) 43 &port))
43 port = kDefaultPort; 44 port = kDefaultPort;
44 return port; 45 return port;
45 } 46 }
46 47
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 UiDevToolsClient* client = it->second; 177 UiDevToolsClient* client = it->second;
177 DCHECK(client); 178 DCHECK(client);
178 main_thread_task_runner_->PostTask( 179 main_thread_task_runner_->PostTask(
179 FROM_HERE, 180 FROM_HERE,
180 base::Bind(&UiDevToolsClient::Disconnect, base::Unretained(client))); 181 base::Bind(&UiDevToolsClient::Disconnect, base::Unretained(client)));
181 connections_.erase(it); 182 connections_.erase(it);
182 } 183 }
183 184
184 } // namespace devtools 185 } // namespace devtools
185 } // namespace ui 186 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/ui_devtools/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698