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

Unified Diff: content/browser/android/child_process_launcher_android.cc

Issue 2285593002: Add ScopedSurfaceRequestManager (Closed)
Patch Set: Added RunUntilIdle() to 2 UTs Created 4 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/browser/BUILD.gn ('k') | content/browser/android/scoped_surface_request_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/child_process_launcher_android.cc
diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android.cc
index e66ed0014e0534d161009675ec19d5784088f8ea..f3ae4486c204340205be62f1ec22eaba3ee0321e 100644
--- a/content/browser/android/child_process_launcher_android.cc
+++ b/content/browser/android/child_process_launcher_android.cc
@@ -14,6 +14,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
#include "base/logging.h"
+#include "content/browser/android/scoped_surface_request_manager.h"
#include "content/browser/file_descriptor_info_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/media/android/browser_media_player_manager.h"
@@ -237,6 +238,26 @@ void EstablishSurfacePeer(JNIEnv* env,
&SetSurfacePeer, jsurface, pid, primary_id, secondary_id));
}
+void CompleteScopedSurfaceRequest(JNIEnv* env,
+ const JavaParamRef<jclass>& clazz,
+ jlong request_token_high,
+ jlong request_token_low,
+ const JavaParamRef<jobject>& surface) {
+ if (request_token_high == 0 && request_token_low == 0) {
+ DLOG(ERROR) << "Received invalid surface request token.";
+ return;
+ }
+
+ DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ ScopedJavaGlobalRef<jobject> jsurface;
+ jsurface.Reset(env, surface);
+ ScopedSurfaceRequestManager::GetInstance()->FulfillScopedSurfaceRequest(
+ base::UnguessableToken::Deserialize(request_token_high,
+ request_token_low),
+ gl::ScopedJavaSurface(jsurface));
+}
+
void RegisterViewSurface(int surface_id, const JavaRef<jobject>& j_surface) {
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/android/scoped_surface_request_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698