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/startup_metric_utils.h" | 5 #include "components/startup_metric_utils/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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 return; | 438 return; |
439 is_first_call = false; | 439 is_first_call = false; |
440 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) | 440 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) |
441 return; | 441 return; |
442 | 442 |
443 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( | 443 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
444 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint", | 444 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint", |
445 g_process_creation_time.Get(), time); | 445 g_process_creation_time.Get(), time); |
446 } | 446 } |
447 | 447 |
| 448 void RecordFirstWebContentsMainNavigationStart(const base::Time& time) { |
| 449 static bool is_first_call = true; |
| 450 if (!is_first_call || time.is_null()) |
| 451 return; |
| 452 is_first_call = false; |
| 453 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) |
| 454 return; |
| 455 |
| 456 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
| 457 UMA_HISTOGRAM_LONG_TIMES_100, |
| 458 "Startup.FirstWebContents.MainNavigationStart", |
| 459 g_process_creation_time.Get(), time); |
| 460 } |
| 461 |
| 462 void RecordFirstWebContentsMainNavigationFinished(const base::Time& time) { |
| 463 static bool is_first_call = true; |
| 464 if (!is_first_call || time.is_null()) |
| 465 return; |
| 466 is_first_call = false; |
| 467 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) |
| 468 return; |
| 469 |
| 470 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( |
| 471 UMA_HISTOGRAM_LONG_TIMES_100, |
| 472 "Startup.FirstWebContents.MainNavigationFinished", |
| 473 g_process_creation_time.Get(), time); |
| 474 } |
| 475 |
448 base::Time MainEntryPointTime() { | 476 base::Time MainEntryPointTime() { |
449 return g_main_entry_point_time.Get(); | 477 return g_main_entry_point_time.Get(); |
450 } | 478 } |
451 | 479 |
452 StartupTemperature GetStartupTemperature() { | 480 StartupTemperature GetStartupTemperature() { |
453 return g_startup_temperature; | 481 return g_startup_temperature; |
454 } | 482 } |
455 | 483 |
456 } // namespace startup_metric_utils | 484 } // namespace startup_metric_utils |
OLD | NEW |