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

Unified Diff: third_party/mojo/src/mojo/edk/system/slave_connection_manager.h

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 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
Index: third_party/mojo/src/mojo/edk/system/slave_connection_manager.h
diff --git a/third_party/mojo/src/mojo/edk/system/slave_connection_manager.h b/third_party/mojo/src/mojo/edk/system/slave_connection_manager.h
index e773448e1d0938e18cdf7cb80160719b770e005a..731d9dbaac81bfb53673d8cb34920276779b923f 100644
--- a/third_party/mojo/src/mojo/edk/system/slave_connection_manager.h
+++ b/third_party/mojo/src/mojo/edk/system/slave_connection_manager.h
@@ -31,10 +31,10 @@ namespace system {
// The |ConnectionManager| implementation for slave processes.
//
-// Objects of this class must created, initialized (via |Init()|), shut down
-// (via |Shutdown()|), and destroyed on the same thread (the "creation thread").
-// Otherwise, its public methods are thread-safe (except that they may not be
-// called from its internal, private thread).
+// Objects of this class may be created and destroyed on any thread. However,
+// |Init()| and |Shutdown()| must be called on the "delegate thread". Otherwise,
+// its public methods are thread-safe (except that they may not be called from
+// its internal, private thread).
class MOJO_SYSTEM_IMPL_EXPORT SlaveConnectionManager
: public ConnectionManager,
public RawChannel::Delegate {
@@ -45,10 +45,11 @@ class MOJO_SYSTEM_IMPL_EXPORT SlaveConnectionManager
~SlaveConnectionManager() override;
// No other methods may be called until after this has been called.
- // |slave_process_delegate| must stay alive at least until after |Shutdown()|
- // has been called; its methods will be called on this object's creation
- // thread.
- void Init(embedder::SlaveProcessDelegate* slave_process_delegate,
+ // |delegate_thread_task_runner| should be the task runner for the "delegate
+ // thread", on which |slave_process_delegate|'s methods will be called. Both
+ // must stay alive at least until after |Shutdown()| has been called.
+ void Init(scoped_refptr<base::TaskRunner> delegate_thread_task_runner,
+ embedder::SlaveProcessDelegate* slave_process_delegate,
embedder::ScopedPlatformHandle platform_handle);
// No other methods may be called after this is (or while it is being) called.
@@ -80,10 +81,10 @@ class MOJO_SYSTEM_IMPL_EXPORT SlaveConnectionManager
embedder::ScopedPlatformHandleVectorPtr platform_handles) override;
void OnError(Error error) override;
- // Asserts that the current thread is the creation thread. (This actually
- // checks the current message loop, which is what we depend on, not the thread
- // per se.)
- void AssertOnCreationThread() const;
+ // Asserts that the current thread is the delegate thread. (This actually
+ // checks the current message loop.)
+ // TODO(vtl): Probably we should actually check the thread.
+ void AssertOnDelegateThread() const;
// Asserts that the current thread is *not* |private_thread_| (no-op if
// DCHECKs are not enabled). This should only be called while
@@ -95,12 +96,11 @@ class MOJO_SYSTEM_IMPL_EXPORT SlaveConnectionManager
// (i.e., after |Init()| but before |Shutdown()|).
void AssertOnPrivateThread() const;
- const scoped_refptr<base::TaskRunner> creation_thread_task_runner_;
-
- // These is set in |Init()| before |private_thread_| exists and only cleared
+ // These are set in |Init()| before |private_thread_| exists and only cleared
// in |Shutdown()| after |private_thread_| is dead. Thus it's safe to "use" on
// |private_thread_|. (Note that |slave_process_delegate_| may only be called
- // from the creation thread.)
+ // from the delegate thread.)
+ scoped_refptr<base::TaskRunner> delegate_thread_task_runner_;
embedder::SlaveProcessDelegate* slave_process_delegate_;
// This is a private I/O thread on which this class does the bulk of its work.

Powered by Google App Engine
This is Rietveld 408576698