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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 // Must be done after g_browser_process is constructed, before | 989 // Must be done after g_browser_process is constructed, before |
990 // SetupMetricsAndFieldTrials(). | 990 // SetupMetricsAndFieldTrials(). |
991 chromeos::CrosSettings::Initialize(); | 991 chromeos::CrosSettings::Initialize(); |
992 #endif | 992 #endif |
993 | 993 |
994 // Now the command line has been mutated based on about:flags, we can setup | 994 // Now the command line has been mutated based on about:flags, we can setup |
995 // metrics and initialize field trials. The field trials are needed by | 995 // metrics and initialize field trials. The field trials are needed by |
996 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. | 996 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. |
997 SetupMetricsAndFieldTrials(); | 997 SetupMetricsAndFieldTrials(); |
998 | 998 |
999 cpu_profiler_.Initialize(nullptr); | |
1000 | |
1001 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. | 999 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. |
1002 browser_process_->PreCreateThreads(); | 1000 browser_process_->PreCreateThreads(); |
1003 | 1001 |
1004 return content::RESULT_CODE_NORMAL_EXIT; | 1002 return content::RESULT_CODE_NORMAL_EXIT; |
1005 } | 1003 } |
1006 | 1004 |
1007 void ChromeBrowserMainParts::PreMainMessageLoopRun() { | 1005 void ChromeBrowserMainParts::PreMainMessageLoopRun() { |
1008 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); | 1006 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); |
1009 result_code_ = PreMainMessageLoopRunImpl(); | 1007 result_code_ = PreMainMessageLoopRunImpl(); |
1010 | 1008 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 } | 1643 } |
1646 | 1644 |
1647 void ChromeBrowserMainParts::PostMainMessageLoopRun() { | 1645 void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
1648 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopRun"); | 1646 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopRun"); |
1649 #if defined(OS_ANDROID) | 1647 #if defined(OS_ANDROID) |
1650 // Chrome on Android does not use default MessageLoop. It has its own | 1648 // Chrome on Android does not use default MessageLoop. It has its own |
1651 // Android specific MessageLoop | 1649 // Android specific MessageLoop |
1652 NOTREACHED(); | 1650 NOTREACHED(); |
1653 #else | 1651 #else |
1654 | 1652 |
1655 cpu_profiler_.Stop(); | |
1656 | |
1657 // Start watching for jank during shutdown. It gets disarmed when | 1653 // Start watching for jank during shutdown. It gets disarmed when |
1658 // |shutdown_watcher_| object is destructed. | 1654 // |shutdown_watcher_| object is destructed. |
1659 metrics::MetricsService::SetExecutionPhase( | 1655 metrics::MetricsService::SetExecutionPhase( |
1660 metrics::MetricsService::SHUTDOWN_TIMEBOMB_ARM, | 1656 metrics::MetricsService::SHUTDOWN_TIMEBOMB_ARM, |
1661 g_browser_process->local_state()); | 1657 g_browser_process->local_state()); |
1662 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); | 1658 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); |
1663 | 1659 |
1664 // Disarm the startup hang detector time bomb if it is still Arm'ed. | 1660 // Disarm the startup hang detector time bomb if it is still Arm'ed. |
1665 startup_watcher_->Disarm(); | 1661 startup_watcher_->Disarm(); |
1666 | 1662 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 chromeos::CrosSettings::Shutdown(); | 1710 chromeos::CrosSettings::Shutdown(); |
1715 #endif | 1711 #endif |
1716 #endif | 1712 #endif |
1717 } | 1713 } |
1718 | 1714 |
1719 // Public members: | 1715 // Public members: |
1720 | 1716 |
1721 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1717 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1722 chrome_extra_parts_.push_back(parts); | 1718 chrome_extra_parts_.push_back(parts); |
1723 } | 1719 } |
OLD | NEW |