Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: content/renderer/render_widget.cc

Issue 12314139: We use UMA to track event latency both as a group of all events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/events/event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/base/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698