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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/gpu/compositor_software_output_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 const size_t size_in_bytes = 4 * frame_size.GetArea(); 1578 const size_t size_in_bytes = 4 * frame_size.GetArea();
1579 #ifdef OS_WIN 1579 #ifdef OS_WIN
1580 scoped_ptr<base::SharedMemory> shared_memory( 1580 scoped_ptr<base::SharedMemory> shared_memory(
1581 new base::SharedMemory(frame_data->handle, true, 1581 new base::SharedMemory(frame_data->handle, true,
1582 host_->GetProcess()->GetHandle())); 1582 host_->GetProcess()->GetHandle()));
1583 #else 1583 #else
1584 scoped_ptr<base::SharedMemory> shared_memory( 1584 scoped_ptr<base::SharedMemory> shared_memory(
1585 new base::SharedMemory(frame_data->handle, true)); 1585 new base::SharedMemory(frame_data->handle, true));
1586 #endif 1586 #endif
1587 1587
1588 if (!shared_memory->Map(size_in_bytes)) { 1588 if (!shared_memory->Map(0)) {
1589 DLOG(ERROR) << "Unable to map renderer memory.";
1590 RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA1"));
1589 host_->GetProcess()->ReceivedBadMessage(); 1591 host_->GetProcess()->ReceivedBadMessage();
piman 2013/10/23 00:10:15 TBH this could fail if we're out of address space
1590 return; 1592 return;
1591 } 1593 }
1594
1595 if (shared_memory->mapped_size() < size_in_bytes) {
1596 DLOG(ERROR) << "Shared memory too small for given rectangle";
1597 RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA2"));
1598 host_->GetProcess()->ReceivedBadMessage();
1599 return;
1600 }
1592 1601
1593 if (last_swapped_surface_size_ != frame_size) { 1602 if (last_swapped_surface_size_ != frame_size) {
1594 DLOG_IF(ERROR, damage_rect != gfx::Rect(frame_size)) 1603 DLOG_IF(ERROR, damage_rect != gfx::Rect(frame_size))
1595 << "Expected full damage rect"; 1604 << "Expected full damage rect";
1596 } 1605 }
1597 last_swapped_surface_size_ = frame_size; 1606 last_swapped_surface_size_ = frame_size;
1598 last_swapped_surface_scale_factor_ = frame_device_scale_factor; 1607 last_swapped_surface_scale_factor_ = frame_device_scale_factor;
1599 1608
1600 scoped_refptr<MemoryHolder> holder(new MemoryHolder( 1609 scoped_refptr<MemoryHolder> holder(new MemoryHolder(
1601 shared_memory.Pass(), 1610 shared_memory.Pass(),
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
3444 RenderWidgetHost* widget) { 3453 RenderWidgetHost* widget) {
3445 return new RenderWidgetHostViewAura(widget); 3454 return new RenderWidgetHostViewAura(widget);
3446 } 3455 }
3447 3456
3448 // static 3457 // static
3449 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3458 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3450 GetScreenInfoForWindow(results, NULL); 3459 GetScreenInfoForWindow(results, NULL);
3451 } 3460 }
3452 3461
3453 } // namespace content 3462 } // namespace content
OLDNEW
« 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