Chromium Code Reviews| Index: pdf/paint_manager.cc |
| diff --git a/pdf/paint_manager.cc b/pdf/paint_manager.cc |
| index ea9cc7814679f0c077ce1e0861a83fab2d4fef93..28406d904f4b6d04794e24fc2954a58ff8ec1079 100644 |
| --- a/pdf/paint_manager.cc |
| +++ b/pdf/paint_manager.cc |
| @@ -141,8 +141,9 @@ void PaintManager::Invalidate() { |
| } |
| void PaintManager::InvalidateRect(const pp::Rect& rect) { |
| - DCHECK(!in_paint_); |
| - |
| + // Note, we can't DCHECK(!in_paint_) here because javascript inside the |
|
Tom Sepez
2017/01/19 17:43:37
Do we just want to no-op it in this special case?
dsinclair
2017/01/19 18:56:10
I don't know. My concern when I did this originall
|
| + // PDF can trigger at any point. So, while we're attempting to paint it's |
| + // possible for the JS to trigger and cause an invalidation. |
| if (graphics_.is_null() && !has_pending_resize_) |
| return; |
| @@ -151,7 +152,8 @@ void PaintManager::InvalidateRect(const pp::Rect& rect) { |
| if (clipped_rect.IsEmpty()) |
| return; // Nothing to do. |
| - EnsureCallbackPending(); |
| + if (!in_paint_) |
| + EnsureCallbackPending(); |
| aggregator_.InvalidateRect(clipped_rect); |
| } |