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

Unified Diff: chrome_elf/chrome_elf_main.cc

Issue 2487783002: Make Crashpad use the user data dir, rather than always default location (Closed)
Patch Set: thunk Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« chrome/install_static/install_util.cc ('K') | « chrome_elf/chrome_elf.def ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/chrome_elf_main.cc
diff --git a/chrome_elf/chrome_elf_main.cc b/chrome_elf/chrome_elf_main.cc
index a0bf20a3e53f494ce8f15b2dbcd2bc6fbefc2521..fdbeb0b75ba61f7676ec351f889944e2bc246c77 100644
--- a/chrome_elf/chrome_elf_main.cc
+++ b/chrome_elf/chrome_elf_main.cc
@@ -10,6 +10,7 @@
#include "chrome/install_static/install_details.h"
#include "chrome/install_static/install_util.h"
#include "chrome/install_static/product_install_details.h"
+#include "chrome/install_static/user_data_dir.h"
#include "chrome_elf/blacklist/blacklist.h"
#include "chrome_elf/crash/crash_helper.h"
@@ -28,6 +29,19 @@ void SignalChromeElf() {
blacklist::ResetBeacon();
}
+extern "C" void GetUserDataDirectoryThunk(wchar_t* user_data_dir,
+ size_t user_data_dir_length,
+ wchar_t* invalid_user_data_dir,
+ size_t invalid_user_data_dir_length) {
+ std::wstring user_data_dir_str, invalid_user_data_dir_str;
+ bool ret = install_static::GetUserDataDirectory(&user_data_dir_str,
+ &invalid_user_data_dir_str);
+ assert(ret);
+ wcscpy_s(user_data_dir, user_data_dir_length, user_data_dir_str.c_str());
grt (UTC plus 2) 2016/11/23 09:47:37 looks like this is counting on the crt's parameter
scottmg 2016/11/23 17:59:03 I think process_startup_helper.cc is fine (other t
+ wcscpy_s(invalid_user_data_dir, invalid_user_data_dir_length,
+ invalid_user_data_dir_str.c_str());
+}
+
// Returns the payload for the ELF's InstallDetails instance. For use by
// install_static::InstallDetails::InitializeFromPrimaryModule.
extern "C" const install_static::InstallDetails::Payload*
@@ -39,11 +53,11 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
if (reason == DLL_PROCESS_ATTACH) {
install_static::InitializeProductDetailsForPrimaryModule();
-// CRT on initialization installs an exception filter which calls
-// TerminateProcess. We need to hook CRT's attempt to set an exception.
-// NOTE: Do not hook if ASan is present, or ASan will fail to install
-// its own unhandled exception filter.
#if !defined(ADDRESS_SANITIZER)
+ // CRT on initialization installs an exception filter which calls
+ // TerminateProcess. We need to hook CRT's attempt to set an exception.
+ // NOTE: Do not hook if ASan is present, or ASan will fail to install
+ // its own unhandled exception filter.
elf_crash::DisableSetUnhandledExceptionFilter();
#endif // !defined (ADDRESS_SANITIZER)
« chrome/install_static/install_util.cc ('K') | « chrome_elf/chrome_elf.def ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698