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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/BrowserProcessSurfaceTexture.java

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments and resolving merge conflicts Created 8 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
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/BrowserProcessSurfaceTexture.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/BrowserProcessSurfaceTexture.java b/content/public/android/java/src/org/chromium/content/browser/BrowserProcessSurfaceTexture.java
new file mode 100644
index 0000000000000000000000000000000000000000..e22add14c511ed7b504c532db51f3e173b8d8147
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/BrowserProcessSurfaceTexture.java
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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.content.browser;
+
+import android.graphics.SurfaceTexture;
+import android.view.Surface;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+@JNINamespace("content")
+class BrowserProcessSurfaceTexture {
+ /**
+ * Called from native code to set up the peer surface texture producer in
+ * another process.
+ *
+ * @param pid Process handle of the sandboxed process to share the
+ * SurfaceTexture with.
+ * @param type The type of process that the SurfaceTexture is for.
+ * @param st The SurfaceTexture object to share with the sandboxed process.
+ * @param primaryID Used to route the call to the correct client instance.
+ * @param secondaryID Used to route the call to the correct client instance.
+ */
+ @SuppressWarnings("unused")
+ @CalledByNative
+ static void establishSurfaceTexturePeer(int pid, int type, SurfaceTexture st, int primaryID,
+ int secondaryID) {
+ Surface surface = new Surface(st);
+ SandboxedProcessLauncher.establishSurfacePeer(pid, type, surface, primaryID, secondaryID);
+
+ // We need to explicitly release the native resource of our newly created surface
+ // or the Surface class will print a warning message to the log in its finalizer.
+ // This should be ok to do since our caller is responsible for retaining a
+ // reference to the SurfaceTexture that is being sent across processes and the
+ // receiving end should have retained a reference before the binder call finished.
+ surface.release();
+ }
+}
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698