| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/chrome_version_info.h" | 5 #include "chrome/common/chrome_version_info.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/thread_restrictions.h" | |
| 11 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 12 | 11 |
| 13 namespace chrome { | 12 namespace chrome { |
| 14 | 13 |
| 15 #if defined(OS_WIN) || defined(OS_MACOSX) | 14 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 16 // On Windows and Mac, we get the Chrome version info by querying | 15 // On Windows and Mac, we get the Chrome version info by querying |
| 17 // FileVersionInfo for the current module. | 16 // FileVersionInfo for the current module. |
| 18 | 17 |
| 19 VersionInfo::VersionInfo() { | 18 VersionInfo::VersionInfo() { |
| 20 // The current module is already loaded in memory, so this will be cheap. | |
| 21 base::ThreadRestrictions::ScopedAllowIO allow_io; | |
| 22 version_info_.reset(FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 19 version_info_.reset(FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 23 } | 20 } |
| 24 | 21 |
| 25 VersionInfo::~VersionInfo() { | 22 VersionInfo::~VersionInfo() { |
| 26 } | 23 } |
| 27 | 24 |
| 28 bool VersionInfo::is_valid() const { | 25 bool VersionInfo::is_valid() const { |
| 29 return version_info_.get() != NULL; | 26 return version_info_.get() != NULL; |
| 30 } | 27 } |
| 31 | 28 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return LAST_CHANGE; | 78 return LAST_CHANGE; |
| 82 } | 79 } |
| 83 | 80 |
| 84 bool VersionInfo::IsOfficialBuild() const { | 81 bool VersionInfo::IsOfficialBuild() const { |
| 85 return OFFICIAL_BUILD; | 82 return OFFICIAL_BUILD; |
| 86 } | 83 } |
| 87 | 84 |
| 88 #endif | 85 #endif |
| 89 | 86 |
| 90 } // namespace chrome | 87 } // namespace chrome |
| OLD | NEW |