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

Unified Diff: mojo/edk/js/drain_data.h

Issue 1722543003: Mojo bindings environment: remove usage in mojo/edk/js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « mojo/edk/js/BUILD.gn ('k') | mojo/edk/js/drain_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/js/drain_data.h
diff --git a/mojo/edk/js/drain_data.h b/mojo/edk/js/drain_data.h
index 9fcdba220d3085e3dcdc78e61531692193ccde83..13af286631d75785c3ae16bea285b6c46cd53de3 100644
--- a/mojo/edk/js/drain_data.h
+++ b/mojo/edk/js/drain_data.h
@@ -7,7 +7,7 @@
#include "base/memory/scoped_vector.h"
#include "gin/runner.h"
-#include "mojo/public/c/environment/async_waiter.h"
+#include "mojo/message_pump/handle_watcher.h"
#include "mojo/public/cpp/system/core.h"
#include "v8/include/v8.h"
@@ -34,11 +34,8 @@ class DrainData {
private:
~DrainData();
- // Registers an "async waiter" that calls DataReady() via WaitCompleted().
+ // Waits for data to be available. DataReady() will be notified.
void WaitForData();
- static void WaitCompleted(void* self, MojoResult result) {
- static_cast<DrainData*>(self)->DataReady(result);
- }
// Use ReadData() to read whatever is availble now on handle_ and save
// it in data_buffers_.
@@ -53,7 +50,7 @@ class DrainData {
v8::Isolate* isolate_;
ScopedDataPipeConsumerHandle handle_;
- MojoAsyncWaitID wait_id_;
+ common::HandleWatcher handle_watcher_;
base::WeakPtr<gin::Runner> runner_;
v8::UniquePersistent<v8::Promise::Resolver> resolver_;
ScopedVector<DataBuffer> data_buffers_;
« no previous file with comments | « mojo/edk/js/BUILD.gn ('k') | mojo/edk/js/drain_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698