Chromium Code Reviews| Index: base/file_version_info_win.h |
| diff --git a/base/file_version_info_win.h b/base/file_version_info_win.h |
| index 1e152a86d6516079c3651907e2a5c64793a7b824..827ebea6044ab933b1059d9f26581b6014f5847c 100644 |
| --- a/base/file_version_info_win.h |
| +++ b/base/file_version_info_win.h |
| @@ -5,20 +5,23 @@ |
| #ifndef BASE_FILE_VERSION_INFO_WIN_H_ |
| #define BASE_FILE_VERSION_INFO_WIN_H_ |
| +#include <windows.h> |
| + |
| +#include <stdint.h> |
| + |
| #include <memory> |
| #include <string> |
| +#include <vector> |
| #include "base/base_export.h" |
| #include "base/file_version_info.h" |
| #include "base/macros.h" |
| -#include "base/memory/free_deleter.h" |
| struct tagVS_FIXEDFILEINFO; |
| typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO; |
| class BASE_EXPORT FileVersionInfoWin : public FileVersionInfo { |
| public: |
| - FileVersionInfoWin(void* data, WORD language, WORD code_page); |
| ~FileVersionInfoWin() override; |
| // Accessors to the different version properties. |
| @@ -48,14 +51,23 @@ class BASE_EXPORT FileVersionInfoWin : public FileVersionInfo { |
| 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_; } |
| + const VS_FIXEDFILEINFO* fixed_file_info() const { return fixed_file_info_; } |
| private: |
| - std::unique_ptr<char, base::FreeDeleter> data_; |
| - WORD language_; |
| - WORD code_page_; |
| - // This is a pointer into the data_ if it exists. Otherwise NULL. |
| - VS_FIXEDFILEINFO* fixed_file_info_; |
| + friend FileVersionInfo; |
| + |
| + // |data| is a VS_VERSION_INFO resource. |language| and |code_page| are |
| + // extracted from the \VarFileInfo\Translation value of |data|. |
| + FileVersionInfoWin(std::vector<uint8_t> data, WORD language, WORD code_page); |
|
Lei Zhang
2016/06/23 04:33:53
std::vector<uint8_t>&& data ?
fdoray
2016/06/27 20:51:29
Done.
|
| + FileVersionInfoWin(void* data, WORD language, WORD code_page); |
| + |
| + const std::vector<uint8_t> owned_data_; |
| + const void* const data_; |
| + const WORD language_; |
| + const WORD code_page_; |
| + |
| + // This is a pointer into the data_ if it exists. Otherwise nullptr. |
|
Lei Zhang
2016/06/23 04:33:53
|data_|
fdoray
2016/06/27 20:51:29
Done.
|
| + const VS_FIXEDFILEINFO* const fixed_file_info_ = nullptr; |
| DISALLOW_COPY_AND_ASSIGN(FileVersionInfoWin); |
| }; |