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_android.h" | 5 #include "chrome/browser/chrome_browser_main_android.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/base/ui_base_paths.h" | 22 #include "ui/base/ui_base_paths.h" |
23 | 23 |
24 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( | 24 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( |
25 const content::MainFunctionParams& parameters) | 25 const content::MainFunctionParams& parameters) |
26 : ChromeBrowserMainParts(parameters) { | 26 : ChromeBrowserMainParts(parameters) { |
27 } | 27 } |
28 | 28 |
29 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { | 29 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { |
30 } | 30 } |
31 | 31 |
32 void ChromeBrowserMainPartsAndroid::PreProfileInit() { | 32 int ChromeBrowserMainPartsAndroid::PreCreateThreads() { |
33 TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreProfileInit") | 33 TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreCreateThreads") |
| 34 |
| 35 // The CrashDumpManager must be initialized before any child process is |
| 36 // created (as they need to access it during creation). Such processes |
| 37 // are created on the PROCESS_LAUNCHER thread, and so the manager is |
| 38 // initialized before that thread is created. |
34 #if defined(GOOGLE_CHROME_BUILD) | 39 #if defined(GOOGLE_CHROME_BUILD) |
35 // TODO(jcivelli): we should not initialize the crash-reporter when it was not | 40 // TODO(jcivelli): we should not initialize the crash-reporter when it was not |
36 // enabled. Right now if it is disabled we still generate the minidumps but we | 41 // enabled. Right now if it is disabled we still generate the minidumps but we |
37 // do not upload them. | 42 // do not upload them. |
38 bool breakpad_enabled = true; | 43 bool breakpad_enabled = true; |
39 #else | 44 #else |
40 bool breakpad_enabled = false; | 45 bool breakpad_enabled = false; |
41 #endif | 46 #endif |
42 | 47 |
43 // Allow Breakpad to be enabled in Chromium builds for testing purposes. | 48 // Allow Breakpad to be enabled in Chromium builds for testing purposes. |
44 if (!breakpad_enabled) | 49 if (!breakpad_enabled) |
45 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 50 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
46 switches::kEnableCrashReporterForTesting); | 51 switches::kEnableCrashReporterForTesting); |
47 | 52 |
48 if (breakpad_enabled) { | 53 if (breakpad_enabled) { |
49 base::FilePath crash_dump_dir; | 54 base::FilePath crash_dump_dir; |
50 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); | 55 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); |
51 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); | 56 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); |
52 } | 57 } |
53 | 58 |
54 ChromeBrowserMainParts::PreProfileInit(); | 59 return ChromeBrowserMainParts::PreCreateThreads(); |
55 } | 60 } |
56 | 61 |
57 void ChromeBrowserMainPartsAndroid::PostProfileInit() { | 62 void ChromeBrowserMainPartsAndroid::PostProfileInit() { |
58 Profile* main_profile = profile(); | 63 Profile* main_profile = profile(); |
59 search_counter_.reset(new GoogleSearchCounterAndroid(main_profile)); | 64 search_counter_.reset(new GoogleSearchCounterAndroid(main_profile)); |
60 InitBookmarksExperimentState(main_profile); | 65 InitBookmarksExperimentState(main_profile); |
61 | 66 |
62 ChromeBrowserMainParts::PostProfileInit(); | 67 ChromeBrowserMainParts::PostProfileInit(); |
63 } | 68 } |
64 | 69 |
(...skipping 22 matching lines...) Expand all Loading... |
87 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop"); | 92 "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop"); |
88 base::MessageLoopForUI::current()->Start(); | 93 base::MessageLoopForUI::current()->Start(); |
89 } | 94 } |
90 | 95 |
91 ChromeBrowserMainParts::PreEarlyInitialization(); | 96 ChromeBrowserMainParts::PreEarlyInitialization(); |
92 } | 97 } |
93 | 98 |
94 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | 99 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
95 NOTREACHED(); | 100 NOTREACHED(); |
96 } | 101 } |
OLD | NEW |