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

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: 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..535042fefc66838ef3f037459e2a932e368fd690
--- /dev/null
+++ b/android_webview/native/aw_gl_functor.h
@@ -0,0 +1,59 @@
+// 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"
boliu 2016/04/07 18:14:03 think this is only used in .cc file?
Tobias Sargeant 2016/04/07 21:07:36 Removed.
+
+namespace android_webview {
+
+class BrowserViewRenderer;
+
+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 SetBrowserViewRenderer(BrowserViewRenderer* browser_view_renderer);
+
+ void SetClient(JNIEnv* env,
boliu 2016/04/07 18:14:03 delete
Tobias Sargeant 2016/04/07 21:07:36 Done.
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong client);
+
+ void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
+
boliu 2016/04/07 18:14:03 nit: remove these blank lines between jni methods.
Tobias Sargeant 2016/04/07 21:07:36 Done.
+ 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_;
+ BrowserViewRenderer* browser_view_renderer_;
+};
+
+bool RegisterAwGLFunctor(JNIEnv* env);
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_

Powered by Google App Engine
This is Rietveld 408576698