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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 popup_type_(popup_type), | 384 popup_type_(popup_type), |
385 pending_window_rect_count_(0), | 385 pending_window_rect_count_(0), |
386 suppress_next_char_events_(false), | 386 suppress_next_char_events_(false), |
387 is_accelerated_compositing_active_(false), | 387 is_accelerated_compositing_active_(false), |
388 was_accelerated_compositing_ever_active_(false), | 388 was_accelerated_compositing_ever_active_(false), |
389 animation_update_pending_(false), | 389 animation_update_pending_(false), |
390 invalidation_task_posted_(false), | 390 invalidation_task_posted_(false), |
391 screen_info_(screen_info), | 391 screen_info_(screen_info), |
392 device_scale_factor_(screen_info_.deviceScaleFactor), | 392 device_scale_factor_(screen_info_.deviceScaleFactor), |
393 is_threaded_compositing_enabled_(false), | 393 is_threaded_compositing_enabled_(false), |
| 394 current_event_latency_info_(NULL), |
394 next_output_surface_id_(0), | 395 next_output_surface_id_(0), |
395 #if defined(OS_ANDROID) | 396 #if defined(OS_ANDROID) |
396 text_field_is_dirty_(false), | 397 text_field_is_dirty_(false), |
397 outstanding_ime_acks_(0), | 398 outstanding_ime_acks_(0), |
398 #endif | 399 #endif |
399 popup_origin_scale_for_emulation_(0.f), | 400 popup_origin_scale_for_emulation_(0.f), |
400 resizing_mode_selector_(new ResizingModeSelector()), | 401 resizing_mode_selector_(new ResizingModeSelector()), |
401 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { | 402 context_menu_source_type_(ui::MENU_SOURCE_MOUSE) { |
402 if (!swapped_out) | 403 if (!swapped_out) |
403 RenderProcess::current()->AddRefProcess(); | 404 RenderProcess::current()->AddRefProcess(); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 | 936 |
936 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 937 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
937 const ui::LatencyInfo& latency_info, | 938 const ui::LatencyInfo& latency_info, |
938 bool is_keyboard_shortcut) { | 939 bool is_keyboard_shortcut) { |
939 handling_input_event_ = true; | 940 handling_input_event_ = true; |
940 if (!input_event) { | 941 if (!input_event) { |
941 handling_input_event_ = false; | 942 handling_input_event_ = false; |
942 return; | 943 return; |
943 } | 944 } |
944 | 945 |
| 946 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
| 947 &latency_info); |
| 948 |
945 base::TimeTicks start_time; | 949 base::TimeTicks start_time; |
946 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 950 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
947 start_time = base::TimeTicks::HighResNow(); | 951 start_time = base::TimeTicks::HighResNow(); |
948 | 952 |
949 const char* const event_name = | 953 const char* const event_name = |
950 WebInputEventTraits::GetName(input_event->type); | 954 WebInputEventTraits::GetName(input_event->type); |
951 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 955 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", |
952 "event", event_name); | 956 "event", event_name); |
953 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); | 957 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
954 TRACE_EVENT_FLOW_STEP0( | 958 TRACE_EVENT_FLOW_STEP0( |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2339 | 2343 |
2340 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2344 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2341 swapped_out_frames_.AddObserver(frame); | 2345 swapped_out_frames_.AddObserver(frame); |
2342 } | 2346 } |
2343 | 2347 |
2344 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2348 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2345 swapped_out_frames_.RemoveObserver(frame); | 2349 swapped_out_frames_.RemoveObserver(frame); |
2346 } | 2350 } |
2347 | 2351 |
2348 } // namespace content | 2352 } // namespace content |
OLD | NEW |