summaryrefslogtreecommitdiffstats
path: root/chrome/browser/devtools
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 22:27:20 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 22:27:20 +0000
commit0e60fce0f20f6b7cfadf52fb80cef888f007a2fe (patch)
treedd8a1bf349aac96d10904bf3854e46037bb0db95 /chrome/browser/devtools
parent9de395e4b2e4c7aed021813373544e219271b8f1 (diff)
downloadchromium_src-0e60fce0f20f6b7cfadf52fb80cef888f007a2fe.zip
chromium_src-0e60fce0f20f6b7cfadf52fb80cef888f007a2fe.tar.gz
chromium_src-0e60fce0f20f6b7cfadf52fb80cef888f007a2fe.tar.bz2
Support ephemeral ports in DevTools and Telemetry.
In DevTools, if port 0 is requested, query the HttpServer for the port actually used, and write the port to a well-known location: the file "DevToolsActivePort" in the user's profile directory. Currently this handshaking protocol is only implemented for Chromium, not content_shell, but this is the only scenario in which flakiness has been observed. Add a hidden command-line argument to Telemetry's desktop browser backend which uses this new code path. The bots will specify this argument. Telemetry must support browsers two releases back, so once Chrome 37 goes to the Stable channel, the old initialization path will be removed. Issue 379980 has been filed to remove the old code. Tested with and without the new --use-devtools-active-port command line argument with -v. Verified the new code path is taken. Once these changes are committed, the bots will begin verifying this new code. BUG=372560 NOTRY=true Review URL: https://codereview.chromium.org/315503002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/devtools')
-rw-r--r--chrome/browser/devtools/remote_debugging_server.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/devtools/remote_debugging_server.cc b/chrome/browser/devtools/remote_debugging_server.cc
index 7c98d7f..211ff1a 100644
--- a/chrome/browser/devtools/remote_debugging_server.cc
+++ b/chrome/browser/devtools/remote_debugging_server.cc
@@ -4,8 +4,10 @@
#include "chrome/browser/devtools/remote_debugging_server.h"
+#include "base/path_service.h"
#include "chrome/browser/devtools/browser_list_tabcontents_provider.h"
#include "chrome/browser/ui/webui/devtools_ui.h"
+#include "chrome/common/chrome_paths.h"
#include "content/public/browser/devtools_http_handler.h"
#include "net/socket/tcp_listen_socket.h"
@@ -13,10 +15,20 @@ RemoteDebuggingServer::RemoteDebuggingServer(
chrome::HostDesktopType host_desktop_type,
const std::string& ip,
int port) {
+ base::FilePath output_dir;
+ if (!port) {
+ // The client requested an ephemeral port. Must write the selected
+ // port to a well-known location in the profile directory to
+ // bootstrap the connection process.
+ bool result = PathService::Get(chrome::DIR_USER_DATA, &output_dir);
+ DCHECK(result);
+ }
+
devtools_http_handler_ = content::DevToolsHttpHandler::Start(
new net::TCPListenSocketFactory(ip, port),
"",
- new BrowserListTabContentsProvider(host_desktop_type));
+ new BrowserListTabContentsProvider(host_desktop_type),
+ output_dir);
}
RemoteDebuggingServer::~RemoteDebuggingServer() {