Index: shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java |
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java b/shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2ec2ead646fb48eaf0b92f9d1ee633e59bf57c6f |
--- /dev/null |
+++ b/shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java |
@@ -0,0 +1,36 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.mojo.shell; |
+ |
+import android.os.HandlerThread; |
+ |
+import org.chromium.mojo.application.ServiceFactoryBinder; |
+import org.chromium.mojo.bindings.InterfaceRequest; |
+import org.chromium.mojo.system.impl.CoreImpl; |
+import org.chromium.mojo.vsync.VSyncProviderImpl; |
+import org.chromium.mojom.vsync.VSyncProvider; |
+ |
+/** |
+ * A ServiceFactoryBinder for the input service. |
ppi
2015/11/17 16:40:46
for the vsync service?
qsr
2015/11/17 17:19:41
Done.
|
+ */ |
+final class VsyncFactory implements ServiceFactoryBinder<VSyncProvider> { |
+ private final HandlerThread mHandlerThread; |
ppi
2015/11/17 16:40:46
Can we be passing around just the looper?
qsr
2015/11/17 17:19:41
Done.
|
+ |
+ public VsyncFactory(HandlerThread handlerThread) { |
+ mHandlerThread = handlerThread; |
+ } |
+ |
+ @Override |
+ public void bind(InterfaceRequest<VSyncProvider> request) { |
+ VSyncProviderImpl implementation = |
+ new VSyncProviderImpl(CoreImpl.getInstance(), mHandlerThread); |
+ implementation.setBinding(VSyncProvider.MANAGER.bind(implementation, request)); |
+ } |
+ |
+ @Override |
+ public String getInterfaceName() { |
+ return VSyncProvider.MANAGER.getName(); |
+ } |
+} |