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

Unified Diff: mojo/edk/system/raw_channel.h

Issue 1526063003: EDK: Add TaskRunner and PlatformHandleWatcher to RawChannel. (Closed) Base URL: https://github.com/domokit/mojo.git@channel_watcher
Patch Set: Created 5 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 | « mojo/edk/system/master_connection_manager.cc ('k') | mojo/edk/system/raw_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel.h
diff --git a/mojo/edk/system/raw_channel.h b/mojo/edk/system/raw_channel.h
index 03a3c884c5b1fa847c94700dc0d9f994b096d061..3a254fdd84e4752a85d51d052620f982c8e980d2 100644
--- a/mojo/edk/system/raw_channel.h
+++ b/mojo/edk/system/raw_channel.h
@@ -10,10 +10,13 @@
#include "base/memory/weak_ptr.h"
#include "mojo/edk/platform/platform_handle.h"
+#include "mojo/edk/platform/platform_handle_watcher.h"
#include "mojo/edk/platform/scoped_platform_handle.h"
+#include "mojo/edk/platform/task_runner.h"
#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/message_in_transit_queue.h"
#include "mojo/edk/util/mutex.h"
+#include "mojo/edk/util/ref_ptr.h"
#include "mojo/edk/util/thread_annotations.h"
#include "mojo/public/cpp/system/macros.h"
@@ -92,7 +95,9 @@ class RawChannel {
// *not* take ownership of |delegate|. Both the I/O thread and |delegate| must
// remain alive until |Shutdown()| is called (unless this fails); |delegate|
// will no longer be used after |Shutdown()|.
- void Init(Delegate* delegate) MOJO_NOT_THREAD_SAFE;
+ void Init(util::RefPtr<platform::TaskRunner>&& io_task_runner,
+ platform::PlatformHandleWatcher* io_watcher,
+ Delegate* delegate) MOJO_NOT_THREAD_SAFE;
// This must be called (on the I/O thread) before this object is destroyed.
void Shutdown() MOJO_NOT_THREAD_SAFE;
@@ -316,9 +321,12 @@ class RawChannel {
// Set in |Init()| and never changed (hence usable on any thread without
// locking):
+ util::RefPtr<platform::TaskRunner> io_task_runner_;
+ // TODO(vtl): Remove this, once RawChannelPosix has been converted.
base::MessageLoopForIO* message_loop_for_io_;
// Only used on the I/O thread:
+ platform::PlatformHandleWatcher* io_watcher_;
Delegate* delegate_;
bool* set_on_shutdown_;
std::unique_ptr<ReadBuffer> read_buffer_;
« no previous file with comments | « mojo/edk/system/master_connection_manager.cc ('k') | mojo/edk/system/raw_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698