Use presentation time in paint-timing metrics

These metrics currently use swap time which is the time the compositor
sends compositor frame to the display compositor. This CL changes the
metrics to use presentation time which is the time pixels actually
appear on screen, according to gpu.

BUG=899847

Change-Id: I5981fbc88a2cabebd5f4109e26f7e4cb152ea3fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1598212
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Sadrul Chowdhury <[email protected]>
Reviewed-by: Timothy Dresser <[email protected]>
Commit-Queue: Mohsen Izadi <[email protected]>
Cr-Commit-Position: refs/heads/master@{#666074}
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 1115b02..47e137f 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -460,6 +460,16 @@
                      base::OnceCallback<void(bool)> callback) override;
   void NotifySwapTime(ReportTimeCallback callback) override;
 
+  // Registers a SwapPromise to report presentation time and possibly swap time.
+  // If |swap_time_callback| is not a null callback, it would be called once
+  // swap happens. |presentation_time_callback| will be called some time after
+  // pixels are presented on screen. Swap time is needed only in tests and
+  // production code uses |NotifySwapTime()| above which calls this one passing
+  // a null callback as |swap_time_callback|.
+  void NotifySwapAndPresentationTime(
+      ReportTimeCallback swap_time_callback,
+      ReportTimeCallback presentation_time_callback);
+
   // Override point to obtain that the current input method state and caret
   // position.
   ui::TextInputType GetTextInputType();