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

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

Issue 516483002: Stop devtools if socket for http server cannot be instantiated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | 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 954482e5730b4fea416361da78281d3b5c1d72eb..0f2875c273c10700e1e07dac4c75dc7eee1734f8 100644
--- a/content/browser/devtools/devtools_http_handler_impl.cc
+++ b/content/browser/devtools/devtools_http_handler_impl.cc
@@ -699,8 +699,16 @@ DevToolsHttpHandlerImpl::DevToolsHttpHandlerImpl(
// Runs on the handler thread
void DevToolsHttpHandlerImpl::Init() {
- server_.reset(new net::HttpServer(server_socket_factory_->CreateAndListen(),
- this));
+ scoped_ptr<net::ServerSocket> server_socket =
+ server_socket_factory_->CreateAndListen();
+ if (!server_socket) {
+ LOG(ERROR) << "Cannot start http server for devtools. Stop devtools.";
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&DevToolsHttpHandlerImpl::Stop, this));
dgozman 2014/08/27 19:32:24 This call will destroy this object, and later call
byungchul 2014/08/27 20:45:36 Done.
+ return;
+ }
+
+ server_.reset(new net::HttpServer(server_socket.Pass(), this));
if (!active_port_output_directory_.empty())
WriteActivePortToUserProfile();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698