[go: nahoru, domu]

FileVersionInfoWin: BASE_EXPORT the class instead of select methods.

Some methods are being called from a different component, so should be
exported. Rather than selectively exporting them, we just made the
entire class (and its parent class, FileVersionInfo) BASE_EXPORTed.

Note: This is not currently breaking the build, because the methods are
called by virtual dispatch, but in principle, they should be exported.
Context: I am investigating adding the "final" keyword to a bunch of
classes (http://crbug.com/482800) and this breaks once "final" is added
to FileVersionInfoWin.

BUG=484939

Review URL: https://codereview.chromium.org/1122413002

Cr-Commit-Position: refs/heads/master@{#328683}
diff --git a/base/file_version_info.h b/base/file_version_info.h
index e18ba13..5bc577c 100644
--- a/base/file_version_info.h
+++ b/base/file_version_info.h
@@ -32,22 +32,21 @@
 // version returns values from the Info.plist as appropriate. TODO(avi): make
 // this a less-obvious Windows-ism.
 
-class FileVersionInfo {
+class BASE_EXPORT FileVersionInfo {
  public:
   virtual ~FileVersionInfo() {}
 #if defined(OS_WIN) || defined(OS_MACOSX)
   // Creates a FileVersionInfo for the specified path. Returns NULL if something
   // goes wrong (typically the file does not exit or cannot be opened). The
   // returned object should be deleted when you are done with it.
-  BASE_EXPORT static FileVersionInfo* CreateFileVersionInfo(
+  static FileVersionInfo* CreateFileVersionInfo(
       const base::FilePath& file_path);
 #endif  // OS_WIN || OS_MACOSX
 
 #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.
-  BASE_EXPORT static FileVersionInfo* CreateFileVersionInfoForModule(
-      HMODULE module);
+  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.
@@ -61,7 +60,7 @@
 #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.
-  BASE_EXPORT static FileVersionInfo* CreateFileVersionInfoForCurrentModule();
+  static FileVersionInfo* CreateFileVersionInfoForCurrentModule();
 #endif  // OS_WIN
 
   // Accessors to the different version properties.
diff --git a/base/file_version_info_win.h b/base/file_version_info_win.h
index 92d0844a..09d8d37 100644
--- a/base/file_version_info_win.h
+++ b/base/file_version_info_win.h
@@ -15,10 +15,10 @@
 struct tagVS_FIXEDFILEINFO;
 typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO;
 
-class FileVersionInfoWin : public FileVersionInfo {
+class BASE_EXPORT FileVersionInfoWin : public FileVersionInfo {
  public:
-  BASE_EXPORT FileVersionInfoWin(void* data, WORD language, WORD code_page);
-  BASE_EXPORT ~FileVersionInfoWin() override;
+  FileVersionInfoWin(void* data, WORD language, WORD code_page);
+  ~FileVersionInfoWin() override;
 
   // Accessors to the different version properties.
   // Returns an empty string if the property is not found.
@@ -40,11 +40,11 @@
   bool is_official_build() override;
 
   // Lets you access other properties not covered above.
-  BASE_EXPORT bool GetValue(const wchar_t* name, std::wstring* value);
+  bool GetValue(const wchar_t* name, std::wstring* value);
 
   // Similar to GetValue but returns a wstring (empty string if the property
   // does not exist).
-  BASE_EXPORT std::wstring GetStringValue(const wchar_t* name);
+  std::wstring GetStringValue(const wchar_t* name);
 
   // Get the fixed file info if it exists. Otherwise NULL
   VS_FIXEDFILEINFO* fixed_file_info() { return fixed_file_info_; }