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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 35883006: Add debugging info for software compositor swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « no previous file | content/renderer/gpu/compositor_software_output_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index dab846da1e684867338e148bdb710ceaed4d2ea6..24291b819bd307a6c841cd5546fc014480a50a48 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1585,10 +1585,28 @@ void RenderWidgetHostViewAura::SwapSoftwareFrame(
new base::SharedMemory(frame_data->handle, true));
#endif
+#ifdef OS_WIN
+ if (!shared_memory->Map(0)) {
+ DLOG(ERROR) << "Unable to map renderer memory.";
+ RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA1"));
+ host_->GetProcess()->ReceivedBadMessage();
+ return;
+ }
+
+ if (shared_memory->mapped_size() < size_in_bytes) {
+ DLOG(ERROR) << "Shared memory too small for given rectangle";
+ RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA2"));
+ host_->GetProcess()->ReceivedBadMessage();
+ return;
+ }
+#else
if (!shared_memory->Map(size_in_bytes)) {
+ DLOG(ERROR) << "Unable to map renderer memory.";
+ RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA1"));
host_->GetProcess()->ReceivedBadMessage();
return;
}
+#endif
if (last_swapped_surface_size_ != frame_size) {
DLOG_IF(ERROR, damage_rect != gfx::Rect(frame_size))
« no previous file with comments | « no previous file | content/renderer/gpu/compositor_software_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698