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

Unified Diff: services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java

Issue 2214383002: Move registration of Java mojo interfaces to the new InterfaceRegistrar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java-content-interface-registry
Patch Set: Created 4 years, 3 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: services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java
diff --git a/services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java b/services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java
index 90b7d904866a22e81d8ca4fb23df275d177e40ce..6891f330cf006b714fd14c6a6353d0e49e7b047d 100644
--- a/services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java
+++ b/services/shell/public/java/src/org/chromium/services/shell/InterfaceRegistry.java
@@ -19,7 +19,7 @@ import java.util.Map;
* implement an InterfaceFactory that creates instances of your implementation
* and register that on the registry with a Manager for the interface like this:
*
- * registry.addInterface(factory, InterfaceType.MANAGER);
+ * registry.addInterface(InterfaceType.MANAGER, factory);
*/
public class InterfaceRegistry implements InterfaceProvider {
private final Map<String, InterfaceBinder> mBinders = new HashMap<String, InterfaceBinder>();
@@ -67,7 +67,12 @@ public class InterfaceRegistry implements InterfaceProvider {
}
public void bindToMessagePipe(MessagePipeHandle pipe) {
- mManager.bind(mFactory.createImpl(), pipe);
+ I impl = mFactory.createImpl();
+ if (impl == null) {
+ pipe.close();
+ return;
+ }
+ mManager.bind(impl, pipe);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698