summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_exe_main.cc
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 13:36:55 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 13:36:55 +0000
commit2f66e8ce0f3ac83e5dbc80bfa52760bb1a903ced (patch)
tree732e449f1e510c1eab2d7e8802db97c4d632324a /chrome/app/chrome_exe_main.cc
parent3d5efa1683dd0f865463159e0837bb4ee6a6ea34 (diff)
downloadchromium_src-2f66e8ce0f3ac83e5dbc80bfa52760bb1a903ced.zip
chromium_src-2f66e8ce0f3ac83e5dbc80bfa52760bb1a903ced.tar.gz
chromium_src-2f66e8ce0f3ac83e5dbc80bfa52760bb1a903ced.tar.bz2
Change the breakpad initialization for Google Chrome to be
the same as Chromium. Chromium was delayed, while Google Chrome was not, resulting in another LoadLibrary of chrome.dll. Since we are not really getting crash reports of chrome crashing during LoadLibrary, we don't mind initializing after. BUG:4564 TEST:about:crash still report a crash in Google Chrome and Chromium. Review URL: http://codereview.chromium.org/146030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_exe_main.cc')
-rw-r--r--chrome/app/chrome_exe_main.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/chrome/app/chrome_exe_main.cc b/chrome/app/chrome_exe_main.cc
index 197a50d..07a757c 100644
--- a/chrome/app/chrome_exe_main.cc
+++ b/chrome/app/chrome_exe_main.cc
@@ -44,48 +44,41 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
CommandLine::Init(0, NULL);
const wchar_t* dll_name = L"chrome.dll";
+ std::wstring dll_full_path;
+ std::wstring versionned_path;
+
#if defined(GOOGLE_CHROME_BUILD)
google_update::GoogleUpdateClient client;
// TODO(erikkay): Get guid from build macros rather than hardcoding.
// TODO(erikkay): verify client.Init() return value for official builds
client.Init(L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", dll_name);
-
- // Initialize the crash reporter.
- InitCrashReporterWithDllPath(client.GetDLLPath());
-
- bool exit_now = true;
- if (ShowRestartDialogIfCrashed(&exit_now)) {
- // We have restarted because of a previous crash. The user might
- // decide that he does not want to continue.
- if (exit_now)
- return ResultCodes::NORMAL_EXIT;
- }
-
- int ret = 0;
- if (client.Launch(instance, &sandbox_info, command_line, "ChromeMain",
- &ret)) {
- return ret;
- }
+ dll_full_path = client.GetDLLFullPath();
+ versionned_path = client.GetDLLPath();
#else
wchar_t exe_path[MAX_PATH] = {0};
client_util::GetExecutablePath(exe_path);
wchar_t *version;
- std::wstring dll_path;
if (client_util::GetChromiumVersion(exe_path, L"Software\\Chromium",
&version)) {
- dll_path = exe_path;
- dll_path.append(version);
- if (client_util::FileExists(dll_path.c_str()))
- ::SetCurrentDirectory(dll_path.c_str());
+ versionned_path = exe_path;
+ versionned_path.append(version);
delete[] version;
}
+ dll_full_path = client_util::GetDLLPath(dll_name, versionned_path);
+#endif
+
+ // If the versionned path exists, we set the current directory to this path.
+ if (client_util::FileExists(versionned_path.c_str())) {
+ ::SetCurrentDirectory(versionned_path.c_str());
+ }
+
HINSTANCE dll_handle = ::LoadLibraryEx(dll_name, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
// Initialize the crash reporter.
- InitCrashReporterWithDllPath(client_util::GetDLLPath(dll_name, dll_path));
+ InitCrashReporterWithDllPath(dll_full_path);
bool exit_now = true;
if (ShowRestartDialogIfCrashed(&exit_now)) {
@@ -95,6 +88,13 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
return ResultCodes::NORMAL_EXIT;
}
+#if defined(GOOGLE_CHROME_BUILD)
+ int ret = 0;
+ if (client.Launch(instance, &sandbox_info, command_line, "ChromeMain",
+ &ret)) {
+ return ret;
+ }
+#else
if (NULL != dll_handle) {
client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>(
::GetProcAddress(dll_handle, "ChromeMain"));