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_.MergeWith(latency_info); | 1066 latency_info_.MergeWith(latency_info); |
1065 } | 1067 } |
1066 | 1068 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 Send(response); | 1190 Send(response); |
1189 } | 1191 } |
1190 | 1192 |
1191 #if defined(OS_ANDROID) | 1193 #if defined(OS_ANDROID) |
1192 // Allow the IME to be shown when the focus changes as a consequence | 1194 // Allow the IME to be shown when the focus changes as a consequence |
1193 // of a processed touch end event. | 1195 // of a processed touch end event. |
1194 if (input_event->type == WebInputEvent::TouchEnd && processed) | 1196 if (input_event->type == WebInputEvent::TouchEnd && processed) |
1195 UpdateTextInputState(true, true); | 1197 UpdateTextInputState(true, true); |
1196 #endif | 1198 #endif |
1197 | 1199 |
| 1200 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
1198 handling_input_event_ = false; | 1201 handling_input_event_ = false; |
1199 | 1202 |
1200 if (!prevent_default) { | 1203 if (!prevent_default) { |
1201 if (WebInputEvent::isKeyboardEventType(input_event->type)) | 1204 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
1202 DidHandleKeyEvent(); | 1205 DidHandleKeyEvent(); |
1203 if (WebInputEvent::isMouseEventType(input_event->type)) | 1206 if (WebInputEvent::isMouseEventType(input_event->type)) |
1204 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); | 1207 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); |
1205 if (WebInputEvent::isTouchEventType(input_event->type)) | 1208 if (WebInputEvent::isTouchEventType(input_event->type)) |
1206 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); | 1209 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); |
1207 } | 1210 } |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 surface_id(), | 2863 surface_id(), |
2861 GetURLForGraphicsContext3D(), | 2864 GetURLForGraphicsContext3D(), |
2862 gpu_channel_host.get(), | 2865 gpu_channel_host.get(), |
2863 attributes, | 2866 attributes, |
2864 false /* bind generates resources */, | 2867 false /* bind generates resources */, |
2865 limits)); | 2868 limits)); |
2866 return context.Pass(); | 2869 return context.Pass(); |
2867 } | 2870 } |
2868 | 2871 |
2869 } // namespace content | 2872 } // namespace content |
OLD | NEW |