OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/startup_metric_utils/browser/startup_metric_utils.h" | 5 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
6 | 6 |
7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 return; | 461 return; |
462 is_first_call = false; | 462 is_first_call = false; |
463 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) | 463 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) |
464 return; | 464 return; |
465 | 465 |
466 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( | 466 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
467 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad2", | 467 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad2", |
468 g_process_creation_ticks.Get(), ticks); | 468 g_process_creation_ticks.Get(), ticks); |
469 } | 469 } |
470 | 470 |
471 void RecordDeprecatedFirstWebContentsMainFrameLoad( | |
472 const base::TimeTicks& ticks) { | |
473 static bool is_first_call = true; | |
474 if (!is_first_call || ticks.is_null()) | |
475 return; | |
476 is_first_call = false; | |
477 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) | |
478 return; | |
479 | |
480 UMA_HISTOGRAM_WITH_STARTUP_TEMPERATURE( | |
481 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad", | |
482 ticks - g_process_creation_ticks.Get()); | |
483 } | |
484 | |
485 void RecordFirstWebContentsNonEmptyPaint(const base::TimeTicks& ticks) { | 471 void RecordFirstWebContentsNonEmptyPaint(const base::TimeTicks& ticks) { |
486 static bool is_first_call = true; | 472 static bool is_first_call = true; |
487 if (!is_first_call || ticks.is_null()) | 473 if (!is_first_call || ticks.is_null()) |
488 return; | 474 return; |
489 is_first_call = false; | 475 is_first_call = false; |
490 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) | 476 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) |
491 return; | 477 return; |
492 | 478 |
493 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( | 479 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
494 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2", | 480 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2", |
495 g_process_creation_ticks.Get(), ticks); | 481 g_process_creation_ticks.Get(), ticks); |
496 } | 482 } |
497 | 483 |
498 void RecordDeprecatedFirstWebContentsNonEmptyPaint( | |
499 const base::TimeTicks& ticks) { | |
500 static bool is_first_call = true; | |
501 if (!is_first_call || ticks.is_null()) | |
502 return; | |
503 is_first_call = false; | |
504 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) | |
505 return; | |
506 | |
507 UMA_HISTOGRAM_WITH_STARTUP_TEMPERATURE( | |
508 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint", | |
509 ticks - g_process_creation_ticks.Get()); | |
510 } | |
511 | |
512 void RecordFirstWebContentsMainNavigationStart(const base::TimeTicks& ticks) { | 484 void RecordFirstWebContentsMainNavigationStart(const base::TimeTicks& ticks) { |
513 static bool is_first_call = true; | 485 static bool is_first_call = true; |
514 if (!is_first_call || ticks.is_null()) | 486 if (!is_first_call || ticks.is_null()) |
515 return; | 487 return; |
516 is_first_call = false; | 488 is_first_call = false; |
517 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) | 489 if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null()) |
518 return; | 490 return; |
519 | 491 |
520 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( | 492 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
521 UMA_HISTOGRAM_LONG_TIMES_100, | 493 UMA_HISTOGRAM_LONG_TIMES_100, |
(...skipping 18 matching lines...) Expand all Loading... |
540 | 512 |
541 base::TimeTicks MainEntryPointTicks() { | 513 base::TimeTicks MainEntryPointTicks() { |
542 return g_main_entry_point_ticks.Get(); | 514 return g_main_entry_point_ticks.Get(); |
543 } | 515 } |
544 | 516 |
545 StartupTemperature GetStartupTemperature() { | 517 StartupTemperature GetStartupTemperature() { |
546 return g_startup_temperature; | 518 return g_startup_temperature; |
547 } | 519 } |
548 | 520 |
549 } // namespace startup_metric_utils | 521 } // namespace startup_metric_utils |
OLD | NEW |