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

Side by Side Diff: base/file_version_info_win.cc

Issue 6816027: Make the windows_version.h functions threadsafe by using a singleton. Add accessors to the singl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/process_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_version_info_win.h" 5 #include "base/file_version_info_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_version_info.h" 10 #include "base/file_version_info.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 14
15 // This has to be last.
16 #include <strsafe.h>
17
18 FileVersionInfoWin::FileVersionInfoWin(void* data, int language, int code_page) 15 FileVersionInfoWin::FileVersionInfoWin(void* data, int language, int code_page)
19 : language_(language), code_page_(code_page) { 16 : language_(language), code_page_(code_page) {
20 base::ThreadRestrictions::AssertIOAllowed(); 17 base::ThreadRestrictions::AssertIOAllowed();
21 data_.reset((char*) data); 18 data_.reset((char*) data);
22 fixed_file_info_ = NULL; 19 fixed_file_info_ = NULL;
23 UINT size; 20 UINT size;
24 ::VerQueryValue(data_.get(), L"\\", (LPVOID*)&fixed_file_info_, &size); 21 ::VerQueryValue(data_.get(), L"\\", (LPVOID*)&fixed_file_info_, &size);
25 } 22 }
26 23
27 FileVersionInfoWin::~FileVersionInfoWin() { 24 FileVersionInfoWin::~FileVersionInfoWin() {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return false; 173 return false;
177 } 174 }
178 175
179 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) { 176 std::wstring FileVersionInfoWin::GetStringValue(const wchar_t* name) {
180 std::wstring str; 177 std::wstring str;
181 if (GetValue(name, &str)) 178 if (GetValue(name, &str))
182 return str; 179 return str;
183 else 180 else
184 return L""; 181 return L"";
185 } 182 }
OLDNEW
« no previous file with comments | « no previous file | base/process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698