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

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

Issue 170783014: android: Expose content locks in RenderWidgetHostViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 10 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: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 382db082ec38eaec66f344b737c010195ad0ca3a..b36300e3bdd0ec73f98b5f34c60db3af25d0b8f2 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1849,6 +1849,26 @@ void ContentViewCoreImpl::WebContentsDestroyed(WebContents* web_contents) {
wcva->SetContentViewCore(NULL);
}
+
+jboolean ContentViewCoreImpl::CanLockContent(JNIEnv* env, jobject obj) {
+ RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
+ if (!rwhva || !rwhva->IsSurfaceAvailableForCopy() || !rwhva->IsShowing())
+ return false;
+ return true;
+}
+
+void ContentViewCoreImpl::LockContent(JNIEnv* env, jobject obj) {
+ RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
+ if (rwhva)
+ rwhva->LockResources();
+}
+
+void ContentViewCoreImpl::UnlockContent(JNIEnv* env, jobject obj) {
+ RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
+ if (rwhva)
+ rwhva->UnlockResources();
+}
+
// This is called for each ContentView.
jlong Init(JNIEnv* env,
jobject obj,
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698