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

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 f52e90f609c6e3437d88536214b4c669dc10e4ce..46195d145f540965764e6002ee206c8d1d8f31f7 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1585,7 +1585,16 @@ void RenderWidgetHostViewAura::SwapSoftwareFrame(
new base::SharedMemory(frame_data->handle, true));
#endif
- if (!shared_memory->Map(size_in_bytes)) {
+ if (!shared_memory->Map(0)) {
+ DLOG(ERROR) << "Unable to map renderer memory.";
+ RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA1"));
+ host_->GetProcess()->ReceivedBadMessage();
piman 2013/10/23 00:10:15 TBH this could fail if we're out of address space
+ 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;
}
« 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