| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 } | 1804 } |
| 1805 | 1805 |
| 1806 void ChromeBrowserMainParts::PostMainMessageLoopRun() { | 1806 void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
| 1807 // Start watching for jank during shutdown. It gets disarmed when | 1807 // Start watching for jank during shutdown. It gets disarmed when |
| 1808 // |shutdown_watcher_| object is destructed. | 1808 // |shutdown_watcher_| object is destructed. |
| 1809 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(90)); | 1809 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(90)); |
| 1810 | 1810 |
| 1811 // Disarm the startup hang detector time bomb if it is still Arm'ed. | 1811 // Disarm the startup hang detector time bomb if it is still Arm'ed. |
| 1812 startup_watcher_->Disarm(); | 1812 startup_watcher_->Disarm(); |
| 1813 | 1813 |
| 1814 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
| 1815 chrome_extra_parts_[i]->PostMainMessageLoopRun(); |
| 1816 |
| 1814 #if defined(OS_WIN) | 1817 #if defined(OS_WIN) |
| 1815 // If it's the first run, log the search engine chosen. We wait until | 1818 // If it's the first run, log the search engine chosen. We wait until |
| 1816 // shutdown because otherwise we can't be sure the user has finished | 1819 // shutdown because otherwise we can't be sure the user has finished |
| 1817 // selecting a search engine through the dialog reached from the first run | 1820 // selecting a search engine through the dialog reached from the first run |
| 1818 // bubble link. | 1821 // bubble link. |
| 1819 if (record_search_engine_) { | 1822 if (record_search_engine_) { |
| 1820 TemplateURLService* url_service = | 1823 TemplateURLService* url_service = |
| 1821 TemplateURLServiceFactory::GetForProfile(profile_); | 1824 TemplateURLServiceFactory::GetForProfile(profile_); |
| 1822 const TemplateURL* default_search_engine = | 1825 const TemplateURL* default_search_engine = |
| 1823 url_service->GetDefaultSearchProvider(); | 1826 url_service->GetDefaultSearchProvider(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_); | 1892 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_); |
| 1890 master_prefs_.reset(); | 1893 master_prefs_.reset(); |
| 1891 process_singleton_.reset(); | 1894 process_singleton_.reset(); |
| 1892 | 1895 |
| 1893 // We need to do this check as late as possible, but due to modularity, this | 1896 // We need to do this check as late as possible, but due to modularity, this |
| 1894 // may be the last point in Chrome. This would be more effective if done at | 1897 // may be the last point in Chrome. This would be more effective if done at |
| 1895 // a higher level on the stack, so that it is impossible for an early return | 1898 // a higher level on the stack, so that it is impossible for an early return |
| 1896 // to bypass this code. Perhaps we need a *final* hook that is called on all | 1899 // to bypass this code. Perhaps we need a *final* hook that is called on all |
| 1897 // paths from content/browser/browser_main. | 1900 // paths from content/browser/browser_main. |
| 1898 CHECK(MetricsService::UmaMetricsProperlyShutdown()); | 1901 CHECK(MetricsService::UmaMetricsProperlyShutdown()); |
| 1899 | |
| 1900 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | |
| 1901 chrome_extra_parts_[i]->PostMainMessageLoopRun(); | |
| 1902 } | 1902 } |
| 1903 | 1903 |
| 1904 // Public members: | 1904 // Public members: |
| 1905 | 1905 |
| 1906 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1906 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1907 chrome_extra_parts_.push_back(parts); | 1907 chrome_extra_parts_.push_back(parts); |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 // Misc ------------------------------------------------------------------------ | 1910 // Misc ------------------------------------------------------------------------ |
| 1911 | 1911 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1929 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 1929 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
| 1930 (pre_read == "0" || pre_read == "1")) { | 1930 (pre_read == "0" || pre_read == "1")) { |
| 1931 std::string uma_name(name); | 1931 std::string uma_name(name); |
| 1932 uma_name += "_PreRead"; | 1932 uma_name += "_PreRead"; |
| 1933 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 1933 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
| 1934 AddPreReadHistogramTime(uma_name.c_str(), time); | 1934 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1935 } | 1935 } |
| 1936 #endif | 1936 #endif |
| 1937 #endif | 1937 #endif |
| 1938 } | 1938 } |
| OLD | NEW |