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

Unified Diff: android_webview/native/aw_gl_functor.h

Issue 1844343005: WIP - Control the lifetime of RenderThreadManager from Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Connect BVR and RTM Created 4 years, 8 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
Index: android_webview/native/aw_gl_functor.h
diff --git a/android_webview/native/aw_gl_functor.h b/android_webview/native/aw_gl_functor.h
new file mode 100644
index 0000000000000000000000000000000000000000..4975715e43dab95343ab1465d26d687f4bd64f67
--- /dev/null
+++ b/android_webview/native/aw_gl_functor.h
@@ -0,0 +1,53 @@
+// Copyright 2016 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 ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_
+#define ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_
+
+#include <jni.h>
+
+#include "android_webview/browser/render_thread_manager.h"
+#include "android_webview/browser/render_thread_manager_client.h"
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+
+namespace android_webview {
+
+class AwGLFunctor : public RenderThreadManagerClient {
+ public:
+ void OnParentDrawConstraintsUpdated() override;
+ bool RequestDrawGL(bool wait_for_completion) override;
+ void DetachFunctorFromView() override;
+
+ AwGLFunctor(const JavaObjectWeakGlobalRef& java_ref);
+ ~AwGLFunctor() override;
+
+ void SetClient(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong client);
+ void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+
+ void DeleteHardwareRenderer(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
+ jlong GetAwDrawGLViewContext(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
+ jlong GetAwDrawGLFunction(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
+ RenderThreadManager* GetRenderThreadManager() {
+ return &render_thread_manager_;
+ }
+
+ private:
+ JavaObjectWeakGlobalRef java_ref_;
+ RenderThreadManager render_thread_manager_;
+};
+
+bool RegisterAwGLFunctor(JNIEnv* env);
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_

Powered by Google App Engine
This is Rietveld 408576698