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

Side by Side Diff: chrome/browser/devtools/remote_debugging_server.cc

Issue 2472093003: [DevTools]: Expose V8 version in /json/version (Closed)
Patch Set: Android browser added Created 4 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
« no previous file with comments | « chrome/browser/android/devtools_server.cc ('k') | chromecast/browser/devtools/DEPS » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/devtools/remote_debugging_server.h" 5 #include "chrome/browser/devtools/remote_debugging_server.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/devtools/devtools_window.h" 15 #include "chrome/browser/devtools/devtools_window.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_list.h" 18 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/common/chrome_content_client.h" 19 #include "chrome/common/chrome_content_client.h"
20 #include "chrome/common/chrome_paths.h" 20 #include "chrome/common/chrome_paths.h"
21 #include "components/version_info/version_info.h" 21 #include "components/version_info/version_info.h"
22 #include "content/public/browser/devtools_agent_host.h" 22 #include "content/public/browser/devtools_agent_host.h"
23 #include "content/public/browser/devtools_frontend_host.h" 23 #include "content/public/browser/devtools_frontend_host.h"
24 #include "content/public/browser/devtools_socket_factory.h" 24 #include "content/public/browser/devtools_socket_factory.h"
25 #include "net/base/net_errors.h" 25 #include "net/base/net_errors.h"
26 #include "net/log/net_log_source.h" 26 #include "net/log/net_log_source.h"
27 #include "net/socket/tcp_server_socket.h" 27 #include "net/socket/tcp_server_socket.h"
28 #include "third_party/WebKit/public/public_features.h" 28 #include "third_party/WebKit/public/public_features.h"
29 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
30 #include "v8/include/v8.h"
30 31
31 namespace { 32 namespace {
32 33
33 base::LazyInstance<bool>::Leaky g_tethering_enabled = LAZY_INSTANCE_INITIALIZER; 34 base::LazyInstance<bool>::Leaky g_tethering_enabled = LAZY_INSTANCE_INITIALIZER;
34 35
35 const uint16_t kMinTetheringPort = 9333; 36 const uint16_t kMinTetheringPort = 9333;
36 const uint16_t kMaxTetheringPort = 9444; 37 const uint16_t kMaxTetheringPort = 9444;
37 const int kBackLog = 10; 38 const int kBackLog = 10;
38 39
39 class TCPServerSocketFactory 40 class TCPServerSocketFactory
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 #if BUILDFLAG(DEBUG_DEVTOOLS) 109 #if BUILDFLAG(DEBUG_DEVTOOLS)
109 PathService::Get(chrome::DIR_INSPECTOR_DEBUG, &debug_frontend_dir); 110 PathService::Get(chrome::DIR_INSPECTOR_DEBUG, &debug_frontend_dir);
110 #endif 111 #endif
111 112
112 content::DevToolsAgentHost::StartRemoteDebuggingServer( 113 content::DevToolsAgentHost::StartRemoteDebuggingServer(
113 base::MakeUnique<TCPServerSocketFactory>(ip, port), 114 base::MakeUnique<TCPServerSocketFactory>(ip, port),
114 std::string(), 115 std::string(),
115 output_dir, 116 output_dir,
116 debug_frontend_dir, 117 debug_frontend_dir,
117 version_info::GetProductNameAndVersionForUserAgent(), 118 version_info::GetProductNameAndVersionForUserAgent(),
118 ::GetUserAgent()); 119 ::GetUserAgent(),
120 v8::V8::GetVersion());
119 } 121 }
120 122
121 RemoteDebuggingServer::~RemoteDebuggingServer() { 123 RemoteDebuggingServer::~RemoteDebuggingServer() {
122 // Ensure Profile is alive, because the whole DevTools subsystem 124 // Ensure Profile is alive, because the whole DevTools subsystem
123 // accesses it during shutdown. 125 // accesses it during shutdown.
124 DCHECK(g_browser_process->profile_manager()); 126 DCHECK(g_browser_process->profile_manager());
125 content::DevToolsAgentHost::StopRemoteDebuggingServer(); 127 content::DevToolsAgentHost::StopRemoteDebuggingServer();
126 } 128 }
OLDNEW
« no previous file with comments | « chrome/browser/android/devtools_server.cc ('k') | chromecast/browser/devtools/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698