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

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

Issue 1984173002: Log First User Interaction in Page Load Metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumbing RWH latency tracker instead of DidGetUserInteraction API Created 4 years, 7 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
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // a page load. This stops |new_content_rendering_timeout_|, or prevents 288 // a page load. This stops |new_content_rendering_timeout_|, or prevents
289 // the timer from running if the load commit message hasn't been received 289 // the timer from running if the load commit message hasn't been received
290 // yet. 290 // yet.
291 void OnFirstPaintAfterLoad(); 291 void OnFirstPaintAfterLoad();
292 292
293 // Forwards the given message to the renderer. These are called by the view 293 // Forwards the given message to the renderer. These are called by the view
294 // when it has received a message. 294 // when it has received a message.
295 void ForwardGestureEventWithLatencyInfo( 295 void ForwardGestureEventWithLatencyInfo(
296 const blink::WebGestureEvent& gesture_event, 296 const blink::WebGestureEvent& gesture_event,
297 const ui::LatencyInfo& ui_latency) override; 297 const ui::LatencyInfo& ui_latency) override;
298 void ForwardTouchEventWithLatencyInfo( 298 void ForwardTouchEventWithLatencyInfo(const blink::WebTouchEvent& touch_event,
Bryan McQuade 2016/05/25 21:32:30 can you run git cl format in your client just to
299 const blink::WebTouchEvent& touch_event, 299 const ui::LatencyInfo& ui_latency);
300 const ui::LatencyInfo& ui_latency); 300 void ForwardMouseEventWithLatencyInfo(const blink::WebMouseEvent& mouse_event,
301 void ForwardMouseEventWithLatencyInfo( 301 const ui::LatencyInfo& ui_latency);
302 const blink::WebMouseEvent& mouse_event,
303 const ui::LatencyInfo& ui_latency);
304 virtual void ForwardWheelEventWithLatencyInfo( 302 virtual void ForwardWheelEventWithLatencyInfo(
305 const blink::WebMouseWheelEvent& wheel_event, 303 const blink::WebMouseWheelEvent& wheel_event,
306 const ui::LatencyInfo& ui_latency); // Virtual for testing. 304 const ui::LatencyInfo& ui_latency); // Virtual for testing.
307 305
308 // Enables/disables touch emulation using mouse event. See TouchEmulator. 306 // Enables/disables touch emulation using mouse event. See TouchEmulator.
309 void SetTouchEventEmulationEnabled( 307 void SetTouchEventEmulationEnabled(bool enabled,
310 bool enabled, ui::GestureProviderConfigType config_type); 308 ui::GestureProviderConfigType config_type);
311 309
312 // TouchEmulatorClient implementation. 310 // TouchEmulatorClient implementation.
313 void ForwardEmulatedGestureEvent( 311 void ForwardEmulatedGestureEvent(
314 const blink::WebGestureEvent& gesture_event) override; 312 const blink::WebGestureEvent& gesture_event) override;
315 void ForwardEmulatedTouchEvent( 313 void ForwardEmulatedTouchEvent(
316 const blink::WebTouchEvent& touch_event) override; 314 const blink::WebTouchEvent& touch_event) override;
317 void SetCursor(const WebCursor& cursor) override; 315 void SetCursor(const WebCursor& cursor) override;
318 void ShowContextMenuAtPoint(const gfx::Point& point) override; 316 void ShowContextMenuAtPoint(const gfx::Point& point) override;
319 317
320 // Queues a synthetic gesture for testing purposes. Invokes the on_complete 318 // Queues a synthetic gesture for testing purposes. Invokes the on_complete
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // (on Windows); 351 // (on Windows);
354 // * when it receives a "commit" signal of GtkIMContext (on Linux); 352 // * when it receives a "commit" signal of GtkIMContext (on Linux);
355 // * when insertText of NSTextInput is called (on Mac). 353 // * when insertText of NSTextInput is called (on Mac).
356 void ImeConfirmComposition(const base::string16& text, 354 void ImeConfirmComposition(const base::string16& text,
357 const gfx::Range& replacement_range, 355 const gfx::Range& replacement_range,
358 bool keep_selection); 356 bool keep_selection);
359 357
360 // Cancels an ongoing composition. 358 // Cancels an ongoing composition.
361 void ImeCancelComposition(); 359 void ImeCancelComposition();
362 360
363 bool ignore_input_events() const { 361 bool ignore_input_events() const { return ignore_input_events_; }
364 return ignore_input_events_;
365 }
366 362
367 // Whether forwarded WebInputEvents should be dropped. 363 // Whether forwarded WebInputEvents should be dropped.
368 bool ShouldDropInputEvents() const; 364 bool ShouldDropInputEvents() const;
369 365
370 bool has_touch_handler() const { return has_touch_handler_; } 366 bool has_touch_handler() const { return has_touch_handler_; }
371 367
372 // Set the RenderView background transparency. 368 // Set the RenderView background transparency.
373 void SetBackgroundOpaque(bool opaque); 369 void SetBackgroundOpaque(bool opaque);
374 370
375 // Notifies the renderer that the next key event is bound to one or more 371 // Notifies the renderer that the next key event is bound to one or more
376 // pre-defined edit commands 372 // pre-defined edit commands
377 void SetEditCommandsForNextKeyEvent( 373 void SetEditCommandsForNextKeyEvent(const std::vector<EditCommand>& commands);
378 const std::vector<EditCommand>& commands);
379 374
380 // Executes the edit command. 375 // Executes the edit command.
381 void ExecuteEditCommand(const std::string& command, 376 void ExecuteEditCommand(const std::string& command, const std::string& value);
382 const std::string& value);
383 377
384 // Tells the renderer to scroll the currently focused node into rect only if 378 // Tells the renderer to scroll the currently focused node into rect only if
385 // the currently focused node is a Text node (textfield, text area or content 379 // the currently focused node is a Text node (textfield, text area or content
386 // editable divs). 380 // editable divs).
387 void ScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect); 381 void ScrollFocusedEditableNodeIntoRect(const gfx::Rect& rect);
388 382
389 // Requests the renderer to move the caret selection towards the point. 383 // Requests the renderer to move the caret selection towards the point.
390 void MoveCaret(const gfx::Point& point); 384 void MoveCaret(const gfx::Point& point);
391 385
392 // Called when the reponse to a pending mouse lock request has arrived. 386 // Called when the reponse to a pending mouse lock request has arrived.
393 // Returns true if |allowed| is true and the mouse has been successfully 387 // Returns true if |allowed| is true and the mouse has been successfully
394 // locked. 388 // locked.
395 bool GotResponseToLockMouseRequest(bool allowed); 389 bool GotResponseToLockMouseRequest(bool allowed);
396 390
397 // Tells the RenderWidget about the latest vsync parameters. 391 // Tells the RenderWidget about the latest vsync parameters.
398 void UpdateVSyncParameters(base::TimeTicks timebase, 392 void UpdateVSyncParameters(base::TimeTicks timebase,
399 base::TimeDelta interval); 393 base::TimeDelta interval);
400 394
401 // Called by the view in response to OnSwapCompositorFrame. 395 // Called by the view in response to OnSwapCompositorFrame.
402 static void SendSwapCompositorFrameAck( 396 static void SendSwapCompositorFrameAck(int32_t route_id,
403 int32_t route_id, 397 uint32_t output_surface_id,
404 uint32_t output_surface_id, 398 int renderer_host_id,
405 int renderer_host_id, 399 const cc::CompositorFrameAck& ack);
406 const cc::CompositorFrameAck& ack);
407 400
408 // Called by the view to return resources to the compositor. 401 // Called by the view to return resources to the compositor.
409 static void SendReclaimCompositorResources(int32_t route_id, 402 static void SendReclaimCompositorResources(int32_t route_id,
410 uint32_t output_surface_id, 403 uint32_t output_surface_id,
411 int renderer_host_id, 404 int renderer_host_id,
412 const cc::CompositorFrameAck& ack); 405 const cc::CompositorFrameAck& ack);
413 406
414 void set_allow_privileged_mouse_lock(bool allow) { 407 void set_allow_privileged_mouse_lock(bool allow) {
415 allow_privileged_mouse_lock_ = allow; 408 allow_privileged_mouse_lock_ = allow;
416 } 409 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 int64_t GetLatencyComponentId() const; 452 int64_t GetLatencyComponentId() const;
460 453
461 static void CompositorFrameDrawn( 454 static void CompositorFrameDrawn(
462 const std::vector<ui::LatencyInfo>& latency_info); 455 const std::vector<ui::LatencyInfo>& latency_info);
463 456
464 // Don't check whether we expected a resize ack during layout tests. 457 // Don't check whether we expected a resize ack during layout tests.
465 static void DisableResizeAckCheckForTesting(); 458 static void DisableResizeAckCheckForTesting();
466 459
467 InputRouter* input_router() { return input_router_.get(); } 460 InputRouter* input_router() { return input_router_.get(); }
468 461
462 RenderWidgetHostLatencyTracker* latency_tracker() {
463 return latency_tracker_.get();
464 }
465
469 // Get the BrowserAccessibilityManager for the root of the frame tree, 466 // Get the BrowserAccessibilityManager for the root of the frame tree,
470 BrowserAccessibilityManager* GetRootBrowserAccessibilityManager(); 467 BrowserAccessibilityManager* GetRootBrowserAccessibilityManager();
471 468
472 // Get the BrowserAccessibilityManager for the root of the frame tree, 469 // Get the BrowserAccessibilityManager for the root of the frame tree,
473 // or create it if it doesn't already exist. 470 // or create it if it doesn't already exist.
474 BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager(); 471 BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager();
475 472
476 void RejectMouseLockOrUnlockIfNecessary(); 473 void RejectMouseLockOrUnlockIfNecessary();
477 474
478 void set_renderer_initialized(bool renderer_initialized) { 475 void set_renderer_initialized(bool renderer_initialized) {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 // called. This means that a paint for the new load has completed before 775 // called. This means that a paint for the new load has completed before
779 // the browser received a DidCommitProvisionalLoad message. In that case 776 // the browser received a DidCommitProvisionalLoad message. In that case
780 // |new_content_rendering_timeout_| is not needed. The renderer will send 777 // |new_content_rendering_timeout_| is not needed. The renderer will send
781 // both the FirstPaintAfterLoad and DidCommitProvisionalLoad messages after 778 // both the FirstPaintAfterLoad and DidCommitProvisionalLoad messages after
782 // any new page navigation, it doesn't matter which is received first, and 779 // any new page navigation, it doesn't matter which is received first, and
783 // it should not be possible to interleave other navigations in between 780 // it should not be possible to interleave other navigations in between
784 // receipt of those messages (unless FirstPaintAfterLoad is prevented from 781 // receipt of those messages (unless FirstPaintAfterLoad is prevented from
785 // being sent, in which case the timer should fire). 782 // being sent, in which case the timer should fire).
786 bool received_paint_after_load_; 783 bool received_paint_after_load_;
787 784
788 RenderWidgetHostLatencyTracker latency_tracker_; 785 std::unique_ptr<RenderWidgetHostLatencyTracker> latency_tracker_;
tdresser 2016/05/24 14:28:38 Why change this to unique_ptr?
789 786
790 int next_browser_snapshot_id_; 787 int next_browser_snapshot_id_;
791 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; 788 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>;
792 PendingSnapshotMap pending_browser_snapshots_; 789 PendingSnapshotMap pending_browser_snapshots_;
793 790
794 // Indicates whether a RenderFramehost has ownership, in which case this 791 // Indicates whether a RenderFramehost has ownership, in which case this
795 // object does not self destroy. 792 // object does not self destroy.
796 bool owned_by_render_frame_host_; 793 bool owned_by_render_frame_host_;
797 794
798 // Indicates whether this RenderWidgetHost thinks is focused. This is trying 795 // Indicates whether this RenderWidgetHost thinks is focused. This is trying
(...skipping 10 matching lines...) Expand all
809 base::TimeDelta new_content_rendering_delay_; 806 base::TimeDelta new_content_rendering_delay_;
810 807
811 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 808 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
812 809
813 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 810 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
814 }; 811 };
815 812
816 } // namespace content 813 } // namespace content
817 814
818 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 815 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698