OLD | NEW |
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 #include "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // Register a synthetic field trial with the PreRead group used during the | 576 // Register a synthetic field trial with the PreRead group used during the |
577 // current startup. This must be done before the first metric log | 577 // current startup. This must be done before the first metric log |
578 // (metrics::MetricLog) is created. Otherwise, UMA metrics generated during | 578 // (metrics::MetricLog) is created. Otherwise, UMA metrics generated during |
579 // startup won't be correctly annotated. The current function is always called | 579 // startup won't be correctly annotated. The current function is always called |
580 // before the first metric log is created, as part of | 580 // before the first metric log is created, as part of |
581 // ChromeBrowserMainParts::PreMainMessageLoopRun(). | 581 // ChromeBrowserMainParts::PreMainMessageLoopRun(). |
582 startup_metric_utils::RegisterPreReadSyntheticFieldTrial( | 582 startup_metric_utils::RegisterPreReadSyntheticFieldTrial( |
583 registry_path, | 583 registry_path, |
584 base::Bind(&ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial)); | 584 base::Bind(&ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial)); |
585 | 585 |
586 // After startup is complete, update the pre-read group in the registry. The | 586 // Initialize the PreRead options for the current process. |
| 587 startup_metric_utils::InitializePreReadOptions(registry_path); |
| 588 |
| 589 // After startup is complete, update the PreRead group in the registry. The |
587 // group written in the registry will be used for the next startup. | 590 // group written in the registry will be used for the next startup. |
588 BrowserThread::PostAfterStartupTask( | 591 BrowserThread::PostAfterStartupTask( |
589 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 592 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
590 base::Bind(&startup_metric_utils::UpdatePreReadOptions, registry_path)); | 593 base::Bind(&startup_metric_utils::UpdatePreReadOptions, registry_path)); |
591 } | 594 } |
592 #endif // defined(OS_WIN) | 595 #endif // defined(OS_WIN) |
593 | 596 |
594 // This error message is not localized because we failed to load the | 597 // This error message is not localized because we failed to load the |
595 // localization data files. | 598 // localization data files. |
596 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 chromeos::CrosSettings::Shutdown(); | 1872 chromeos::CrosSettings::Shutdown(); |
1870 #endif // defined(OS_CHROMEOS) | 1873 #endif // defined(OS_CHROMEOS) |
1871 #endif // defined(OS_ANDROID) | 1874 #endif // defined(OS_ANDROID) |
1872 } | 1875 } |
1873 | 1876 |
1874 // Public members: | 1877 // Public members: |
1875 | 1878 |
1876 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1879 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1877 chrome_extra_parts_.push_back(parts); | 1880 chrome_extra_parts_.push_back(parts); |
1878 } | 1881 } |
OLD | NEW |