| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 base::TimeTicks::Now().ToInternalValue()); | 618 base::TimeTicks::Now().ToInternalValue()); |
| 619 | 619 |
| 620 int64 delta = static_cast<int64>( | 620 int64 delta = static_cast<int64>( |
| 621 (now.InSecondsF() - input_event->timeStampSeconds) * | 621 (now.InSecondsF() - input_event->timeStampSeconds) * |
| 622 base::Time::kMicrosecondsPerSecond); | 622 base::Time::kMicrosecondsPerSecond); |
| 623 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100); | 623 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100); |
| 624 std::string name_for_event = | 624 std::string name_for_event = |
| 625 base::StringPrintf("Event.Latency.Renderer.%s", | 625 base::StringPrintf("Event.Latency.Renderer.%s", |
| 626 GetEventName(input_event->type)); | 626 GetEventName(input_event->type)); |
| 627 base::HistogramBase* counter_for_type = | 627 base::HistogramBase* counter_for_type = |
| 628 base::Histogram::FactoryTimeGet( | 628 base::Histogram::FactoryGet( |
| 629 name_for_event, | 629 name_for_event, |
| 630 base::TimeDelta::FromMilliseconds(0), | 630 0, |
| 631 base::TimeDelta::FromMilliseconds(1000000), | 631 1000000, |
| 632 100, | 632 100, |
| 633 base::HistogramBase::kUmaTargetedHistogramFlag); | 633 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 634 counter_for_type->AddTime(base::TimeDelta::FromMicroseconds(delta)); | 634 counter_for_type->Add(delta); |
| 635 | 635 |
| 636 bool prevent_default = false; | 636 bool prevent_default = false; |
| 637 if (WebInputEvent::isMouseEventType(input_event->type)) { | 637 if (WebInputEvent::isMouseEventType(input_event->type)) { |
| 638 const WebMouseEvent& mouse_event = | 638 const WebMouseEvent& mouse_event = |
| 639 *static_cast<const WebMouseEvent*>(input_event); | 639 *static_cast<const WebMouseEvent*>(input_event); |
| 640 TRACE_EVENT2("renderer", "HandleMouseMove", | 640 TRACE_EVENT2("renderer", "HandleMouseMove", |
| 641 "x", mouse_event.x, "y", mouse_event.y); | 641 "x", mouse_event.x, "y", mouse_event.y); |
| 642 prevent_default = WillHandleMouseEvent(mouse_event); | 642 prevent_default = WillHandleMouseEvent(mouse_event); |
| 643 } | 643 } |
| 644 | 644 |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 bool RenderWidget::WillHandleGestureEvent( | 2137 bool RenderWidget::WillHandleGestureEvent( |
| 2138 const WebKit::WebGestureEvent& event) { | 2138 const WebKit::WebGestureEvent& event) { |
| 2139 return false; | 2139 return false; |
| 2140 } | 2140 } |
| 2141 | 2141 |
| 2142 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 2142 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
| 2143 return true; | 2143 return true; |
| 2144 } | 2144 } |
| 2145 | 2145 |
| 2146 } // namespace content | 2146 } // namespace content |
| OLD | NEW |