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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java

Issue 1458453003: Add mojo service to get notified of vsync. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 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: 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..b159ce2099eca7bb04cdfa9f2713ff8058f54035
--- /dev/null
+++ b/shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java
@@ -0,0 +1,35 @@
+// 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.Looper;
+
+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 vsync service.
+ */
+final class VsyncFactory implements ServiceFactoryBinder<VSyncProvider> {
+ private final Looper mLooper;
+
+ public VsyncFactory(Looper looper) {
+ mLooper = looper;
+ }
+
+ @Override
+ public void bind(InterfaceRequest<VSyncProvider> request) {
+ VSyncProviderImpl implementation = new VSyncProviderImpl(CoreImpl.getInstance(), mLooper);
+ implementation.setBinding(VSyncProvider.MANAGER.bind(implementation, request));
+ }
+
+ @Override
+ public String getInterfaceName() {
+ return VSyncProvider.MANAGER.getName();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698