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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1049 } |
1049 | 1050 |
1050 base::TimeTicks start_time; | 1051 base::TimeTicks start_time; |
1051 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 1052 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
1052 start_time = base::TimeTicks::HighResNow(); | 1053 start_time = base::TimeTicks::HighResNow(); |
1053 | 1054 |
1054 const char* const event_name = | 1055 const char* const event_name = |
1055 WebInputEventTraits::GetName(input_event->type); | 1056 WebInputEventTraits::GetName(input_event->type); |
1056 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 1057 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", |
1057 "event", event_name); | 1058 "event", event_name); |
| 1059 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
1058 | 1060 |
1059 if (compositor_) | 1061 if (compositor_) |
1060 compositor_->SetLatencyInfo(latency_info); | 1062 compositor_->SetLatencyInfo(latency_info); |
1061 else | 1063 else |
1062 latency_info_.MergeWith(latency_info); | 1064 latency_info_.MergeWith(latency_info); |
1063 | 1065 |
1064 base::TimeDelta now = base::TimeDelta::FromInternalValue( | 1066 base::TimeDelta now = base::TimeDelta::FromInternalValue( |
1065 base::TimeTicks::Now().ToInternalValue()); | 1067 base::TimeTicks::Now().ToInternalValue()); |
1066 | 1068 |
1067 int64 delta = static_cast<int64>( | 1069 int64 delta = static_cast<int64>( |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 Send(response); | 1182 Send(response); |
1181 } | 1183 } |
1182 | 1184 |
1183 #if defined(OS_ANDROID) | 1185 #if defined(OS_ANDROID) |
1184 // Allow the IME to be shown when the focus changes as a consequence | 1186 // Allow the IME to be shown when the focus changes as a consequence |
1185 // of a processed touch end event. | 1187 // of a processed touch end event. |
1186 if (input_event->type == WebInputEvent::TouchEnd && processed) | 1188 if (input_event->type == WebInputEvent::TouchEnd && processed) |
1187 UpdateTextInputState(true, true); | 1189 UpdateTextInputState(true, true); |
1188 #endif | 1190 #endif |
1189 | 1191 |
| 1192 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
1190 handling_input_event_ = false; | 1193 handling_input_event_ = false; |
1191 | 1194 |
1192 if (!prevent_default) { | 1195 if (!prevent_default) { |
1193 if (WebInputEvent::isKeyboardEventType(input_event->type)) | 1196 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
1194 DidHandleKeyEvent(); | 1197 DidHandleKeyEvent(); |
1195 if (WebInputEvent::isMouseEventType(input_event->type)) | 1198 if (WebInputEvent::isMouseEventType(input_event->type)) |
1196 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); | 1199 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); |
1197 if (WebInputEvent::isTouchEventType(input_event->type)) | 1200 if (WebInputEvent::isTouchEventType(input_event->type)) |
1198 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); | 1201 DidHandleTouchEvent(*(static_cast<const WebTouchEvent*>(input_event))); |
1199 } | 1202 } |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2839 GetURLForGraphicsContext3D(), | 2842 GetURLForGraphicsContext3D(), |
2840 gpu_channel_host.get(), | 2843 gpu_channel_host.get(), |
2841 use_echo_for_swap_ack, | 2844 use_echo_for_swap_ack, |
2842 attributes, | 2845 attributes, |
2843 false /* bind generates resources */, | 2846 false /* bind generates resources */, |
2844 limits)); | 2847 limits)); |
2845 return context.Pass(); | 2848 return context.Pass(); |
2846 } | 2849 } |
2847 | 2850 |
2848 } // namespace content | 2851 } // namespace content |
OLD | NEW |