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

Unified Diff: file_version_info.h

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « debug/debugger_posix.cc ('k') | files/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: file_version_info.h
diff --git a/file_version_info.h b/file_version_info.h
index 57b837c24b08e90c8a1b14ec4175160a7cea0d3e..e8f544c999e080ed5662429bd84a3a190bbc5955 100644
--- a/file_version_info.h
+++ b/file_version_info.h
@@ -32,6 +32,17 @@ class FilePath;
// version returns values from the Info.plist as appropriate. TODO(avi): make
// this a less-obvious Windows-ism.
+#if defined(OS_WIN)
+// Creates a FileVersionInfo for the current module. Returns NULL in case of
+// error. The returned object should be deleted when you are done with it. This
+// is done as a macro to force inlining of __ImageBase. It used to be inside of
+// a method labeled with __forceinline, but inlining through __forceinline
+// stopped working for Debug builds in VS2013 (http://crbug.com/516359).
+#define CREATE_FILE_VERSION_INFO_FOR_CURRENT_MODULE() \
+ FileVersionInfo::CreateFileVersionInfoForModule( \
+ reinterpret_cast<HMODULE>(&__ImageBase))
+#endif
+
class BASE_EXPORT FileVersionInfo {
public:
virtual ~FileVersionInfo() {}
@@ -46,17 +57,9 @@ class BASE_EXPORT FileVersionInfo {
#if defined(OS_WIN)
// Creates a FileVersionInfo for the specified module. Returns NULL in case
// of error. The returned object should be deleted when you are done with it.
+ // See CREATE_FILE_VERSION_INFO_FOR_CURRENT_MODULE() helper above for a
+ // CreateFileVersionInfoForCurrentModule() alternative for Windows.
static FileVersionInfo* CreateFileVersionInfoForModule(HMODULE module);
-
- // Creates a FileVersionInfo for the current module. Returns NULL in case
- // of error. The returned object should be deleted when you are done with it.
- // This function should be inlined so that the "current module" is evaluated
- // correctly, instead of being the module that contains base.
- __forceinline static FileVersionInfo*
- CreateFileVersionInfoForCurrentModule() {
- HMODULE module = reinterpret_cast<HMODULE>(&__ImageBase);
- return CreateFileVersionInfoForModule(module);
- }
#else
// Creates a FileVersionInfo for the current module. Returns NULL in case
// of error. The returned object should be deleted when you are done with it.
« no previous file with comments | « debug/debugger_posix.cc ('k') | files/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698