OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.services.shell; | 5 package org.chromium.services.service_manager; |
6 | 6 |
7 import org.chromium.mojo.bindings.Interface; | 7 import org.chromium.mojo.bindings.Interface; |
8 import org.chromium.mojo.system.MessagePipeHandle; | 8 import org.chromium.mojo.system.MessagePipeHandle; |
9 import org.chromium.mojo.system.MojoException; | 9 import org.chromium.mojo.system.MojoException; |
10 import org.chromium.shell.mojom.InterfaceProvider; | 10 import org.chromium.service_manager.mojom.InterfaceProvider; |
11 | 11 |
12 import java.util.HashMap; | 12 import java.util.HashMap; |
13 import java.util.Map; | 13 import java.util.Map; |
14 | 14 |
15 /** | 15 /** |
16 * A registry where interfaces may be registered to be exposed to another applic
ation. | 16 * A registry where interfaces may be registered to be exposed to another applic
ation. |
17 * | 17 * |
18 * To use, define a class that implements your specific interface. Then | 18 * To use, define a class that implements your specific interface. Then |
19 * implement an InterfaceFactory that creates instances of your implementation | 19 * implement an InterfaceFactory that creates instances of your implementation |
20 * and register that on the registry with a Manager for the interface like this: | 20 * and register that on the registry with a Manager for the interface like this: |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 public void bindToMessagePipe(MessagePipeHandle pipe) { | 69 public void bindToMessagePipe(MessagePipeHandle pipe) { |
70 I impl = mFactory.createImpl(); | 70 I impl = mFactory.createImpl(); |
71 if (impl == null) { | 71 if (impl == null) { |
72 pipe.close(); | 72 pipe.close(); |
73 return; | 73 return; |
74 } | 74 } |
75 mManager.bind(impl, pipe); | 75 mManager.bind(impl, pipe); |
76 } | 76 } |
77 } | 77 } |
78 } | 78 } |
OLD | NEW |