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

Unified Diff: chrome/plugin/webplugin_proxy.cc

Issue 164226: linux: fix race in TransportDIB passing (Closed)
Patch Set: Add newline for clarity Created 11 years, 4 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 | « chrome/common/transport_dib_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/webplugin_proxy.cc
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 0e2e006f47760656b78ad1734fcc6e62b08ca8d0..8a046502687fb86360455103d28ca932da30d0b5 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -636,7 +636,13 @@ void WebPluginProxy::SetWindowlessBuffer(
int width = delegate_->GetRect().width();
int height = delegate_->GetRect().height();
windowless_dib_.reset(TransportDIB::Map(windowless_buffer));
- windowless_canvas_.reset(windowless_dib_->GetPlatformCanvas(width, height));
+ if (windowless_dib_.get()) {
+ windowless_canvas_.reset(windowless_dib_->GetPlatformCanvas(width, height));
+ } else {
+ // This can happen if the renderer has already destroyed the TransportDIB
+ // by the time we receive the handle, e.g. in case of multiple resizes.
+ windowless_canvas_.reset();
+ }
background_dib_.reset(TransportDIB::Map(background_buffer));
if (background_dib_.get()) {
background_canvas_.reset(background_dib_->GetPlatformCanvas(width, height));
« no previous file with comments | « chrome/common/transport_dib_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698