Index: components/ui_devtools/devtools_server.cc |
diff --git a/components/ui_devtools/devtools_server.cc b/components/ui_devtools/devtools_server.cc |
index c8fd76c15f1bbb4aa29ed94ce537c75446a43eb1..aceecaa75e3d4d88b9cf5a6968f1d71d83ee0fac 100644 |
--- a/components/ui_devtools/devtools_server.cc |
+++ b/components/ui_devtools/devtools_server.cc |
@@ -65,6 +65,12 @@ UiDevToolsServer::UiDevToolsServer( |
} |
UiDevToolsServer::~UiDevToolsServer() { |
+ DCHECK(io_thread_task_runner_); |
+ io_thread_task_runner_->PostTask( |
+ FROM_HERE, |
+ base::Bind(&UiDevToolsServer::StopServer, base::Unretained(this))); |
+ if (thread_->IsRunning()) |
sadrul
2017/06/26 22:43:30
This will not work when |io_thread_task_runner_| h
thanhph
2017/06/27 15:02:29
To elaborate more, with current patch 1, does this
sadrul
2017/06/28 04:49:10
No. The problem with this change was, that if UiDe
thanhph
2017/06/28 14:38:22
Acknowledged! Thanks for the explanation.
|
+ thread_->Stop(); |
devtools_server_ = nullptr; |
} |
@@ -127,6 +133,10 @@ void UiDevToolsServer::StartServer(const std::string& address_string, |
server_ = base::MakeUnique<net::HttpServer>(std::move(socket), this); |
} |
+void UiDevToolsServer::StopServer() { |
+ server_.reset(); |
+} |
+ |
// HttpServer::Delegate Implementation |
void UiDevToolsServer::OnConnect(int connection_id) { |
NOTIMPLEMENTED(); |