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 <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 // Request that the renderer produce a frame of the right size, if it | 922 // Request that the renderer produce a frame of the right size, if it |
923 // hasn't been requested already. | 923 // hasn't been requested already. |
924 if (!repaint_ack_pending_ && !resize_ack_pending_) { | 924 if (!repaint_ack_pending_ && !resize_ack_pending_) { |
925 repaint_start_time_ = TimeTicks::Now(); | 925 repaint_start_time_ = TimeTicks::Now(); |
926 repaint_ack_pending_ = true; | 926 repaint_ack_pending_ = true; |
927 TRACE_EVENT_ASYNC_BEGIN0( | 927 TRACE_EVENT_ASYNC_BEGIN0( |
928 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); | 928 "renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this); |
929 Send(new ViewMsg_Repaint(routing_id_, view_size)); | 929 Send(new ViewMsg_Repaint(routing_id_, view_size)); |
930 } | 930 } |
931 | 931 |
932 // Pump a nested message loop until we time out or get a frame of the right | 932 // Pump a nested run loop until we time out or get a frame of the right |
933 // size. | 933 // size. |
934 TimeTicks start_time = TimeTicks::Now(); | 934 TimeTicks start_time = TimeTicks::Now(); |
935 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); | 935 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); |
936 TimeTicks timeout_time = start_time + time_left; | 936 TimeTicks timeout_time = start_time + time_left; |
937 while (1) { | 937 while (1) { |
938 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); | 938 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); |
939 if (ui::WindowResizeHelperMac::Get()->WaitForSingleTaskToRun(time_left)) { | 939 if (ui::WindowResizeHelperMac::Get()->WaitForSingleTaskToRun(time_left)) { |
940 // For auto-resized views, current_size_ determines the view_size and it | 940 // For auto-resized views, current_size_ determines the view_size and it |
941 // may have changed during the handling of an UpdateRect message. | 941 // may have changed during the handling of an UpdateRect message. |
942 if (auto_resize_enabled_) | 942 if (auto_resize_enabled_) |
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 RenderProcessHost* rph = GetProcess(); | 2629 RenderProcessHost* rph = GetProcess(); |
2630 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); | 2630 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
2631 i != messages.end(); ++i) { | 2631 i != messages.end(); ++i) { |
2632 rph->OnMessageReceived(*i); | 2632 rph->OnMessageReceived(*i); |
2633 if (i->dispatch_error()) | 2633 if (i->dispatch_error()) |
2634 rph->OnBadMessageReceived(*i); | 2634 rph->OnBadMessageReceived(*i); |
2635 } | 2635 } |
2636 } | 2636 } |
2637 | 2637 |
2638 } // namespace content | 2638 } // namespace content |
OLD | NEW |