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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 232283002: Add NULL check before CanPauseForPendingResizeOrRepaints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <QuartzCore/QuartzCore.h> 8 #include <QuartzCore/QuartzCore.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 2208
2209 void RenderWidgetHostViewMac::PauseForPendingResizeOrRepaintsAndDraw() { 2209 void RenderWidgetHostViewMac::PauseForPendingResizeOrRepaintsAndDraw() {
2210 if (!render_widget_host_ || render_widget_host_->is_hidden()) 2210 if (!render_widget_host_ || render_widget_host_->is_hidden())
2211 return; 2211 return;
2212 2212
2213 // Pausing for the overlay view prevents the underlay from receiving 2213 // Pausing for the overlay view prevents the underlay from receiving
2214 // frames. This may lead to large delays, causing overlaps. If both 2214 // frames. This may lead to large delays, causing overlaps. If both
2215 // overlay and underlay resize at the same time, let them both to have 2215 // overlay and underlay resize at the same time, let them both to have
2216 // some time waiting. See crbug.com/352020. 2216 // some time waiting. See crbug.com/352020.
2217 if (underlay_view_ && 2217 if (underlay_view_ &&
2218 underlay_view_->render_widget_host_ &&
2218 !underlay_view_->render_widget_host_-> 2219 !underlay_view_->render_widget_host_->
2219 CanPauseForPendingResizeOrRepaints()) 2220 CanPauseForPendingResizeOrRepaints())
2220 return; 2221 return;
2221 2222
2222 // Ensure that all frames are acked before waiting for a frame to come in. 2223 // Ensure that all frames are acked before waiting for a frame to come in.
2223 // Note that we will draw a frame at the end of this function, so it is safe 2224 // Note that we will draw a frame at the end of this function, so it is safe
2224 // to ack a never-drawn frame here. 2225 // to ack a never-drawn frame here.
2225 SendPendingSwapAck(); 2226 SendPendingSwapAck();
2226 2227
2227 // Wait for a frame of the right size to come in. 2228 // Wait for a frame of the right size to come in.
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after
4310 } 4311 }
4311 4312
4312 - (void)disableRendering { 4313 - (void)disableRendering {
4313 // Disable the fade-out animation as the layer is removed. 4314 // Disable the fade-out animation as the layer is removed.
4314 ScopedCAActionDisabler disabler; 4315 ScopedCAActionDisabler disabler;
4315 [self removeFromSuperlayer]; 4316 [self removeFromSuperlayer];
4316 renderWidgetHostView_ = nil; 4317 renderWidgetHostView_ = nil;
4317 } 4318 }
4318 4319
4319 @end // implementation SoftwareLayer 4320 @end // implementation SoftwareLayer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698