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

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: Move utility functions into related files. Created 6 years, 10 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "chrome/browser/profiles/profile.h" 89 #include "chrome/browser/profiles/profile.h"
90 #include "chrome/browser/profiles/profile_manager.h" 90 #include "chrome/browser/profiles/profile_manager.h"
91 #include "chrome/browser/profiles/profiles_state.h" 91 #include "chrome/browser/profiles/profiles_state.h"
92 #include "chrome/browser/shell_integration.h" 92 #include "chrome/browser/shell_integration.h"
93 #include "chrome/browser/three_d_api_observer.h" 93 #include "chrome/browser/three_d_api_observer.h"
94 #include "chrome/browser/translate/translate_service.h" 94 #include "chrome/browser/translate/translate_service.h"
95 #include "chrome/browser/ui/app_list/app_list_service.h" 95 #include "chrome/browser/ui/app_list/app_list_service.h"
96 #include "chrome/browser/ui/browser.h" 96 #include "chrome/browser/ui/browser.h"
97 #include "chrome/browser/ui/browser_finder.h" 97 #include "chrome/browser/ui/browser_finder.h"
98 #include "chrome/browser/ui/host_desktop.h" 98 #include "chrome/browser/ui/host_desktop.h"
99 #include "chrome/browser/ui/startup/bad_flags_prompt.h"
99 #include "chrome/browser/ui/startup/default_browser_prompt.h" 100 #include "chrome/browser/ui/startup/default_browser_prompt.h"
100 #include "chrome/browser/ui/startup/startup_browser_creator.h" 101 #include "chrome/browser/ui/startup/startup_browser_creator.h"
101 #include "chrome/browser/ui/uma_browsing_activity_observer.h" 102 #include "chrome/browser/ui/uma_browsing_activity_observer.h"
102 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 103 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
103 #include "chrome/browser/user_data_dir_extractor.h"
104 #include "chrome/common/chrome_constants.h" 104 #include "chrome/common/chrome_constants.h"
105 #include "chrome/common/chrome_paths.h" 105 #include "chrome/common/chrome_paths.h"
106 #include "chrome/common/chrome_result_codes.h" 106 #include "chrome/common/chrome_result_codes.h"
107 #include "chrome/common/chrome_switches.h" 107 #include "chrome/common/chrome_switches.h"
108 #include "chrome/common/crash_keys.h" 108 #include "chrome/common/crash_keys.h"
109 #include "chrome/common/env_vars.h" 109 #include "chrome/common/env_vars.h"
110 #include "chrome/common/logging_chrome.h" 110 #include "chrome/common/logging_chrome.h"
111 #include "chrome/common/net/net_resource_provider.h" 111 #include "chrome/common/net/net_resource_provider.h"
112 #include "chrome/common/pref_names.h" 112 #include "chrome/common/pref_names.h"
113 #include "chrome/common/profile_management_switches.h" 113 #include "chrome/common/profile_management_switches.h"
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 779 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
780 chrome_extra_parts_[i]->PreCreateThreads(); 780 chrome_extra_parts_[i]->PreCreateThreads();
781 } 781 }
782 782
783 return result_code_; 783 return result_code_;
784 } 784 }
785 785
786 int ChromeBrowserMainParts::PreCreateThreadsImpl() { 786 int ChromeBrowserMainParts::PreCreateThreadsImpl() {
787 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") 787 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl")
788 run_message_loop_ = false; 788 run_message_loop_ = false;
789 { 789 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_));
790 TRACE_EVENT0("startup", 790 chrome::MaybeShowInvalidUserDataDirWarningDialog();
791 "ChromeBrowserMainParts::PreCreateThreadsImpl:GetUserDataDir");
792 user_data_dir_ = chrome::GetUserDataDir(parameters());
793 }
794 791
795 // Force MediaCaptureDevicesDispatcher to be created on UI thread. 792 // Force MediaCaptureDevicesDispatcher to be created on UI thread.
796 MediaCaptureDevicesDispatcher::GetInstance(); 793 MediaCaptureDevicesDispatcher::GetInstance();
797 794
798 // Android's first run is done in Java instead of native. 795 // Android's first run is done in Java instead of native.
799 #if !defined(OS_ANDROID) 796 #if !defined(OS_ANDROID)
800 process_singleton_.reset(new ChromeProcessSingleton( 797 process_singleton_.reset(new ChromeProcessSingleton(
801 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback))); 798 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback)));
802 799
803 // Cache first run state early. 800 // Cache first run state early.
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 chromeos::CrosSettings::Shutdown(); 1695 chromeos::CrosSettings::Shutdown();
1699 #endif 1696 #endif
1700 #endif 1697 #endif
1701 } 1698 }
1702 1699
1703 // Public members: 1700 // Public members:
1704 1701
1705 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1702 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1706 chrome_extra_parts_.push_back(parts); 1703 chrome_extra_parts_.push_back(parts);
1707 } 1704 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698