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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_tracker.h

Issue 2874663005: [Page Load Metrics] Add mojom file to page load metrics. (Closed)
Patch Set: rebase Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void OnInputEvent(const blink::WebInputEvent& event); 212 void OnInputEvent(const blink::WebInputEvent& event);
213 213
214 // Flush any buffered metrics, as part of the metrics subsystem persisting 214 // Flush any buffered metrics, as part of the metrics subsystem persisting
215 // metrics as the application goes into the background. The application may be 215 // metrics as the application goes into the background. The application may be
216 // killed at any time after this method is invoked without further 216 // killed at any time after this method is invoked without further
217 // notification. 217 // notification.
218 void FlushMetricsOnAppEnterBackground(); 218 void FlushMetricsOnAppEnterBackground();
219 219
220 void NotifyClientRedirectTo(const PageLoadTracker& destination); 220 void NotifyClientRedirectTo(const PageLoadTracker& destination);
221 221
222 void UpdateTiming(const PageLoadTiming& timing, 222 void UpdateTiming(const mojom::PageLoadTiming& timing,
223 const PageLoadMetadata& metadata); 223 const mojom::PageLoadMetadata& metadata);
224 224
225 // Update metadata for child frames. Updates for child frames arrive 225 // Update metadata for child frames. Updates for child frames arrive
226 // separately from updates for the main frame, so aren't included in 226 // separately from updates for the main frame, so aren't included in
227 // UpdateTiming. 227 // UpdateTiming.
228 void UpdateChildFrameMetadata(const PageLoadMetadata& child_metadata); 228 void UpdateChildFrameMetadata(const mojom::PageLoadMetadata& child_metadata);
229 229
230 void OnStartedResource( 230 void OnStartedResource(
231 const ExtraRequestStartInfo& extra_request_started_info); 231 const ExtraRequestStartInfo& extra_request_started_info);
232 232
233 void OnLoadedResource( 233 void OnLoadedResource(
234 const ExtraRequestCompleteInfo& extra_request_complete_info); 234 const ExtraRequestCompleteInfo& extra_request_complete_info);
235 235
236 // Signals that we should stop tracking metrics for the associated page load. 236 // Signals that we should stop tracking metrics for the associated page load.
237 // We may stop tracking a page load if it doesn't meet the criteria for 237 // We may stop tracking a page load if it doesn't meet the criteria for
238 // tracking metrics in DidFinishNavigation. 238 // tracking metrics in DidFinishNavigation.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 base::TimeTicks page_end_time_; 369 base::TimeTicks page_end_time_;
370 370
371 // We record separate metrics for events that occur after a background, 371 // We record separate metrics for events that occur after a background,
372 // because metrics like layout/paint are delayed artificially 372 // because metrics like layout/paint are delayed artificially
373 // when they occur in the background. 373 // when they occur in the background.
374 base::TimeTicks background_time_; 374 base::TimeTicks background_time_;
375 base::TimeTicks foreground_time_; 375 base::TimeTicks foreground_time_;
376 bool started_in_foreground_; 376 bool started_in_foreground_;
377 377
378 PageLoadTiming timing_; 378 mojo::StructPtr<mojom::PageLoadTiming> timing_;
379 PageLoadMetadata main_frame_metadata_; 379 mojom::PageLoadMetadata main_frame_metadata_;
380 PageLoadMetadata child_frame_metadata_; 380 mojom::PageLoadMetadata child_frame_metadata_;
381 381
382 ui::PageTransition page_transition_; 382 ui::PageTransition page_transition_;
383 383
384 base::Optional<content::GlobalRequestID> navigation_request_id_; 384 base::Optional<content::GlobalRequestID> navigation_request_id_;
385 385
386 // Whether this page load was user initiated. 386 // Whether this page load was user initiated.
387 UserInitiatedInfo user_initiated_info_; 387 UserInitiatedInfo user_initiated_info_;
388 388
389 // This is a subtle member. If a provisional load A gets aborted by 389 // This is a subtle member. If a provisional load A gets aborted by
390 // provisional load B, which gets aborted by C that eventually commits, then 390 // provisional load B, which gets aborted by C that eventually commits, then
(...skipping 11 matching lines...) Expand all
402 PageLoadMetricsEmbedderInterface* const embedder_interface_; 402 PageLoadMetricsEmbedderInterface* const embedder_interface_;
403 403
404 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; 404 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_;
405 405
406 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); 406 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker);
407 }; 407 };
408 408
409 } // namespace page_load_metrics 409 } // namespace page_load_metrics
410 410
411 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 411 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698