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

Unified Diff: remoting/base/stoppable.cc

Issue 10855249: [Chromoting] The daemon process now starts the networking process and passes the host configuration… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: remoting/base/stoppable.cc
diff --git a/remoting/base/stoppable.cc b/remoting/base/stoppable.cc
index 99acba4c06d6cbecd32db96df5838572d11669cb..0dbfd1e9a37ebde8ce5d455696cd5eb3a7049c73 100644
--- a/remoting/base/stoppable.cc
+++ b/remoting/base/stoppable.cc
@@ -4,6 +4,7 @@
#include "remoting/base/stoppable.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "base/single_thread_task_runner.h"
@@ -22,7 +23,11 @@ Stoppable::~Stoppable() {
}
void Stoppable::Stop() {
- DCHECK(task_runner_->BelongsToCurrentThread());
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(FROM_HERE, base::Bind(&Stoppable::Stop,
+ base::Unretained(this)));
Wez 2012/08/21 00:18:57 Using base::Unretained here means that multiple St
alexeypa (please no reviews) 2012/08/21 17:16:36 Indeed, your are right. Stop() should not be ever
+ return;
+ }
if (state_ == kRunning) {
state_ = kStopping;

Powered by Google App Engine
This is Rietveld 408576698