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

Unified Diff: chrome/plugin/webplugin_proxy.cc

Issue 332033: Make the web plugin proxy tolerant of windowless bitmap memory mapping failur... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | chrome/test/data/reliability/known_crashes.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/webplugin_proxy.cc
===================================================================
--- chrome/plugin/webplugin_proxy.cc (revision 29945)
+++ chrome/plugin/webplugin_proxy.cc (working copy)
@@ -455,20 +455,33 @@
void WebPluginProxy::SetWindowlessBuffer(
const TransportDIB::Handle& windowless_buffer,
const TransportDIB::Handle& background_buffer) {
- // Create a canvas that will reference the shared bits.
- windowless_canvas_.reset(new skia::PlatformCanvas(
- delegate_->GetRect().width(),
- delegate_->GetRect().height(),
- true,
- win_util::GetSectionFromProcess(windowless_buffer,
- channel_->renderer_handle(), false)));
+ // Create a canvas that will reference the shared bits. We have to handle
+ // errors here since we're mapping a large amount of memory that may not fit
+ // in our address space, or go wrong in some other way.
+ windowless_canvas_.reset(new skia::PlatformCanvas);
+ if (!windowless_canvas_->initialize(
+ delegate_->GetRect().width(),
+ delegate_->GetRect().height(),
+ true,
+ win_util::GetSectionFromProcess(windowless_buffer,
+ channel_->renderer_handle(), false))) {
+ windowless_canvas_.reset();
+ background_canvas_.reset();
+ return;
+ }
+
if (background_buffer) {
- background_canvas_.reset(new skia::PlatformCanvas(
- delegate_->GetRect().width(),
- delegate_->GetRect().height(),
- true,
- win_util::GetSectionFromProcess(background_buffer,
- channel_->renderer_handle(), false)));
+ background_canvas_.reset(new skia::PlatformCanvas);
+ if (!background_canvas_->initialize(
+ delegate_->GetRect().width(),
+ delegate_->GetRect().height(),
+ true,
+ win_util::GetSectionFromProcess(background_buffer,
+ channel_->renderer_handle(), false))) {
+ windowless_canvas_.reset();
+ background_canvas_.reset();
+ return;
+ }
}
}
« no previous file with comments | « no previous file | chrome/test/data/reliability/known_crashes.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698