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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 12746009: Revert 189969 "Add RenderWidgetHost::GetSnapshotFromRenderer met..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1450/src/
Patch Set: Created 7 years, 9 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/renderer_host/render_widget_host_view_gtk.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
===================================================================
--- content/browser/web_contents/web_contents_impl.cc (revision 190011)
+++ content/browser/web_contents/web_contents_impl.cc (working copy)
@@ -636,6 +636,15 @@
prefs.accelerated_compositing_enabled = false;
}
+#if defined(OS_LINUX) && !defined(USE_AURA)
+ // Temporary fix for Linux non-Aura capturing. http://crbug.com/174957
+ WebContentsImpl* web_contents =
+ static_cast<WebContentsImpl*>(WebContents::FromRenderViewHost(rvh));
+ if (web_contents && web_contents->capturer_count_ > 0) {
+ prefs.accelerated_compositing_enabled = false;
+ }
+#endif
+
return prefs;
}
@@ -982,6 +991,16 @@
++capturer_count_;
DVLOG(1) << "There are now " << capturer_count_
<< " capturing(s) of WebContentsImpl@" << this;
+
+#if defined(OS_LINUX) && !defined(USE_AURA)
+ // Temporary fix for Linux non-Aura capturing. http://crbug.com/174957
+ if (capturer_count_ == 1) {
+ // Force a WebkitPreferences reload to disable compositing for snapshots.
+ RenderViewHost* rvh = GetRenderViewHost();
+ if (rvh)
+ rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences());
+ }
+#endif
}
void WebContentsImpl::DecrementCapturerCount() {
@@ -993,6 +1012,16 @@
if (is_being_destroyed_)
return;
+#if defined(OS_LINUX) && !defined(USE_AURA)
+ // Temporary fix for Linux non-Aura capturing. http://crbug.com/174957
+ if (capturer_count_ == 0) {
+ // Force a WebkitPreferences reload to re-enable compositing.
+ RenderViewHost* rvh = GetRenderViewHost();
+ if (rvh)
+ rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences());
+ }
+#endif
+
// While capturer_count_ was greater than zero, the WasHidden() calls to RWHV
// were being prevented. If there are no more capturers, make the call now.
if (capturer_count_ == 0 && !should_normally_be_visible_) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698