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

Unified Diff: remoting/host/native_messaging/native_messaging_pipe.cc

Issue 887853002: Shutdown the It2Me host cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@it2me_host_dcheck
Patch Set: Created 5 years, 11 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 | « remoting/host/native_messaging/native_messaging_pipe.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/native_messaging/native_messaging_pipe.cc
diff --git a/remoting/host/native_messaging/native_messaging_pipe.cc b/remoting/host/native_messaging/native_messaging_pipe.cc
index 13abc35d4ddc821e7d99a3bb04193dbbb5be63a4..8521472df0873dfbba833d043a5925431cd67e2e 100644
--- a/remoting/host/native_messaging/native_messaging_pipe.cc
+++ b/remoting/host/native_messaging/native_messaging_pipe.cc
@@ -19,11 +19,9 @@ NativeMessagingPipe::~NativeMessagingPipe() {
void NativeMessagingPipe::Start(
scoped_ptr<extensions::NativeMessageHost> host,
- scoped_ptr<extensions::NativeMessagingChannel> channel,
- const base::Closure& quit_closure) {
+ scoped_ptr<extensions::NativeMessagingChannel> channel) {
host_ = host.Pass();
channel_ = channel.Pass();
- quit_closure_ = quit_closure;
channel_->Start(this);
}
@@ -34,8 +32,8 @@ void NativeMessagingPipe::OnMessage(scoped_ptr<base::Value> message) {
}
void NativeMessagingPipe::OnDisconnect() {
- if (!quit_closure_.is_null())
- base::ResetAndReturn(&quit_closure_).Run();
+ host_.reset();
+ channel_.reset();
}
void NativeMessagingPipe::PostMessageFromNativeHost(
@@ -45,8 +43,8 @@ void NativeMessagingPipe::PostMessageFromNativeHost(
}
void NativeMessagingPipe::CloseChannel(const std::string& error_message) {
- if (!quit_closure_.is_null())
- base::ResetAndReturn(&quit_closure_).Run();
+ host_.reset();
+ channel_.reset();
}
} // namespace remoting
« no previous file with comments | « remoting/host/native_messaging/native_messaging_pipe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698