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

Unified Diff: content/browser/renderer_host/compositing_iosurface_layer_mac.mm

Issue 447113004: Fix crash in GotAcceleratedIOSurfaceFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: content/browser/renderer_host/compositing_iosurface_layer_mac.mm
diff --git a/content/browser/renderer_host/compositing_iosurface_layer_mac.mm b/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
index 38054c855a5e65c68c07f4406ef71c7df0da6f39..81a3529f0b56c45374e82cf450818ca8d377929f 100644
--- a/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
+++ b/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
@@ -102,7 +102,10 @@ void CompositingIOSurfaceLayerHelper::AckPendingFrame(bool success) {
if (!has_pending_frame_)
return;
has_pending_frame_ = false;
- client_->AcceleratedLayerDidDrawFrame(success);
+ if (success)
+ client_->AcceleratedLayerDidDrawFrame();
+ else
+ client_->AcceleratedLayerHitError();
// A trace value of 0 indicates that there is no longer a pending swap ack.
TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 0);
}
@@ -174,13 +177,19 @@ void CompositingIOSurfaceLayerHelper::EndPumpingFrames() {
iosurface
withScaleFactor:(float)scale_factor
withClient:(content::CompositingIOSurfaceLayerClient*)client {
+ DCHECK(iosurface);
if (self = [super init]) {
helper_.reset(new content::CompositingIOSurfaceLayerHelper(client, self));
iosurface_ = iosurface;
context_ = content::CompositingIOSurfaceContext::Get(
content::CompositingIOSurfaceContext::kCALayerContextWindowNumber);
- DCHECK(context_);
+ if (!context_) {
+ LOG(ERROR) << "Failed create CompositingIOSurfaceContext";
Ken Russell (switch to Gerrit) 2014/08/07 22:11:44 I wonder whether here and throughout these classes
ccameron 2014/08/07 22:28:24 If anything, I'd like to make these errors more vi
+ [self resetClient];
+ [self release];
+ return nil;
+ }
[self setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
[self setAnchorPoint:CGPointMake(0, 0)];

Powered by Google App Engine
This is Rietveld 408576698