diff options
author | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-16 23:29:16 +0000 |
---|---|---|
committer | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-16 23:29:16 +0000 |
commit | 82790583773a1e65944abad49e62690d1293e7b3 (patch) | |
tree | fb4cf12a7841c3339a9ef68e9766a5aa53d6d2c7 /chrome/nacl | |
parent | a187ad47d59699fcfa17c4b58c7dcca8c4bf0d3e (diff) | |
download | chromium_src-82790583773a1e65944abad49e62690d1293e7b3.zip chromium_src-82790583773a1e65944abad49e62690d1293e7b3.tar.gz chromium_src-82790583773a1e65944abad49e62690d1293e7b3.tar.bz2 |
Windows Breakpad: Get metadata from chrome.exe instead of chrome.dll
Comments in the code indicate that getting the metadata from
chrome.dll in GetCustomInfo() is slow because the DLL might not have
loaded at the point where Breakpad is initialised. Getting the
metadata from the current module (which is either chrome.exe or
nacl64.exe) will be faster since the module is already loaded.
This will let us initialise Breakpad on the main thread in a later
change.
I tested this by adding the following debugging prints:
printf("product_version=%ls\n", version_info->product_version().c_str());
printf("product_short_name=%ls\n",
version_info->product_short_name().c_str());
printf("is_official_build=%i\n", version_info->is_official_build());
printf("special_build=%ls\n", version_info->special_build().c_str());
This produced the same output before and after the change:
product_version=19.0.1041.0
product_short_name=Chromium
is_official_build=0
special_build=
and it produced the same from nacl64.exe when NaCl was run. These are
all the fields of version_info that this code uses.
We rename "dll_path" to "exe_path" for clarity.
The other use of "dll_path", for IsPerUserInstall(), is safe to change
to use chrome.exe's path because this only looks at the directory of
the pathname.
We change chrome.exe to use the same method (GetModuleFileNameW()) as
nacl64.exe for getting the current executable's pathname.
BUG=111265
TEST=see above
Review URL: https://chromiumcodereview.appspot.com/9404034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r-- | chrome/nacl/nacl_exe_win_64.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/nacl/nacl_exe_win_64.cc b/chrome/nacl/nacl_exe_win_64.cc index 9bddf80..00c2ce0 100644 --- a/chrome/nacl/nacl_exe_win_64.cc +++ b/chrome/nacl/nacl_exe_win_64.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,9 +48,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { base::AtExitManager exit_manager; CommandLine::Init(0, NULL); - wchar_t path[MAX_PATH]; - ::GetModuleFileNameW(NULL, path, MAX_PATH); - InitCrashReporterWithDllPath(std::wstring(path)); + InitCrashReporter(); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); std::string process_type = |