Chromium Code Reviews| 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(); |
| } |