Index: content/browser/devtools/devtools_http_handler_impl.cc |
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc |
index 90ee8d204942addc1676212df17489f57577c8c6..373a2a837881e1c23f8ca9771e8fbe7acc84a93b 100644 |
--- a/content/browser/devtools/devtools_http_handler_impl.cc |
+++ b/content/browser/devtools/devtools_http_handler_impl.cc |
@@ -333,10 +333,9 @@ void DevToolsHttpHandlerImpl::StopWithoutRelease() { |
} |
GURL DevToolsHttpHandlerImpl::GetFrontendURL() { |
- net::IPEndPoint ip_address; |
- if (server_ && server_->GetLocalAddress(&ip_address)) |
+ if (!server_ip_address_) |
pfeldman
2014/10/21 11:32:47
This is called on the UI thread.
|
return GURL(); |
- return GURL(std::string("http://") + ip_address.ToString() + frontend_url_); |
+ return GURL(std::string("http://") + server_ip_address_->ToString() + frontend_url_); |
} |
static std::string PathWithoutParams(const std::string& path) { |
@@ -796,12 +795,16 @@ void DevToolsHttpHandlerImpl::Init() { |
} |
server_.reset(new net::HttpServer(server_socket.Pass(), this)); |
+ net::IPEndPoint ip_address; |
+ server_->GetLocalAddress(&ip_address); |
+ server_ip_address_.reset(new net::IPEndPoint(ip_address)); |
pfeldman
2014/10/21 11:32:47
This is called on the handler thread.
|
if (!active_port_output_directory_.empty()) |
WriteActivePortToUserProfile(); |
} |
// Runs on the handler thread |
void DevToolsHttpHandlerImpl::Teardown() { |
+ server_ip_address_.reset(NULL); |
server_.reset(NULL); |
} |