diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 16:06:13 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 16:06:13 +0000 |
commit | c5e4a2224ab96a7380e768c6a6148985accd3488 (patch) | |
tree | 993cafd3bd7514df75ff773879d3633ee916e3f8 | |
parent | 3bc2e375275d2e3a2aa0d8766d8e17f766ddbf78 (diff) | |
download | chromium_src-c5e4a2224ab96a7380e768c6a6148985accd3488.zip chromium_src-c5e4a2224ab96a7380e768c6a6148985accd3488.tar.gz chromium_src-c5e4a2224ab96a7380e768c6a6148985accd3488.tar.bz2 |
Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the header."
This is a speculative revert of r242414.
BUG=330681
TEST=as in bug
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/109673004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242889 0039d316-1c4b-4281-b951-d872f2087c98
114 files changed, 424 insertions, 426 deletions
diff --git a/base/version.h b/base/version.h index dfd17ef..b3012eb 100644 --- a/base/version.h +++ b/base/version.h @@ -65,4 +65,8 @@ class BASE_EXPORT Version { } // namespace base +// TODO(xhwang) remove this when all users are updated to explicitly use the +// namespace +using base::Version; + #endif // BASE_VERSION_H_ diff --git a/base/version_unittest.cc b/base/version_unittest.cc index 96d39b1..2a2309e 100644 --- a/base/version_unittest.cc +++ b/base/version_unittest.cc @@ -6,8 +6,6 @@ #include "testing/gtest/include/gtest/gtest.h" -using base::Version; - namespace { TEST(VersionTest, DefaultConstructor) { diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc index bb07888..57b604b 100644 --- a/chrome/app/chrome_breakpad_client.cc +++ b/chrome/app/chrome_breakpad_client.cc @@ -171,7 +171,7 @@ bool ChromeBreakpadClient::AboutToRestart() { bool ChromeBreakpadClient::GetDeferredUploadsSupported( bool is_per_user_install) { - base::Version update_version = GoogleUpdateSettings::GetGoogleUpdateVersion( + Version update_version = GoogleUpdateSettings::GetGoogleUpdateVersion( !is_per_user_install); if (!update_version.IsValid() || update_version.IsOlderThan(std::string(kMinUpdateVersion))) diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index b69a5d0..5baa453 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -202,7 +202,7 @@ base::string16 GetCurrentModuleVersion() { FileVersionInfo::CreateFileVersionInfoForCurrentModule()); if (file_version_info.get()) { base::string16 version_string(file_version_info->file_version()); - if (base::Version(WideToASCII(version_string)).IsValid()) + if (Version(WideToASCII(version_string)).IsValid()) return version_string; } return base::string16(); @@ -238,7 +238,7 @@ HMODULE MainDllLoader::Load(base::string16* out_version, // This is used to support Chrome Frame, see http://crbug.com/88589. version_string = cmd_line.GetSwitchValueNative(switches::kChromeVersion); - if (!base::Version(WideToASCII(version_string)).IsValid()) { + if (!Version(WideToASCII(version_string)).IsValid()) { // If a bogus command line flag was given, then abort. LOG(ERROR) << "Invalid command line version: " << version_string; return NULL; diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index fe8965e..9a19ceb 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -356,7 +356,7 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { // TODO(tommi): Check if using the default distribution is always the right // thing to do. BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - base::Version version; + Version version; InstallUtil::GetChromeVersion(dist, true, &version); if (version.IsValid()) { base::FilePath exe_path; diff --git a/chrome/browser/chromeos/extensions/external_cache.cc b/chrome/browser/chromeos/extensions/external_cache.cc index 75cf2c4..5818916 100644 --- a/chrome/browser/chromeos/extensions/external_cache.cc +++ b/chrome/browser/chromeos/extensions/external_cache.cc @@ -341,7 +341,7 @@ void ExternalCache::BackendCheckCacheContentsInternal( id.clear(); } - if (!base::Version(version).IsValid()) { + if (!Version(version).IsValid()) { LOG(ERROR) << "Bad extension version in ExternalCache: " << version; version.clear(); } @@ -376,8 +376,8 @@ void ExternalCache::BackendCheckCacheContentsInternal( &prev_version_string) && entry->GetString(extensions::ExternalProviderImpl::kExternalCrx, &prev_crx)) { - base::Version prev_version(prev_version_string); - base::Version curr_version(version); + Version prev_version(prev_version_string); + Version curr_version(version); DCHECK(prev_version.IsValid()); DCHECK(curr_version.IsValid()); if (prev_version.CompareTo(curr_version) <= 0) { @@ -472,7 +472,7 @@ void ExternalCache::BackendInstallCacheEntry( const std::string& id, const base::FilePath& path, const std::string& version) { - base::Version version_validator(version); + Version version_validator(version); if (!version_validator.IsValid()) { LOG(ERROR) << "ExternalCache downloaded extension " << id << " but got bad " << "version: " << version; diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index a5907a3..5cd162c 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -19,6 +19,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "base/version.h" #include "chrome/browser/accessibility/accessibility_events.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index 9782431..5325d60 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -73,8 +73,8 @@ static std::string HexStringToID(const std::string& hexstr) { } // Returns true if the |proposed| version is newer than |current| version. -bool IsVersionNewer(const base::Version& current, const std::string& proposed) { - base::Version proposed_ver(proposed); +bool IsVersionNewer(const Version& current, const std::string& proposed) { + Version proposed_ver(proposed); return proposed_ver.IsValid() && current.CompareTo(proposed_ver) < 0; } @@ -329,7 +329,7 @@ class CrxUpdateService : public ComponentUpdateService { scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; - const base::Version chrome_version_; + const Version chrome_version_; bool running_; @@ -738,7 +738,7 @@ void CrxUpdateService::AddItemToUpdateCheck(CrxUpdateItem* item, item->crx_urls.clear(); item->crx_diffurls.clear(); item->previous_version = item->component.version; - item->next_version = base::Version(); + item->next_version = Version(); item->previous_fp = item->component.fingerprint; item->next_fp.clear(); item->diff_update_failed = false; @@ -849,7 +849,7 @@ void CrxUpdateService::OnParseUpdateResponseSucceeded( } // Parse the members of the result and queue an upgrade for this component. - crx->next_version = base::Version(it->manifest.version); + crx->next_version = Version(it->manifest.version); typedef component_updater:: UpdateResponse::Result::Manifest::Package Package; diff --git a/chrome/browser/component_updater/component_updater_service.h b/chrome/browser/component_updater/component_updater_service.h index 1a14940..8f3f8b6 100644 --- a/chrome/browser/component_updater/component_updater_service.h +++ b/chrome/browser/component_updater/component_updater_service.h @@ -100,7 +100,7 @@ struct CrxComponent { std::vector<uint8> pk_hash; ComponentInstaller* installer; ComponentObserver* observer; - base::Version version; + Version version; std::string fingerprint; std::string name; CrxComponent(); diff --git a/chrome/browser/component_updater/crx_update_item.h b/chrome/browser/component_updater/crx_update_item.h index be79e48..477da9a 100644 --- a/chrome/browser/component_updater/crx_update_item.h +++ b/chrome/browser/component_updater/crx_update_item.h @@ -84,8 +84,8 @@ struct CrxUpdateItem { std::vector<GURL> crx_diffurls; // The from/to version and fingerprint values. - base::Version previous_version; - base::Version next_version; + Version previous_version; + Version next_version; std::string previous_fp; std::string next_fp; diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index ccfd49e..f21234b 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -96,7 +96,7 @@ base::FilePath GetPepperFlashBaseDirectory() { // |latest_version| returns the corresponding version number. |older_dirs| // returns directories of all older versions. bool GetPepperFlashDirectory(base::FilePath* latest_dir, - base::Version* latest_version, + Version* latest_version, std::vector<base::FilePath>* older_dirs) { base::FilePath base_dir = GetPepperFlashBaseDirectory(); bool found = false; @@ -104,7 +104,7 @@ bool GetPepperFlashDirectory(base::FilePath* latest_dir, file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - base::Version version(path.BaseName().MaybeAsASCII()); + Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (found) { @@ -138,7 +138,7 @@ bool SupportsPepperInterface(const char* interface_name) { } bool MakePepperFlashPluginInfo(const base::FilePath& flash_path, - const base::Version& flash_version, + const Version& flash_version, bool out_of_process, content::PepperPluginInfo* plugin_info) { if (!flash_version.IsValid()) @@ -179,7 +179,7 @@ bool IsPepperFlash(const content::WebPluginInfo& plugin) { } void RegisterPepperFlashWithChrome(const base::FilePath& path, - const base::Version& version) { + const Version& version) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); content::PepperPluginInfo plugin_info; if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) @@ -193,7 +193,7 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path, continue; // Do it only if the version we're trying to register is newer. - base::Version registered_version(base::UTF16ToUTF8(it->version)); + Version registered_version(base::UTF16ToUTF8(it->version)); if (registered_version.IsValid() && version.CompareTo(registered_version) <= 0) { return; @@ -245,7 +245,7 @@ bool CheckPepperFlashInterfaces(const base::DictionaryValue& manifest) { class PepperFlashComponentInstaller : public ComponentInstaller { public: - explicit PepperFlashComponentInstaller(const base::Version& version); + explicit PepperFlashComponentInstaller(const Version& version); virtual ~PepperFlashComponentInstaller() {} @@ -258,11 +258,11 @@ class PepperFlashComponentInstaller : public ComponentInstaller { base::FilePath* installed_file) OVERRIDE; private: - base::Version current_version_; + Version current_version_; }; PepperFlashComponentInstaller::PepperFlashComponentInstaller( - const base::Version& version) : current_version_(version) { + const Version& version) : current_version_(version) { DCHECK(version.IsValid()); } @@ -273,7 +273,7 @@ void PepperFlashComponentInstaller::OnUpdateError(int error) { bool PepperFlashComponentInstaller::Install( const base::DictionaryValue& manifest, const base::FilePath& unpack_path) { - base::Version version; + Version version; if (!CheckPepperFlashManifest(manifest, &version)) return false; if (current_version_.CompareTo(version) > 0) @@ -305,7 +305,7 @@ bool PepperFlashComponentInstaller::GetInstalledFile( } bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, - base::Version* version_out) { + Version* version_out) { std::string name; manifest.GetStringASCII("name", &name); // TODO(viettrungluu): Support WinFlapper for now, while we change the format @@ -316,7 +316,7 @@ bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - base::Version version(proposed_version.c_str()); + Version version(proposed_version.c_str()); if (!version.IsValid()) return false; @@ -347,7 +347,7 @@ namespace { #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus, - const base::Version& version) { + const Version& version) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CrxComponent pepflash; pepflash.name = "pepper_flash"; @@ -369,7 +369,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { } } - base::Version version(kNullVersion); + Version version(kNullVersion); std::vector<base::FilePath> older_dirs; if (GetPepperFlashDirectory(&path, &version, &older_dirs)) { path = path.Append(chrome::kPepperFlashPluginFilename); @@ -378,7 +378,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { BrowserThread::UI, FROM_HERE, base::Bind(&RegisterPepperFlashWithChrome, path, version)); } else { - version = base::Version(kNullVersion); + version = Version(kNullVersion); } } diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc index b7e9d2d..2f9a10e 100644 --- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc +++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc @@ -90,7 +90,7 @@ void OverrideDirPnaclComponent(const base::FilePath& base_path) { bool GetLatestPnaclDirectory(PnaclComponentInstaller* pci, base::FilePath* latest_dir, - base::Version* latest_version, + Version* latest_version, std::vector<base::FilePath>* older_dirs) { // Enumerate all versions starting from the base directory. base::FilePath base_dir = pci->GetPnaclBaseDirectory(); @@ -99,7 +99,7 @@ bool GetLatestPnaclDirectory(PnaclComponentInstaller* pci, file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - base::Version version(path.BaseName().MaybeAsASCII()); + Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (found) { @@ -155,7 +155,7 @@ base::DictionaryValue* ReadComponentManifest( // PNaCl manifest indicates this is the correct arch-specific package. bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, const base::DictionaryValue& pnacl_manifest, - base::Version* version_out) { + Version* version_out) { // Make sure we have the right |manifest| file. std::string name; if (!manifest.GetStringASCII("name", &name)) { @@ -177,7 +177,7 @@ bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, LOG(WARNING) << "'version' field is missing from manifest!"; return false; } - base::Version version(proposed_version.c_str()); + Version version(proposed_version.c_str()); if (!version.IsValid()) { LOG(WARNING) << "'version' field in manifest is invalid " << version.GetString(); @@ -259,7 +259,7 @@ bool PnaclComponentInstaller::Install(const base::DictionaryValue& manifest, return false; } - base::Version version; + Version version; if (!CheckPnaclComponentManifest(manifest, *pnacl_manifest, &version)) { LOG(WARNING) << "CheckPnaclComponentManifest failed, not installing."; return false; @@ -297,7 +297,7 @@ bool PnaclComponentInstaller::Install(const base::DictionaryValue& manifest, // |installed_file| actually exists. bool PnaclComponentInstaller::GetInstalledFile( const std::string& file, base::FilePath* installed_file) { - if (current_version().Equals(base::Version(kNullVersion))) + if (current_version().Equals(Version(kNullVersion))) return false; *installed_file = GetPnaclBaseDirectory().AppendASCII( @@ -318,7 +318,7 @@ CrxComponent PnaclComponentInstaller::GetCrxComponent() { namespace { -void FinishPnaclUpdateRegistration(const base::Version& current_version, +void FinishPnaclUpdateRegistration(const Version& current_version, const std::string& current_fingerprint, PnaclComponentInstaller* pci) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -347,7 +347,7 @@ void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) { } } - base::Version current_version(kNullVersion); + Version current_version(kNullVersion); std::string current_fingerprint; std::vector<base::FilePath> older_dirs; if (GetLatestPnaclDirectory(pci, &path, ¤t_version, &older_dirs)) { @@ -355,7 +355,7 @@ void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) { ReadComponentManifest(path)); scoped_ptr<base::DictionaryValue> pnacl_manifest( ReadPnaclManifest(path)); - base::Version manifest_version; + Version manifest_version; // Check that the component manifest and PNaCl manifest files // are legit, and that the indicated version matches the one // encoded within the path name. @@ -364,7 +364,7 @@ void StartPnaclUpdateRegistration(PnaclComponentInstaller* pci) { *pnacl_manifest, &manifest_version) || !current_version.Equals(manifest_version)) { - current_version = base::Version(kNullVersion); + current_version = Version(kNullVersion); } else { OverrideDirPnaclComponent(path); base::ReadFileToString(path.AppendASCII("manifest.fingerprint"), diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc index 3d04f29..db620fe 100644 --- a/chrome/browser/component_updater/recovery_component_installer.cc +++ b/chrome/browser/component_updater/recovery_component_installer.cc @@ -46,7 +46,7 @@ const char kRecoveryManifestName[] = "ChromeRecovery"; class RecoveryComponentInstaller : public ComponentInstaller { public: - explicit RecoveryComponentInstaller(const base::Version& version, + explicit RecoveryComponentInstaller(const Version& version, PrefService* prefs); virtual ~RecoveryComponentInstaller() {} @@ -60,14 +60,14 @@ class RecoveryComponentInstaller : public ComponentInstaller { base::FilePath* installed_file) OVERRIDE; private: - base::Version current_version_; + Version current_version_; PrefService* prefs_; }; void RecoveryRegisterHelper(ComponentUpdateService* cus, PrefService* prefs) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - base::Version version(prefs->GetString(prefs::kRecoveryComponentVersion)); + Version version(prefs->GetString(prefs::kRecoveryComponentVersion)); if (!version.IsValid()) { NOTREACHED(); return; @@ -83,14 +83,13 @@ void RecoveryRegisterHelper(ComponentUpdateService* cus, } } -void RecoveryUpdateVersionHelper(const base::Version& version, - PrefService* prefs) { +void RecoveryUpdateVersionHelper(const Version& version, PrefService* prefs) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString()); } RecoveryComponentInstaller::RecoveryComponentInstaller( - const base::Version& version, PrefService* prefs) + const Version& version, PrefService* prefs) : current_version_(version), prefs_(prefs){ DCHECK(version.IsValid()); } @@ -107,7 +106,7 @@ bool RecoveryComponentInstaller::Install(const base::DictionaryValue& manifest, return false; std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - base::Version version(proposed_version.c_str()); + Version version(proposed_version.c_str()); if (!version.IsValid()) return false; if (current_version_.CompareTo(version) >= 0) diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc index 4e63685..038c294 100644 --- a/chrome/browser/component_updater/swiftshader_component_installer.cc +++ b/chrome/browser/component_updater/swiftshader_component_installer.cc @@ -60,7 +60,7 @@ base::FilePath GetSwiftShaderBaseDirectory() { // On success it returns something like: // <profile>\AppData\Local\Google\Chrome\User Data\SwiftShader\10.3.44.555\. bool GetLatestSwiftShaderDirectory(base::FilePath* result, - base::Version* latest, + Version* latest, std::vector<base::FilePath>* older_dirs) { base::FilePath base_dir = GetSwiftShaderBaseDirectory(); bool found = false; @@ -68,7 +68,7 @@ bool GetLatestSwiftShaderDirectory(base::FilePath* result, file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - base::Version version(path.BaseName().MaybeAsASCII()); + Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (version.CompareTo(*latest) > 0 && @@ -96,7 +96,7 @@ void RegisterSwiftShaderWithChrome(const base::FilePath& path) { class SwiftShaderComponentInstaller : public ComponentInstaller { public: - explicit SwiftShaderComponentInstaller(const base::Version& version); + explicit SwiftShaderComponentInstaller(const Version& version); virtual ~SwiftShaderComponentInstaller() {} @@ -109,11 +109,11 @@ class SwiftShaderComponentInstaller : public ComponentInstaller { base::FilePath* installed_file) OVERRIDE; private: - base::Version current_version_; + Version current_version_; }; SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( - const base::Version& version) : current_version_(version) { + const Version& version) : current_version_(version) { DCHECK(version.IsValid()); } @@ -130,7 +130,7 @@ bool SwiftShaderComponentInstaller::Install( return false; std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - base::Version version(proposed_version.c_str()); + Version version(proposed_version.c_str()); if (!version.IsValid()) return false; if (current_version_.CompareTo(version) >= 0) @@ -158,7 +158,7 @@ bool SwiftShaderComponentInstaller::GetInstalledFile( } void FinishSwiftShaderUpdateRegistration(ComponentUpdateService* cus, - const base::Version& version) { + const Version& version) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CrxComponent swiftshader; @@ -195,7 +195,7 @@ void UpdateChecker::OnGpuInfoUpdate() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::FilePath path = GetSwiftShaderBaseDirectory(); - base::Version version(kNullVersion); + Version version(kNullVersion); GetLatestSwiftShaderDirectory(&path, &version, NULL); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, @@ -215,7 +215,7 @@ void RegisterSwiftShaderPath(ComponentUpdateService* cus) { } } - base::Version version(kNullVersion); + Version version(kNullVersion); std::vector<base::FilePath> older_dirs; if (GetLatestSwiftShaderDirectory(&path, &version, &older_dirs)) BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, diff --git a/chrome/browser/component_updater/test/component_installers_unittest.cc b/chrome/browser/component_updater/test/component_installers_unittest.cc index f4d77a1..e9c86d6 100644 --- a/chrome/browser/component_updater/test/component_installers_unittest.cc +++ b/chrome/browser/component_updater/test/component_installers_unittest.cc @@ -78,7 +78,7 @@ TEST(ComponentInstallerTest, MAYBE_PepperFlashCheck) { ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); // This checks that the whole manifest is compatible. - base::Version version; + Version version; EXPECT_TRUE(CheckPepperFlashManifest(*root, &version)); EXPECT_TRUE(version.IsValid()); } diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc index bcb0c42..3889db2 100644 --- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc @@ -209,7 +209,7 @@ TestConfigurator* ComponentUpdaterTest::test_configurator() { ComponentUpdateService::Status ComponentUpdaterTest::RegisterComponent( CrxComponent* com, TestComponents component, - const base::Version& version, + const Version& version, TestInstaller* installer) { if (component == kTestComponent_abag) { com->name = "test_abag"; @@ -288,7 +288,7 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) { EXPECT_EQ(ComponentUpdateService::kOk, RegisterComponent(&com, kTestComponent_abag, - base::Version("1.1"), + Version("1.1"), &installer)); // We loop twice, but there are no updates so we expect two sleep messages. @@ -426,13 +426,11 @@ TEST_F(ComponentUpdaterTest, InstallCrx) { TestInstaller installer1; CrxComponent com1; com1.observer = &observer1; - RegisterComponent( - &com1, kTestComponent_jebg, base::Version("0.9"), &installer1); + RegisterComponent(&com1, kTestComponent_jebg, Version("0.9"), &installer1); TestInstaller installer2; CrxComponent com2; com2.observer = &observer2; - RegisterComponent( - &com2, kTestComponent_abag, base::Version("2.2"), &installer2); + RegisterComponent(&com2, kTestComponent_abag, Version("2.2"), &installer2); test_configurator()->SetLoopCount(2); component_updater()->Start(); @@ -497,8 +495,7 @@ TEST_F(ComponentUpdaterTest, ProdVersionCheck) { TestInstaller installer; CrxComponent com; - RegisterComponent( - &com, kTestComponent_jebg, base::Version("0.9"), &installer); + RegisterComponent(&com, kTestComponent_jebg, Version("0.9"), &installer); test_configurator()->SetLoopCount(1); component_updater()->Start(); @@ -588,13 +585,11 @@ TEST_F(ComponentUpdaterTest, OnDemandUpdate) { TestInstaller installer1; CrxComponent com1; com1.observer = &observer1; - RegisterComponent( - &com1, kTestComponent_abag, base::Version("2.2"), &installer1); + RegisterComponent(&com1, kTestComponent_abag, Version("2.2"), &installer1); TestInstaller installer2; CrxComponent com2; com2.observer = &observer2; - RegisterComponent( - &com2, kTestComponent_jebg, base::Version("0.9"), &installer2); + RegisterComponent(&com2, kTestComponent_jebg, Version("0.9"), &installer2); // No update normally. test_configurator()->SetLoopCount(1); @@ -815,13 +810,11 @@ TEST_F(ComponentUpdaterTest, CheckReRegistration) { TestInstaller installer1; CrxComponent com1; com1.observer = &observer1; - RegisterComponent( - &com1, kTestComponent_jebg, base::Version("0.9"), &installer1); + RegisterComponent(&com1, kTestComponent_jebg, Version("0.9"), &installer1); TestInstaller installer2; CrxComponent com2; com2.observer = &observer2; - RegisterComponent( - &com2, kTestComponent_abag, base::Version("2.2"), &installer2); + RegisterComponent(&com2, kTestComponent_abag, Version("2.2"), &installer2); // Loop twice to issue two checks: (1) with original 0.9 version, update to // 1.0, and do the second check (2) with the updated 1.0 version. @@ -891,7 +884,7 @@ TEST_F(ComponentUpdaterTest, CheckReRegistration) { EXPECT_EQ(ComponentUpdateService::kReplaced, RegisterComponent(&com1, kTestComponent_jebg, - base::Version("2.2"), + Version("2.2"), &installer3)); // Loop once just to notice the check happening with the re-register version. @@ -949,8 +942,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdate) { VersionedTestInstaller installer; CrxComponent com; - RegisterComponent( - &com, kTestComponent_ihfo, base::Version("0.0"), &installer); + RegisterComponent(&com, kTestComponent_ihfo, Version("0.0"), &installer); test_configurator()->SetLoopCount(3); component_updater()->Start(); @@ -1021,8 +1013,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdateFails) { TestInstaller installer; CrxComponent com; - RegisterComponent( - &com, kTestComponent_ihfo, base::Version("1.0"), &installer); + RegisterComponent(&com, kTestComponent_ihfo, Version("1.0"), &installer); test_configurator()->SetLoopCount(2); component_updater()->Start(); @@ -1088,8 +1079,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdateFails) { // Loop twice to issue two checks: (1) with original 0.9 version // and (2), which should retry with 0.9. CrxComponent com; - RegisterComponent( - &com, kTestComponent_jebg, base::Version("0.9"), &installer); + RegisterComponent(&com, kTestComponent_jebg, Version("0.9"), &installer); test_configurator()->SetLoopCount(2); component_updater()->Start(); @@ -1177,8 +1167,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdateFailErrorcode) { VersionedTestInstaller installer; CrxComponent com; - RegisterComponent( - &com, kTestComponent_ihfo, base::Version("0.0"), &installer); + RegisterComponent(&com, kTestComponent_ihfo, Version("0.0"), &installer); test_configurator()->SetLoopCount(3); component_updater()->Start(); @@ -1283,7 +1272,7 @@ TEST_F(ComponentUpdaterTest, ResourceThrottleDeletedNoUpdate) { EXPECT_EQ(ComponentUpdateService::kOk, RegisterComponent(&com, kTestComponent_abag, - base::Version("1.1"), + Version("1.1"), &installer)); // The following two calls ensure that we don't do an update check via the // timer, so the only update check should be the on-demand one. @@ -1368,7 +1357,7 @@ TEST_F(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate) { EXPECT_EQ(ComponentUpdateService::kOk, RegisterComponent(&com, kTestComponent_abag, - base::Version("1.1"), + Version("1.1"), &installer)); // The following two calls ensure that we don't do an update check via the // timer, so the only update check should be the on-demand one. diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.h b/chrome/browser/component_updater/test/component_updater_service_unittest.h index e26e1bb..b776f29 100644 --- a/chrome/browser/component_updater/test/component_updater_service_unittest.h +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.h @@ -128,7 +128,7 @@ class ComponentUpdaterTest : public testing::Test { ComponentUpdateService::Status RegisterComponent(CrxComponent* com, TestComponents component, - const base::Version& version, + const Version& version, TestInstaller* installer); protected: diff --git a/chrome/browser/component_updater/test/test_installer.cc b/chrome/browser/component_updater/test/test_installer.cc index e6796f2..62ae494 100644 --- a/chrome/browser/component_updater/test/test_installer.cc +++ b/chrome/browser/component_updater/test/test_installer.cc @@ -59,7 +59,7 @@ bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest, const base::FilePath& unpack_path) { std::string version_string; manifest.GetStringASCII("version", &version_string); - base::Version version(version_string.c_str()); + Version version(version_string.c_str()); base::FilePath path; path = install_directory_.AppendASCII(version.GetString()); diff --git a/chrome/browser/component_updater/test/test_installer.h b/chrome/browser/component_updater/test/test_installer.h index 11d0419..2233d88 100644 --- a/chrome/browser/component_updater/test/test_installer.h +++ b/chrome/browser/component_updater/test/test_installer.h @@ -67,7 +67,7 @@ class VersionedTestInstaller : public TestInstaller { private: base::FilePath install_directory_; - base::Version current_version_; + Version current_version_; }; #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_TEST_INSTALLER_H_ diff --git a/chrome/browser/component_updater/update_response.cc b/chrome/browser/component_updater/update_response.cc index f1f4b2c..cf93658 100644 --- a/chrome/browser/component_updater/update_response.cc +++ b/chrome/browser/component_updater/update_response.cc @@ -146,7 +146,7 @@ bool ParseManifestTag(xmlNode* manifest, *error = "Missing version for manifest."; return false; } - base::Version version(result->manifest.version); + Version version(result->manifest.version); if (!version.IsValid()) { *error = "Invalid version: '"; *error += result->manifest.version; @@ -158,7 +158,7 @@ bool ParseManifestTag(xmlNode* manifest, result->manifest.browser_min_version = GetAttribute(manifest, "prodversionmin"); if (result->manifest.browser_min_version.length()) { - base::Version browser_min_version(result->manifest.browser_min_version); + Version browser_min_version(result->manifest.browser_min_version); if (!browser_min_version.IsValid()) { *error = "Invalid prodversionmin: '"; *error += result->manifest.browser_min_version; diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index 746cc07..80fa255 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -384,9 +384,9 @@ ModuleEnumerator::ModuleStatus ModuleEnumerator::Match( location_hash == blacklisted.location)) { // We have a name match against the blacklist (and possibly location match // also), so check version. - base::Version module_version(UTF16ToASCII(module.version)); - base::Version version_min(blacklisted.version_from); - base::Version version_max(blacklisted.version_to); + Version module_version(UTF16ToASCII(module.version)); + Version version_min(blacklisted.version_from); + Version version_max(blacklisted.version_to); bool version_ok = !version_min.IsValid() && !version_max.IsValid(); if (!version_ok) { bool too_low = version_min.IsValid() && diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc index 95cc8ee..03ce5ce 100644 --- a/chrome/browser/extensions/api/runtime/runtime_api.cc +++ b/chrome/browser/extensions/api/runtime/runtime_api.cc @@ -215,7 +215,7 @@ void RuntimeAPI::OnExtensionLoaded(const Extension* extension) { base::Bind(&RuntimeEventRouter::DispatchOnInstalledEvent, browser_context_, extension->id(), - base::Version(), + Version(), true)); } @@ -224,7 +224,7 @@ void RuntimeAPI::OnExtensionInstalled(const Extension* extension) { ExtensionService* service = ExtensionSystem::GetForBrowserContext( browser_context_)->extension_service(); const Extension* old = service->GetExtensionById(extension->id(), true); - base::Version old_version; + Version old_version; if (old) old_version = *old->version(); @@ -269,7 +269,7 @@ void RuntimeEventRouter::DispatchOnStartupEvent( void RuntimeEventRouter::DispatchOnInstalledEvent( content::BrowserContext* context, const std::string& extension_id, - const base::Version& old_version, + const Version& old_version, bool chrome_updated) { if (!ExtensionsBrowserClient::Get()->IsValidContext(context)) return; @@ -477,10 +477,9 @@ void RuntimeRequestUpdateCheckFunction::Observe( return; DCHECK(type == chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND); - typedef const std::pair<std::string, base::Version> UpdateDetails; + typedef const std::pair<std::string, Version> UpdateDetails; const std::string& id = content::Details<UpdateDetails>(details)->first; - const base::Version& version = - content::Details<UpdateDetails>(details)->second; + const Version& version = content::Details<UpdateDetails>(details)->second; if (id == extension_id()) { ReplyUpdateFound(version.GetString()); } diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index b4189a6..e5d5e50 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -153,7 +153,7 @@ CrxInstaller::CrxInstaller( expected_id_ = approval->extension_id; } if (approval->minimum_version.get()) { - expected_version_.reset(new base::Version(*approval->minimum_version)); + expected_version_.reset(new Version(*approval->minimum_version)); expected_version_strict_checking_ = false; } @@ -482,7 +482,7 @@ void CrxInstaller::CheckImportsAndRequirements() { SharedModuleInfo::GetImports(extension()); std::vector<SharedModuleInfo::ImportInfo>::const_iterator i; for (i = imports.begin(); i != imports.end(); ++i) { - base::Version version_required(i->minimum_version); + Version version_required(i->minimum_version); const Extension* imported_module = service->GetExtensionById(i->extension_id, true); if (imported_module && @@ -660,7 +660,7 @@ void CrxInstaller::CompleteInstall() { DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); if (!current_version_.empty()) { - base::Version current_version(current_version_); + Version current_version(current_version_); if (current_version.CompareTo(*(extension()->version())) > 0) { ReportFailureFromFileThread( CrxInstallerError( diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index 87f650b..7facb81 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h @@ -125,8 +125,8 @@ class CrxInstaller const std::string& expected_id() const { return expected_id_; } void set_expected_id(const std::string& val) { expected_id_ = val; } - void set_expected_version(const base::Version& val) { - expected_version_.reset(new base::Version(val)); + void set_expected_version(const Version& val) { + expected_version_.reset(new Version(val)); expected_version_strict_checking_ = true; } @@ -297,7 +297,7 @@ class CrxInstaller // installing. Important for external sources, where claiming the wrong // version could cause unnecessary unpacking of an extension at every // restart. - scoped_ptr<base::Version> expected_version_; + scoped_ptr<Version> expected_version_; // If true, the actual version should be same with the |expected_version_|, // Otherwise the actual version should be equal to or newer than diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index fdfde83..7eff5d9 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -1827,7 +1827,7 @@ void ExtensionService::AddExtension(const Extension* extension) { void ExtensionService::AddComponentExtension(const Extension* extension) { const std::string old_version_string( extension_prefs_->GetVersionString(extension->id())); - const base::Version old_version(old_version_string); + const Version old_version(old_version_string); VLOG(1) << "AddComponentExtension " << extension->name(); if (!old_version.IsValid() || !old_version.Equals(*extension->version())) { @@ -2003,7 +2003,7 @@ ExtensionService::ImportStatus ExtensionService::CheckImports( SharedModuleInfo::GetImports(extension); std::vector<SharedModuleInfo::ImportInfo>::const_iterator i; for (i = imports.begin(); i != imports.end(); ++i) { - base::Version version_required(i->minimum_version); + Version version_required(i->minimum_version); const Extension* imported_module = GetExtensionById(i->extension_id, true); if (!imported_module) { @@ -2400,7 +2400,7 @@ bool ExtensionService::ShouldBlockUrlInBrowserTab(GURL* url) { bool ExtensionService::OnExternalExtensionFileFound( const std::string& id, - const base::Version* version, + const Version* version, const base::FilePath& path, Manifest::Location location, int creation_flags, diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 6dae5fc..eafc32d 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -250,7 +250,7 @@ class MockExtensionProvider : public extensions::ExternalProviderInterface { visit_count_++; for (DataMap::const_iterator i = extension_map_.begin(); i != extension_map_.end(); ++i) { - base::Version version(i->second.first); + Version version(i->second.first); visitor_->OnExternalExtensionFileFound( i->first, &version, i->second.second, location_, @@ -266,13 +266,13 @@ class MockExtensionProvider : public extensions::ExternalProviderInterface { virtual bool GetExtensionDetails( const std::string& id, Manifest::Location* location, - scoped_ptr<base::Version>* version) const OVERRIDE { + scoped_ptr<Version>* version) const OVERRIDE { DataMap::const_iterator it = extension_map_.find(id); if (it == extension_map_.end()) return false; if (version) - version->reset(new base::Version(it->second.first)); + version->reset(new Version(it->second.first)); if (location) *location = location_; @@ -361,7 +361,7 @@ class MockProviderVisitor } virtual bool OnExternalExtensionFileFound(const std::string& id, - const base::Version* version, + const Version* version, const base::FilePath& path, Manifest::Location unused, int creation_flags, @@ -385,13 +385,13 @@ class MockProviderVisitor // Ask provider if the extension we got back is registered. Manifest::Location location = Manifest::INVALID_LOCATION; - scoped_ptr<base::Version> v1; + scoped_ptr<Version> v1; base::FilePath crx_path; EXPECT_TRUE(provider_->GetExtensionDetails(id, NULL, &v1)); EXPECT_STREQ(version->GetString().c_str(), v1->GetString().c_str()); - scoped_ptr<base::Version> v2; + scoped_ptr<Version> v2; EXPECT_TRUE(provider_->GetExtensionDetails(id, &location, &v2)); EXPECT_STREQ(version->GetString().c_str(), v1->GetString().c_str()); EXPECT_STREQ(version->GetString().c_str(), v2->GetString().c_str()); @@ -421,7 +421,7 @@ class MockProviderVisitor EXPECT_TRUE(provider_->HasExtension(id)); // External extensions with update URLs do not have versions. - scoped_ptr<base::Version> v1; + scoped_ptr<Version> v1; Manifest::Location location1 = Manifest::INVALID_LOCATION; EXPECT_TRUE(provider_->GetExtensionDetails(id, &location1, &v1)); EXPECT_FALSE(v1.get()); @@ -1777,7 +1777,7 @@ TEST_F(ExtensionServiceTest, InstallingExternalExtensionWithFlags) { set_extensions_enabled(true); // Register and install an external extension. - base::Version version("1.0.0.0"); + Version version("1.0.0.0"); content::WindowedNotificationObserver observer( chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1813,7 +1813,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { set_extensions_enabled(true); // Install an external extension. - base::Version version("1.0.0.0"); + Version version("1.0.0.0"); content::WindowedNotificationObserver observer( chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1839,7 +1839,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { ValidateIntegerPref(good_crx, "location", Extension::EXTERNAL_EXTENSION_UNINSTALLED); - version = base::Version("1.0.0.1"); + version = Version("1.0.0.1"); // Repeat the same thing with a newer version of the extension. path = data_dir_.AppendASCII("good2.crx"); service_->OnExternalExtensionFileFound(good_crx, &version, @@ -1895,7 +1895,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongId) { base::FilePath path = data_dir_.AppendASCII("good.crx"); set_extensions_enabled(true); - base::Version version("1.0.0.0"); + Version version("1.0.0.0"); const std::string wrong_id = all_zero; const std::string correct_id = good_crx; @@ -1933,7 +1933,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) { // Install an external extension with a version from the external // source that is not equal to the version in the extension manifest. - base::Version wrong_version("1.2.3.4"); + Version wrong_version("1.2.3.4"); content::WindowedNotificationObserver observer( chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1946,7 +1946,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) { // Try again with the right version. Expect success. service_->pending_extension_manager()->Remove(good_crx); - base::Version correct_version("1.0.0.0"); + Version correct_version("1.0.0.0"); content::WindowedNotificationObserver observer2( chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -3351,7 +3351,7 @@ TEST_F(ExtensionServiceTest, UpdatePendingExtensionAlreadyInstalled) { // Use AddExtensionImpl() as AddFrom*() would balk. service_->pending_extension_manager()->AddExtensionImpl( good->id(), extensions::ManifestURL::GetUpdateURL(good), - base::Version(), &IsExtension, kGoodIsFromSync, + Version(), &IsExtension, kGoodIsFromSync, kGoodInstallSilently, Manifest::INTERNAL, Extension::NO_FLAGS, false); UpdateExtension(good->id(), path, ENABLED); @@ -6076,8 +6076,8 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalUpdateUrl) { } TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) { - base::Version older_version("0.1.0.0"); - base::Version newer_version("2.0.0.0"); + Version older_version("0.1.0.0"); + Version newer_version("2.0.0.0"); // We don't want the extension to be installed. A path that doesn't // point to a valid CRX ensures this. @@ -6255,9 +6255,9 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) { } TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) { - base::Version kVersion123("1.2.3"); - base::Version kVersion124("1.2.4"); - base::Version kVersion125("1.2.5"); + Version kVersion123("1.2.3"); + Version kVersion124("1.2.4"); + Version kVersion125("1.2.5"); const base::FilePath kInvalidPathToCrx = base::FilePath(); const int kCreationFlags = 0; const bool kDontMarkAcknowledged = false; @@ -6361,7 +6361,7 @@ class ExtensionSourcePriorityTest : public ExtensionServiceTest { // Fake an external file from external_extensions.json. bool AddPendingExternalPrefFileInstall() { - base::Version version("1.0.0.0"); + Version version("1.0.0.0"); return service_->OnExternalExtensionFileFound( crx_id_, &version, crx_path_, Manifest::EXTERNAL_PREF, diff --git a/chrome/browser/extensions/extension_sync_data.cc b/chrome/browser/extensions/extension_sync_data.cc index 09d0358..2371867 100644 --- a/chrome/browser/extensions/extension_sync_data.cc +++ b/chrome/browser/extensions/extension_sync_data.cc @@ -79,7 +79,7 @@ void ExtensionSyncData::PopulateFromExtensionSpecifics( LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; } - base::Version specifics_version(specifics.version()); + Version specifics_version(specifics.version()); if (!specifics_version.IsValid()) LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; diff --git a/chrome/browser/extensions/extension_sync_data.h b/chrome/browser/extensions/extension_sync_data.h index 1f89794..8fbe73a 100644 --- a/chrome/browser/extensions/extension_sync_data.h +++ b/chrome/browser/extensions/extension_sync_data.h @@ -59,7 +59,7 @@ class ExtensionSyncData { // Version-dependent properties (i.e., should be used only when the // version of the currenty-installed extension matches |version|). - const base::Version& version() const { return version_; } + const Version& version() const { return version_; } const GURL& update_url() const { return update_url_; } // Used only for debugging. const std::string& name() const { return name_; } @@ -72,7 +72,7 @@ class ExtensionSyncData { bool uninstalled_; bool enabled_; bool incognito_enabled_; - base::Version version_; + Version version_; GURL update_url_; std::string name_; }; diff --git a/chrome/browser/extensions/extension_sync_data_unittest.cc b/chrome/browser/extensions/extension_sync_data_unittest.cc index 70cf3a2..46b3549 100644 --- a/chrome/browser/extensions/extension_sync_data_unittest.cc +++ b/chrome/browser/extensions/extension_sync_data_unittest.cc @@ -6,6 +6,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" +#include "base/version.h" #include "sync/protocol/extension_specifics.pb.h" #include "sync/protocol/sync.pb.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index f889f75..8f70dba 100644 --- a/chrome/browser/extensions/external_policy_loader_unittest.cc +++ b/chrome/browser/extensions/external_policy_loader_unittest.cc @@ -70,7 +70,7 @@ class MockExternalPolicyProviderVisitor } virtual bool OnExternalExtensionFileFound(const std::string& id, - const base::Version* version, + const Version* version, const base::FilePath& path, Manifest::Location unused, int unused2, @@ -87,7 +87,7 @@ class MockExternalPolicyProviderVisitor // Provider returns the correct location when asked. Manifest::Location location1; - scoped_ptr<base::Version> version1; + scoped_ptr<Version> version1; provider_->GetExtensionDetails(id, &location1, &version1); EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1); EXPECT_FALSE(version1.get()); diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index 1eebfc1..1a85f5f 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc @@ -246,7 +246,7 @@ void ExternalProviderImpl::SetPrefs(base::DictionaryValue* prefs) { path = base_path.Append(external_crx); } - base::Version version(external_version); + Version version(external_version); if (!version.IsValid()) { LOG(WARNING) << "Malformed extension dictionary for extension: " << extension_id.c_str() << ". Invalid version string \"" @@ -305,7 +305,7 @@ bool ExternalProviderImpl::HasExtension( bool ExternalProviderImpl::GetExtensionDetails( const std::string& id, Manifest::Location* location, - scoped_ptr<base::Version>* version) const { + scoped_ptr<Version>* version) const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(prefs_.get()); CHECK(ready_); @@ -325,7 +325,7 @@ bool ExternalProviderImpl::GetExtensionDetails( return false; if (version) - version->reset(new base::Version(external_version)); + version->reset(new Version(external_version)); } else { NOTREACHED(); // Chrome should not allow prefs to get into this state. diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index 95eab90..ed8e2c0 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -146,7 +146,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - base::Version version(WideToASCII(extension_version)); + Version version(WideToASCII(extension_version)); if (!version.IsValid()) { LOG(ERROR) << "Invalid version value " << extension_version << " for key " << key_path << "."; diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc index 44fee7f..ca4193c 100644 --- a/chrome/browser/extensions/updater/extension_downloader.cc +++ b/chrome/browser/extensions/updater/extension_downloader.cc @@ -96,8 +96,7 @@ bool ShouldRetryRequest(const net::URLRequestStatus& status, } // namespace -UpdateDetails::UpdateDetails(const std::string& id, - const base::Version& version) +UpdateDetails::UpdateDetails(const std::string& id, const Version& version) : id(id), version(version) {} UpdateDetails::~UpdateDetails() {} @@ -161,7 +160,7 @@ bool ExtensionDownloader::AddPendingExtension(const std::string& id, // Use a zero version to ensure that a pending extension will always // be updated, and thus installed (assuming all extensions have // non-zero versions). - base::Version version("0.0.0.0"); + Version version("0.0.0.0"); DCHECK(version.IsValid()); return AddExtensionData(id, @@ -206,7 +205,7 @@ void ExtensionDownloader::StartBlacklistUpdate( } bool ExtensionDownloader::AddExtensionData(const std::string& id, - const base::Version& version, + const Version& version, Manifest::Type extension_type, const GURL& extension_update_url, const std::string& update_url_data, @@ -531,7 +530,7 @@ void ExtensionDownloader::DetermineUpdates( std::vector<int>* result) { // This will only be valid if one of possible_updates specifies // browser_min_version. - base::Version browser_version; + Version browser_version; for (size_t i = 0; i < possible_updates.list.size(); i++) { const UpdateManifest::Result* update = &possible_updates.list[i]; @@ -562,8 +561,8 @@ void ExtensionDownloader::DetermineUpdates( VLOG(2) << id << " is at '" << version << "'"; - base::Version existing_version(version); - base::Version update_version(update->version); + Version existing_version(version); + Version update_version(update->version); if (!update_version.IsValid() || update_version.CompareTo(existing_version) <= 0) { @@ -577,9 +576,9 @@ void ExtensionDownloader::DetermineUpdates( if (!browser_version.IsValid()) { chrome::VersionInfo version_info; if (version_info.is_valid()) - browser_version = base::Version(version_info.Version()); + browser_version = Version(version_info.Version()); } - base::Version browser_min_version(update->browser_min_version); + Version browser_min_version(update->browser_min_version); if (browser_version.IsValid() && browser_min_version.IsValid() && browser_min_version.CompareTo(browser_version) > 0) { // TODO(asargent) - We may want this to show up in the extensions UI @@ -706,7 +705,7 @@ void ExtensionDownloader::NotifyExtensionsDownloadFailed( void ExtensionDownloader::NotifyUpdateFound(const std::string& id, const std::string& version) { - UpdateDetails updateInfo(id, base::Version(version)); + UpdateDetails updateInfo(id, Version(version)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, content::NotificationService::AllBrowserContextsAndSources(), diff --git a/chrome/browser/extensions/updater/extension_downloader_delegate.cc b/chrome/browser/extensions/updater/extension_downloader_delegate.cc index ee1c2fd..2cddee3 100644 --- a/chrome/browser/extensions/updater/extension_downloader_delegate.cc +++ b/chrome/browser/extensions/updater/extension_downloader_delegate.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/updater/extension_downloader_delegate.h" #include "base/logging.h" +#include "base/version.h" namespace extensions { diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index a6ef7ad..43fadaa 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -311,7 +311,7 @@ void SetupPendingExtensionManagerForTest( pending_extension_manager->AddForTesting( PendingExtensionInfo(id, update_url, - base::Version(), + Version(), should_allow_install, kIsFromSync, kInstallSilently, @@ -987,7 +987,7 @@ class ExtensionUpdaterTest : public testing::Test { std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; std::string hash; - base::Version version("0.0.1"); + Version version("0.0.1"); std::set<int> requests; requests.insert(0); scoped_ptr<ExtensionDownloader::ExtensionFetch> fetch( diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index 89a64a5..ebde012 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -115,7 +115,7 @@ bool UserScriptMaster::ScriptReloader::ParseMetadataHeader( } else if (GetDeclarationValue(line, kNameDeclaration, &value)) { script->set_name(value); } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) { - base::Version version(value); + Version version(value); if (version.IsValid()) script->set_version(version.GetString()); } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) { diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 5325bcf..081226f 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -356,7 +356,7 @@ void WebstoreInstaller::Observe(int type, CHECK_EQ(extension->id(), id_); ReportSuccess(); } else { - const base::Version version_required(info.minimum_version); + const Version version_required(info.minimum_version); if (version_required.IsValid() && extension->version()->CompareTo(version_required) < 0) { // It should not happen, CrxInstaller will make sure the version is @@ -430,11 +430,11 @@ void WebstoreInstaller::OnDownloadStarted( scoped_ptr<Approval> approval = Approval::CreateForSharedModule(profile_); const SharedModuleInfo::ImportInfo& info = pending_modules_.front(); approval->extension_id = info.extension_id; - const base::Version version_required(info.minimum_version); + const Version version_required(info.minimum_version); if (version_required.IsValid()) { approval->minimum_version.reset( - new base::Version(version_required)); + new Version(version_required)); } download_item_->SetUserData(kApprovalKey, approval.release()); } else { diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h index 5679623..99ede0c 100644 --- a/chrome/browser/extensions/webstore_installer.h +++ b/chrome/browser/extensions/webstore_installer.h @@ -149,7 +149,7 @@ class WebstoreInstaller :public content::NotificationObserver, scoped_refptr<Extension> dummy_extension; // Required minimum version. - scoped_ptr<base::Version> minimum_version; + scoped_ptr<Version> minimum_version; // Ephemeral apps (experimental) are not permanently installed in Chrome. bool is_ephemeral; diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc index 3c430fd..47d7465 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc @@ -235,12 +235,12 @@ bool SwapNewChromeExeIfPresent() { if (cmd_line.HasSwitch(switches::kChromeVersion)) { std::string version_string = cmd_line.GetSwitchValueASCII(switches::kChromeVersion); - base::Version cmd_version(version_string); + Version cmd_version(version_string); std::wstring pv_value; if (key.ReadValue(google_update::kRegVersionField, &pv_value) == ERROR_SUCCESS) { - base::Version pv_version(WideToASCII(pv_value)); + Version pv_version(WideToASCII(pv_value)); if (cmd_version.IsValid() && pv_version.IsValid() && !cmd_version.Equals(pv_version)) { return false; diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc index 9d57dc4..4ce6f14 100644 --- a/chrome/browser/hang_monitor/hung_plugin_action.cc +++ b/chrome/browser/hang_monitor/hung_plugin_action.cc @@ -40,7 +40,7 @@ enum GTalkPluginLogVersion { // 10 * major + minor - kGTalkPluginLogMinVersion. GTalkPluginLogVersion GetGTalkPluginVersion(const base::string16& version) { int gtalk_plugin_version = GTALK_PLUGIN_VERSION_MIN; - base::Version plugin_version; + Version plugin_version; content::WebPluginInfo::CreateVersionFromString(version, &plugin_version); if (plugin_version.IsValid() && plugin_version.components().size() >= 2) { gtalk_plugin_version = 10 * plugin_version.components()[0] + diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc index e9d44d9..a14e30f 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc @@ -73,7 +73,7 @@ void RecordDefaultBrowserUMAStat() { void RecordLinuxGlibcVersion() { #if defined(OS_LINUX) && !defined(OS_CHROMEOS) - base::Version version(gnu_get_libc_version()); + Version version(gnu_get_libc_version()); UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; if (version.IsValid() && version.components().size() == 2) { diff --git a/chrome/browser/net/crl_set_fetcher.cc b/chrome/browser/net/crl_set_fetcher.cc index c79837d..0dca1ee 100644 --- a/chrome/browser/net/crl_set_fetcher.cc +++ b/chrome/browser/net/crl_set_fetcher.cc @@ -126,10 +126,10 @@ void CRLSetFetcher::RegisterComponent(uint32 sequence_of_loaded_crl) { kPublicKeySHA256 + sizeof(kPublicKeySHA256)); component.installer = this; component.name = "CRLSet"; - component.version = base::Version(base::UintToString(sequence_of_loaded_crl)); + component.version = Version(base::UintToString(sequence_of_loaded_crl)); if (!component.version.IsValid()) { NOTREACHED(); - component.version = base::Version("0"); + component.version = Version("0"); } if (cus_->RegisterComponent(component) != diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc index 23ece21..31f6db5 100644 --- a/chrome/browser/plugins/plugin_finder.cc +++ b/chrome/browser/plugins/plugin_finder.cc @@ -119,7 +119,7 @@ PluginMetadata* CreatePluginMetadata( PluginMetadata::SECURITY_STATUS_UP_TO_DATE; success = PluginMetadata::ParseSecurityStatus(status_str, &status); DCHECK(success); - plugin->AddVersion(base::Version(version), status); + plugin->AddVersion(Version(version), status); } } diff --git a/chrome/browser/plugins/plugin_installer.h b/chrome/browser/plugins/plugin_installer.h index e3cf859..abcfe6f 100644 --- a/chrome/browser/plugins/plugin_installer.h +++ b/chrome/browser/plugins/plugin_installer.h @@ -7,6 +7,7 @@ #include "base/observer_list.h" #include "base/strings/string16.h" +#include "base/version.h" #include "chrome/browser/plugins/plugin_metadata.h" #include "content/public/browser/download_item.h" #include "net/base/net_errors.h" diff --git a/chrome/browser/plugins/plugin_metadata.cc b/chrome/browser/plugins/plugin_metadata.cc index f0fc6d4..33f83a0 100644 --- a/chrome/browser/plugins/plugin_metadata.cc +++ b/chrome/browser/plugins/plugin_metadata.cc @@ -39,7 +39,7 @@ PluginMetadata::PluginMetadata(const std::string& identifier, PluginMetadata::~PluginMetadata() { } -void PluginMetadata::AddVersion(const base::Version& version, +void PluginMetadata::AddVersion(const Version& version, SecurityStatus status) { DCHECK(versions_.find(version) == versions_.end()); versions_[version] = status; @@ -97,14 +97,14 @@ PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( return SECURITY_STATUS_REQUIRES_AUTHORIZATION; } - base::Version version; + Version version; content::WebPluginInfo::CreateVersionFromString(plugin.version, &version); if (!version.IsValid()) - version = base::Version("0"); + version = Version("0"); // |lower_bound| returns the latest version that is not newer than |version|. - std::map<base::Version, SecurityStatus, VersionComparator>:: - const_iterator it = versions_.lower_bound(version); + std::map<Version, SecurityStatus, VersionComparator>::const_iterator it = + versions_.lower_bound(version); // If there is at least one version defined, everything older than the oldest // defined version is considered out-of-date. if (it == versions_.end()) @@ -113,8 +113,8 @@ PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( return it->second; } -bool PluginMetadata::VersionComparator::operator() ( - const base::Version& lhs, const base::Version& rhs) const { +bool PluginMetadata::VersionComparator::operator() (const Version& lhs, + const Version& rhs) const { // Keep versions ordered by newest (biggest) first. return lhs.CompareTo(rhs) > 0; } diff --git a/chrome/browser/plugins/plugin_metadata.h b/chrome/browser/plugins/plugin_metadata.h index de49b28..261e6e8 100644 --- a/chrome/browser/plugins/plugin_metadata.h +++ b/chrome/browser/plugins/plugin_metadata.h @@ -67,7 +67,7 @@ class PluginMetadata { void AddMatchingMimeType(const std::string& mime_type); // Adds information about a plug-in version. - void AddVersion(const base::Version& version, SecurityStatus status); + void AddVersion(const Version& version, SecurityStatus status); // Checks if |plugin| mime types match all |matching_mime_types_|. // If there is no |matching_mime_types_|, |group_name_matcher_| is used @@ -87,7 +87,7 @@ class PluginMetadata { private: struct VersionComparator { - bool operator() (const base::Version& lhs, const base::Version& rhs) const; + bool operator() (const Version& lhs, const Version& rhs) const; }; std::string identifier_; @@ -97,7 +97,7 @@ class PluginMetadata { GURL plugin_url_; GURL help_url_; std::string language_; - std::map<base::Version, SecurityStatus, VersionComparator> versions_; + std::map<Version, SecurityStatus, VersionComparator> versions_; std::vector<std::string> all_mime_types_; std::vector<std::string> matching_mime_types_; diff --git a/chrome/browser/plugins/plugin_metadata_unittest.cc b/chrome/browser/plugins/plugin_metadata_unittest.cc index dd5ac8a..03d57a7 100644 --- a/chrome/browser/plugins/plugin_metadata_unittest.cc +++ b/chrome/browser/plugins/plugin_metadata_unittest.cc @@ -41,9 +41,9 @@ TEST(PluginMetadataTest, SecurityStatus) { EXPECT_EQ(kRequiresAuthorization, GetSecurityStatus(&plugin_metadata, "1.2.3")); - plugin_metadata.AddVersion(base::Version("9.4.1"), kRequiresAuthorization); - plugin_metadata.AddVersion(base::Version("10"), kOutOfDate); - plugin_metadata.AddVersion(base::Version("10.2.1"), kUpToDate); + plugin_metadata.AddVersion(Version("9.4.1"), kRequiresAuthorization); + plugin_metadata.AddVersion(Version("10"), kOutOfDate); + plugin_metadata.AddVersion(Version("10.2.1"), kUpToDate); // Invalid version. EXPECT_EQ(kOutOfDate, GetSecurityStatus(&plugin_metadata, "foo")); diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc index e28872a..69bd418 100644 --- a/chrome/browser/prefs/session_startup_pref.cc +++ b/chrome/browser/prefs/session_startup_pref.cc @@ -256,8 +256,8 @@ void SessionStartupPref::MigrateMacDefaultPrefIfNecessary(PrefService* prefs) { bool old_profile_version = !prefs->FindPreference( prefs::kProfileCreatedByVersion)->IsDefaultValue() && - base::Version(prefs->GetString(prefs::kProfileCreatedByVersion)). - IsOlderThan("21.0.1180.0"); + Version(prefs->GetString(prefs::kProfileCreatedByVersion)).IsOlderThan( + "21.0.1180.0"); if (old_profile_version && TypeIsDefault(prefs)) prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueLast); #endif diff --git a/chrome/browser/profiles/chrome_version_service.cc b/chrome/browser/profiles/chrome_version_service.cc index d4972944..5a177a6 100644 --- a/chrome/browser/profiles/chrome_version_service.cc +++ b/chrome/browser/profiles/chrome_version_service.cc @@ -5,6 +5,7 @@ #include "chrome/browser/profiles/chrome_version_service.h" #include "base/prefs/pref_service.h" +#include "base/version.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc index 80d197d..affbc3a 100644 --- a/chrome/browser/profiles/profile_browsertest.cc +++ b/chrome/browser/profiles/profile_browsertest.cc @@ -8,6 +8,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/platform_file.h" #include "base/prefs/pref_service.h" +#include "base/version.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/chrome_version_service.h" #include "chrome/browser/profiles/profile_impl.h" diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index df8a22a..fa628f7 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -853,8 +853,8 @@ void ProfileImpl::OnPrefsLoaded(bool success) { } bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) { - base::Version profile_version(ChromeVersionService::GetVersion(prefs_.get())); - base::Version arg_version(version); + Version profile_version(ChromeVersionService::GetVersion(prefs_.get())); + Version arg_version(version); return (profile_version.CompareTo(arg_version) >= 0); } diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index 6f39ab4..b02b6cd 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -9,6 +9,7 @@ #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "base/version.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/plugins/chrome_plugin_service_filter.h" #include "chrome/browser/plugins/plugin_finder.h" diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc index 6aacfc2..5016ee2 100644 --- a/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/chrome/browser/ui/startup/default_browser_prompt.cc @@ -244,11 +244,11 @@ void ShowDefaultBrowserPrompt(Profile* profile, HostDesktopType desktop_type) { const std::string disable_version_string = g_browser_process->local_state()->GetString( prefs::kBrowserSuppressDefaultBrowserPrompt); - const base::Version disable_version(disable_version_string); + const Version disable_version(disable_version_string); DCHECK(disable_version_string.empty() || disable_version.IsValid()); if (disable_version.IsValid()) { const chrome::VersionInfo version_info; - if (disable_version.Equals(base::Version(version_info.Version()))) + if (disable_version.Equals(Version(version_info.Version()))) return; } diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index e266746..331a1a0 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -21,6 +21,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "base/version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/devtools/devtools_window.h" diff --git a/chrome/browser/ui/webui/help/version_updater_win.cc b/chrome/browser/ui/webui/help/version_updater_win.cc index 1db095a..9491e10 100644 --- a/chrome/browser/ui/webui/help/version_updater_win.cc +++ b/chrome/browser/ui/webui/help/version_updater_win.cc @@ -57,7 +57,7 @@ class VersionUpdaterWin : public VersionUpdater, // Got the intalled version so the handling of the UPGRADE_ALREADY_UP_TO_DATE // result case can now be completeb on the UI thread. - void GotInstalledVersion(const base::Version& version); + void GotInstalledVersion(const Version& version); // Little helper function to create google_updater_. void CreateGoogleUpdater(); @@ -119,7 +119,7 @@ class VersionReader // This is the version that gets read in the FILE thread and set on the // the updater in the UI thread. - base::Version installed_version_; + Version installed_version_; }; VersionUpdaterWin::VersionUpdaterWin() @@ -241,7 +241,7 @@ void VersionUpdaterWin::UpdateStatus(GoogleUpdateUpgradeResult result, #endif // defined(GOOGLE_CHROME_BUILD) } -void VersionUpdaterWin::GotInstalledVersion(const base::Version& version) { +void VersionUpdaterWin::GotInstalledVersion(const Version& version) { // This must be called on the UI thread so that callback_ can be called. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -252,7 +252,7 @@ void VersionUpdaterWin::GotInstalledVersion(const base::Version& version) { // may be already up to date on disk though the running app is still // out of date. chrome::VersionInfo version_info; - base::Version running_version(version_info.Version()); + Version running_version(version_info.Version()); if (!version.IsValid() || version.CompareTo(running_version) <= 0) { content::RecordAction( UserMetricsAction("UpgradeCheck_AlreadyUpToDate")); diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc index 620acff..74a1388 100644 --- a/chrome/browser/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector_impl.cc @@ -218,8 +218,8 @@ void UpgradeDetectorImpl::DetectUpgradeTask( base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - base::Version installed_version; - base::Version critical_update; + Version installed_version; + Version critical_update; #if defined(OS_WIN) // Get the version of the currently *installed* instance of Chrome, @@ -238,7 +238,7 @@ void UpgradeDetectorImpl::DetectUpgradeTask( } #elif defined(OS_MACOSX) installed_version = - base::Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); + Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); #elif defined(OS_POSIX) // POSIX but not Mac OS X: Linux, etc. CommandLine command_line(*CommandLine::ForCurrentProcess()); @@ -249,7 +249,7 @@ void UpgradeDetectorImpl::DetectUpgradeTask( return; } - installed_version = base::Version(reply); + installed_version = Version(reply); #endif // Get the version of the currently *running* instance of Chrome. @@ -258,7 +258,7 @@ void UpgradeDetectorImpl::DetectUpgradeTask( NOTREACHED() << "Failed to get current file version"; return; } - base::Version running_version(version_info.Version()); + Version running_version(version_info.Version()); if (!running_version.IsValid()) { NOTREACHED(); return; diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 647baf6..6e55ab9 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "base/sys_info.h" #include "base/threading/thread_restrictions.h" +#include "base/version.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths_internal.h" #include "chrome/common/widevine_cdm_constants.h" diff --git a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc index 8f63db6..d675d3e 100644 --- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc +++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc @@ -33,14 +33,14 @@ bool MinimumChromeVersionChecker::Parse(Extension* extension, return false; } - base::Version minimum_version(minimum_version_string); + Version minimum_version(minimum_version_string); if (!minimum_version.IsValid()) { *error = base::ASCIIToUTF16(errors::kInvalidMinimumChromeVersion); return false; } chrome::VersionInfo current_version_info; - base::Version current_version(current_version_info.Version()); + Version current_version(current_version_info.Version()); if (!current_version.IsValid()) { NOTREACHED(); return false; diff --git a/chrome/common/extensions/update_manifest.cc b/chrome/common/extensions/update_manifest.cc index 7fd85e85..0ed653f 100644 --- a/chrome/common/extensions/update_manifest.cc +++ b/chrome/common/extensions/update_manifest.cc @@ -167,7 +167,7 @@ static bool ParseSingleAppTag(xmlNode* app_node, xmlNs* xml_namespace, *error_detail = "Missing version for updatecheck."; return false; } - base::Version version(result->version); + Version version(result->version); if (!version.IsValid()) { *error_detail = "Invalid version: '"; *error_detail += result->version; @@ -178,7 +178,7 @@ static bool ParseSingleAppTag(xmlNode* app_node, xmlNs* xml_namespace, // Get the minimum browser version (not required). result->browser_min_version = GetAttribute(updatecheck, "prodversionmin"); if (result->browser_min_version.length()) { - base::Version browser_min_version(result->browser_min_version); + Version browser_min_version(result->browser_min_version); if (!browser_min_version.IsValid()) { *error_detail = "Invalid prodversionmin: '"; *error_detail += result->browser_min_version; diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc index 6773fab..d542b74 100644 --- a/chrome/common/service_process_util.cc +++ b/chrome/common/service_process_util.cc @@ -67,7 +67,7 @@ ServiceProcessRunningState GetServiceProcessRunningState( if (service_version_out) *service_version_out = version; - base::Version service_version(version); + Version service_version(version); // If the version string is invalid, treat it like an older version. if (!service_version.IsValid()) return SERVICE_OLDER_VERSION_RUNNING; @@ -80,7 +80,7 @@ ServiceProcessRunningState GetServiceProcessRunningState( // are out of date. return SERVICE_NEWER_VERSION_RUNNING; } - base::Version running_version(version_info.Version()); + Version running_version(version_info.Version()); if (!running_version.IsValid()) { NOTREACHED() << "Failed to parse version info"; // Our own version is invalid. This is an error case. Pretend that we diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm index 8dd7525..d023627 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -203,7 +203,7 @@ bool CheckServiceProcessReady() { if (!GetServiceProcessData(&version, &pid)) { return false; } - base::Version service_version(version); + Version service_version(version); bool ready = true; if (!service_version.IsValid()) { ready = false; @@ -216,7 +216,7 @@ bool CheckServiceProcessReady() { ready = true; } else { - base::Version running_version(version_info.Version()); + Version running_version(version_info.Version()); if (!running_version.IsValid()) { // Our own version is invalid. This is an error case. Pretend that we // are out of date. diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 6d75274..fb1bd37 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -186,8 +186,8 @@ installer::InstallStatus InstallNewVersion( const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const base::Version& new_version, - scoped_ptr<base::Version>* current_version) { + const Version& new_version, + scoped_ptr<Version>* current_version) { DCHECK(current_version); installer_state.UpdateStage(installer::BUILDING); @@ -306,7 +306,7 @@ void EscapeXmlAttributeValueInSingleQuotes(base::string16* att_value) { } bool CreateVisualElementsManifest(const base::FilePath& src_path, - const base::Version& version) { + const Version& version) { // Construct the relative path to the versioned VisualElements directory. base::string16 elements_dir(ASCIIToUTF16(version.GetString())); elements_dir.push_back(base::FilePath::kSeparators[0]); @@ -507,7 +507,7 @@ InstallStatus InstallOrUpdateProduct( const base::FilePath& src_path, const base::FilePath& prefs_path, const MasterPreferences& prefs, - const base::Version& new_version) { + const Version& new_version) { DCHECK(!installer_state.products().empty()); // TODO(robertshield): Removing the pending on-reboot moves should be done @@ -524,7 +524,7 @@ InstallStatus InstallOrUpdateProduct( installer_state.UpdateStage(installer::CREATING_VISUAL_MANIFEST); CreateVisualElementsManifest(src_path, new_version); - scoped_ptr<base::Version> existing_version; + scoped_ptr<Version> existing_version; InstallStatus result = InstallNewVersion(original_state, installer_state, setup_path, archive_path, src_path, install_temp_path, new_version, &existing_version); diff --git a/chrome/installer/setup/install.h b/chrome/installer/setup/install.h index 3c80935..a700b3c 100644 --- a/chrome/installer/setup/install.h +++ b/chrome/installer/setup/install.h @@ -58,7 +58,7 @@ void EscapeXmlAttributeValueInSingleQuotes(base::string16* att_value); // |src_path|\VisualElements exists. // Returns true unless the manifest is supposed to be created, but fails to be. bool CreateVisualElementsManifest(const base::FilePath& src_path, - const base::Version& version); + const Version& version); // Overwrites shortcuts (desktop, quick launch, and start menu) if they are // present on the system. @@ -114,7 +114,7 @@ InstallStatus InstallOrUpdateProduct( const base::FilePath& src_path, const base::FilePath& prefs_path, const installer::MasterPreferences& prefs, - const base::Version& new_version); + const Version& new_version); // Performs installation-related tasks following an OS upgrade. // |chrome| The installed product (must be a browser). diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc index 5164ee3..99337d0 100644 --- a/chrome/installer/setup/install_unittest.cc +++ b/chrome/installer/setup/install_unittest.cc @@ -38,7 +38,7 @@ class CreateVisualElementsManifestTest : public testing::Test { // Create a temp directory for testing. ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); - version_ = base::Version("0.0.0.0"); + version_ = Version("0.0.0.0"); version_dir_ = test_dir_.path().AppendASCII(version_.GetString()); ASSERT_TRUE(base::CreateDirectory(version_dir_)); @@ -56,7 +56,7 @@ class CreateVisualElementsManifestTest : public testing::Test { base::ScopedTempDir test_dir_; // A dummy version number used to create the version directory. - base::Version version_; + Version version_; // The path to |test_dir_|\|version_|. base::FilePath version_dir_; diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 8daa86a..16aebce 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -114,8 +114,8 @@ void GetIELowRightsElevationPolicyKeyPath(ElevationPolicyId policy, // products managed by a given package. // |old_version| can be NULL to indicate no Chrome is currently installed. void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, - const base::Version* old_version, - const base::Version& new_version, + const Version* old_version, + const Version& new_version, WorkItemList* work_item_list) { // First collect the list of DLLs to be registered from each product. std::vector<base::FilePath> com_dll_list; @@ -157,7 +157,7 @@ void AddInstallerCopyTasks(const InstallerState& installer_state, const base::FilePath& setup_path, const base::FilePath& archive_path, const base::FilePath& temp_path, - const base::Version& new_version, + const Version& new_version, WorkItemList* install_list) { DCHECK(install_list); base::FilePath installer_dir( @@ -230,7 +230,7 @@ base::string16 GetRegCommandKey(BrowserDistribution* dist, // 4. The command is run as the user. void AddCommandWithParameterWorkItems(const InstallerState& installer_state, const InstallationState& machine_state, - const base::Version& new_version, + const Version& new_version, const Product& product, const wchar_t* command_key, const wchar_t* app, @@ -262,7 +262,7 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state, void AddInstallAppCommandWorkItems(const InstallerState& installer_state, const InstallationState& machine_state, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* work_item_list) { DCHECK(product.is_chrome_app_host()); @@ -276,7 +276,7 @@ void AddInstallAppCommandWorkItems(const InstallerState& installer_state, void AddInstallExtensionCommandWorkItem(const InstallerState& installer_state, const InstallationState& machine_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* work_item_list) { DCHECK(product.is_chrome()); @@ -296,7 +296,7 @@ CommandLine GetGenericQuickEnableCommand( const InstallerState& installer_state, const InstallationState& machine_state, const base::FilePath& setup_path, - const base::Version& new_version) { + const Version& new_version) { // Only valid for multi-install operations. DCHECK(installer_state.is_multi_install()); // Only valid when Chrome Binaries aren't being uninstalled. @@ -341,7 +341,7 @@ void AddQuickEnableApplicationLauncherWorkItems( const InstallerState& installer_state, const InstallationState& machine_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, WorkItemList* work_item_list) { DCHECK(work_item_list); @@ -376,7 +376,7 @@ void AddQuickEnableApplicationLauncherWorkItems( void AddProductSpecificWorkItems(const InstallationState& original_state, const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, WorkItemList* list) { const Products& products = installer_state.products(); for (Products::const_iterator it = products.begin(); it < products.end(); @@ -457,8 +457,8 @@ void AddChromeWorkItems(const InstallationState& original_state, const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const base::Version* current_version, - const base::Version& new_version, + const Version* current_version, + const Version& new_version, WorkItemList* install_list) { const base::FilePath& target_path = installer_state.target_path(); @@ -661,7 +661,7 @@ void CleanupBadCanaryDelegateExecuteRegistration( // state key if running under an MSI installer. void AddUninstallShortcutWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* install_list) { HKEY reg_root = installer_state.root_key(); @@ -759,7 +759,7 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, // product version as the last step. void AddVersionKeyWorkItems(HKEY root, BrowserDistribution* dist, - const base::Version& new_version, + const Version& new_version, bool add_language_identifier, WorkItemList* list) { // Create Version key for each distribution (if not already present) and set @@ -1005,8 +1005,8 @@ void AddUsageStatsWorkItems(const InstallationState& original_state, bool AppendPostInstallTasks(const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version* current_version, - const base::Version& new_version, + const Version* current_version, + const Version& new_version, const base::FilePath& temp_path, WorkItemList* post_install_task_list) { DCHECK(post_install_task_list); @@ -1028,7 +1028,7 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, // |critical_version| will be valid only if this in-use update includes a // version considered critical relative to the version being updated. - base::Version critical_version(installer_state.DetermineCriticalVersion( + Version critical_version(installer_state.DetermineCriticalVersion( current_version, new_version)); base::FilePath installer_path( installer_state.GetInstallerDirectory(new_version).Append( @@ -1132,8 +1132,8 @@ void AddInstallWorkItems(const InstallationState& original_state, const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const base::Version* current_version, - const base::Version& new_version, + const Version* current_version, + const Version& new_version, WorkItemList* install_list) { DCHECK(install_list); @@ -1261,7 +1261,7 @@ void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, void AddDelegateExecuteWorkItems(const InstallerState& installer_state, const base::FilePath& target_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* list) { base::string16 handler_class_uuid; @@ -1323,7 +1323,7 @@ void AddDelegateExecuteWorkItems(const InstallerState& installer_state, void AddActiveSetupWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* list) { DCHECK(installer_state.operation() != InstallerState::UNINSTALL); @@ -1419,7 +1419,7 @@ void RefreshElevationPolicy() { void AddOsUpgradeWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* install_list) { const HKEY root_key = installer_state.root_key(); @@ -1452,7 +1452,7 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state, void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const base::Version& new_version, + const Version& new_version, const Product& product, WorkItemList* work_item_list) { const HKEY root_key = installer_state.root_key(); diff --git a/chrome/installer/setup/install_worker_unittest.cc b/chrome/installer/setup/install_worker_unittest.cc index b1a57db..9d2a266 100644 --- a/chrome/installer/setup/install_worker_unittest.cc +++ b/chrome/installer/setup/install_worker_unittest.cc @@ -100,7 +100,7 @@ class MockWorkItemList : public WorkItemList { class MockProductState : public ProductState { public: // Takes ownership of |version|. - void set_version(base::Version* version) { version_.reset(version); } + void set_version(Version* version) { version_.reset(version); } void set_multi_install(bool multi) { multi_install_ = multi; } void set_brand(const std::wstring& brand) { brand_ = brand; } void set_eula_accepted(DWORD eula_accepted) { @@ -167,8 +167,8 @@ class MockInstallerState : public InstallerState { class InstallWorkerTest : public testing::Test { public: virtual void SetUp() { - current_version_.reset(new base::Version("1.0.0.0")); - new_version_.reset(new base::Version("42.0.0.0")); + current_version_.reset(new Version("1.0.0.0")); + new_version_.reset(new Version("42.0.0.0")); // Don't bother ensuring that these paths exist. Since we're just // building the work item lists and not running them, they shouldn't @@ -195,7 +195,7 @@ class InstallWorkerTest : public testing::Test { if (installation_state->GetProductState( system_level, BrowserDistribution::CHROME_BINARIES) == NULL) { MockProductState product_state; - product_state.set_version(new base::Version(*current_version_)); + product_state.set_version(new Version(*current_version_)); product_state.set_brand(L"TEST"); product_state.set_multi_install(true); BrowserDistribution* dist = @@ -224,7 +224,7 @@ class InstallWorkerTest : public testing::Test { if (multi_install) MaybeAddBinariesToInstallationState(system_level, installation_state); MockProductState product_state; - product_state.set_version(new base::Version(*current_version_)); + product_state.set_version(new Version(*current_version_)); product_state.set_multi_install(multi_install); product_state.set_brand(L"TEST"); product_state.set_eula_accepted(1); @@ -257,7 +257,7 @@ class InstallWorkerTest : public testing::Test { if (multi_install) MaybeAddBinariesToInstallationState(system_level, installation_state); MockProductState product_state; - product_state.set_version(new base::Version(*current_version_)); + product_state.set_version(new Version(*current_version_)); product_state.set_multi_install(multi_install); BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( @@ -418,8 +418,8 @@ class InstallWorkerTest : public testing::Test { } protected: - scoped_ptr<base::Version> current_version_; - scoped_ptr<base::Version> new_version_; + scoped_ptr<Version> current_version_; + scoped_ptr<Version> new_version_; base::FilePath archive_path_; base::FilePath installation_path_; base::FilePath setup_path_; @@ -542,7 +542,7 @@ TEST_F(InstallWorkerTest, GoogleUpdateWorkItemsTest) { BuildChromeInstallationState(system_level, false)); MockProductState cf_state; - cf_state.set_version(new base::Version(*current_version_)); + cf_state.set_version(new Version(*current_version_)); cf_state.set_multi_install(false); installation_state->SetProductState(system_level, @@ -615,7 +615,7 @@ TEST_F(InstallWorkerTest, AddUsageStatsWorkItems) { BuildChromeInstallationState(system_level, multi_install)); MockProductState chrome_state; - chrome_state.set_version(new base::Version(*current_version_)); + chrome_state.set_version(new Version(*current_version_)); chrome_state.set_multi_install(false); chrome_state.set_usagestats(1); diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 71e9a01..fa258ab 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -291,7 +291,7 @@ installer::InstallStatus RenameChromeExecutables( // the proper installer result has been written to the registry. bool CheckGroupPolicySettings(const InstallationState& original_state, const InstallerState& installer_state, - const base::Version& new_version, + const Version& new_version, installer::InstallStatus* status) { #if !defined(GOOGLE_CHROME_BUILD) // Chromium builds are not updated via Google Update, so there are no @@ -951,7 +951,7 @@ installer::InstallStatus RegisterDevChrome( scoped_ptr<WorkItemList> delegate_execute_list( WorkItem::CreateWorkItemList()); installer::AddDelegateExecuteWorkItems( - installer_state, chrome_exe.DirName(), base::Version(), chrome, + installer_state, chrome_exe.DirName(), Version(), chrome, delegate_execute_list.get()); delegate_execute_list->Do(); if (ShellUtil::CanMakeChromeDefaultUnattended()) { @@ -1174,7 +1174,7 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state, BrowserDistribution* browser_dist = product.distribution(); // We started as system-level and have been re-launched as user level // to continue with the toast experiment. - base::Version installed_version; + Version installed_version; InstallUtil::GetChromeVersion(browser_dist, true, &installed_version); if (!installed_version.IsValid()) { LOG(ERROR) << "No installation of " @@ -1463,7 +1463,7 @@ InstallStatus InstallProductsHelper( VLOG(1) << "unpacked to " << unpack_path.value(); base::FilePath src_path( unpack_path.Append(kInstallSourceChromeDir)); - scoped_ptr<base::Version> + scoped_ptr<Version> installer_version(GetMaxVersionFromArchiveDir(src_path)); if (!installer_version.get()) { LOG(ERROR) << "Did not find any valid version in installer."; diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index cbfc457..d21abf9 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -139,22 +139,22 @@ int BsdiffPatchFiles(const base::FilePath& src, return exit_code; } -base::Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) { +Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) { VLOG(1) << "Looking for Chrome version folder under " << chrome_path.value(); base::FileEnumerator version_enum(chrome_path, false, base::FileEnumerator::DIRECTORIES); // TODO(tommi): The version directory really should match the version of // setup.exe. To begin with, we should at least DCHECK that that's true. - scoped_ptr<base::Version> max_version(new base::Version("0.0.0.0")); + scoped_ptr<Version> max_version(new Version("0.0.0.0")); bool version_found = false; while (!version_enum.Next().empty()) { base::FileEnumerator::FileInfo find_data = version_enum.GetInfo(); VLOG(1) << "directory found: " << find_data.GetName().value(); - scoped_ptr<base::Version> found_version( - new base::Version(WideToASCII(find_data.GetName().value()))); + scoped_ptr<Version> found_version( + new Version(WideToASCII(find_data.GetName().value()))); if (found_version->IsValid() && found_version->CompareTo(*max_version.get()) > 0) { max_version.reset(found_version.release()); @@ -180,7 +180,7 @@ base::FilePath FindArchiveToPatch(const InstallationState& original_state, if (base::PathExists(patch_source)) return patch_source; } - scoped_ptr<base::Version> version( + scoped_ptr<Version> version( installer::GetMaxVersionFromArchiveDir(installer_state.target_path())); if (version) { patch_source = installer_state.GetInstallerDirectory(*version) @@ -252,7 +252,7 @@ bool DeleteFileFromTempProcess(const base::FilePath& path, bool GetExistingHigherInstaller( const InstallationState& original_state, bool system_install, - const base::Version& installer_version, + const Version& installer_version, base::FilePath* setup_exe) { DCHECK(setup_exe); bool trying_single_browser = false; diff --git a/chrome/installer/setup/setup_util.h b/chrome/installer/setup/setup_util.h index 6bfd43f..205198e 100644 --- a/chrome/installer/setup/setup_util.h +++ b/chrome/installer/setup/setup_util.h @@ -48,7 +48,7 @@ int BsdiffPatchFiles(const base::FilePath& src, // Find the version of Chrome from an install source directory. // Chrome_path should contain at least one version folder. // Returns the maximum version found or NULL if no version is found. -base::Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); +Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); // Returns the uncompressed archive of the installed version that serves as the // source for patching. diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index a4e972f..c08e2b7 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -102,7 +102,7 @@ TEST_F(SetupUtilTestWithDir, GetMaxVersionFromArchiveDirTest) { base::FilePath chrome_dir = test_dir_.path().AppendASCII("1.0.0.0"); base::CreateDirectory(chrome_dir); ASSERT_TRUE(base::PathExists(chrome_dir)); - scoped_ptr<base::Version> version( + scoped_ptr<Version> version( installer::GetMaxVersionFromArchiveDir(test_dir_.path())); ASSERT_EQ(version->GetString(), "1.0.0.0"); @@ -275,9 +275,9 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { return static_cast<FakeProductState*>(const_cast<ProductState*>(product)); } - void set_version(const base::Version& version) { + void set_version(const Version& version) { if (version.IsValid()) - version_.reset(new base::Version(version)); + version_.reset(new Version(version)); else version_.reset(); } @@ -289,8 +289,8 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { virtual void SetUp() OVERRIDE { SetupUtilTestWithDir::SetUp(); - product_version_ = base::Version("30.0.1559.0"); - max_version_ = base::Version("47.0.1559.0"); + product_version_ = Version("30.0.1559.0"); + max_version_ = Version("47.0.1559.0"); // Install the product according to the version. original_state_.reset(new FakeInstallationState()); @@ -318,7 +318,7 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { SetupUtilTestWithDir::TearDown(); } - base::FilePath GetArchivePath(const base::Version& version) const { + base::FilePath GetArchivePath(const Version& version) const { return test_dir_.path() .AppendASCII(version.GetString()) .Append(installer::kInstallerDir) @@ -351,13 +351,13 @@ class FindArchiveToPatchTest : public SetupUtilTestWithDir { FakeProductState::FromProductState( original_state_->GetNonVersionedProductState(kSystemInstall_, kProductType_)) - ->set_version(base::Version()); + ->set_version(Version()); } static const bool kSystemInstall_; static const BrowserDistribution::Type kProductType_; - base::Version product_version_; - base::Version max_version_; + Version product_version_; + Version max_version_; scoped_ptr<FakeInstallationState> original_state_; scoped_ptr<installer::InstallerState> installer_state_; }; diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 66614ca..d11334e 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -154,8 +154,8 @@ void ProcessOnOsUpgradeWorkItems( const installer::Product& product) { scoped_ptr<WorkItemList> work_item_list( WorkItem::CreateNoRollbackWorkItemList()); - AddOsUpgradeWorkItems(installer_state, base::FilePath(), base::Version(), - product, work_item_list.get()); + AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, + work_item_list.get()); if (!work_item_list->Do()) LOG(ERROR) << "Failed to remove on-os-upgrade command."; } @@ -521,9 +521,8 @@ DeleteResult DeleteChromeDirectoriesIfEmpty( return result; } -DeleteResult DeleteAppHostFilesAndFolders( - const InstallerState& installer_state, - const base::Version& installed_version) { +DeleteResult DeleteAppHostFilesAndFolders(const InstallerState& installer_state, + const Version& installed_version) { const base::FilePath& target_path = installer_state.target_path(); if (target_path.empty()) { LOG(ERROR) << "DeleteAppHostFilesAndFolders: no installation destination " @@ -917,8 +916,8 @@ const wchar_t kChromeExtProgId[] = L"ChromiumExt"; bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, const Product& product) { scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); - AddDelegateExecuteWorkItems(installer_state, base::FilePath(), - base::Version(), product, item_list.get()); + AddDelegateExecuteWorkItems(installer_state, base::FilePath(), Version(), + product, item_list.get()); return item_list->Do(); } diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc index f9606ff..6b65aa1 100644 --- a/chrome/installer/test/alternate_version_generator.cc +++ b/chrome/installer/test/alternate_version_generator.cc @@ -108,7 +108,7 @@ class ChromeVersion { static_cast<ULONGLONG>(low)); } static ChromeVersion FromString(const std::string& version_string) { - base::Version version(version_string); + Version version(version_string); DCHECK(version.IsValid()); const std::vector<uint16>& c(version.components()); return ChromeVersion(static_cast<ULONGLONG>(c[0]) << 48 | @@ -669,7 +669,7 @@ bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, return false; } - base::Version new_version(WideToASCII(ctx.new_version_str)); + Version new_version(WideToASCII(ctx.new_version_str)); GenerateSpecificPEFileVersion(original_file, target_file, new_version); return true; @@ -677,7 +677,7 @@ bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, bool GenerateSpecificPEFileVersion(const base::FilePath& original_file, const base::FilePath& target_file, - const base::Version& version) { + const Version& version) { // First copy original_file to target_file. if (!base::CopyFile(original_file, target_file)) { LOG(DFATAL) << "Failed copying \"" << original_file.value() diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index ae4fc80..8909f9f 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -128,7 +128,7 @@ BrowserDistribution* BrowserDistribution::GetSpecificDistribution( } void BrowserDistribution::DoPostUninstallOperations( - const base::Version& version, const base::FilePath& local_data_path, + const Version& version, const base::FilePath& local_data_path, const base::string16& distribution_data) { } diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index 89fd28f..16d2500 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -55,7 +55,7 @@ class BrowserDistribution { Type GetType() const { return type_; } virtual void DoPostUninstallOperations( - const base::Version& version, + const Version& version, const base::FilePath& local_data_path, const base::string16& distribution_data); diff --git a/chrome/installer/util/fake_installation_state.h b/chrome/installer/util/fake_installation_state.h index d701835..c81cc5b 100644 --- a/chrome/installer/util/fake_installation_state.h +++ b/chrome/installer/util/fake_installation_state.h @@ -18,9 +18,7 @@ namespace installer { class FakeInstallationState : public InstallationState { public: // Takes ownership of |version|. - void AddChrome(bool system_install, - bool multi_install, - base::Version* version) { + void AddChrome(bool system_install, bool multi_install, Version* version) { FakeProductState chrome_state; chrome_state.set_version(version); chrome_state.set_multi_install(multi_install); diff --git a/chrome/installer/util/fake_product_state.h b/chrome/installer/util/fake_product_state.h index 24b0cf6..27946b7 100644 --- a/chrome/installer/util/fake_product_state.h +++ b/chrome/installer/util/fake_product_state.h @@ -14,7 +14,7 @@ namespace installer { class FakeProductState : public ProductState { public: // Takes ownership of |version|. - void set_version(base::Version* version) { version_.reset(version); } + void set_version(Version* version) { version_.reset(version); } void set_multi_install(bool multi) { multi_install_ = multi; } void set_brand(const std::wstring& brand) { brand_ = brand; } void set_usagestats(DWORD usagestats) { diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index ea9b2ea..e49ba91 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -67,7 +67,7 @@ GoogleChromeDistribution::GoogleChromeDistribution() } void GoogleChromeDistribution::DoPostUninstallOperations( - const base::Version& version, + const Version& version, const base::FilePath& local_data_path, const base::string16& distribution_data) { // Send the Chrome version and OS version as params to the form. diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h index 296bc3d..eaed890 100644 --- a/chrome/installer/util/google_chrome_distribution.h +++ b/chrome/installer/util/google_chrome_distribution.h @@ -28,7 +28,7 @@ class GoogleChromeDistribution : public BrowserDistribution { // concatenated to the survey url if the file in local_data_path indicates // the user has opted in to providing anonymous usage data. virtual void DoPostUninstallOperations( - const base::Version& version, + const Version& version, const base::FilePath& local_data_path, const base::string16& distribution_data) OVERRIDE; diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc index a7191b9..8429307 100644 --- a/chrome/installer/util/google_chrome_distribution_dummy.cc +++ b/chrome/installer/util/google_chrome_distribution_dummy.cc @@ -21,7 +21,7 @@ GoogleChromeDistribution::GoogleChromeDistribution() } void GoogleChromeDistribution::DoPostUninstallOperations( - const base::Version& version, + const Version& version, const base::FilePath& local_data_path, const base::string16& distribution_data) { } diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 8160989..8d4fbd7 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -585,8 +585,7 @@ base::string16 GoogleUpdateSettings::GetUninstallCommandLine( return cmd_line; } -base::Version GoogleUpdateSettings::GetGoogleUpdateVersion( - bool system_install) { +Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; base::string16 version; RegKey key; @@ -596,10 +595,10 @@ base::Version GoogleUpdateSettings::GetGoogleUpdateVersion( KEY_QUERY_VALUE) == ERROR_SUCCESS && key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) == ERROR_SUCCESS) { - return base::Version(base::UTF16ToUTF8(version)); + return Version(base::UTF16ToUTF8(version)); } - return base::Version(); + return Version(); } base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index e202436..8e99978 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h @@ -232,7 +232,7 @@ class GoogleUpdateSettings { static base::string16 GetUninstallCommandLine(bool system_install); // Returns the version of Google Update that is installed. - static base::Version GetGoogleUpdateVersion(bool system_install); + static Version GetGoogleUpdateVersion(bool system_install); // Returns the time at which Google Update last started an automatic update // check, or the null time if this information isn't available. diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc index 58feba6..536b6f3 100644 --- a/chrome/installer/util/google_update_settings_unittest.cc +++ b/chrome/installer/util/google_update_settings_unittest.cc @@ -455,7 +455,7 @@ TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { // Chrome is installed. machine_state.AddChrome(system_level, multi_install, - new base::Version(chrome::kChromeVersion)); + new Version(chrome::kChromeVersion)); RegKey key; DWORD value; @@ -749,7 +749,7 @@ TEST_P(GetGoogleUpdateVersion, TestEmptyValue) { TEST_P(GetGoogleUpdateVersion, TestRealValue) { RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); - base::Version expected(base::UTF16ToUTF8(kDummyVersion)); + Version expected(base::UTF16ToUTF8(kDummyVersion)); EXPECT_TRUE(expected.Equals( GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_))); // Make sure that there's no value in the other level (user or system). diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index c2d1102..433f363 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -214,7 +214,7 @@ CommandLine InstallUtil::GetChromeUninstallCmd( void InstallUtil::GetChromeVersion(BrowserDistribution* dist, bool system_install, - base::Version* version) { + Version* version) { DCHECK(dist); RegKey key; HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; @@ -225,11 +225,11 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS) result = key.ReadValue(google_update::kRegVersionField, &version_str); - *version = base::Version(); + *version = Version(); if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Existing " << dist->GetDisplayName() << " version found " << version_str; - *version = base::Version(WideToASCII(version_str)); + *version = Version(WideToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetDisplayName() @@ -239,7 +239,7 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, bool system_install, - base::Version* version) { + Version* version) { DCHECK(dist); RegKey key; HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; @@ -251,11 +251,11 @@ void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, result = key.ReadValue(google_update::kRegCriticalVersionField, &version_str); - *version = base::Version(); + *version = Version(); if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Critical Update version for " << dist->GetDisplayName() << " found " << version_str; - *version = base::Version(WideToASCII(version_str)); + *version = Version(WideToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetDisplayName() diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc index c67a036..d6d06ab 100644 --- a/chrome/installer/util/installation_state.cc +++ b/chrome/installer/util/installation_state.cc @@ -60,7 +60,7 @@ bool ProductState::Initialize(bool system_install, std::wstring version_str; if (key.ReadValue(google_update::kRegVersionField, &version_str) == ERROR_SUCCESS) { - version_.reset(new base::Version(WideToASCII(version_str))); + version_.reset(new Version(WideToASCII(version_str))); if (!version_->IsValid()) version_.reset(); } @@ -70,7 +70,7 @@ bool ProductState::Initialize(bool system_install, // only be accessible via InstallationState::GetNonVersionedProductState. if (key.ReadValue(google_update::kRegOldVersionField, &version_str) == ERROR_SUCCESS) { - old_version_.reset(new base::Version(WideToASCII(version_str))); + old_version_.reset(new Version(WideToASCII(version_str))); if (!old_version_->IsValid()) old_version_.reset(); } @@ -147,17 +147,16 @@ base::FilePath ProductState::GetSetupPath() const { return uninstall_command_.GetProgram(); } -const base::Version& ProductState::version() const { +const Version& ProductState::version() const { DCHECK(version_.get() != NULL); return *version_; } ProductState& ProductState::CopyFrom(const ProductState& other) { channel_.set_value(other.channel_.value()); - version_.reset( - other.version_.get() ? new base::Version(*other.version_) : NULL); + version_.reset(other.version_.get() ? new Version(*other.version_) : NULL); old_version_.reset( - other.old_version_.get() ? new base::Version(*other.old_version_) : NULL); + other.old_version_.get() ? new Version(*other.old_version_) : NULL); brand_ = other.brand_; rename_cmd_ = other.rename_cmd_; uninstall_command_ = other.uninstall_command_; diff --git a/chrome/installer/util/installation_state.h b/chrome/installer/util/installation_state.h index a9da549..153760d2 100644 --- a/chrome/installer/util/installation_state.h +++ b/chrome/installer/util/installation_state.h @@ -102,8 +102,8 @@ class ProductState { AppCommands* commands); ChannelInfo channel_; - scoped_ptr<base::Version> version_; - scoped_ptr<base::Version> old_version_; + scoped_ptr<Version> version_; + scoped_ptr<Version> old_version_; std::wstring brand_; std::wstring rename_cmd_; std::wstring oem_install_; diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc index 2dd063a..ce18722 100644 --- a/chrome/installer/util/installation_validator.cc +++ b/chrome/installer/util/installation_validator.cc @@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" +#include "base/version.h" #include "chrome/common/chrome_switches.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" diff --git a/chrome/installer/util/installation_validator_unittest.cc b/chrome/installer/util/installation_validator_unittest.cc index b3ded02..d5abb13 100644 --- a/chrome/installer/util/installation_validator_unittest.cc +++ b/chrome/installer/util/installation_validator_unittest.cc @@ -179,7 +179,7 @@ void FakeProductState::SetChannel(const wchar_t* base, int channel_modifiers) { } void FakeProductState::SetVersion(const char* version) { - version_.reset(version == NULL ? NULL : new base::Version(version)); + version_.reset(version == NULL ? NULL : new Version(version)); } // Sets the uninstall command for this object. diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index 544c53e..500aadc 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -293,7 +293,7 @@ void InstallerState::Initialize(const CommandLine& command_line, // Parse --critical-update-version=W.X.Y.Z std::string critical_version_value( command_line.GetSwitchValueASCII(switches::kCriticalUpdateVersion)); - critical_update_version_ = base::Version(critical_version_value); + critical_update_version_ = Version(critical_version_value); } void InstallerState::set_level(Level level) { @@ -501,10 +501,10 @@ const Product* InstallerState::FindProduct( return NULL; } -base::Version* InstallerState::GetCurrentVersion( +Version* InstallerState::GetCurrentVersion( const InstallationState& machine_state) const { DCHECK(!products_.empty()); - scoped_ptr<base::Version> current_version; + scoped_ptr<Version> current_version; // If we're doing a multi-install, the current version may be either an // existing multi or an existing single product that is being migrated // in place (i.e., Chrome). In the latter case, there is no existing @@ -536,7 +536,7 @@ base::Version* InstallerState::GetCurrentVersion( machine_state.GetProductState(level_ == SYSTEM_LEVEL, prod_type); if (product_state != NULL) { - const base::Version* version = NULL; + const Version* version = NULL; // Be aware that there might be a pending "new_chrome.exe" already in the // installation path. If so, we use old_version, which holds the version of @@ -547,15 +547,15 @@ base::Version* InstallerState::GetCurrentVersion( if (version == NULL) version = &product_state->version(); - current_version.reset(new base::Version(*version)); + current_version.reset(new Version(*version)); } return current_version.release(); } -base::Version InstallerState::DetermineCriticalVersion( - const base::Version* current_version, - const base::Version& new_version) const { +Version InstallerState::DetermineCriticalVersion( + const Version* current_version, + const Version& new_version) const { DCHECK(current_version == NULL || current_version->IsValid()); DCHECK(new_version.IsValid()); if (critical_update_version_.IsValid() && @@ -564,7 +564,7 @@ base::Version InstallerState::DetermineCriticalVersion( new_version.CompareTo(critical_update_version_) >= 0) { return critical_update_version_; } - return base::Version(); + return Version(); } bool InstallerState::IsChromeFrameRunning( @@ -581,7 +581,7 @@ bool InstallerState::AreBinariesInUse( } base::FilePath InstallerState::GetInstallerDirectory( - const base::Version& version) const { + const Version& version) const { return target_path().Append(base::ASCIIToWide(version.GetString())) .Append(kInstallerDir); } @@ -631,7 +631,7 @@ bool InstallerState::AnyExistsAndIsInUse( // _from_). Later versions from pending in-use updates need not be checked // since the current version is guaranteed to be in use if any such are. bool in_use = false; - scoped_ptr<base::Version> current_version(GetCurrentVersion(machine_state)); + scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); if (!current_version) return false; base::FilePath directory( @@ -668,10 +668,10 @@ void InstallerState::GetExistingExeVersions( } void InstallerState::RemoveOldVersionDirectories( - const base::Version& new_version, - base::Version* existing_version, + const Version& new_version, + Version* existing_version, const base::FilePath& temp_path) const { - base::Version version; + Version version; scoped_ptr<WorkItem> item; std::set<std::string> existing_version_strings; @@ -689,7 +689,7 @@ void InstallerState::RemoveOldVersionDirectories( for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - version = base::Version(WideToASCII(dir_name.value())); + version = Version(WideToASCII(dir_name.value())); // Delete the version folder if it is less than the new version and not // equal to the old version (if we have an old version). if (version.IsValid() && diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index d618c85..3818712 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -55,7 +55,7 @@ class MockInstallerState : public InstallerState { static bool IsFileInUse(const base::FilePath& file) { return InstallerState::IsFileInUse(file); } - const base::Version& critical_update_version() const { + const Version& critical_update_version() const { return critical_update_version_; } void GetExistingExeVersions(std::set<std::string>* existing_version_strings) { @@ -140,7 +140,7 @@ TEST_F(InstallerStateTest, Delete) { MockInstallerState installer_state; BuildSingleChromeState(chrome_dir, &installer_state); - base::Version latest_version("1.0.4.0"); + Version latest_version("1.0.4.0"); { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -220,8 +220,8 @@ TEST_F(InstallerStateTest, DeleteInUsed) { MockInstallerState installer_state; BuildSingleChromeState(chrome_dir, &installer_state); - base::Version latest_version("1.0.4.0"); - base::Version existing_version("1.0.1.0"); + Version latest_version("1.0.4.0"); + Version existing_version("1.0.1.0"); { base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -264,8 +264,8 @@ TEST_F(InstallerStateTest, Basic) { const char kOldVersion[] = "1.2.3.4"; const char kNewVersion[] = "2.3.4.5"; - base::Version new_version(kNewVersion); - base::Version old_version(kOldVersion); + Version new_version(kNewVersion); + Version old_version(kOldVersion); ASSERT_TRUE(new_version.IsValid()); ASSERT_TRUE(old_version.IsValid()); @@ -345,7 +345,7 @@ TEST_F(InstallerStateTest, WithProduct) { EXPECT_EQ(system_level, installer_state.system_install()); const char kCurrentVersion[] = "1.2.3.4"; - base::Version current_version(kCurrentVersion); + Version current_version(kCurrentVersion); HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; EXPECT_EQ(root, installer_state.root_key()); @@ -363,8 +363,7 @@ TEST_F(InstallerStateTest, WithProduct) { current_version.GetString()).c_str()); machine_state.Initialize(); // TODO(tommi): Also test for when there exists a new_chrome.exe. - base::Version found_version( - *installer_state.GetCurrentVersion(machine_state)); + Version found_version(*installer_state.GetCurrentVersion(machine_state)); EXPECT_TRUE(found_version.IsValid()); if (found_version.IsValid()) EXPECT_TRUE(current_version.Equals(found_version)); @@ -455,7 +454,7 @@ TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { // Pretend that this version of single-install Chrome is already installed. machine_state.AddChrome(system_install, false, - new base::Version(chrome::kChromeVersion)); + new Version(chrome::kChromeVersion)); // Now we're invoked to install multi Chrome. CommandLine cmd_line( @@ -465,8 +464,7 @@ TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { installer_state.Initialize(cmd_line, prefs, machine_state); // Is the Chrome version picked up? - scoped_ptr<base::Version> version( - installer_state.GetCurrentVersion(machine_state)); + scoped_ptr<Version> version(installer_state.GetCurrentVersion(machine_state)); EXPECT_TRUE(version.get() != NULL); } @@ -508,11 +506,11 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { const char kChromeExeVersion[] = "2.1.1.1"; const char kNewChromeExeVersion[] = "3.0.0.0"; - base::Version new_version(kNewVersion); - base::Version old_version(kOldVersion); - base::Version old_chrome_exe_version(kOldChromeExeVersion); - base::Version chrome_exe_version(kChromeExeVersion); - base::Version new_chrome_exe_version(kNewChromeExeVersion); + Version new_version(kNewVersion); + Version old_version(kOldVersion); + Version old_chrome_exe_version(kOldChromeExeVersion); + Version chrome_exe_version(kChromeExeVersion); + Version new_chrome_exe_version(kNewChromeExeVersion); ASSERT_TRUE(new_version.IsValid()); ASSERT_TRUE(old_version.IsValid()); @@ -547,7 +545,7 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { struct target_info { base::FilePath target_file; - const base::Version& target_version; + const Version& target_version; } targets[] = { { installer_state.target_path().Append(installer::kChromeOldExe), old_chrome_exe_version }, @@ -591,7 +589,7 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - base::Version version(WideToASCII(dir_name.value())); + Version version(WideToASCII(dir_name.value())); if (version.IsValid()) { EXPECT_TRUE(expected_remaining_dirs.erase(version.GetString())) << "Unexpected version dir found: " << version.GetString(); @@ -666,11 +664,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { // Creates a set of versions for use by all test runs. static void SetUpTestCase() { - low_version_ = new base::Version("15.0.874.106"); - opv_version_ = new base::Version("15.0.874.255"); - middle_version_ = new base::Version("16.0.912.32"); - pv_version_ = new base::Version("16.0.912.255"); - high_version_ = new base::Version("17.0.932.0"); + low_version_ = new Version("15.0.874.106"); + opv_version_ = new Version("15.0.874.255"); + middle_version_ = new Version("16.0.912.32"); + pv_version_ = new Version("16.0.912.255"); + high_version_ = new Version("17.0.932.0"); } // Cleans up versions used by all test runs. @@ -685,7 +683,7 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { // Initializes the InstallerState to use for a test run. The returned // instance's critical update version is set to |version|. |version| may be // NULL, in which case the critical update version is unset. - MockInstallerState& Initialize(const base::Version* version) { + MockInstallerState& Initialize(const Version* version) { cmd_line_ = version == NULL ? CommandLine::FromString(L"setup.exe") : CommandLine::FromString( @@ -697,11 +695,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { return installer_state_; } - static base::Version* low_version_; - static base::Version* opv_version_; - static base::Version* middle_version_; - static base::Version* pv_version_; - static base::Version* high_version_; + static Version* low_version_; + static Version* opv_version_; + static Version* middle_version_; + static Version* pv_version_; + static Version* high_version_; CommandLine cmd_line_; scoped_ptr<MasterPreferences> prefs_; @@ -709,11 +707,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { MockInstallerState installer_state_; }; -base::Version* InstallerStateCriticalVersionTest::low_version_ = NULL; -base::Version* InstallerStateCriticalVersionTest::opv_version_ = NULL; -base::Version* InstallerStateCriticalVersionTest::middle_version_ = NULL; -base::Version* InstallerStateCriticalVersionTest::pv_version_ = NULL; -base::Version* InstallerStateCriticalVersionTest::high_version_ = NULL; +Version* InstallerStateCriticalVersionTest::low_version_ = NULL; +Version* InstallerStateCriticalVersionTest::opv_version_ = NULL; +Version* InstallerStateCriticalVersionTest::middle_version_ = NULL; +Version* InstallerStateCriticalVersionTest::pv_version_ = NULL; +Version* InstallerStateCriticalVersionTest::high_version_ = NULL; // Test the case where the critical version is less than the currently-running // Chrome. The critical version is ignored since it doesn't apply. diff --git a/chrome/installer/util/product_state_unittest.cc b/chrome/installer/util/product_state_unittest.cc index dc997f8..42c4a99 100644 --- a/chrome/installer/util/product_state_unittest.cc +++ b/chrome/installer/util/product_state_unittest.cc @@ -6,6 +6,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/test_reg_util_win.h" +#include "base/version.h" #include "base/win/registry.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc index 36d9239..fc5b96fa 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -108,7 +108,7 @@ TEST_F(ProductTest, MAYBE_ProductInstallBasic) { ASSERT_TRUE(version_key.Valid()); const char kCurrentVersion[] = "1.2.3.4"; - base::Version current_version(kCurrentVersion); + Version current_version(kCurrentVersion); version_key.WriteValue(google_update::kRegVersionField, base::UTF8ToWide( current_version.GetString()).c_str()); diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index abe4624..bb59fae 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -249,7 +249,7 @@ void GetSupportedCodecs( static void AddPepperBasedWidevine( std::vector<KeySystemInfo>* concrete_key_systems) { #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) - base::Version glibc_version(gnu_get_libc_version()); + Version glibc_version(gnu_get_libc_version()); DCHECK(glibc_version.IsValid()); if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) return; diff --git a/chrome/test/gpu/gpu_feature_browsertest.cc b/chrome/test/gpu/gpu_feature_browsertest.cc index bdd84b6..bc98d29 100644 --- a/chrome/test/gpu/gpu_feature_browsertest.cc +++ b/chrome/test/gpu/gpu_feature_browsertest.cc @@ -8,6 +8,7 @@ #include "base/path_service.h" #include "base/strings/stringprintf.h" #include "base/test/trace_event_analyzer.h" +#include "base/version.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_paths.h" diff --git a/chrome/test/mini_installer_test/installer_test_util.cc b/chrome/test/mini_installer_test/installer_test_util.cc index e7cab4c..76d1f97 100644 --- a/chrome/test/mini_installer_test/installer_test_util.cc +++ b/chrome/test/mini_installer_test/installer_test_util.cc @@ -109,7 +109,7 @@ bool GetInstalledProducts( if (type != InstallationValidator::NO_PRODUCTS) { current_dist = BrowserDistribution::GetSpecificDistribution( ToBrowserDistributionType(type)); - base::Version version; + Version version; InstallUtil::GetChromeVersion(current_dist, system_level, &version); if (version.IsValid()) { current_prod.type = type; diff --git a/chrome_frame/dll_redirector.cc b/chrome_frame/dll_redirector.cc index e52362c..b21b368 100644 --- a/chrome_frame/dll_redirector.cc +++ b/chrome_frame/dll_redirector.cc @@ -124,7 +124,7 @@ bool DllRedirector::RegisterAsFirstCFModule() { DCHECK(first_module_handle_ == NULL); // Build our own file version outside of the lock: - scoped_ptr<base::Version> our_version(GetCurrentModuleVersion()); + scoped_ptr<Version> our_version(GetCurrentModuleVersion()); // We sadly can't use the autolock here since we want to have a timeout. // Be careful not to return while holding the lock. Also, attempt to do as @@ -188,7 +188,7 @@ bool DllRedirector::RegisterAsFirstCFModule() { } else { char buffer[kSharedMemorySize] = {0}; memcpy(buffer, shared_memory_->memory(), kSharedMemorySize - 1); - dll_version_.reset(new base::Version(buffer)); + dll_version_.reset(new Version(buffer)); if (!dll_version_->IsValid() || dll_version_->Equals(*our_version.get())) { @@ -239,15 +239,15 @@ LPFNGETCLASSOBJECT DllRedirector::GetDllGetClassObjectPtr() { return proc_ptr; } -base::Version* DllRedirector::GetCurrentModuleVersion() { +Version* DllRedirector::GetCurrentModuleVersion() { scoped_ptr<FileVersionInfo> file_version_info( FileVersionInfo::CreateFileVersionInfoForCurrentModule()); DCHECK(file_version_info.get()); - scoped_ptr<base::Version> current_version; + scoped_ptr<Version> current_version; if (file_version_info.get()) { current_version.reset( - new base::Version(WideToASCII(file_version_info->file_version()))); + new Version(WideToASCII(file_version_info->file_version()))); DCHECK(current_version->IsValid()); } @@ -270,7 +270,7 @@ HMODULE DllRedirector::GetFirstModule() { return first_module_handle_; } -HMODULE DllRedirector::LoadVersionedModule(base::Version* version) { +HMODULE DllRedirector::LoadVersionedModule(Version* version) { DCHECK(version); HMODULE hmodule = NULL; diff --git a/chrome_frame/test/dll_redirector_loading_test.cc b/chrome_frame/test/dll_redirector_loading_test.cc index 3d58eba..efafa7c 100644 --- a/chrome_frame/test/dll_redirector_loading_test.cc +++ b/chrome_frame/test/dll_redirector_loading_test.cc @@ -46,7 +46,7 @@ class DllRedirectorLoadingTest : public testing::Test { FileVersionInfo::CreateFileVersionInfo(build_chrome_frame_dll)); ASSERT_TRUE(original_version_info != NULL); original_version_.reset( - new base::Version(WideToASCII(original_version_info->file_version()))); + new Version(WideToASCII(original_version_info->file_version()))); ASSERT_TRUE(original_version_->IsValid()); // Make a place for us to run the test from. @@ -81,7 +81,7 @@ class DllRedirectorLoadingTest : public testing::Test { FileVersionInfo::CreateFileVersionInfo(temporary_new_chrome_frame_dll)); ASSERT_TRUE(new_version_info != NULL); new_version_.reset( - new base::Version(WideToASCII(new_version_info->file_version()))); + new Version(WideToASCII(new_version_info->file_version()))); ASSERT_TRUE(new_version_->IsValid()); // Make sure the new version is larger than the old. @@ -110,16 +110,16 @@ class DllRedirectorLoadingTest : public testing::Test { protected: static base::FilePath original_chrome_frame_dll_; static base::FilePath new_chrome_frame_dll_; - static scoped_ptr<base::Version> original_version_; - static scoped_ptr<base::Version> new_version_; + static scoped_ptr<Version> original_version_; + static scoped_ptr<Version> new_version_; static base::ScopedTempDir temp_dir_; }; // class DllRedirectorLoadingTest base::FilePath DllRedirectorLoadingTest::original_chrome_frame_dll_; base::FilePath DllRedirectorLoadingTest::new_chrome_frame_dll_; -scoped_ptr<base::Version> DllRedirectorLoadingTest::original_version_; -scoped_ptr<base::Version> DllRedirectorLoadingTest::new_version_; +scoped_ptr<Version> DllRedirectorLoadingTest::original_version_; +scoped_ptr<Version> DllRedirectorLoadingTest::new_version_; base::ScopedTempDir DllRedirectorLoadingTest::temp_dir_; #if defined(COMPONENT_BUILD) @@ -135,7 +135,7 @@ TEST_F(DllRedirectorLoadingTest, MAYBE_TestDllRedirection) { struct TestData { base::FilePath first_dll; base::FilePath second_dll; - base::Version* expected_beacon_version; + Version* expected_beacon_version; } test_data[] = { { original_chrome_frame_dll_, @@ -208,7 +208,7 @@ TEST_F(DllRedirectorLoadingTest, MAYBE_TestDllRedirection) { char buffer[kSharedMemoryBytes] = {0}; memcpy(buffer, beacon.memory(), kSharedMemoryBytes - 1); - base::Version beacon_version(buffer); + Version beacon_version(buffer); ASSERT_TRUE(beacon_version.IsValid()); EXPECT_EQ(0, diff --git a/chrome_frame/test/dll_redirector_test.cc b/chrome_frame/test/dll_redirector_test.cc index 853235a..104eba2 100644 --- a/chrome_frame/test/dll_redirector_test.cc +++ b/chrome_frame/test/dll_redirector_test.cc @@ -36,17 +36,17 @@ class MockDllRedirector : public DllRedirector { return kMockModuleHandle; } - virtual base::Version* GetCurrentModuleVersion() { - return new base::Version(kMockVersionString); + virtual Version* GetCurrentModuleVersion() { + return new Version(kMockVersionString); } virtual HMODULE GetFirstModule() { return DllRedirector::GetFirstModule(); } - base::Version* GetFirstModuleVersion() { + Version* GetFirstModuleVersion() { // Lazy man's copy. - return new base::Version(dll_version_->GetString()); + return new Version(dll_version_->GetString()); } base::SharedMemory* shared_memory() { @@ -63,8 +63,8 @@ class MockDllRedirector2 : public MockDllRedirector { return kMockModuleHandle2; } - virtual base::Version* GetCurrentModuleVersion() { - return new base::Version(kMockVersionString2); + virtual Version* GetCurrentModuleVersion() { + return new Version(kMockVersionString2); } }; @@ -87,8 +87,8 @@ class DllRedirectorTest : public testing::Test { public: virtual void SetUp() { shared_memory_.reset(new base::SharedMemory); - mock_version_.reset(new base::Version(kMockVersionString)); - mock_version2_.reset(new base::Version(kMockVersionString2)); + mock_version_.reset(new Version(kMockVersionString)); + mock_version2_.reset(new Version(kMockVersionString2)); } virtual void TearDown() { @@ -111,7 +111,7 @@ class DllRedirectorTest : public testing::Test { } // Opens the named beacon and returns the version. - base::Version* OpenAndReadVersionFromBeacon(const std::string& name) { + Version* OpenAndReadVersionFromBeacon(const std::string& name) { // Abort the test if we can't open and map the named memory object. EXPECT_TRUE(shared_memory_->Open(name, true /* read_only */)); EXPECT_TRUE(shared_memory_->Map(0)); @@ -119,7 +119,7 @@ class DllRedirectorTest : public testing::Test { char buffer[kSharedMemorySize] = {0}; memcpy(buffer, shared_memory_->memory(), kSharedMemorySize - 1); - scoped_ptr<base::Version> version(new base::Version(buffer)); + scoped_ptr<Version> version(new Version(buffer)); if (!version->IsValid()) version.reset(); return version.release(); @@ -131,8 +131,8 @@ class DllRedirectorTest : public testing::Test { // Shared memory segment that contains the version beacon. scoped_ptr<base::SharedMemory> shared_memory_; - scoped_ptr<base::Version> mock_version_; - scoped_ptr<base::Version> mock_version2_; + scoped_ptr<Version> mock_version_; + scoped_ptr<Version> mock_version2_; }; TEST_F(DllRedirectorTest, RegisterAsFirstModule) { @@ -143,12 +143,12 @@ TEST_F(DllRedirectorTest, RegisterAsFirstModule) { base::SharedMemory* redirector_memory = redirector->shared_memory(); char buffer[kSharedMemorySize] = {0}; memcpy(buffer, redirector_memory->memory(), kSharedMemorySize - 1); - base::Version redirector_version(buffer); + Version redirector_version(buffer); ASSERT_TRUE(redirector_version.IsValid()); EXPECT_TRUE(redirector_version.Equals(*mock_version_.get())); redirector_memory = NULL; - scoped_ptr<base::Version> memory_version( + scoped_ptr<Version> memory_version( OpenAndReadVersionFromBeacon(kTestVersionBeaconName)); ASSERT_TRUE(memory_version.get()); EXPECT_TRUE(redirector_version.Equals(*memory_version.get())); @@ -167,9 +167,9 @@ TEST_F(DllRedirectorTest, SecondModuleLoading) { new MockDllRedirector2(kTestVersionBeaconName)); EXPECT_FALSE(second_redirector->RegisterAsFirstCFModule()); - scoped_ptr<base::Version> first_redirector_version( + scoped_ptr<Version> first_redirector_version( first_redirector->GetFirstModuleVersion()); - scoped_ptr<base::Version> second_redirector_version( + scoped_ptr<Version> second_redirector_version( second_redirector->GetFirstModuleVersion()); EXPECT_TRUE( @@ -189,9 +189,9 @@ TEST_F(DllRedirectorTest, TestBeaconOwnershipHandoff) { new MockDllRedirector2(kTestVersionBeaconName)); EXPECT_FALSE(second_redirector->RegisterAsFirstCFModule()); - scoped_ptr<base::Version> first_redirector_version( + scoped_ptr<Version> first_redirector_version( first_redirector->GetFirstModuleVersion()); - scoped_ptr<base::Version> second_redirector_version( + scoped_ptr<Version> second_redirector_version( second_redirector->GetFirstModuleVersion()); EXPECT_TRUE( @@ -207,7 +207,7 @@ TEST_F(DllRedirectorTest, TestBeaconOwnershipHandoff) { new MockDllRedirector2(kTestVersionBeaconName)); EXPECT_FALSE(third_redirector->RegisterAsFirstCFModule()); - scoped_ptr<base::Version> third_redirector_version( + scoped_ptr<Version> third_redirector_version( third_redirector->GetFirstModuleVersion()); EXPECT_TRUE( @@ -224,7 +224,7 @@ TEST_F(DllRedirectorTest, TestBeaconOwnershipHandoff) { new MockDllRedirector2(kTestVersionBeaconName)); EXPECT_TRUE(fourth_redirector->RegisterAsFirstCFModule()); - scoped_ptr<base::Version> fourth_redirector_version( + scoped_ptr<Version> fourth_redirector_version( fourth_redirector->GetFirstModuleVersion()); EXPECT_TRUE( @@ -281,7 +281,7 @@ TEST_F(DllRedirectorTest, LockSquatting) { new MockDllRedirector2(kTestVersionBeaconName)); EXPECT_TRUE(second_redirector->RegisterAsFirstCFModule()); - scoped_ptr<base::Version> second_redirector_version( + scoped_ptr<Version> second_redirector_version( second_redirector->GetFirstModuleVersion()); EXPECT_TRUE( second_redirector_version->Equals(*mock_version2_.get())); diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index 06047f0..d979dd9 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -306,9 +306,9 @@ void ChromeFrameTestWithWebServer::VersionTest(BrowserKind browser, // the directory where chrome is installed. if (!version_info) { BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - base::Version ver_system; + Version ver_system; InstallUtil::GetChromeVersion(dist, true, &ver_system); - base::Version ver_user; + Version ver_user; InstallUtil::GetChromeVersion(dist, false, &ver_system); ASSERT_TRUE(ver_system.IsValid() || ver_user.IsValid()); diff --git a/components/variations/processed_study.cc b/components/variations/processed_study.cc index a34f894..9d0e4f1 100644 --- a/components/variations/processed_study.cc +++ b/components/variations/processed_study.cc @@ -23,13 +23,13 @@ bool ValidateStudyAndComputeTotalProbability( return false; } if (study.filter().has_min_version() && - !base::Version::IsValidWildcardString(study.filter().min_version())) { + !Version::IsValidWildcardString(study.filter().min_version())) { DVLOG(1) << study.name() << " has invalid min version: " << study.filter().min_version(); return false; } if (study.filter().has_max_version() && - !base::Version::IsValidWildcardString(study.filter().max_version())) { + !Version::IsValidWildcardString(study.filter().max_version())) { DVLOG(1) << study.name() << " has invalid max version: " << study.filter().max_version(); return false; diff --git a/components/variations/variations_seed_processor_unittest.cc b/components/variations/variations_seed_processor_unittest.cc index e03fcd9..cbf0864 100644 --- a/components/variations/variations_seed_processor_unittest.cc +++ b/components/variations/variations_seed_processor_unittest.cc @@ -399,8 +399,9 @@ TEST_F(VariationsSeedProcessorTest, CheckStudyVersion) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(min_test_cases); ++i) { filter.set_min_version(min_test_cases[i].min_version); - const bool result = seed_processor.CheckStudyVersion( - filter, base::Version(min_test_cases[i].version)); + const bool result = + seed_processor.CheckStudyVersion(filter, + Version(min_test_cases[i].version)); EXPECT_EQ(min_test_cases[i].expected_result, result) << "Min. version case " << i << " failed!"; } @@ -408,8 +409,9 @@ TEST_F(VariationsSeedProcessorTest, CheckStudyVersion) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(max_test_cases); ++i) { filter.set_max_version(max_test_cases[i].max_version); - const bool result = seed_processor.CheckStudyVersion( - filter, base::Version(max_test_cases[i].version)); + const bool result = + seed_processor.CheckStudyVersion(filter, + Version(max_test_cases[i].version)); EXPECT_EQ(max_test_cases[i].expected_result, result) << "Max version case " << i << " failed!"; } @@ -421,14 +423,16 @@ TEST_F(VariationsSeedProcessorTest, CheckStudyVersion) { filter.set_max_version(max_test_cases[j].max_version); if (!min_test_cases[i].expected_result) { - const bool result = seed_processor.CheckStudyVersion( - filter, base::Version(min_test_cases[i].version)); + const bool result = + seed_processor.CheckStudyVersion( + filter, Version(min_test_cases[i].version)); EXPECT_FALSE(result) << "Case " << i << "," << j << " failed!"; } if (!max_test_cases[j].expected_result) { - const bool result = seed_processor.CheckStudyVersion( - filter, base::Version(max_test_cases[j].version)); + const bool result = + seed_processor.CheckStudyVersion( + filter, Version(max_test_cases[j].version)); EXPECT_FALSE(result) << "Case " << i << "," << j << " failed!"; } } diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index eb5db66..d742412 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -75,7 +75,7 @@ int GetGpuBlacklistHistogramValueWin(GpuFeatureStatus status) { size_t pos = version_str.find_first_not_of("0123456789."); if (pos != std::string::npos) version_str = version_str.substr(0, pos); - base::Version os_version(version_str); + Version os_version(version_str); if (os_version.IsValid() && os_version.components().size() >= 2) { const std::vector<uint16>& version_numbers = os_version.components(); if (version_numbers[0] == 5) diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index 31d3e27..9133e59 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -46,10 +46,10 @@ void PluginDataRemover::GetSupportedPlugins( std::vector<WebPluginInfo> plugins; PluginService::GetInstance()->GetPluginInfoArray( GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); - base::Version min_version(kMinFlashVersion); + Version min_version(kMinFlashVersion); for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); it != plugins.end(); ++it) { - base::Version version; + Version version; WebPluginInfo::CreateVersionFromString(it->version, &version); if (version.IsValid() && min_version.CompareTo(version) == -1) supported_plugins->push_back(*it); diff --git a/content/child/npapi/webplugin_delegate_impl_win.cc b/content/child/npapi/webplugin_delegate_impl_win.cc index deaa375..73bb442 100644 --- a/content/child/npapi/webplugin_delegate_impl_win.cc +++ b/content/child/npapi/webplugin_delegate_impl_win.cc @@ -191,7 +191,7 @@ std::wstring GetKeyPath(HKEY key) { } int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { - base::Version plugin_version; + Version plugin_version; WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); int major_version = 0; diff --git a/content/common/webplugininfo_unittest.cc b/content/common/webplugininfo_unittest.cc index e067e45..1d659c3 100644 --- a/content/common/webplugininfo_unittest.cc +++ b/content/common/webplugininfo_unittest.cc @@ -31,7 +31,7 @@ TEST(PluginUtilsTest, VersionExtraction) { }; for (size_t i = 0; i < arraysize(versions); i++) { - base::Version version; + Version version; WebPluginInfo::CreateVersionFromString( base::ASCIIToUTF16(versions[i][0]), &version); diff --git a/content/public/common/webplugininfo.cc b/content/public/common/webplugininfo.cc index 760a634..6f53d05 100644 --- a/content/public/common/webplugininfo.cc +++ b/content/public/common/webplugininfo.cc @@ -97,7 +97,7 @@ void WebPluginInfo::CreateVersionFromString( } } - *parsed_version = base::Version(no_leading_zeros_version); + *parsed_version = Version(no_leading_zeros_version); } } // namespace content diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc index 90e7c1d..cbc2f2c 100644 --- a/content/renderer/npapi/webplugin_delegate_proxy.cc +++ b/content/renderer/npapi/webplugin_delegate_proxy.cc @@ -23,6 +23,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/version.h" #include "content/child/child_process.h" #include "content/child/npapi/npobject_proxy.h" #include "content/child/npapi/npobject_stub.h" diff --git a/extensions/browser/pending_extension_info.cc b/extensions/browser/pending_extension_info.cc index 83e6201..0abcdf6 100644 --- a/extensions/browser/pending_extension_info.cc +++ b/extensions/browser/pending_extension_info.cc @@ -11,7 +11,7 @@ namespace extensions { PendingExtensionInfo::PendingExtensionInfo( const std::string& id, const GURL& update_url, - const base::Version& version, + const Version& version, ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, bool install_silently, diff --git a/extensions/browser/pending_extension_info.h b/extensions/browser/pending_extension_info.h index b2eb00f..fd1d3ae 100644 --- a/extensions/browser/pending_extension_info.h +++ b/extensions/browser/pending_extension_info.h @@ -30,7 +30,7 @@ class PendingExtensionInfo { PendingExtensionInfo( const std::string& id, const GURL& update_url, - const base::Version& version, + const Version& version, ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, bool install_silently, @@ -46,7 +46,7 @@ class PendingExtensionInfo { const std::string& id() const { return id_; } const GURL& update_url() const { return update_url_; } - const base::Version& version() const { return version_; } + const Version& version() const { return version_; } // ShouldAllowInstall() returns the result of running constructor argument // |should_allow_install| on an extension. After an extension is unpacked, @@ -74,7 +74,7 @@ class PendingExtensionInfo { std::string id_; GURL update_url_; - base::Version version_; + Version version_; // When the extension is about to be installed, this function is // called. If this function returns true, the install proceeds. If diff --git a/extensions/browser/pending_extension_manager.cc b/extensions/browser/pending_extension_manager.cc index ae74e41..d16b92b 100644 --- a/extensions/browser/pending_extension_manager.cc +++ b/extensions/browser/pending_extension_manager.cc @@ -22,7 +22,7 @@ bool AlwaysInstall(const extensions::Extension* extension) { return true; } -std::string GetVersionString(const base::Version& version) { +std::string GetVersionString(const Version& version) { return version.IsValid() ? version.GetString() : "invalid"; } @@ -109,7 +109,7 @@ bool PendingExtensionManager::AddFromSync( const Manifest::Location kSyncLocation = Manifest::INTERNAL; const bool kMarkAcknowledged = false; - return AddExtensionImpl(id, update_url, base::Version(), should_allow_install, + return AddExtensionImpl(id, update_url, Version(), should_allow_install, kIsFromSync, install_silently, kSyncLocation, Extension::NO_FLAGS, kMarkAcknowledged); } @@ -131,7 +131,7 @@ bool PendingExtensionManager::AddFromExtensionImport( const Manifest::Location kManifestLocation = Manifest::INTERNAL; const bool kMarkAcknowledged = false; - return AddExtensionImpl(id, update_url, base::Version(), should_allow_install, + return AddExtensionImpl(id, update_url, Version(), should_allow_install, kIsFromSync, kInstallSilently, kManifestLocation, Extension::NO_FLAGS, kMarkAcknowledged); } @@ -164,7 +164,7 @@ bool PendingExtensionManager::AddFromExternalUpdateUrl( } } - return AddExtensionImpl(id, update_url, base::Version(), &AlwaysInstall, + return AddExtensionImpl(id, update_url, Version(), &AlwaysInstall, kIsFromSync, kInstallSilently, location, creation_flags, mark_acknowledged); } @@ -173,7 +173,7 @@ bool PendingExtensionManager::AddFromExternalUpdateUrl( bool PendingExtensionManager::AddFromExternalFile( const std::string& id, Manifest::Location install_source, - const base::Version& version, + const Version& version, int creation_flags, bool mark_acknowledged) { // TODO(skerner): AddFromSync() checks to see if the extension is @@ -218,7 +218,7 @@ void PendingExtensionManager::GetPendingIdsForUpdateCheck( bool PendingExtensionManager::AddExtensionImpl( const std::string& id, const GURL& update_url, - const base::Version& version, + const Version& version, PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, bool install_silently, diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index ceb6a79..d3bb5a7 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc @@ -590,7 +590,7 @@ bool Extension::LoadVersion(base::string16* error) { *error = base::ASCIIToUTF16(errors::kInvalidVersion); return false; } - version_.reset(new base::Version(version_str)); + version_.reset(new Version(version_str)); if (!version_->IsValid() || version_->components().size() > 4) { *error = base::ASCIIToUTF16(errors::kInvalidVersion); return false; diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc index 0c01f75..5f44160 100644 --- a/extensions/common/manifest_handlers/shared_module_info.cc +++ b/extensions/common/manifest_handlers/shared_module_info.cc @@ -175,7 +175,7 @@ bool SharedModuleInfo::Parse(const Extension* extension, return false; } imports_.back().minimum_version = min_version; - base::Version v(min_version); + Version v(min_version); if (!v.IsValid()) { *error = ErrorUtils::FormatErrorMessageUTF16( errors::kInvalidImportVersion, base::IntToString(i)); diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc index f789790..c3dc16f 100644 --- a/gpu/config/gpu_info.cc +++ b/gpu/config/gpu_info.cc @@ -48,7 +48,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { bool optimus; bool amd_switchable; bool lenovo_dcute; - base::Version display_link_version; + Version display_link_version; GPUDevice gpu; std::vector<GPUDevice> secondary_gpus; uint64 adapter_luid; diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h index ec22ed5..09417f7 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h @@ -66,7 +66,7 @@ struct GPU_EXPORT GPUInfo { // Version of DisplayLink driver installed. Zero if not installed. // http://crbug.com/177611. - base::Version display_link_version; + Version display_link_version; // Primary GPU, for exmaple, the discrete GPU in a dual GPU machine. GPUDevice gpu; diff --git a/gpu/config/gpu_info_collector_win.cc b/gpu/config/gpu_info_collector_win.cc index db608d9..6467262 100644 --- a/gpu/config/gpu_info_collector_win.cc +++ b/gpu/config/gpu_info_collector_win.cc @@ -170,23 +170,23 @@ GpuPerformanceStats RetrieveGpuPerformanceStatsWithHistograms() { // Returns the display link driver version or an invalid version if it is // not installed. -base::Version DisplayLinkVersion() { +Version DisplayLinkVersion() { base::win::RegKey key; if (key.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY)) - return base::Version(); + return Version(); if (key.OpenKey(L"DisplayLink", KEY_READ | KEY_WOW64_64KEY)) - return base::Version(); + return Version(); if (key.OpenKey(L"Core", KEY_READ | KEY_WOW64_64KEY)) - return base::Version(); + return Version(); base::string16 version; if (key.ReadValue(L"Version", &version)) - return base::Version(); + return Version(); - return base::Version(WideToASCII(version)); + return Version(WideToASCII(version)); } // Returns whether Lenovo dCute is installed. |