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

Unified Diff: mojo/android/system/watcher_impl.cc

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: . Created 3 years, 9 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: mojo/android/system/watcher_impl.cc
diff --git a/mojo/android/system/watcher_impl.cc b/mojo/android/system/watcher_impl.cc
index 28d8c9f1e7a04bddf0c7758da1c2f6b7d9089c39..139dfb4ef4bf5244f2a9a12a96b5e5b6e57d8d52 100644
--- a/mojo/android/system/watcher_impl.cc
+++ b/mojo/android/system/watcher_impl.cc
@@ -15,7 +15,7 @@
#include "base/bind.h"
#include "jni/WatcherImpl_jni.h"
#include "mojo/public/cpp/system/handle.h"
-#include "mojo/public/cpp/system/watcher.h"
+#include "mojo/public/cpp/system/simple_watcher.h"
namespace mojo {
namespace android {
@@ -26,7 +26,7 @@ namespace {
class WatcherImpl {
public:
- WatcherImpl() : watcher_(FROM_HERE) {}
+ WatcherImpl() : watcher_(FROM_HERE, SimpleWatcher::ArmingPolicy::AUTOMATIC) {}
~WatcherImpl() = default;
@@ -40,9 +40,8 @@ class WatcherImpl {
base::Bind(&WatcherImpl::OnHandleReady, base::Unretained(this));
MojoResult result =
- watcher_.Start(mojo::Handle(static_cast<MojoHandle>(mojo_handle)),
+ watcher_.Watch(mojo::Handle(static_cast<MojoHandle>(mojo_handle)),
static_cast<MojoHandleSignals>(signals), ready_callback);
-
if (result != MOJO_RESULT_OK)
java_watcher_.Reset();
@@ -68,7 +67,7 @@ class WatcherImpl {
result);
}
- Watcher watcher_;
+ SimpleWatcher watcher_;
base::android::ScopedJavaGlobalRef<jobject> java_watcher_;
DISALLOW_COPY_AND_ASSIGN(WatcherImpl);
« no previous file with comments | « mojo/android/javatests/src/org/chromium/mojo/system/impl/WatcherImplTest.java ('k') | mojo/common/data_pipe_drainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698