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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "chrome/common/chrome_version_info.h" | 98 #include "chrome/common/chrome_version_info.h" |
99 #include "chrome/common/crash_keys.h" | 99 #include "chrome/common/crash_keys.h" |
100 #include "chrome/common/env_vars.h" | 100 #include "chrome/common/env_vars.h" |
101 #include "chrome/common/logging_chrome.h" | 101 #include "chrome/common/logging_chrome.h" |
102 #include "chrome/common/net/net_resource_provider.h" | 102 #include "chrome/common/net/net_resource_provider.h" |
103 #include "chrome/common/pref_names.h" | 103 #include "chrome/common/pref_names.h" |
104 #include "chrome/common/profiling.h" | 104 #include "chrome/common/profiling.h" |
105 #include "chrome/grit/generated_resources.h" | 105 #include "chrome/grit/generated_resources.h" |
106 #include "chrome/installer/util/google_update_settings.h" | 106 #include "chrome/installer/util/google_update_settings.h" |
107 #include "components/component_updater/component_updater_service.h" | 107 #include "components/component_updater/component_updater_service.h" |
| 108 #include "components/device_event_log/device_event_log.h" |
108 #include "components/google/core/browser/google_util.h" | 109 #include "components/google/core/browser/google_util.h" |
109 #include "components/language_usage_metrics/language_usage_metrics.h" | 110 #include "components/language_usage_metrics/language_usage_metrics.h" |
110 #include "components/metrics/metrics_service.h" | 111 #include "components/metrics/metrics_service.h" |
111 #include "components/metrics/profiler/tracking_synchronizer.h" | 112 #include "components/metrics/profiler/tracking_synchronizer.h" |
112 #include "components/nacl/browser/nacl_browser.h" | 113 #include "components/nacl/browser/nacl_browser.h" |
113 #include "components/rappor/rappor_service.h" | 114 #include "components/rappor/rappor_service.h" |
114 #include "components/signin/core/common/profile_management_switches.h" | 115 #include "components/signin/core/common/profile_management_switches.h" |
115 #include "components/startup_metric_utils/startup_metric_utils.h" | 116 #include "components/startup_metric_utils/startup_metric_utils.h" |
116 #include "components/translate/content/browser/browser_cld_utils.h" | 117 #include "components/translate/content/browser/browser_cld_utils.h" |
117 #include "components/translate/content/common/cld_data_source.h" | 118 #include "components/translate/content/common/cld_data_source.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 } | 754 } |
754 | 755 |
755 void ChromeBrowserMainParts::ToolkitInitialized() { | 756 void ChromeBrowserMainParts::ToolkitInitialized() { |
756 TRACE_EVENT0("startup", "ChromeBrowserMainParts::ToolkitInitialized"); | 757 TRACE_EVENT0("startup", "ChromeBrowserMainParts::ToolkitInitialized"); |
757 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 758 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
758 chrome_extra_parts_[i]->ToolkitInitialized(); | 759 chrome_extra_parts_[i]->ToolkitInitialized(); |
759 } | 760 } |
760 | 761 |
761 void ChromeBrowserMainParts::PreMainMessageLoopStart() { | 762 void ChromeBrowserMainParts::PreMainMessageLoopStart() { |
762 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopStart"); | 763 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopStart"); |
| 764 |
| 765 device_event_log::Initialize(0 /* default max entries */); |
| 766 |
763 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 767 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
764 chrome_extra_parts_[i]->PreMainMessageLoopStart(); | 768 chrome_extra_parts_[i]->PreMainMessageLoopStart(); |
765 } | 769 } |
766 | 770 |
767 void ChromeBrowserMainParts::PostMainMessageLoopStart() { | 771 void ChromeBrowserMainParts::PostMainMessageLoopStart() { |
768 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopStart"); | 772 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopStart"); |
769 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 773 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
770 chrome_extra_parts_[i]->PostMainMessageLoopStart(); | 774 chrome_extra_parts_[i]->PostMainMessageLoopStart(); |
771 } | 775 } |
772 | 776 |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 // not finish. | 1706 // not finish. |
1703 NOTREACHED(); | 1707 NOTREACHED(); |
1704 #else | 1708 #else |
1705 browser_process_->PostDestroyThreads(); | 1709 browser_process_->PostDestroyThreads(); |
1706 // browser_shutdown takes care of deleting browser_process, so we need to | 1710 // browser_shutdown takes care of deleting browser_process, so we need to |
1707 // release it. | 1711 // release it. |
1708 ignore_result(browser_process_.release()); | 1712 ignore_result(browser_process_.release()); |
1709 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_); | 1713 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_); |
1710 master_prefs_.reset(); | 1714 master_prefs_.reset(); |
1711 process_singleton_.reset(); | 1715 process_singleton_.reset(); |
| 1716 device_event_log::Shutdown(); |
1712 | 1717 |
1713 // We need to do this check as late as possible, but due to modularity, this | 1718 // We need to do this check as late as possible, but due to modularity, this |
1714 // may be the last point in Chrome. This would be more effective if done at | 1719 // may be the last point in Chrome. This would be more effective if done at |
1715 // a higher level on the stack, so that it is impossible for an early return | 1720 // a higher level on the stack, so that it is impossible for an early return |
1716 // to bypass this code. Perhaps we need a *final* hook that is called on all | 1721 // to bypass this code. Perhaps we need a *final* hook that is called on all |
1717 // paths from content/browser/browser_main. | 1722 // paths from content/browser/browser_main. |
1718 CHECK(metrics::MetricsService::UmaMetricsProperlyShutdown()); | 1723 CHECK(metrics::MetricsService::UmaMetricsProperlyShutdown()); |
1719 | 1724 |
1720 #if defined(OS_CHROMEOS) | 1725 #if defined(OS_CHROMEOS) |
1721 chromeos::CrosSettings::Shutdown(); | 1726 chromeos::CrosSettings::Shutdown(); |
1722 #endif | 1727 #endif |
1723 #endif | 1728 #endif |
1724 } | 1729 } |
1725 | 1730 |
1726 // Public members: | 1731 // Public members: |
1727 | 1732 |
1728 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1733 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1729 chrome_extra_parts_.push_back(parts); | 1734 chrome_extra_parts_.push_back(parts); |
1730 } | 1735 } |
OLD | NEW |