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 #if defined(OS_MACOSX) |
| 619 view_->AboutToWaitForBackingStoreMsg(); |
| 620 #endif |
| 621 |
618 // When we have asked the RenderWidget to resize, and we are still waiting | 622 // 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 | 623 // 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. | 624 // before returning the old (incorrectly sized) backing store. |
621 IPC::Message msg; | 625 IPC::Message msg; |
622 if (process_->WaitForBackingStoreMsg(routing_id_, max_delay, &msg)) { | 626 if (process_->WaitForBackingStoreMsg(routing_id_, max_delay, &msg)) { |
623 OnMessageReceived(msg); | 627 OnMessageReceived(msg); |
624 | 628 |
625 // For auto-resized views, current_size_ determines the view_size and it | 629 // For auto-resized views, current_size_ determines the view_size and it |
626 // may have changed during the handling of an UpdateRect message. | 630 // may have changed during the handling of an UpdateRect message. |
627 if (should_auto_resize_) | 631 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 | 1782 // indicate that no callback is in progress (i.e. without this line |
1779 // DelayedAutoResized will not get called again). | 1783 // DelayedAutoResized will not get called again). |
1780 new_auto_size_.SetSize(0, 0); | 1784 new_auto_size_.SetSize(0, 0); |
1781 if (!should_auto_resize_) | 1785 if (!should_auto_resize_) |
1782 return; | 1786 return; |
1783 | 1787 |
1784 OnRenderAutoResized(new_size); | 1788 OnRenderAutoResized(new_size); |
1785 } | 1789 } |
1786 | 1790 |
1787 } // namespace content | 1791 } // namespace content |
OLD | NEW |