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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 681763003: Add input latency histograms for wheel events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments about histograms Created 6 years, 1 month 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput. 430 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput.
431 void FlushInput(); 431 void FlushInput();
432 432
433 // InputRouterClient 433 // InputRouterClient
434 void SetNeedsFlush() override; 434 void SetNeedsFlush() override;
435 435
436 // Indicates whether the renderer drives the RenderWidgetHosts's size or the 436 // Indicates whether the renderer drives the RenderWidgetHosts's size or the
437 // other way around. 437 // other way around.
438 bool should_auto_resize() { return should_auto_resize_; } 438 bool should_auto_resize() { return should_auto_resize_; }
439 439
440 void ComputeTouchLatency(const ui::LatencyInfo& latency_info);
441 void FrameSwapped(const ui::LatencyInfo& latency_info); 440 void FrameSwapped(const ui::LatencyInfo& latency_info);
442 void DidReceiveRendererFrame(); 441 void DidReceiveRendererFrame();
443 442
444 // Returns the ID that uniquely describes this component to the latency 443 // Returns the ID that uniquely describes this component to the latency
445 // subsystem. 444 // subsystem.
446 int64 GetLatencyComponentId(); 445 int64 GetLatencyComponentId() const;
447 446
448 static void CompositorFrameDrawn( 447 static void CompositorFrameDrawn(
449 const std::vector<ui::LatencyInfo>& latency_info); 448 const std::vector<ui::LatencyInfo>& latency_info);
450 449
451 // Don't check whether we expected a resize ack during layout tests. 450 // Don't check whether we expected a resize ack during layout tests.
452 static void DisableResizeAckCheckForTesting(); 451 static void DisableResizeAckCheckForTesting();
453 452
454 void WindowSnapshotAsyncCallback( 453 void WindowSnapshotAsyncCallback(
455 int routing_id, 454 int routing_id,
456 int snapshot_id, 455 int snapshot_id,
(...skipping 19 matching lines...) Expand all
476 #if defined(OS_WIN) 475 #if defined(OS_WIN)
477 gfx::NativeViewAccessible GetParentNativeViewAccessible(); 476 gfx::NativeViewAccessible GetParentNativeViewAccessible();
478 #endif 477 #endif
479 478
480 protected: 479 protected:
481 RenderWidgetHostImpl* AsRenderWidgetHostImpl() override; 480 RenderWidgetHostImpl* AsRenderWidgetHostImpl() override;
482 481
483 // Create a LatencyInfo struct with INPUT_EVENT_LATENCY_RWH_COMPONENT 482 // Create a LatencyInfo struct with INPUT_EVENT_LATENCY_RWH_COMPONENT
484 // component if it is not already in |original|. And if |original| is 483 // component if it is not already in |original|. And if |original| is
485 // not NULL, it is also merged into the resulting LatencyInfo. 484 // not NULL, it is also merged into the resulting LatencyInfo.
486 ui::LatencyInfo CreateRWHLatencyInfoIfNotExist( 485 ui::LatencyInfo CreateInputEventLatencyInfoIfNotExist(
487 const ui::LatencyInfo* original, 486 const ui::LatencyInfo* original,
488 blink::WebInputEvent::Type type, 487 blink::WebInputEvent::Type type,
489 const ui::LatencyInfo::InputCoordinate* logical_coordinates, 488 const ui::LatencyInfo::InputCoordinate* logical_coordinates,
490 size_t logical_coordinates_size); 489 size_t logical_coordinates_size);
490 // Add UMA histograms for the latency to the renderer and roundtrip latency
491 // for a given event type. Note that it is necessary to update the histograms
492 // XML file any time histograms for a new event type are added.
Alexei Svitkine (slow) 2014/10/31 20:18:20 Can you document in the comment the current string
ccameron 2014/10/31 22:13:05 I put a DCHECK that this be "Touch" or "Wheel" nex
493 void ComputeInputLatencyHistograms(
494 const char* event_type_name,
495 const ui::LatencyInfo& latency_info) const;
491 496
492 // Called when we receive a notification indicating that the renderer 497 // Called when we receive a notification indicating that the renderer
493 // process has gone. This will reset our state so that our state will be 498 // process has gone. This will reset our state so that our state will be
494 // consistent if a new renderer is created. 499 // consistent if a new renderer is created.
495 void RendererExited(base::TerminationStatus status, int exit_code); 500 void RendererExited(base::TerminationStatus status, int exit_code);
496 501
497 // Retrieves an id the renderer can use to refer to its view. 502 // Retrieves an id the renderer can use to refer to its view.
498 // This is used for various IPC messages, including plugins. 503 // This is used for various IPC messages, including plugins.
499 gfx::NativeViewId GetNativeViewId() const; 504 gfx::NativeViewId GetNativeViewId() const;
500 505
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 cc::RollingTimeDeltaHistory browser_composite_latency_history_; 847 cc::RollingTimeDeltaHistory browser_composite_latency_history_;
843 848
844 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 849 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
845 850
846 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 851 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
847 }; 852 };
848 853
849 } // namespace content 854 } // namespace content
850 855
851 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 856 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698