OLD | NEW |
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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 repaint_start_time_ = TimeTicks::Now(); | 608 repaint_start_time_ = TimeTicks::Now(); |
609 repaint_ack_pending_ = true; | 609 repaint_ack_pending_ = true; |
610 Send(new ViewMsg_Repaint(routing_id_, view_size)); | 610 Send(new ViewMsg_Repaint(routing_id_, view_size)); |
611 } | 611 } |
612 | 612 |
613 TimeDelta max_delay = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); | 613 TimeDelta max_delay = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); |
614 TimeTicks end_time = TimeTicks::Now() + max_delay; | 614 TimeTicks end_time = TimeTicks::Now() + max_delay; |
615 do { | 615 do { |
616 TRACE_EVENT0("renderer_host", "GetBackingStore::WaitForUpdate"); | 616 TRACE_EVENT0("renderer_host", "GetBackingStore::WaitForUpdate"); |
617 | 617 |
| 618 view_->AboutToWaitForBackingStoreMsg(); |
| 619 |
618 // When we have asked the RenderWidget to resize, and we are still waiting | 620 // When we have asked the RenderWidget to resize, and we are still waiting |
619 // on a response, block for a little while to see if we can't get a response | 621 // on a response, block for a little while to see if we can't get a response |
620 // before returning the old (incorrectly sized) backing store. | 622 // before returning the old (incorrectly sized) backing store. |
621 IPC::Message msg; | 623 IPC::Message msg; |
622 if (process_->WaitForBackingStoreMsg(routing_id_, max_delay, &msg)) { | 624 if (process_->WaitForBackingStoreMsg(routing_id_, max_delay, &msg)) { |
623 OnMessageReceived(msg); | 625 OnMessageReceived(msg); |
624 | 626 |
625 // For auto-resized views, current_size_ determines the view_size and it | 627 // For auto-resized views, current_size_ determines the view_size and it |
626 // may have changed during the handling of an UpdateRect message. | 628 // may have changed during the handling of an UpdateRect message. |
627 if (should_auto_resize_) | 629 if (should_auto_resize_) |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 // indicate that no callback is in progress (i.e. without this line | 1780 // indicate that no callback is in progress (i.e. without this line |
1779 // DelayedAutoResized will not get called again). | 1781 // DelayedAutoResized will not get called again). |
1780 new_auto_size_.SetSize(0, 0); | 1782 new_auto_size_.SetSize(0, 0); |
1781 if (!should_auto_resize_) | 1783 if (!should_auto_resize_) |
1782 return; | 1784 return; |
1783 | 1785 |
1784 OnRenderAutoResized(new_size); | 1786 OnRenderAutoResized(new_size); |
1785 } | 1787 } |
1786 | 1788 |
1787 } // namespace content | 1789 } // namespace content |
OLD | NEW |