| 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 |
| 999 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. | 1001 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. |
| 1000 browser_process_->PreCreateThreads(); | 1002 browser_process_->PreCreateThreads(); |
| 1001 | 1003 |
| 1002 return content::RESULT_CODE_NORMAL_EXIT; | 1004 return content::RESULT_CODE_NORMAL_EXIT; |
| 1003 } | 1005 } |
| 1004 | 1006 |
| 1005 void ChromeBrowserMainParts::PreMainMessageLoopRun() { | 1007 void ChromeBrowserMainParts::PreMainMessageLoopRun() { |
| 1006 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); | 1008 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); |
| 1007 result_code_ = PreMainMessageLoopRunImpl(); | 1009 result_code_ = PreMainMessageLoopRunImpl(); |
| 1008 | 1010 |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 } | 1645 } |
| 1644 | 1646 |
| 1645 void ChromeBrowserMainParts::PostMainMessageLoopRun() { | 1647 void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
| 1646 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopRun"); | 1648 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostMainMessageLoopRun"); |
| 1647 #if defined(OS_ANDROID) | 1649 #if defined(OS_ANDROID) |
| 1648 // Chrome on Android does not use default MessageLoop. It has its own | 1650 // Chrome on Android does not use default MessageLoop. It has its own |
| 1649 // Android specific MessageLoop | 1651 // Android specific MessageLoop |
| 1650 NOTREACHED(); | 1652 NOTREACHED(); |
| 1651 #else | 1653 #else |
| 1652 | 1654 |
| 1655 cpu_profiler_.Stop(); |
| 1656 |
| 1653 // Start watching for jank during shutdown. It gets disarmed when | 1657 // Start watching for jank during shutdown. It gets disarmed when |
| 1654 // |shutdown_watcher_| object is destructed. | 1658 // |shutdown_watcher_| object is destructed. |
| 1655 metrics::MetricsService::SetExecutionPhase( | 1659 metrics::MetricsService::SetExecutionPhase( |
| 1656 metrics::MetricsService::SHUTDOWN_TIMEBOMB_ARM, | 1660 metrics::MetricsService::SHUTDOWN_TIMEBOMB_ARM, |
| 1657 g_browser_process->local_state()); | 1661 g_browser_process->local_state()); |
| 1658 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); | 1662 shutdown_watcher_->Arm(base::TimeDelta::FromSeconds(300)); |
| 1659 | 1663 |
| 1660 // Disarm the startup hang detector time bomb if it is still Arm'ed. | 1664 // Disarm the startup hang detector time bomb if it is still Arm'ed. |
| 1661 startup_watcher_->Disarm(); | 1665 startup_watcher_->Disarm(); |
| 1662 | 1666 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 chromeos::CrosSettings::Shutdown(); | 1714 chromeos::CrosSettings::Shutdown(); |
| 1711 #endif | 1715 #endif |
| 1712 #endif | 1716 #endif |
| 1713 } | 1717 } |
| 1714 | 1718 |
| 1715 // Public members: | 1719 // Public members: |
| 1716 | 1720 |
| 1717 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1721 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1718 chrome_extra_parts_.push_back(parts); | 1722 chrome_extra_parts_.push_back(parts); |
| 1719 } | 1723 } |
| OLD | NEW |