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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 text_direction_updated_(false), | 266 text_direction_updated_(false), |
267 text_direction_(blink::WebTextDirectionLeftToRight), | 267 text_direction_(blink::WebTextDirectionLeftToRight), |
268 text_direction_canceled_(false), | 268 text_direction_canceled_(false), |
269 suppress_events_until_keydown_(false), | 269 suppress_events_until_keydown_(false), |
270 pending_mouse_lock_request_(false), | 270 pending_mouse_lock_request_(false), |
271 allow_privileged_mouse_lock_(false), | 271 allow_privileged_mouse_lock_(false), |
272 has_touch_handler_(false), | 272 has_touch_handler_(false), |
273 is_in_touchpad_gesture_scroll_(false), | 273 is_in_touchpad_gesture_scroll_(false), |
274 is_in_touchscreen_gesture_scroll_(false), | 274 is_in_touchscreen_gesture_scroll_(false), |
275 received_paint_after_load_(false), | 275 received_paint_after_load_(false), |
| 276 latency_tracker_(), |
276 next_browser_snapshot_id_(1), | 277 next_browser_snapshot_id_(1), |
277 owned_by_render_frame_host_(false), | 278 owned_by_render_frame_host_(false), |
278 is_focused_(false), | 279 is_focused_(false), |
279 hung_renderer_delay_( | 280 hung_renderer_delay_( |
280 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)), | 281 base::TimeDelta::FromMilliseconds(kHungRendererDelayMs)), |
281 hang_monitor_reason_( | 282 hang_monitor_reason_( |
282 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_UNKNOWN), | 283 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_UNKNOWN), |
283 hang_monitor_event_type_(blink::WebInputEvent::Undefined), | 284 hang_monitor_event_type_(blink::WebInputEvent::Undefined), |
284 last_event_type_(blink::WebInputEvent::Undefined), | 285 last_event_type_(blink::WebInputEvent::Undefined), |
285 new_content_rendering_delay_( | 286 new_content_rendering_delay_( |
286 base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)), | 287 base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)), |
287 weak_factory_(this) { | 288 weak_factory_(this) { |
288 CHECK(delegate_); | 289 CHECK(delegate_); |
289 CHECK_NE(MSG_ROUTING_NONE, routing_id_); | 290 CHECK_NE(MSG_ROUTING_NONE, routing_id_); |
| 291 latency_tracker_.SetDelegate(delegate_); |
290 | 292 |
291 #if defined(OS_WIN) | 293 #if defined(OS_WIN) |
292 // Update the display color profile cache so that it is likely to be up to | 294 // Update the display color profile cache so that it is likely to be up to |
293 // date when the renderer process requests the color profile. | 295 // date when the renderer process requests the color profile. |
294 if (gfx::ICCProfile::CachedProfilesNeedUpdate()) { | 296 if (gfx::ICCProfile::CachedProfilesNeedUpdate()) { |
295 BrowserThread::PostBlockingPoolTask( | 297 BrowserThread::PostBlockingPoolTask( |
296 FROM_HERE, | 298 FROM_HERE, |
297 base::Bind(&gfx::ICCProfile::UpdateCachedProfilesOnBackgroundThread)); | 299 base::Bind(&gfx::ICCProfile::UpdateCachedProfilesOnBackgroundThread)); |
298 } | 300 } |
299 #endif | 301 #endif |
(...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 new_auto_size_.SetSize(0, 0); | 2299 new_auto_size_.SetSize(0, 0); |
2298 if (!auto_resize_enabled_) | 2300 if (!auto_resize_enabled_) |
2299 return; | 2301 return; |
2300 | 2302 |
2301 if (delegate_) | 2303 if (delegate_) |
2302 delegate_->ResizeDueToAutoResize(this, new_size); | 2304 delegate_->ResizeDueToAutoResize(this, new_size); |
2303 } | 2305 } |
2304 | 2306 |
2305 void RenderWidgetHostImpl::DetachDelegate() { | 2307 void RenderWidgetHostImpl::DetachDelegate() { |
2306 delegate_ = NULL; | 2308 delegate_ = NULL; |
| 2309 latency_tracker_.SetDelegate(nullptr); |
2307 } | 2310 } |
2308 | 2311 |
2309 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { | 2312 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { |
2310 ui::LatencyInfo::LatencyComponent window_snapshot_component; | 2313 ui::LatencyInfo::LatencyComponent window_snapshot_component; |
2311 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 2314 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
2312 GetLatencyComponentId(), | 2315 GetLatencyComponentId(), |
2313 &window_snapshot_component)) { | 2316 &window_snapshot_component)) { |
2314 int sequence_number = static_cast<int>( | 2317 int sequence_number = static_cast<int>( |
2315 window_snapshot_component.sequence_number); | 2318 window_snapshot_component.sequence_number); |
2316 #if defined(OS_MACOSX) | 2319 #if defined(OS_MACOSX) |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 // Note: We are using the origin URL provided by the sender here. It may be | 2506 // Note: We are using the origin URL provided by the sender here. It may be |
2504 // different from the receiver's. | 2507 // different from the receiver's. |
2505 file_system_file.url = | 2508 file_system_file.url = |
2506 GURL(storage::GetIsolatedFileSystemRootURIString( | 2509 GURL(storage::GetIsolatedFileSystemRootURIString( |
2507 file_system_url.origin(), filesystem_id, std::string()) | 2510 file_system_url.origin(), filesystem_id, std::string()) |
2508 .append(register_name)); | 2511 .append(register_name)); |
2509 } | 2512 } |
2510 } | 2513 } |
2511 | 2514 |
2512 } // namespace content | 2515 } // namespace content |
OLD | NEW |