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

Unified Diff: remoting/base/stoppable.cc

Issue 16143004: Use a weak pointer to post service control events and session change notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback Created 7 years, 6 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/base/stoppable.h ('k') | remoting/host/daemon_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/stoppable.cc
diff --git a/remoting/base/stoppable.cc b/remoting/base/stoppable.cc
deleted file mode 100644
index 99acba4c06d6cbecd32db96df5838572d11669cb..0000000000000000000000000000000000000000
--- a/remoting/base/stoppable.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/base/stoppable.h"
-
-#include "base/message_loop.h"
-#include "base/single_thread_task_runner.h"
-
-namespace remoting {
-
-Stoppable::Stoppable(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner,
- const base::Closure& stopped_callback)
- : state_(kRunning),
- stopped_callback_(stopped_callback),
- task_runner_(task_runner) {
-}
-
-Stoppable::~Stoppable() {
- CHECK_EQ(state_, kStopped);
-}
-
-void Stoppable::Stop() {
- DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (state_ == kRunning) {
- state_ = kStopping;
- }
-
- // DoStop() can be called multiple times.
- DoStop();
-}
-
-void Stoppable::CompleteStopping() {
- DCHECK(task_runner_->BelongsToCurrentThread());
- DCHECK_EQ(state_, kStopping);
-
- state_ = kStopped;
- task_runner_->PostTask(FROM_HERE, stopped_callback_);
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/base/stoppable.h ('k') | remoting/host/daemon_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698