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

Unified Diff: mojo/public/cpp/bindings/interface_ptr.h

Issue 2498743002: Mojo: introducing a thread safe interface pointer. (Closed)
Patch Set: Clean-up Created 4 years, 1 month 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/public/cpp/bindings/interface_ptr.h
diff --git a/mojo/public/cpp/bindings/interface_ptr.h b/mojo/public/cpp/bindings/interface_ptr.h
index bd77ead04285c2173f1b69b574af76ccec8212eb..c6c4bc2a2abdf3b2767d9eca56a9c11cf425de51 100644
--- a/mojo/public/cpp/bindings/interface_ptr.h
+++ b/mojo/public/cpp/bindings/interface_ptr.h
@@ -106,6 +106,13 @@ class InterfacePtr {
internal_state_.QueryVersion(callback);
}
+ // Returns a thread safe interface pointer that can be used to make interface
+ // calls from any thread. The callbacks are invoked on the thread the
+ // interface method is called from.
+ scoped_refptr<ThreadSafeInterfacePtr<Interface>> GetThreadSafePtr() {
+ return internal_state_.GetThreadSafePtr();
+ }
+
// If the remote side doesn't support the specified version, it will close its
// end of the message pipe asynchronously. This does nothing if it's already
// known that the remote side supports the specified version, i.e., if
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698