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

Unified Diff: content/browser/devtools/devtools_http_handler_impl.cc

Issue 666673007: [DevTools] Keep IP address of HttpServer as a member of DevToolsHttpHandlerImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the server_ip_address declaration next to the server_ Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/devtools/devtools_http_handler_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « content/browser/devtools/devtools_http_handler_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698