Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 174253002: Initialize chrome::DIR_USER_DATA early on for service processes, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use dynamic_annotations_win64 for common_constants_win64. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/ui/startup/bad_flags_prompt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #include "chrome/browser/profiles/profile.h" 88 #include "chrome/browser/profiles/profile.h"
89 #include "chrome/browser/profiles/profile_manager.h" 89 #include "chrome/browser/profiles/profile_manager.h"
90 #include "chrome/browser/profiles/profiles_state.h" 90 #include "chrome/browser/profiles/profiles_state.h"
91 #include "chrome/browser/shell_integration.h" 91 #include "chrome/browser/shell_integration.h"
92 #include "chrome/browser/three_d_api_observer.h" 92 #include "chrome/browser/three_d_api_observer.h"
93 #include "chrome/browser/translate/translate_service.h" 93 #include "chrome/browser/translate/translate_service.h"
94 #include "chrome/browser/ui/app_list/app_list_service.h" 94 #include "chrome/browser/ui/app_list/app_list_service.h"
95 #include "chrome/browser/ui/browser.h" 95 #include "chrome/browser/ui/browser.h"
96 #include "chrome/browser/ui/browser_finder.h" 96 #include "chrome/browser/ui/browser_finder.h"
97 #include "chrome/browser/ui/host_desktop.h" 97 #include "chrome/browser/ui/host_desktop.h"
98 #include "chrome/browser/ui/startup/bad_flags_prompt.h"
98 #include "chrome/browser/ui/startup/default_browser_prompt.h" 99 #include "chrome/browser/ui/startup/default_browser_prompt.h"
99 #include "chrome/browser/ui/startup/startup_browser_creator.h" 100 #include "chrome/browser/ui/startup/startup_browser_creator.h"
100 #include "chrome/browser/ui/uma_browsing_activity_observer.h" 101 #include "chrome/browser/ui/uma_browsing_activity_observer.h"
101 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 102 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
102 #include "chrome/browser/user_data_dir_extractor.h"
103 #include "chrome/common/chrome_constants.h" 103 #include "chrome/common/chrome_constants.h"
104 #include "chrome/common/chrome_paths.h" 104 #include "chrome/common/chrome_paths.h"
105 #include "chrome/common/chrome_result_codes.h" 105 #include "chrome/common/chrome_result_codes.h"
106 #include "chrome/common/chrome_switches.h" 106 #include "chrome/common/chrome_switches.h"
107 #include "chrome/common/crash_keys.h" 107 #include "chrome/common/crash_keys.h"
108 #include "chrome/common/env_vars.h" 108 #include "chrome/common/env_vars.h"
109 #include "chrome/common/logging_chrome.h" 109 #include "chrome/common/logging_chrome.h"
110 #include "chrome/common/net/net_resource_provider.h" 110 #include "chrome/common/net/net_resource_provider.h"
111 #include "chrome/common/pref_names.h" 111 #include "chrome/common/pref_names.h"
112 #include "chrome/common/profile_management_switches.h" 112 #include "chrome/common/profile_management_switches.h"
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 778 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
779 chrome_extra_parts_[i]->PreCreateThreads(); 779 chrome_extra_parts_[i]->PreCreateThreads();
780 } 780 }
781 781
782 return result_code_; 782 return result_code_;
783 } 783 }
784 784
785 int ChromeBrowserMainParts::PreCreateThreadsImpl() { 785 int ChromeBrowserMainParts::PreCreateThreadsImpl() {
786 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") 786 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl")
787 run_message_loop_ = false; 787 run_message_loop_ = false;
788 { 788 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_));
789 TRACE_EVENT0("startup", 789 #if !defined(OS_ANDROID)
790 "ChromeBrowserMainParts::PreCreateThreadsImpl:GetUserDataDir"); 790 chrome::MaybeShowInvalidUserDataDirWarningDialog();
791 user_data_dir_ = chrome::GetUserDataDir(parameters()); 791 #endif
792 }
793 792
794 // Force MediaCaptureDevicesDispatcher to be created on UI thread. 793 // Force MediaCaptureDevicesDispatcher to be created on UI thread.
795 MediaCaptureDevicesDispatcher::GetInstance(); 794 MediaCaptureDevicesDispatcher::GetInstance();
796 795
797 // Android's first run is done in Java instead of native. 796 // Android's first run is done in Java instead of native.
798 #if !defined(OS_ANDROID) 797 #if !defined(OS_ANDROID)
799 process_singleton_.reset(new ChromeProcessSingleton( 798 process_singleton_.reset(new ChromeProcessSingleton(
800 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback))); 799 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback)));
801 800
802 // Cache first run state early. 801 // Cache first run state early.
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 chromeos::CrosSettings::Shutdown(); 1692 chromeos::CrosSettings::Shutdown();
1694 #endif 1693 #endif
1695 #endif 1694 #endif
1696 } 1695 }
1697 1696
1698 // Public members: 1697 // Public members:
1699 1698
1700 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1699 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1701 chrome_extra_parts_.push_back(parts); 1700 chrome_extra_parts_.push_back(parts);
1702 } 1701 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/ui/startup/bad_flags_prompt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698