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 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 // Do not add anything below this line until you've verified your new code | 1202 // Do not add anything below this line until you've verified your new code |
1203 // does not interfere with the critical initialization order below. Some of | 1203 // does not interfere with the critical initialization order below. Some of |
1204 // the calls below end up implicitly creating threads and as such new calls | 1204 // the calls below end up implicitly creating threads and as such new calls |
1205 // typically either belong before them or in a later startup phase. | 1205 // typically either belong before them or in a later startup phase. |
1206 | 1206 |
1207 // Now that the command line has been mutated based on about:flags, we can | 1207 // Now that the command line has been mutated based on about:flags, we can |
1208 // initialize field trials and setup metrics. The field trials are needed by | 1208 // initialize field trials and setup metrics. The field trials are needed by |
1209 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. | 1209 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. |
1210 SetupFieldTrials(); | 1210 SetupFieldTrials(); |
1211 | 1211 |
1212 // Initializing TaskScheduler and enabling SequencedWorkerPool needs to be | 1212 // Task Scheduler initialization needs to be here for the following reasons: |
1213 // here for the following reasons: | |
1214 // * After |SetupFieldTrials()|: Initialization uses variations. | 1213 // * After |SetupFieldTrials()|: Initialization uses variations. |
1215 // * Before |SetupMetrics()|: |SetupMetrics()| uses the blocking pool. The | 1214 // * Before |SetupMetrics()|: |SetupMetrics()| uses the blocking pool. The |
1216 // Task Scheduler must do any necessary redirection before then. | 1215 // Task Scheduler must do any necessary redirection before then. |
1217 // * Near the end of |PreCreateThreads()|: The TaskScheduler needs to be | 1216 // * Near the end of |PreCreateThreads()|: The TaskScheduler needs to be |
1218 // created before any other threads are (by contract) but it creates | 1217 // created before any other threads are (by contract) but it creates |
1219 // threads itself so instantiating it earlier is also incorrect. | 1218 // threads itself so instantiating it earlier is also incorrect. |
1220 // To maintain scoping symmetry, if this line is moved, the corresponding | 1219 // To maintain scoping symmetry, if this line is moved, the corresponding |
1221 // shutdown call may also need to be moved. | 1220 // shutdown call may also need to be moved. |
1222 task_scheduler_util::InitializeDefaultBrowserTaskScheduler(); | 1221 task_scheduler_util::InitializeDefaultBrowserTaskScheduler(); |
1223 | 1222 |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 chromeos::CrosSettings::Shutdown(); | 2092 chromeos::CrosSettings::Shutdown(); |
2094 #endif // defined(OS_CHROMEOS) | 2093 #endif // defined(OS_CHROMEOS) |
2095 #endif // defined(OS_ANDROID) | 2094 #endif // defined(OS_ANDROID) |
2096 } | 2095 } |
2097 | 2096 |
2098 // Public members: | 2097 // Public members: |
2099 | 2098 |
2100 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2099 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2101 chrome_extra_parts_.push_back(parts); | 2100 chrome_extra_parts_.push_back(parts); |
2102 } | 2101 } |
OLD | NEW |