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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 popup_type_(popup_type), | 382 popup_type_(popup_type), |
383 pending_window_rect_count_(0), | 383 pending_window_rect_count_(0), |
384 suppress_next_char_events_(false), | 384 suppress_next_char_events_(false), |
385 is_accelerated_compositing_active_(false), | 385 is_accelerated_compositing_active_(false), |
386 was_accelerated_compositing_ever_active_(false), | 386 was_accelerated_compositing_ever_active_(false), |
387 animation_update_pending_(false), | 387 animation_update_pending_(false), |
388 invalidation_task_posted_(false), | 388 invalidation_task_posted_(false), |
389 screen_info_(screen_info), | 389 screen_info_(screen_info), |
390 device_scale_factor_(screen_info_.deviceScaleFactor), | 390 device_scale_factor_(screen_info_.deviceScaleFactor), |
391 is_threaded_compositing_enabled_(false), | 391 is_threaded_compositing_enabled_(false), |
| 392 current_event_latency_info_(NULL), |
392 next_output_surface_id_(0), | 393 next_output_surface_id_(0), |
393 #if defined(OS_ANDROID) | 394 #if defined(OS_ANDROID) |
394 text_field_is_dirty_(false), | 395 text_field_is_dirty_(false), |
395 outstanding_ime_acks_(0), | 396 outstanding_ime_acks_(0), |
396 body_background_color_(SK_ColorWHITE), | 397 body_background_color_(SK_ColorWHITE), |
397 #endif | 398 #endif |
398 #if defined(OS_MACOSX) | 399 #if defined(OS_MACOSX) |
399 cached_has_main_frame_horizontal_scrollbar_(false), | 400 cached_has_main_frame_horizontal_scrollbar_(false), |
400 cached_has_main_frame_vertical_scrollbar_(false), | 401 cached_has_main_frame_vertical_scrollbar_(false), |
401 #endif | 402 #endif |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 911 |
911 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 912 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
912 const ui::LatencyInfo& latency_info, | 913 const ui::LatencyInfo& latency_info, |
913 bool is_keyboard_shortcut) { | 914 bool is_keyboard_shortcut) { |
914 handling_input_event_ = true; | 915 handling_input_event_ = true; |
915 if (!input_event) { | 916 if (!input_event) { |
916 handling_input_event_ = false; | 917 handling_input_event_ = false; |
917 return; | 918 return; |
918 } | 919 } |
919 | 920 |
| 921 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
| 922 &latency_info); |
| 923 |
920 base::TimeTicks start_time; | 924 base::TimeTicks start_time; |
921 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 925 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
922 start_time = base::TimeTicks::HighResNow(); | 926 start_time = base::TimeTicks::HighResNow(); |
923 | 927 |
924 const char* const event_name = | 928 const char* const event_name = |
925 WebInputEventTraits::GetName(input_event->type); | 929 WebInputEventTraits::GetName(input_event->type); |
926 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 930 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", |
927 "event", event_name); | 931 "event", event_name); |
928 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); | 932 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
929 TRACE_EVENT_FLOW_STEP0( | 933 TRACE_EVENT_FLOW_STEP0( |
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 | 2230 |
2227 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2231 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2228 swapped_out_frames_.AddObserver(frame); | 2232 swapped_out_frames_.AddObserver(frame); |
2229 } | 2233 } |
2230 | 2234 |
2231 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2235 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2232 swapped_out_frames_.RemoveObserver(frame); | 2236 swapped_out_frames_.RemoveObserver(frame); |
2233 } | 2237 } |
2234 | 2238 |
2235 } // namespace content | 2239 } // namespace content |
OLD | NEW |