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

Unified Diff: content/common/android/surface_callback.h

Issue 10546079: Added sandboxed process service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 6 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/browser/DEPS ('k') | content/common/android/surface_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/android/surface_callback.h
diff --git a/content/common/android/surface_callback.h b/content/common/android/surface_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..c45b751aff13bd0533b4bc62cf871fc74067bbe2
--- /dev/null
+++ b/content/common/android/surface_callback.h
@@ -0,0 +1,59 @@
+// 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.
+
+#ifndef CONTENT_COMMON_ANDROID_SURFACE_CALLBACK_H_
+#define CONTENT_COMMON_ANDROID_SURFACE_CALLBACK_H_
+#pragma once
+
+#include <jni.h>
+
+#include "base/callback.h"
+#include "content/common/android/surface_texture_peer.h"
+
+struct ANativeWindow;
+
+namespace base {
+class MessageLoopProxy;
+class WaitableEvent;
+}
+
+namespace content {
+
+// This file implements support for passing surface handles from Java
+// to the correct thread on the native side. On Android, these surface
+// handles can only be passed across processes through Java IPC (Binder),
+// which means calls from Java come in on arbitrary threads. Hence the
+// static nature and the need for the client to register a callback with
+// the corresponding message loop.
+
+// Asynchronously sets the Surface. This can be called from any thread.
+// The Surface will be set to the proper thread based on the type. The
+// nature of primary_id and secondary_id depend on the type of surface
+// and are used to route the surface to the correct client.
+// This method will call release() on the jsurface object to release
+// all the resources. So after calling this method, the caller should
+// not use the jsurface object again.
+void SetSurfaceAsync(JNIEnv* env,
+ jobject jsurface,
+ SurfaceTexturePeer::SurfaceTextureTarget type,
+ int primary_id,
+ int secondary_id,
+ base::WaitableEvent* completion);
+
+void ReleaseSurface(jobject surface);
+
+typedef base::Callback<void(int, int, ANativeWindow*, base::WaitableEvent*)>
+ NativeWindowCallback;
+void RegisterNativeWindowCallback(base::MessageLoopProxy* loop,
+ NativeWindowCallback& callback);
+
+typedef base::Callback<void(int, int, jobject surface)> VideoSurfaceCallback;
+void RegisterVideoSurfaceCallback(base::MessageLoopProxy* loop,
+ VideoSurfaceCallback& callback);
+
+bool RegisterSurfaceCallback(JNIEnv* env);
+
+} // namespace content
+
+#endif // CONTENT_COMMON_ANDROID_SURFACE_CALLBACK_H_
« no previous file with comments | « content/browser/DEPS ('k') | content/common/android/surface_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698