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/logging.h" | 11 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
14 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
18 #include "cc/base/switches.h" | 19 #include "cc/base/switches.h" |
19 #include "cc/debug/benchmark_instrumentation.h" | 20 #include "cc/debug/benchmark_instrumentation.h" |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 } | 1048 } |
1048 | 1049 |
1049 base::TimeTicks start_time; | 1050 base::TimeTicks start_time; |
1050 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 1051 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
1051 start_time = base::TimeTicks::HighResNow(); | 1052 start_time = base::TimeTicks::HighResNow(); |
1052 | 1053 |
1053 const char* const event_name = | 1054 const char* const event_name = |
1054 WebInputEventTraits::GetName(input_event->type); | 1055 WebInputEventTraits::GetName(input_event->type); |
1055 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 1056 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", |
1056 "event", event_name); | 1057 "event", event_name); |
| 1058 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
1057 | 1059 |
1058 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 1060 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
1059 | 1061 |
1060 if (compositor_) { | 1062 if (compositor_) { |
1061 latency_info_swap_promise_monitor = | 1063 latency_info_swap_promise_monitor = |
1062 compositor_->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); | 1064 compositor_->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); |
1063 } else { | 1065 } else { |
1064 latency_info_.push_back(latency_info); | 1066 latency_info_.push_back(latency_info); |
1065 } | 1067 } |
1066 | 1068 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 } | 1192 } |
1191 } | 1193 } |
1192 | 1194 |
1193 #if defined(OS_ANDROID) | 1195 #if defined(OS_ANDROID) |
1194 // Allow the IME to be shown when the focus changes as a consequence | 1196 // Allow the IME to be shown when the focus changes as a consequence |
1195 // of a processed touch end event. | 1197 // of a processed touch end event. |
1196 if (input_event->type == WebInputEvent::TouchEnd && processed) | 1198 if (input_event->type == WebInputEvent::TouchEnd && processed) |
1197 UpdateTextInputState(true, true); | 1199 UpdateTextInputState(true, true); |
1198 #endif | 1200 #endif |
1199 | 1201 |
| 1202 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
1200 handling_input_event_ = false; | 1203 handling_input_event_ = false; |
1201 | 1204 |
1202 if (!prevent_default) { | 1205 if (!prevent_default) { |
1203 if (WebInputEvent::isKeyboardEventType(input_event->type)) | 1206 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
1204 DidHandleKeyEvent(); | 1207 DidHandleKeyEvent(); |
1205 if (WebInputEvent::isMouseEventType(input_event->type)) | 1208 if (WebInputEvent::isMouseEventType(input_event->type)) |
1206 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); | 1209 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); |
1207 if (WebInputEvent::isTouchEventType(input_event->type)) | 1210 if (WebInputEvent::isTouchEventType(input_event->type)) |
1208 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); | 1211 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); |
1209 } | 1212 } |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 surface_id(), | 2870 surface_id(), |
2868 GetURLForGraphicsContext3D(), | 2871 GetURLForGraphicsContext3D(), |
2869 gpu_channel_host.get(), | 2872 gpu_channel_host.get(), |
2870 attributes, | 2873 attributes, |
2871 false /* bind generates resources */, | 2874 false /* bind generates resources */, |
2872 limits)); | 2875 limits)); |
2873 return context.Pass(); | 2876 return context.Pass(); |
2874 } | 2877 } |
2875 | 2878 |
2876 } // namespace content | 2879 } // namespace content |
OLD | NEW |