diff options
author | yzshen <yzshen@chromium.org> | 2016-03-03 16:54:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-04 00:55:06 +0000 |
commit | 243b2e8fb9cdd09cf9ec11aa2a68e26c76e00ee7 (patch) | |
tree | 2867c5f05e9a98224e6e4248747190c924ccdcd0 /extensions | |
parent | 1a8a5c27a8a9189bc2ef5069e66e5c44bd1808c4 (diff) | |
download | chromium_src-243b2e8fb9cdd09cf9ec11aa2a68e26c76e00ee7.zip chromium_src-243b2e8fb9cdd09cf9ec11aa2a68e26c76e00ee7.tar.gz chromium_src-243b2e8fb9cdd09cf9ec11aa2a68e26c76e00ee7.tar.bz2 |
Remove the last usage of MojoAsyncWaiter.
BUG=585942
Review URL: https://codereview.chromium.org/1766443002
Cr-Commit-Position: refs/heads/master@{#379157}
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/browser/mojo/DEPS | 1 | ||||
-rw-r--r-- | extensions/browser/mojo/stash_backend.cc | 15 |
2 files changed, 10 insertions, 6 deletions
diff --git a/extensions/browser/mojo/DEPS b/extensions/browser/mojo/DEPS index c1bbc75..2273ad2 100644 --- a/extensions/browser/mojo/DEPS +++ b/extensions/browser/mojo/DEPS @@ -1,3 +1,4 @@ include_rules = [ + "+mojo/message_pump", "+mojo/shell/public/interfaces", ] diff --git a/extensions/browser/mojo/stash_backend.cc b/extensions/browser/mojo/stash_backend.cc index 340d42b..8d3eb40 100644 --- a/extensions/browser/mojo/stash_backend.cc +++ b/extensions/browser/mojo/stash_backend.cc @@ -11,8 +11,8 @@ #include "base/bind.h" #include "base/macros.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/public/cpp/bindings/strong_binding.h" -#include "mojo/public/cpp/environment/async_waiter.h" namespace extensions { namespace { @@ -84,7 +84,7 @@ class StashBackend::StashEntry { void OnHandleReady(MojoResult result); // The waiters that are waiting for handles to be readable. - std::vector<scoped_ptr<mojo::AsyncWaiter>> waiters_; + std::vector<scoped_ptr<mojo::common::HandleWatcher>> waiters_; StashedObjectPtr stashed_object_; @@ -144,10 +144,13 @@ StashBackend::StashEntry::StashEntry(StashedObjectPtr stashed_object, return; for (size_t i = 0; i < stashed_object_->stashed_handles.size(); i++) { - waiters_.push_back(make_scoped_ptr(new mojo::AsyncWaiter( - stashed_object_->stashed_handles[i].get(), MOJO_HANDLE_SIGNAL_READABLE, - base::Bind(&StashBackend::StashEntry::OnHandleReady, - base::Unretained(this))))); + scoped_ptr<mojo::common::HandleWatcher> watcher( + new mojo::common::HandleWatcher()); + watcher->Start(stashed_object_->stashed_handles[i].get(), + MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE, + base::Bind(&StashBackend::StashEntry::OnHandleReady, + base::Unretained(this))); + waiters_.push_back(std::move(watcher)); } } |