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

Unified Diff: base/win/object_watcher.cc

Issue 2598753002: Allow ObjectWatcher to be used from sequenced tasks. (Closed)
Patch Set: self-review Created 4 years 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 | « base/win/object_watcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/object_watcher.cc
diff --git a/base/win/object_watcher.cc b/base/win/object_watcher.cc
index 9a7eea2b054eb85afbc31b5977a549670ba4b2d1..6abc3995d9c9c611c09a8ac99171f96073e9e64b 100644
--- a/base/win/object_watcher.cc
+++ b/base/win/object_watcher.cc
@@ -6,7 +6,7 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/threading/sequenced_task_runner_handle.h"
namespace base {
namespace win {
@@ -32,8 +32,8 @@ bool ObjectWatcher::StopWatching() {
if (!wait_object_)
return false;
- // Make sure ObjectWatcher is used in a single-threaded fashion.
- DCHECK(task_runner_->BelongsToCurrentThread());
+ // Make sure ObjectWatcher is used in a sequenced fashion.
+ DCHECK(task_runner_->RunsTasksOnCurrentThread());
// Blocking call to cancel the wait. Any callbacks already in progress will
// finish before we return from this call.
@@ -70,14 +70,14 @@ bool ObjectWatcher::StartWatchingInternal(HANDLE object, Delegate* delegate,
bool execute_only_once) {
DCHECK(delegate);
DCHECK(!wait_object_) << "Already watching an object";
- DCHECK(ThreadTaskRunnerHandle::IsSet());
+ DCHECK(SequencedTaskRunnerHandle::IsSet());
- task_runner_ = ThreadTaskRunnerHandle::Get();
+ task_runner_ = SequencedTaskRunnerHandle::Get();
run_once_ = execute_only_once;
// Since our job is to just notice when an object is signaled and report the
- // result back to this thread, we can just run on a Windows wait thread.
+ // result back to this sequence, we can just run on a Windows wait thread.
DWORD wait_flags = WT_EXECUTEINWAITTHREAD;
if (run_once_)
wait_flags |= WT_EXECUTEONLYONCE;
« no previous file with comments | « base/win/object_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698