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

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

Issue 13931009: Add latency info to input events sent to RenderWidget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 if (!animation_update_pending_ && !paint_aggregator_.HasPendingUpdate()) { 669 if (!animation_update_pending_ && !paint_aggregator_.HasPendingUpdate()) {
670 TRACE_EVENT0("renderer", "EarlyOut_NoPendingUpdate"); 670 TRACE_EVENT0("renderer", "EarlyOut_NoPendingUpdate");
671 return; 671 return;
672 } 672 }
673 673
674 // Continue painting if necessary... 674 // Continue painting if necessary...
675 DoDeferredUpdateAndSendInputAck(); 675 DoDeferredUpdateAndSendInputAck();
676 } 676 }
677 677
678 void RenderWidget::OnHandleInputEvent(const WebKit::WebInputEvent* input_event, 678 void RenderWidget::OnHandleInputEvent(const WebKit::WebInputEvent* input_event,
679 const cc::LatencyInfo& latency_info,
679 bool is_keyboard_shortcut) { 680 bool is_keyboard_shortcut) {
680 TRACE_EVENT0("renderer", "RenderWidget::OnHandleInputEvent"); 681 TRACE_EVENT0("renderer", "RenderWidget::OnHandleInputEvent");
681 682
682 handling_input_event_ = true; 683 handling_input_event_ = true;
683 if (!input_event) { 684 if (!input_event) {
684 handling_input_event_ = false; 685 handling_input_event_ = false;
685 return; 686 return;
686 } 687 }
687 688
689 if (compositor_)
690 compositor_->SetLatencyInfo(latency_info);
691
688 base::TimeDelta now = base::TimeDelta::FromInternalValue( 692 base::TimeDelta now = base::TimeDelta::FromInternalValue(
689 base::TimeTicks::Now().ToInternalValue()); 693 base::TimeTicks::Now().ToInternalValue());
690 694
691 int64 delta = static_cast<int64>( 695 int64 delta = static_cast<int64>(
692 (now.InSecondsF() - input_event->timeStampSeconds) * 696 (now.InSecondsF() - input_event->timeStampSeconds) *
693 base::Time::kMicrosecondsPerSecond); 697 base::Time::kMicrosecondsPerSecond);
694 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100); 698 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100);
695 std::string name_for_event = 699 std::string name_for_event =
696 base::StringPrintf("Event.Latency.Renderer.%s", 700 base::StringPrintf("Event.Latency.Renderer.%s",
697 GetEventName(input_event->type)); 701 GetEventName(input_event->type));
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 2319
2316 if (!context->Initialize( 2320 if (!context->Initialize(
2317 attributes, 2321 attributes,
2318 false /* bind generates resources */, 2322 false /* bind generates resources */,
2319 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ) 2323 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) )
2320 return NULL; 2324 return NULL;
2321 return context.release(); 2325 return context.release();
2322 } 2326 }
2323 2327
2324 } // namespace content 2328 } // namespace content
OLDNEW
« content/browser/renderer_host/render_widget_host_impl.cc ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698