Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/install_static/install_util.h" | 5 #include "chrome/install_static/install_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <assert.h> | 8 #include <assert.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 | 521 |
| 522 bool IsNonBrowserProcess() { | 522 bool IsNonBrowserProcess() { |
| 523 assert(g_process_type != ProcessType::UNINITIALIZED); | 523 assert(g_process_type != ProcessType::UNINITIALIZED); |
| 524 return g_process_type != ProcessType::BROWSER_PROCESS; | 524 return g_process_type != ProcessType::BROWSER_PROCESS; |
| 525 } | 525 } |
| 526 | 526 |
| 527 bool ProcessNeedsProfileDir(const std::string& process_type) { | 527 bool ProcessNeedsProfileDir(const std::string& process_type) { |
| 528 return ProcessNeedsProfileDir(GetProcessType(UTF8ToUTF16(process_type))); | 528 return ProcessNeedsProfileDir(GetProcessType(UTF8ToUTF16(process_type))); |
| 529 } | 529 } |
| 530 | 530 |
| 531 bool CurrentProcessNeedsProfileDir() { | |
| 532 assert(g_process_type != ProcessType::UNINITIALIZED); | |
| 533 return ProcessNeedsProfileDir(g_process_type); | |
| 534 } | |
| 535 | |
| 536 // DO NOT SUBMIT: GetUserDataDirectory should be called from chrome_elf only. | |
|
grt (UTC plus 2)
2017/05/19 08:15:50
DNS?
manzagop (departed)
2017/05/19 22:02:07
Done.
| |
| 531 std::wstring GetCrashDumpLocation() { | 537 std::wstring GetCrashDumpLocation() { |
| 532 // In order to be able to start crash handling very early and in chrome_elf, | 538 // In order to be able to start crash handling very early and in chrome_elf, |
| 533 // we cannot rely on chrome's PathService entries (for DIR_CRASH_DUMPS) being | 539 // we cannot rely on chrome's PathService entries (for DIR_CRASH_DUMPS) being |
| 534 // available on Windows. See https://crbug.com/564398. | 540 // available on Windows. See https://crbug.com/564398. |
| 535 std::wstring user_data_dir; | 541 std::wstring user_data_dir; |
| 536 bool ret = GetUserDataDirectory(&user_data_dir, nullptr); | 542 bool ret = GetUserDataDirectory(InstallDetails::Get().mode(), &user_data_dir, |
|
grt (UTC plus 2)
2017/05/19 08:15:50
can this just get the dir from InstallDetails now?
manzagop (departed)
2017/05/19 22:02:07
Yup. The DNS was a reminder of this. Done.
| |
| 543 nullptr); | |
| 537 assert(ret); | 544 assert(ret); |
| 538 IgnoreUnused(ret); | 545 IgnoreUnused(ret); |
| 539 return user_data_dir.append(L"\\Crashpad"); | 546 return user_data_dir.append(L"\\Crashpad"); |
| 540 } | 547 } |
| 541 | 548 |
| 542 std::string GetEnvironmentString(const std::string& variable_name) { | 549 std::string GetEnvironmentString(const std::string& variable_name) { |
| 543 return UTF16ToUTF8( | 550 return UTF16ToUTF8( |
| 544 GetEnvironmentString16(UTF8ToUTF16(variable_name).c_str())); | 551 GetEnvironmentString16(UTF8ToUTF16(variable_name).c_str())); |
| 545 } | 552 } |
| 546 | 553 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 887 case ChannelStrategy::ADDITIONAL_PARAMETERS: | 894 case ChannelStrategy::ADDITIONAL_PARAMETERS: |
| 888 return ChannelFromAdditionalParameters(mode, ap_value); | 895 return ChannelFromAdditionalParameters(mode, ap_value); |
| 889 case ChannelStrategy::FIXED: | 896 case ChannelStrategy::FIXED: |
| 890 return mode.default_channel_name; | 897 return mode.default_channel_name; |
| 891 } | 898 } |
| 892 | 899 |
| 893 return std::wstring(); | 900 return std::wstring(); |
| 894 } | 901 } |
| 895 | 902 |
| 896 } // namespace install_static | 903 } // namespace install_static |
| OLD | NEW |