Chromium Code Reviews| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) | 352 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 353 | 353 |
| 354 #endif // OS_POSIX | 354 #endif // OS_POSIX |
| 355 | 355 |
| 356 struct MainFunction { | 356 struct MainFunction { |
| 357 const char* name; | 357 const char* name; |
| 358 int (*function)(const content::MainFunctionParams&); | 358 int (*function)(const content::MainFunctionParams&); |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 // Initializes the user data dir. Must be called before InitializeLocalState(). | 361 // Initializes the user data dir. Must be called before InitializeLocalState(). |
| 362 // WARNING! It is important that this code match behavior with | |
| 363 // GetUserDataDirectory() in chrome_elf. The two functions must be updated in | |
| 364 // sync. | |
|
Mark Mentovai
2016/11/10 22:06:17
Can we add a test for equivalence? Or can we refac
scottmg
2016/11/15 23:23:14
Done.
| |
| 362 void InitializeUserDataDir() { | 365 void InitializeUserDataDir() { |
| 363 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 366 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 364 base::FilePath user_data_dir = | 367 base::FilePath user_data_dir = |
| 365 command_line->GetSwitchValuePath(switches::kUserDataDir); | 368 command_line->GetSwitchValuePath(switches::kUserDataDir); |
| 366 std::string process_type = | 369 std::string process_type = |
| 367 command_line->GetSwitchValueASCII(switches::kProcessType); | 370 command_line->GetSwitchValueASCII(switches::kProcessType); |
| 368 | 371 |
| 369 #if defined(OS_LINUX) | 372 #if defined(OS_LINUX) |
| 370 // On Linux, Chrome does not support running multiple copies under different | 373 // On Linux, Chrome does not support running multiple copies under different |
| 371 // DISPLAYs, so the profile directory can be specified in the environment to | 374 // DISPLAYs, so the profile directory can be specified in the environment to |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1054 case version_info::Channel::CANARY: | 1057 case version_info::Channel::CANARY: |
| 1055 return true; | 1058 return true; |
| 1056 case version_info::Channel::DEV: | 1059 case version_info::Channel::DEV: |
| 1057 case version_info::Channel::BETA: | 1060 case version_info::Channel::BETA: |
| 1058 case version_info::Channel::STABLE: | 1061 case version_info::Channel::STABLE: |
| 1059 default: | 1062 default: |
| 1060 // Don't enable instrumentation. | 1063 // Don't enable instrumentation. |
| 1061 return false; | 1064 return false; |
| 1062 } | 1065 } |
| 1063 } | 1066 } |
| OLD | NEW |