From 9c2f5dc9c732beb936b41d073bf5ec7adefb0872 Mon Sep 17 00:00:00 2001 From: tfarina Date: Tue, 18 Aug 2015 17:05:02 -0700 Subject: [PATCH] base: Remove using:: declaration from version.h header. BUG=None R=brettw@chromium.org Review URL: https://codereview.chromium.org/1281313003 Cr-Commit-Position: refs/heads/master@{#344088} --- base/version.h | 5 -- base/version_unittest.cc | 3 + chrome/app/chrome_crash_reporter_client.cc | 2 +- chrome/app/client_util.cc | 2 +- chrome/browser/chrome_browser_main_win.cc | 2 +- .../chromeos/login/kiosk_browsertest.cc | 2 +- .../component_installers_unittest.cc | 2 +- .../ev_whitelist_component_installer.cc | 2 +- .../pepper_flash_component_installer.cc | 26 +++---- .../pnacl_component_installer.cc | 20 +++--- .../recovery_component_installer.cc | 20 +++--- .../sw_reporter_installer_win.cc | 2 +- .../swiftshader_component_installer.cc | 18 ++--- chrome/browser/enumerate_modules_model_win.cc | 6 +- .../runtime/chrome_runtime_api_delegate.cc | 5 +- .../chrome_extensions_browser_client.cc | 2 +- chrome/browser/extensions/crx_installer.cc | 6 +- chrome/browser/extensions/crx_installer.h | 6 +- .../extension_management_internal.cc | 2 +- .../browser/extensions/extension_service.cc | 16 ++--- .../extensions/extension_service_unittest.cc | 40 +++++------ .../browser/extensions/extension_sync_data.cc | 2 +- .../browser/extensions/extension_sync_data.h | 4 +- .../extension_sync_data_unittest.cc | 2 +- .../external_policy_loader_unittest.cc | 4 +- .../extensions/external_provider_impl.cc | 13 ++-- .../external_registry_loader_win.cc | 2 +- .../extensions/pending_extension_info.cc | 2 +- .../extensions/pending_extension_info.h | 6 +- .../extensions/pending_extension_manager.cc | 13 ++-- .../browser/extensions/unpacked_installer.cc | 2 +- .../updater/extension_updater_unittest.cc | 6 +- .../updater/local_extension_cache.cc | 8 +-- .../browser/extensions/webstore_installer.cc | 7 +- .../browser/extensions/webstore_installer.h | 2 +- .../hang_monitor/hung_plugin_action.cc | 2 +- ...chrome_browser_main_extra_parts_metrics.cc | 2 +- chrome/browser/net/crl_set_fetcher.cc | 4 +- chrome/browser/plugins/plugin_finder.cc | 2 +- chrome/browser/plugins/plugin_metadata.cc | 15 ++-- chrome/browser/plugins/plugin_metadata.h | 6 +- .../plugins/plugin_metadata_unittest.cc | 6 +- chrome/browser/prefs/session_startup_pref.cc | 8 +-- chrome/browser/profiles/profile_impl.cc | 4 +- .../ui/startup/default_browser_prompt.cc | 5 +- chrome/browser/upgrade_detector_impl.cc | 16 ++--- chrome/common/chrome_content_client.cc | 4 +- .../minimum_chrome_version_checker.cc | 4 +- chrome/common/pepper_flash.cc | 4 +- chrome/common/service_process_util.cc | 4 +- chrome/common/service_process_util_mac.mm | 4 +- chrome/installer/setup/install.cc | 10 +-- chrome/installer/setup/install.h | 4 +- chrome/installer/setup/install_unittest.cc | 4 +- chrome/installer/setup/install_worker.cc | 32 ++++----- .../setup/install_worker_unittest.cc | 20 +++--- chrome/installer/setup/setup_main.cc | 9 ++- chrome/installer/setup/setup_util.cc | 12 ++-- chrome/installer/setup/setup_util.h | 2 +- chrome/installer/setup/setup_util_unittest.cc | 18 ++--- chrome/installer/setup/uninstall.cc | 8 +-- .../test/alternate_version_generator.cc | 6 +- chrome/installer/util/browser_distribution.cc | 6 +- chrome/installer/util/browser_distribution.h | 2 +- .../installer/util/fake_installation_state.h | 4 +- chrome/installer/util/fake_product_state.h | 2 +- .../util/google_chrome_distribution.cc | 2 +- .../util/google_chrome_distribution.h | 2 +- .../util/google_chrome_distribution_dummy.cc | 2 +- .../installer/util/google_update_settings.cc | 7 +- .../installer/util/google_update_settings.h | 2 +- .../util/google_update_settings_unittest.cc | 4 +- chrome/installer/util/install_util.cc | 12 ++-- chrome/installer/util/installation_state.cc | 11 +-- chrome/installer/util/installation_state.h | 4 +- .../util/installation_validator_unittest.cc | 2 +- chrome/installer/util/installer_state.cc | 30 ++++---- .../util/installer_state_unittest.cc | 68 ++++++++++--------- chrome/installer/util/product_unittest.cc | 2 +- chrome/renderer/media/chrome_key_systems.cc | 2 +- .../component_updater_service_unittest.cc | 8 +-- .../update_client/action_update_check.cc | 8 +-- components/update_client/crx_update_item.h | 4 +- components/update_client/test_installer.cc | 2 +- components/update_client/test_installer.h | 2 +- components/update_client/update_client.h | 2 +- .../update_client/update_client_unittest.cc | 28 ++++---- components/update_client/update_response.cc | 4 +- components/variations/processed_study.cc | 4 +- .../variations/study_filtering_unittest.cc | 18 +++-- .../gpu/gpu_data_manager_impl_private.cc | 2 +- content/browser/plugin_data_remover_impl.cc | 4 +- .../npapi/webplugin_delegate_impl_win.cc | 2 +- content/common/webplugininfo_unittest.cc | 2 +- content/public/common/webplugininfo.cc | 2 +- extensions/browser/api/runtime/runtime_api.cc | 6 +- .../browser/updater/extension_downloader.cc | 16 ++--- extensions/browser/user_script_loader.cc | 2 +- extensions/common/extension.cc | 2 +- .../manifest_handlers/shared_module_info.cc | 2 +- extensions/common/update_manifest.cc | 4 +- gpu/config/gpu_info.cc | 2 +- gpu/config/gpu_info.h | 2 +- gpu/config/gpu_info_collector_win.cc | 12 ++-- 104 files changed, 393 insertions(+), 388 deletions(-) diff --git a/base/version.h b/base/version.h index 814acaa2b4ed83..7ce18dc10f8f00 100644 --- a/base/version.h +++ b/base/version.h @@ -10,7 +10,6 @@ #include #include "base/base_export.h" -#include "base/basictypes.h" namespace base { @@ -66,8 +65,4 @@ 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 f40ed27d881263..9f6369e75b1bfb 100644 --- a/base/version_unittest.cc +++ b/base/version_unittest.cc @@ -4,8 +4,10 @@ #include "base/version.h" +#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" +namespace base { namespace { TEST(VersionTest, DefaultConstructor) { @@ -152,3 +154,4 @@ TEST(VersionTest, IsValidWildcardString) { } } // namespace +} // namespace base diff --git a/chrome/app/chrome_crash_reporter_client.cc b/chrome/app/chrome_crash_reporter_client.cc index 95ee24ff8f8536..74567d2ebc5e7a 100644 --- a/chrome/app/chrome_crash_reporter_client.cc +++ b/chrome/app/chrome_crash_reporter_client.cc @@ -159,7 +159,7 @@ bool ChromeCrashReporterClient::AboutToRestart() { bool ChromeCrashReporterClient::GetDeferredUploadsSupported( bool is_per_user_install) { - Version update_version = GoogleUpdateSettings::GetGoogleUpdateVersion( + base::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 b01d86e25dd19f..3d740a7f71cf84 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -102,7 +102,7 @@ base::string16 GetCurrentModuleVersion() { FileVersionInfo::CreateFileVersionInfoForCurrentModule()); if (file_version_info.get()) { base::string16 version_string(file_version_info->file_version()); - if (Version(base::UTF16ToASCII(version_string)).IsValid()) + if (base::Version(base::UTF16ToASCII(version_string)).IsValid()) return version_string; } return base::string16(); diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index d87729abac28fa..442eb0d7403248 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -507,7 +507,7 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { // TODO(tommi): Check if using the default distribution is always the right // thing to do. BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - Version version; + base::Version version; InstallUtil::GetChromeVersion(dist, true, &version); if (version.IsValid()) { base::FilePath exe_path; diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index 22a2b6edf2a5fa..5d3c32b729062d 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc @@ -554,7 +554,7 @@ class KioskTest : public OobeBaseTest { extension_service()->GetInstalledExtension(test_app_id_); } - const Version& GetInstalledAppVersion() { + const base::Version& GetInstalledAppVersion() { return *GetInstalledApp()->version(); } diff --git a/chrome/browser/component_updater/component_installers_unittest.cc b/chrome/browser/component_updater/component_installers_unittest.cc index 10c5834824c0de..96545422a8a439 100644 --- a/chrome/browser/component_updater/component_installers_unittest.cc +++ b/chrome/browser/component_updater/component_installers_unittest.cc @@ -80,7 +80,7 @@ TEST(ComponentInstallerTest, PepperFlashCheck) { ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); // This checks that the whole manifest is compatible. - Version version; + base::Version version; EXPECT_TRUE(chrome::CheckPepperFlashManifest(*root, &version)); EXPECT_TRUE(version.IsValid()); } diff --git a/chrome/browser/component_updater/ev_whitelist_component_installer.cc b/chrome/browser/component_updater/ev_whitelist_component_installer.cc index dda01a4689b608..742b353ee023f9 100644 --- a/chrome/browser/component_updater/ev_whitelist_component_installer.cc +++ b/chrome/browser/component_updater/ev_whitelist_component_installer.cc @@ -79,7 +79,7 @@ void DoInitialLoadFromDisk(const base::FilePath& stored_whitelist_path) { // which will have a valid version. scoped_refptr new_whitelist( new packed_ct_ev_whitelist::PackedEVCertsWhitelist(compressed_list, - Version())); + base::Version())); if (!new_whitelist->IsValid()) { VLOG(1) << "Failed uncompressing EV certs whitelist."; return; diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index 9c46ecfd68fad8..ca6b1fd829ab49 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -65,7 +65,7 @@ const char kNullVersion[] = "0.0.0.0"; // |latest_version| returns the corresponding version number. |older_dirs| // returns directories of all older versions. bool GetPepperFlashDirectory(base::FilePath* latest_dir, - Version* latest_version, + base::Version* latest_version, std::vector* older_dirs) { DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath base_dir; @@ -79,7 +79,7 @@ bool GetPepperFlashDirectory(base::FilePath* latest_dir, base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - Version version(path.BaseName().MaybeAsASCII()); + base::Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (found) { @@ -102,7 +102,7 @@ bool GetPepperFlashDirectory(base::FilePath* latest_dir, #if !defined(OS_LINUX) || defined(GOOGLE_CHROME_BUILD) bool MakePepperFlashPluginInfo(const base::FilePath& flash_path, - const Version& flash_version, + const base::Version& flash_version, bool out_of_process, content::PepperPluginInfo* plugin_info) { if (!flash_version.IsValid()) @@ -146,7 +146,7 @@ bool IsPepperFlash(const content::WebPluginInfo& plugin) { } void RegisterPepperFlashWithChrome(const base::FilePath& path, - const Version& version) { + const base::Version& version) { DCHECK_CURRENTLY_ON(BrowserThread::UI); content::PepperPluginInfo plugin_info; if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) @@ -162,7 +162,7 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path, continue; // Do it only if the version we're trying to register is newer. - Version registered_version(base::UTF16ToUTF8(it->version)); + base::Version registered_version(base::UTF16ToUTF8(it->version)); if (registered_version.IsValid() && version.CompareTo(registered_version) <= 0) { return; @@ -183,7 +183,7 @@ void RegisterPepperFlashWithChrome(const base::FilePath& path, class PepperFlashComponentInstaller : public update_client::CrxInstaller { public: - explicit PepperFlashComponentInstaller(const Version& version); + explicit PepperFlashComponentInstaller(const base::Version& version); // ComponentInstaller implementation: void OnUpdateError(int error) override; @@ -199,11 +199,11 @@ class PepperFlashComponentInstaller : public update_client::CrxInstaller { private: ~PepperFlashComponentInstaller() override {} - Version current_version_; + base::Version current_version_; }; PepperFlashComponentInstaller::PepperFlashComponentInstaller( - const Version& version) + const base::Version& version) : current_version_(version) { DCHECK(version.IsValid()); } @@ -215,7 +215,7 @@ void PepperFlashComponentInstaller::OnUpdateError(int error) { bool PepperFlashComponentInstaller::Install( const base::DictionaryValue& manifest, const base::FilePath& unpack_path) { - Version version; + base::Version version; if (!chrome::CheckPepperFlashManifest(manifest, &version)) return false; if (current_version_.CompareTo(version) > 0) @@ -279,7 +279,7 @@ namespace { #if defined(GOOGLE_CHROME_BUILD) void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus, - const Version& version) { + const base::Version& version) { DCHECK_CURRENTLY_ON(BrowserThread::UI); update_client::CrxComponent pepflash; pepflash.name = "pepper_flash"; @@ -305,7 +305,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { } } - Version version(kNullVersion); + base::Version version(kNullVersion); std::vector older_dirs; if (GetPepperFlashDirectory(&path, &version, &older_dirs)) { path = path.Append(chrome::kPepperFlashPluginFilename); @@ -315,7 +315,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { FROM_HERE, base::Bind(&RegisterPepperFlashWithChrome, path, version)); } else { - version = Version(kNullVersion); + version = base::Version(kNullVersion); } } @@ -324,7 +324,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { // than the version of the component, or the component has never been updated, // then set the bundled version as the current version. if (version.CompareTo(Version(FLAPPER_VERSION_STRING)) < 0) - version = Version(FLAPPER_VERSION_STRING); + version = base::Version(FLAPPER_VERSION_STRING); #endif BrowserThread::PostTask( diff --git a/chrome/browser/component_updater/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl_component_installer.cc index 4f2c8228c08f5d..4ad67f3373b079 100644 --- a/chrome/browser/component_updater/pnacl_component_installer.cc +++ b/chrome/browser/component_updater/pnacl_component_installer.cc @@ -94,7 +94,7 @@ void OverrideDirPnaclComponent(const base::FilePath& base_path) { bool GetLatestPnaclDirectory(const scoped_refptr& pci, base::FilePath* latest_dir, - Version* latest_version, + base::Version* latest_version, std::vector* older_dirs) { // Enumerate all versions starting from the base directory. base::FilePath base_dir = pci->GetPnaclBaseDirectory(); @@ -103,7 +103,7 @@ bool GetLatestPnaclDirectory(const scoped_refptr& pci, base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - Version version(path.BaseName().MaybeAsASCII()); + base::Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (found) { @@ -158,7 +158,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, - Version* version_out) { + base::Version* version_out) { // Make sure we have the right |manifest| file. std::string name; if (!manifest.GetStringASCII("name", &name)) { @@ -179,7 +179,7 @@ bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest, LOG(WARNING) << "'version' field is missing from manifest!"; return false; } - Version version(proposed_version.c_str()); + base::Version version(proposed_version.c_str()); if (!version.IsValid()) { LOG(WARNING) << "'version' field in manifest is invalid " << version.GetString(); @@ -233,7 +233,7 @@ bool PnaclComponentInstaller::Install(const base::DictionaryValue& manifest, return false; } - Version version; + base::Version version; if (!CheckPnaclComponentManifest(manifest, *pnacl_manifest, &version)) { LOG(WARNING) << "CheckPnaclComponentManifest failed, not installing."; return false; @@ -271,7 +271,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(Version(kNullVersion))) + if (current_version().Equals(base::Version(kNullVersion))) return false; *installed_file = GetPnaclBaseDirectory() @@ -298,7 +298,7 @@ CrxComponent PnaclComponentInstaller::GetCrxComponent() { namespace { void FinishPnaclUpdateRegistration( - const Version& current_version, + const base::Version& current_version, const std::string& current_fingerprint, const scoped_refptr& pci) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -324,13 +324,13 @@ void StartPnaclUpdateRegistration( } } - Version current_version(kNullVersion); + base::Version current_version(kNullVersion); std::string current_fingerprint; std::vector older_dirs; if (GetLatestPnaclDirectory(pci, &path, ¤t_version, &older_dirs)) { scoped_ptr manifest(ReadComponentManifest(path)); scoped_ptr pnacl_manifest(ReadPnaclManifest(path)); - Version manifest_version; + base::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. @@ -339,7 +339,7 @@ void StartPnaclUpdateRegistration( *pnacl_manifest, &manifest_version) || !current_version.Equals(manifest_version)) { - current_version = Version(kNullVersion); + current_version = base::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 3657d6458dc7cc..5341290c2e8ad2 100644 --- a/chrome/browser/component_updater/recovery_component_installer.cc +++ b/chrome/browser/component_updater/recovery_component_installer.cc @@ -92,7 +92,7 @@ base::CommandLine GetRecoveryInstallCommandLine( const base::FilePath& command, const base::DictionaryValue& manifest, bool is_deferred_run, - const Version& version) { + const base::Version& version) { base::CommandLine command_line(command); // Add a flag to for re-attempted install with elevated privilege so that the @@ -154,7 +154,7 @@ void DoElevatedInstallRecoveryComponent(const base::FilePath& path) { return; std::string proposed_version; manifest->GetStringASCII("version", &proposed_version); - const Version version(proposed_version.c_str()); + const base::Version version(proposed_version.c_str()); if (!version.IsValid()) return; @@ -195,7 +195,7 @@ void ElevatedInstallRecoveryComponent(const base::FilePath& installer_path) { // See chrome/browser/recovery/recovery_install_global_error.cc for details. class RecoveryComponentInstaller : public update_client::CrxInstaller { public: - RecoveryComponentInstaller(const Version& version, PrefService* prefs); + RecoveryComponentInstaller(const base::Version& version, PrefService* prefs); // ComponentInstaller implementation: void OnUpdateError(int error) override; @@ -214,7 +214,7 @@ class RecoveryComponentInstaller : public update_client::CrxInstaller { bool RunInstallCommand(const base::CommandLine& cmdline, const base::FilePath& installer_folder) const; - Version current_version_; + base::Version current_version_; PrefService* prefs_; }; @@ -224,7 +224,7 @@ void SimulateElevatedRecoveryHelper(PrefService* prefs) { void RecoveryRegisterHelper(ComponentUpdateService* cus, PrefService* prefs) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - Version version(prefs->GetString(prefs::kRecoveryComponentVersion)); + base::Version version(prefs->GetString(prefs::kRecoveryComponentVersion)); if (!version.IsValid()) { NOTREACHED(); return; @@ -240,7 +240,8 @@ void RecoveryRegisterHelper(ComponentUpdateService* cus, PrefService* prefs) { } } -void RecoveryUpdateVersionHelper(const Version& version, PrefService* prefs) { +void RecoveryUpdateVersionHelper(const base::Version& version, + PrefService* prefs) { DCHECK_CURRENTLY_ON(BrowserThread::UI); prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString()); } @@ -252,8 +253,9 @@ void SetPrefsForElevatedRecoveryInstall(const base::FilePath& unpack_path, prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, true); } -RecoveryComponentInstaller::RecoveryComponentInstaller(const Version& version, - PrefService* prefs) +RecoveryComponentInstaller::RecoveryComponentInstaller( + const base::Version& version, + PrefService* prefs) : current_version_(version), prefs_(prefs) { DCHECK(version.IsValid()); } @@ -328,7 +330,7 @@ bool RecoveryComponentInstaller::Install(const base::DictionaryValue& manifest, return false; std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - Version version(proposed_version.c_str()); + base::Version version(proposed_version.c_str()); if (!version.IsValid()) return false; if (current_version_.CompareTo(version) >= 0) diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc index ad33c748df4b67..1b0125dc56bf41 100644 --- a/chrome/browser/component_updater/sw_reporter_installer_win.cc +++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc @@ -216,7 +216,7 @@ class SwReporterInstallerTraits : public ComponentInstallerTraits { static std::string ID() { update_client::CrxComponent component; - component.version = Version("0.0.0.0"); + component.version = base::Version("0.0.0.0"); GetPkHash(&component.pk_hash); return update_client::GetCrxComponentID(component); } diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc index 1e82d3e49bcf83..a876aa4801f8a6 100644 --- a/chrome/browser/component_updater/swiftshader_component_installer.cc +++ b/chrome/browser/component_updater/swiftshader_component_installer.cc @@ -64,7 +64,7 @@ base::FilePath GetSwiftShaderBaseDirectory() { // On success it returns something like: // \AppData\Local\Google\Chrome\User Data\SwiftShader\10.3.44.555\. bool GetLatestSwiftShaderDirectory(base::FilePath* result, - Version* latest, + base::Version* latest, std::vector* older_dirs) { base::FilePath base_dir = GetSwiftShaderBaseDirectory(); bool found = false; @@ -72,7 +72,7 @@ bool GetLatestSwiftShaderDirectory(base::FilePath* result, base_dir, false, base::FileEnumerator::DIRECTORIES); for (base::FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - Version version(path.BaseName().MaybeAsASCII()); + base::Version version(path.BaseName().MaybeAsASCII()); if (!version.IsValid()) continue; if (version.CompareTo(*latest) > 0 && @@ -98,7 +98,7 @@ void RegisterSwiftShaderWithChrome(const base::FilePath& path) { class SwiftShaderComponentInstaller : public update_client::CrxInstaller { public: - explicit SwiftShaderComponentInstaller(const Version& version); + explicit SwiftShaderComponentInstaller(const base::Version& version); // ComponentInstaller implementation: void OnUpdateError(int error) override; @@ -114,11 +114,11 @@ class SwiftShaderComponentInstaller : public update_client::CrxInstaller { private: ~SwiftShaderComponentInstaller() override {} - Version current_version_; + base::Version current_version_; }; SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( - const Version& version) + const base::Version& version) : current_version_(version) { DCHECK(version.IsValid()); } @@ -136,7 +136,7 @@ bool SwiftShaderComponentInstaller::Install( return false; std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - Version version(proposed_version.c_str()); + base::Version version(proposed_version.c_str()); if (!version.IsValid()) return false; if (current_version_.CompareTo(version) >= 0) @@ -170,7 +170,7 @@ bool SwiftShaderComponentInstaller::Uninstall() { } void FinishSwiftShaderUpdateRegistration(ComponentUpdateService* cus, - const Version& version) { + const base::Version& version) { DCHECK_CURRENTLY_ON(BrowserThread::UI); update_client::CrxComponent swiftshader; @@ -206,7 +206,7 @@ void UpdateChecker::OnGpuInfoUpdate() { DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath path = GetSwiftShaderBaseDirectory(); - Version version(kNullVersion); + base::Version version(kNullVersion); GetLatestSwiftShaderDirectory(&path, &version, NULL); BrowserThread::PostTask( @@ -230,7 +230,7 @@ void RegisterSwiftShaderPath(ComponentUpdateService* cus) { } } - Version version(kNullVersion); + base::Version version(kNullVersion); std::vector older_dirs; if (GetLatestSwiftShaderDirectory(&path, &version, &older_dirs)) BrowserThread::PostTask(BrowserThread::UI, diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index a940c2eeb1bfcf..ca6666f598759f 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -412,9 +412,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. - Version module_version(base::UTF16ToASCII(module.version)); - Version version_min(blacklisted.version_from); - Version version_max(blacklisted.version_to); + base::Version module_version(base::UTF16ToASCII(module.version)); + base::Version version_min(blacklisted.version_from); + base::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/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc index 8a61cde8853006..ea9f43189d58ee 100644 --- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc +++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc @@ -251,9 +251,10 @@ void ChromeRuntimeAPIDelegate::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { DCHECK(type == extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND); - typedef const std::pair UpdateDetails; + typedef const std::pair UpdateDetails; const std::string& id = content::Details(details)->first; - const Version& version = content::Details(details)->second; + const base::Version& version = + content::Details(details)->second; if (version.IsValid()) { CallUpdateCallbacks( id, UpdateCheckResult(true, kUpdateFound, version.GetString())); diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc index eace973060beec..9240e7b64f7a7d 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc @@ -307,7 +307,7 @@ bool ChromeExtensionsBrowserClient::IsMinBrowserVersionSupported( const std::string& min_version) { base::Version browser_version = base::Version(version_info::GetVersionNumber()); - Version browser_min_version(min_version); + base::Version browser_min_version(min_version); if (browser_version.IsValid() && browser_min_version.IsValid() && browser_min_version.CompareTo(browser_version) > 0) { return false; diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 2effb1afb6afde..4899cf2ab14e51 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -154,7 +154,7 @@ CrxInstaller::CrxInstaller(base::WeakPtr service_weak, expected_id_ = approval->extension_id; } if (approval->minimum_version.get()) { - expected_version_.reset(new Version(*approval->minimum_version)); + expected_version_.reset(new base::Version(*approval->minimum_version)); expected_version_strict_checking_ = false; } @@ -483,7 +483,7 @@ void CrxInstaller::CheckInstall() { SharedModuleInfo::GetImports(extension()); std::vector::const_iterator i; for (i = imports.begin(); i != imports.end(); ++i) { - Version version_required(i->minimum_version); + base::Version version_required(i->minimum_version); const Extension* imported_module = service->GetExtensionById(i->extension_id, true); if (imported_module && @@ -684,7 +684,7 @@ void CrxInstaller::CompleteInstall() { DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); if (!current_version_.empty()) { - Version current_version(current_version_); + base::Version current_version(current_version_); if (current_version.CompareTo(*(extension()->version())) > 0) { ReportFailureFromFileThread(CrxInstallError( CrxInstallError::ERROR_DECLINED, diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index 43b54f2f40ba4a..1cf576ab2d0895 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h @@ -133,8 +133,8 @@ class CrxInstaller bool hash_check_failed() const { return hash_check_failed_; } void set_hash_check_failed(bool val) { hash_check_failed_ = val; } - void set_expected_version(const Version& val) { - expected_version_.reset(new Version(val)); + void set_expected_version(const base::Version& val) { + expected_version_.reset(new base::Version(val)); expected_version_strict_checking_ = true; } @@ -326,7 +326,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 expected_version_; + scoped_ptr 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_management_internal.cc b/chrome/browser/extensions/extension_management_internal.cc index df1bbe7e51ee72..0e78408368bc49 100644 --- a/chrome/browser/extensions/extension_management_internal.cc +++ b/chrome/browser/extensions/extension_management_internal.cc @@ -136,7 +136,7 @@ bool IndividualSettings::Parse(const base::DictionaryValue* dict, schema_constants::kMinimumVersionRequired, &minimum_version_required_str)) { scoped_ptr version( - new Version(minimum_version_required_str)); + new base::Version(minimum_version_required_str)); // We accept a general version string here. Note that count of components in // version string of extensions is limited to 4. if (!version->IsValid()) diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 3ed97062a3d71a..bdfb3333c476f0 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -1563,7 +1563,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 Version old_version(old_version_string); + const base::Version old_version(old_version_string); VLOG(1) << "AddComponentExtension " << extension->name(); if (!old_version.IsValid() || !old_version.Equals(*extension->version())) { @@ -2134,13 +2134,13 @@ const Extension* ExtensionService::GetInstalledExtension( } bool ExtensionService::OnExternalExtensionFileFound( - const std::string& id, - const Version* version, - const base::FilePath& path, - Manifest::Location location, - int creation_flags, - bool mark_acknowledged, - bool install_immediately) { + const std::string& id, + const base::Version* version, + const base::FilePath& path, + Manifest::Location location, + int creation_flags, + bool mark_acknowledged, + bool install_immediately) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(crx_file::id_util::IdIsValid(id)); if (extension_prefs_->IsExternalExtensionUninstalled(id)) diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index eb56fbbb57e6e7..66433c1ca1c9b1 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -276,7 +276,7 @@ class MockExtensionProvider : public extensions::ExternalProviderInterface { visit_count_++; for (DataMap::const_iterator i = extension_map_.begin(); i != extension_map_.end(); ++i) { - Version version(i->second.first); + base::Version version(i->second.first); visitor_->OnExternalExtensionFileFound( i->first, &version, i->second.second, location_, @@ -291,13 +291,13 @@ class MockExtensionProvider : public extensions::ExternalProviderInterface { bool GetExtensionDetails(const std::string& id, Manifest::Location* location, - scoped_ptr* version) const override { + scoped_ptr* version) const override { DataMap::const_iterator it = extension_map_.find(id); if (it == extension_map_.end()) return false; if (version) - version->reset(new Version(it->second.first)); + version->reset(new base::Version(it->second.first)); if (location) *location = location_; @@ -384,7 +384,7 @@ class MockProviderVisitor } bool OnExternalExtensionFileFound(const std::string& id, - const Version* version, + const base::Version* version, const base::FilePath& path, Manifest::Location unused, int creation_flags, @@ -409,13 +409,13 @@ class MockProviderVisitor // Ask provider if the extension we got back is registered. Manifest::Location location = Manifest::INVALID_LOCATION; - scoped_ptr v1; + scoped_ptr v1; base::FilePath crx_path; EXPECT_TRUE(provider_->GetExtensionDetails(id, NULL, &v1)); EXPECT_STREQ(version->GetString().c_str(), v1->GetString().c_str()); - scoped_ptr v2; + scoped_ptr 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()); @@ -446,7 +446,7 @@ class MockProviderVisitor EXPECT_TRUE(provider_->HasExtension(id)); // External extensions with update URLs do not have versions. - scoped_ptr v1; + scoped_ptr v1; Manifest::Location location1 = Manifest::INVALID_LOCATION; EXPECT_TRUE(provider_->GetExtensionDetails(id, &location1, &v1)); EXPECT_FALSE(v1.get()); @@ -1573,7 +1573,7 @@ TEST_F(ExtensionServiceTest, InstallingExternalExtensionWithFlags) { service()->set_extensions_enabled(true); // Register and install an external extension. - Version version("1.0.0.0"); + base::Version version("1.0.0.0"); content::WindowedNotificationObserver observer( extensions::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1610,7 +1610,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { service()->set_extensions_enabled(true); // Install an external extension. - Version version("1.0.0.0"); + base::Version version("1.0.0.0"); content::WindowedNotificationObserver observer( extensions::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1644,7 +1644,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { ValidateIntegerPref(good_crx, "state", Extension::EXTERNAL_EXTENSION_UNINSTALLED); - version = Version("1.0.0.1"); + version = base::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, @@ -1704,7 +1704,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongId) { base::FilePath path = data_dir().AppendASCII("good.crx"); service()->set_extensions_enabled(true); - Version version("1.0.0.0"); + base::Version version("1.0.0.0"); const std::string wrong_id = all_zero; const std::string correct_id = good_crx; @@ -1750,7 +1750,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. - Version wrong_version("1.2.3.4"); + base::Version wrong_version("1.2.3.4"); content::WindowedNotificationObserver observer( extensions::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -1767,7 +1767,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) { // Try again with the right version. Expect success. service()->pending_extension_manager()->Remove(good_crx); - Version correct_version("1.0.0.0"); + base::Version correct_version("1.0.0.0"); content::WindowedNotificationObserver observer2( extensions::NOTIFICATION_CRX_INSTALLER_DONE, content::NotificationService::AllSources()); @@ -3190,7 +3190,7 @@ TEST_F(ExtensionServiceTest, UpdatePendingExtensionAlreadyInstalled) { good->id(), std::string(), extensions::ManifestURL::GetUpdateURL(good), - Version(), + base::Version(), &IsExtension, kGoodIsFromSync, Manifest::INTERNAL, @@ -7254,8 +7254,8 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalUpdateUrl) { } TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) { - Version older_version("0.1.0.0"); - Version newer_version("2.0.0.0"); + base::Version older_version("0.1.0.0"); + base::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. @@ -7487,9 +7487,9 @@ TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) { } TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) { - Version kVersion123("1.2.3"); - Version kVersion124("1.2.4"); - Version kVersion125("1.2.5"); + base::Version kVersion123("1.2.3"); + base::Version kVersion124("1.2.4"); + base::Version kVersion125("1.2.5"); const base::FilePath kInvalidPathToCrx(FILE_PATH_LITERAL("invalid_path")); const int kCreationFlags = 0; const bool kDontMarkAcknowledged = false; @@ -7616,7 +7616,7 @@ class ExtensionSourcePriorityTest : public ExtensionServiceTest { // Fake an external file from external_extensions.json. bool AddPendingExternalPrefFileInstall() { - Version version("1.0.0.0"); + base::Version version("1.0.0.0"); return service()->OnExternalExtensionFileFound(crx_id_, &version, diff --git a/chrome/browser/extensions/extension_sync_data.cc b/chrome/browser/extensions/extension_sync_data.cc index 6404e8b61ca690..af98c866df4911 100644 --- a/chrome/browser/extensions/extension_sync_data.cc +++ b/chrome/browser/extensions/extension_sync_data.cc @@ -236,7 +236,7 @@ bool ExtensionSyncData::PopulateFromExtensionSpecifics( return false; } - Version specifics_version(specifics.version()); + base::Version specifics_version(specifics.version()); if (!specifics_version.IsValid()) { LOG(ERROR) << "Attempt to sync bad ExtensionSpecifics (bad version):\n" << GetExtensionSpecificsLogMessage(specifics); diff --git a/chrome/browser/extensions/extension_sync_data.h b/chrome/browser/extensions/extension_sync_data.h index 2c753f3955e46b..d2d7342619610d 100644 --- a/chrome/browser/extensions/extension_sync_data.h +++ b/chrome/browser/extensions/extension_sync_data.h @@ -96,7 +96,7 @@ class ExtensionSyncData { // Version-dependent properties (i.e., should be used only when the // version of the currently-installed extension matches |version|). - const Version& version() const { return version_; } + const base::Version& version() const { return version_; } const GURL& update_url() const { return update_url_; } // Used only for debugging. const std::string& name() const { return name_; } @@ -154,7 +154,7 @@ class ExtensionSyncData { bool remote_install_; OptionalBoolean all_urls_enabled_; bool installed_by_custodian_; - Version version_; + base::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 bae256ffe3abb3..9b5fd826978c1c 100644 --- a/chrome/browser/extensions/extension_sync_data_unittest.cc +++ b/chrome/browser/extensions/extension_sync_data_unittest.cc @@ -110,7 +110,7 @@ TEST_F(ExtensionSyncDataTest, ExtensionSyncDataForExtension) { EXPECT_FALSE(extension_sync_data.remote_install()); EXPECT_EQ(ExtensionSyncData::BOOLEAN_TRUE, extension_sync_data.all_urls_enabled()); - EXPECT_TRUE(Version(kVersion).Equals(extension_sync_data.version())); + EXPECT_TRUE(base::Version(kVersion).Equals(extension_sync_data.version())); EXPECT_EQ(std::string(kName), extension_sync_data.name()); // Check the serialize-deserialize process for ExtensionSyncData to proto. diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index 11e7448474f977..3b150dd17c094a 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 } bool OnExternalExtensionFileFound(const std::string& id, - const Version* version, + const base::Version* version, const base::FilePath& path, Manifest::Location unused, int unused2, @@ -91,7 +91,7 @@ class MockExternalPolicyProviderVisitor // Provider returns the correct location when asked. Manifest::Location location1; - scoped_ptr version1; + scoped_ptr 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 7844bca135e6f2..dea7367f745718 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc @@ -285,7 +285,7 @@ void ExternalProviderImpl::SetPrefs(base::DictionaryValue* prefs) { path = base_path.Append(external_crx); } - Version version(external_version); + base::Version version(external_version); if (!version.IsValid()) { LOG(WARNING) << "Malformed extension dictionary for extension: " << extension_id.c_str() << ". Invalid version string \"" @@ -347,8 +347,9 @@ bool ExternalProviderImpl::HasExtension( } bool ExternalProviderImpl::GetExtensionDetails( - const std::string& id, Manifest::Location* location, - scoped_ptr* version) const { + const std::string& id, + Manifest::Location* location, + scoped_ptr* version) const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(prefs_.get()); CHECK(ready_); @@ -368,7 +369,7 @@ bool ExternalProviderImpl::GetExtensionDetails( return false; if (version) - version->reset(new Version(external_version)); + version->reset(new base::Version(external_version)); } else { NOTREACHED(); // Chrome should not allow prefs to get into this state. @@ -389,9 +390,9 @@ bool ExternalProviderImpl::HandleMinProfileVersion( if (profile_ && extension->GetString(kMinProfileCreatedByVersion, &min_profile_created_by_version)) { - Version profile_version( + base::Version profile_version( profile_->GetPrefs()->GetString(prefs::kProfileCreatedByVersion)); - Version min_version(min_profile_created_by_version); + base::Version min_version(min_profile_created_by_version); if (min_version.IsValid() && profile_version.CompareTo(min_version) < 0) { unsupported_extensions->insert(extension_id); VLOG(1) << "Skip installing (or uninstall) external extension: " diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index 0b5a67f83687c8..0f45a8a9b5ccc3 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -164,7 +164,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - Version version(base::UTF16ToASCII(extension_version)); + base::Version version(base::UTF16ToASCII(extension_version)); if (!version.IsValid()) { LOG(ERROR) << "Invalid version value " << extension_version << " for key " << key_path << "."; diff --git a/chrome/browser/extensions/pending_extension_info.cc b/chrome/browser/extensions/pending_extension_info.cc index 94a5608cfd03f2..9501f955a74402 100644 --- a/chrome/browser/extensions/pending_extension_info.cc +++ b/chrome/browser/extensions/pending_extension_info.cc @@ -12,7 +12,7 @@ PendingExtensionInfo::PendingExtensionInfo( const std::string& id, const std::string& install_parameter, const GURL& update_url, - const Version& version, + const base::Version& version, ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, Manifest::Location install_source, diff --git a/chrome/browser/extensions/pending_extension_info.h b/chrome/browser/extensions/pending_extension_info.h index 8ac52c55642c62..98bb35af5d3a8d 100644 --- a/chrome/browser/extensions/pending_extension_info.h +++ b/chrome/browser/extensions/pending_extension_info.h @@ -30,7 +30,7 @@ class PendingExtensionInfo { PendingExtensionInfo(const std::string& id, const std::string& install_parameter, const GURL& update_url, - const Version& version, + const base::Version& version, ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, Manifest::Location install_source, @@ -48,7 +48,7 @@ class PendingExtensionInfo { const std::string& id() const { return id_; } const GURL& update_url() const { return update_url_; } - const Version& version() const { return version_; } + const base::Version& version() const { return version_; } const std::string& install_parameter() const { return install_parameter_; } // ShouldAllowInstall() returns the result of running constructor argument @@ -77,7 +77,7 @@ class PendingExtensionInfo { std::string id_; GURL update_url_; - Version version_; + base::Version version_; std::string install_parameter_; // When the extension is about to be installed, this function is diff --git a/chrome/browser/extensions/pending_extension_manager.cc b/chrome/browser/extensions/pending_extension_manager.cc index 7d0546210b9b43..2958ed19edfe46 100644 --- a/chrome/browser/extensions/pending_extension_manager.cc +++ b/chrome/browser/extensions/pending_extension_manager.cc @@ -25,7 +25,7 @@ bool AlwaysInstall(const extensions::Extension* extension) { return true; } -std::string GetVersionString(const Version& version) { +std::string GetVersionString(const base::Version& version) { return version.IsValid() ? version.GetString() : "invalid"; } @@ -121,7 +121,7 @@ bool PendingExtensionManager::AddFromSync( return AddExtensionImpl(id, std::string(), update_url, - Version(), + base::Version(), should_allow_install, kIsFromSync, kSyncLocation, @@ -151,7 +151,7 @@ bool PendingExtensionManager::AddFromExtensionImport( return AddExtensionImpl(id, std::string(), update_url, - Version(), + base::Version(), should_allow_install, kIsFromSync, kManifestLocation, @@ -192,7 +192,7 @@ bool PendingExtensionManager::AddFromExternalUpdateUrl( return AddExtensionImpl(id, install_parameter, update_url, - Version(), + base::Version(), &AlwaysInstall, kIsFromSync, location, @@ -201,11 +201,10 @@ bool PendingExtensionManager::AddFromExternalUpdateUrl( kRemoteInstall); } - bool PendingExtensionManager::AddFromExternalFile( const std::string& id, Manifest::Location install_source, - const Version& version, + const base::Version& version, int creation_flags, bool mark_acknowledged) { // TODO(skerner): AddFromSync() checks to see if the extension is @@ -253,7 +252,7 @@ bool PendingExtensionManager::AddExtensionImpl( const std::string& id, const std::string& install_parameter, const GURL& update_url, - const Version& version, + const base::Version& version, PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, bool is_from_sync, Manifest::Location install_source, diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc index 6fd2f9baaafc04..2a0976daaae612 100644 --- a/chrome/browser/extensions/unpacked_installer.cc +++ b/chrome/browser/extensions/unpacked_installer.cc @@ -214,7 +214,7 @@ void UnpackedInstaller::StartInstallChecks() { SharedModuleInfo::GetImports(extension()); std::vector::const_iterator i; for (i = imports.begin(); i != imports.end(); ++i) { - Version version_required(i->minimum_version); + base::Version version_required(i->minimum_version); const Extension* imported_module = service->GetExtensionById(i->extension_id, true); if (!imported_module) { diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 7c2786247f429c..8541b771dbc364 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -434,7 +434,7 @@ void SetupPendingExtensionManagerForTest( PendingExtensionInfo(id, std::string(), update_url, - Version(), + base::Version(), should_allow_install, kIsFromSync, Manifest::INTERNAL, @@ -1168,7 +1168,7 @@ class ExtensionUpdaterTest : public testing::Test { std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; std::string hash; - Version version("0.0.1"); + base::Version version("0.0.1"); std::set requests; requests.insert(0); scoped_ptr fetch( @@ -1278,7 +1278,7 @@ class ExtensionUpdaterTest : public testing::Test { GURL test_url(base::StringPrintf("%s/extension.crx", url_prefix.c_str())); std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; std::string hash; - Version version("0.0.1"); + base::Version version("0.0.1"); std::set requests; requests.insert(0); scoped_ptr fetch( diff --git a/chrome/browser/extensions/updater/local_extension_cache.cc b/chrome/browser/extensions/updater/local_extension_cache.cc index e265b8ca631ac0..8d9f8517f74c08 100644 --- a/chrome/browser/extensions/updater/local_extension_cache.cc +++ b/chrome/browser/extensions/updater/local_extension_cache.cc @@ -133,8 +133,8 @@ bool LocalExtensionCache::NewerOrSame(const CacheMap::iterator& entry, const std::string& version, const std::string& expected_hash, int* compare) { - Version new_version(version); - Version prev_version(entry->second.version); + base::Version new_version(version); + base::Version prev_version(entry->second.version); int cmp = new_version.CompareTo(prev_version); if (compare) @@ -157,7 +157,7 @@ void LocalExtensionCache::PutExtension(const std::string& id, return; } - Version version_validator(version); + base::Version version_validator(version); if (!version_validator.IsValid()) { LOG(ERROR) << "Extension " << id << " has bad version " << version; callback.Run(file_path, true); @@ -443,7 +443,7 @@ void LocalExtensionCache::BackendCheckCacheContentsInternal( id.clear(); } - if (!Version(version).IsValid()) { + if (!base::Version(version).IsValid()) { LOG(ERROR) << "Bad extension version in cache: " << version; version.clear(); } diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 6ab5475321b80b..53ce4dd5e34386 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -418,7 +418,7 @@ void WebstoreInstaller::OnExtensionInstalled( CHECK_EQ(extension->id(), id_); ReportSuccess(); } else { - const Version version_required(info.minimum_version); + const base::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 @@ -490,11 +490,10 @@ void WebstoreInstaller::OnDownloadStarted( scoped_ptr approval = Approval::CreateForSharedModule(profile_); const SharedModuleInfo::ImportInfo& info = pending_modules_.front(); approval->extension_id = info.extension_id; - const Version version_required(info.minimum_version); + const base::Version version_required(info.minimum_version); if (version_required.IsValid()) { - approval->minimum_version.reset( - new Version(version_required)); + approval->minimum_version.reset(new base::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 58e76fa9cf7137..48aa2368c16cb2 100644 --- a/chrome/browser/extensions/webstore_installer.h +++ b/chrome/browser/extensions/webstore_installer.h @@ -158,7 +158,7 @@ class WebstoreInstaller : public content::NotificationObserver, scoped_refptr dummy_extension; // Required minimum version. - scoped_ptr minimum_version; + scoped_ptr minimum_version; // Ephemeral apps are transiently installed. bool is_ephemeral; diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc index 82142862ab0ad0..9e676150368664 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; - Version plugin_version; + base::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 27cf2e4046b374..cd73559f76bc3e 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc @@ -153,7 +153,7 @@ void RecordStartupMetricsOnBlockingPool() { void RecordLinuxGlibcVersion() { #if defined(OS_LINUX) && !defined(OS_CHROMEOS) - Version version(gnu_get_libc_version()); + base::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 5c402cd1cb995b..7db01ed9bcdba6 100644 --- a/chrome/browser/net/crl_set_fetcher.cc +++ b/chrome/browser/net/crl_set_fetcher.cc @@ -144,11 +144,11 @@ void CRLSetFetcher::RegisterComponent(uint32 sequence_of_loaded_crl) { kPublicKeySHA256 + sizeof(kPublicKeySHA256)); component.installer = this; component.name = "CRLSet"; - component.version = Version(base::UintToString(sequence_of_loaded_crl)); + component.version = base::Version(base::UintToString(sequence_of_loaded_crl)); component.allow_background_download = false; if (!component.version.IsValid()) { NOTREACHED(); - component.version = Version("0"); + component.version = base::Version("0"); } if (!cus_->RegisterComponent(component)) diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc index dc6ec0598259b4..f7ff731adf1d45 100644 --- a/chrome/browser/plugins/plugin_finder.cc +++ b/chrome/browser/plugins/plugin_finder.cc @@ -136,7 +136,7 @@ PluginMetadata* CreatePluginMetadata( PluginMetadata::SECURITY_STATUS_UP_TO_DATE; success = PluginMetadata::ParseSecurityStatus(status_str, &status); DCHECK(success); - plugin->AddVersion(Version(version), status); + plugin->AddVersion(base::Version(version), status); } } diff --git a/chrome/browser/plugins/plugin_metadata.cc b/chrome/browser/plugins/plugin_metadata.cc index 87b4418a9a0132..b28c284f091306 100644 --- a/chrome/browser/plugins/plugin_metadata.cc +++ b/chrome/browser/plugins/plugin_metadata.cc @@ -42,7 +42,7 @@ PluginMetadata::PluginMetadata(const std::string& identifier, PluginMetadata::~PluginMetadata() { } -void PluginMetadata::AddVersion(const Version& version, +void PluginMetadata::AddVersion(const base::Version& version, SecurityStatus status) { DCHECK(versions_.find(version) == versions_.end()); versions_[version] = status; @@ -100,14 +100,14 @@ PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( return SECURITY_STATUS_REQUIRES_AUTHORIZATION; } - Version version; + base::Version version; content::WebPluginInfo::CreateVersionFromString(plugin.version, &version); if (!version.IsValid()) - version = Version("0"); + version = base::Version("0"); // |lower_bound| returns the latest version that is not newer than |version|. - std::map::const_iterator it = - versions_.lower_bound(version); + std::map::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()) @@ -116,8 +116,9 @@ PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( return it->second; } -bool PluginMetadata::VersionComparator::operator() (const Version& lhs, - const Version& rhs) const { +bool PluginMetadata::VersionComparator::operator()( + const base::Version& lhs, + const base::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 99ed7d3202150e..1080bec905ec1f 100644 --- a/chrome/browser/plugins/plugin_metadata.h +++ b/chrome/browser/plugins/plugin_metadata.h @@ -69,7 +69,7 @@ class PluginMetadata { void AddMatchingMimeType(const std::string& mime_type); // Adds information about a plugin version. - void AddVersion(const Version& version, SecurityStatus status); + void AddVersion(const base::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 @@ -89,7 +89,7 @@ class PluginMetadata { private: struct VersionComparator { - bool operator() (const Version& lhs, const Version& rhs) const; + bool operator() (const base::Version& lhs, const base::Version& rhs) const; }; std::string identifier_; @@ -99,7 +99,7 @@ class PluginMetadata { GURL plugin_url_; GURL help_url_; std::string language_; - std::map versions_; + std::map versions_; std::vector all_mime_types_; std::vector matching_mime_types_; diff --git a/chrome/browser/plugins/plugin_metadata_unittest.cc b/chrome/browser/plugins/plugin_metadata_unittest.cc index fe9e2e659beb42..25748e7b23f6ad 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(Version("9.4.1"), kRequiresAuthorization); - plugin_metadata.AddVersion(Version("10"), kOutOfDate); - plugin_metadata.AddVersion(Version("10.2.1"), kUpToDate); + 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); // 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 b75739f77b635c..27601354fd1e0d 100644 --- a/chrome/browser/prefs/session_startup_pref.cc +++ b/chrome/browser/prefs/session_startup_pref.cc @@ -247,10 +247,10 @@ void SessionStartupPref::MigrateMacDefaultPrefIfNecessary(PrefService* prefs) { // the setting for existing profiles (even if the user has never changed it), // but make new profiles default to DEFAULT. bool old_profile_version = - !prefs->FindPreference( - prefs::kProfileCreatedByVersion)->IsDefaultValue() && - Version(prefs->GetString(prefs::kProfileCreatedByVersion)).IsOlderThan( - "21.0.1180.0"); + !prefs->FindPreference(prefs::kProfileCreatedByVersion) + ->IsDefaultValue() && + base::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/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index d35ab339633fbb..b722a644f2c12b 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -871,8 +871,8 @@ void ProfileImpl::OnPrefsLoaded(CreateMode create_mode, bool success) { } bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) { - Version profile_version(ChromeVersionService::GetVersion(prefs_.get())); - Version arg_version(version); + base::Version profile_version(ChromeVersionService::GetVersion(prefs_.get())); + base::Version arg_version(version); return (profile_version.CompareTo(arg_version) >= 0); } diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc index e11da719ed8172..329da02b9dd1e5 100644 --- a/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/chrome/browser/ui/startup/default_browser_prompt.cc @@ -267,10 +267,11 @@ void ShowDefaultBrowserPrompt(Profile* profile, HostDesktopType desktop_type) { const std::string disable_version_string = g_browser_process->local_state()->GetString( prefs::kBrowserSuppressDefaultBrowserPrompt); - const Version disable_version(disable_version_string); + const base::Version disable_version(disable_version_string); DCHECK(disable_version_string.empty() || disable_version.IsValid()); if (disable_version.IsValid()) { - if (disable_version.Equals(Version(version_info::GetVersionNumber()))) + if (disable_version.Equals( + base::Version(version_info::GetVersionNumber()))) show_prompt = false; } } diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc index 7742a47103db45..06c3d9ff25b50d 100644 --- a/chrome/browser/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector_impl.cc @@ -151,10 +151,10 @@ void DetectUpdatability(const base::Closure& callback_task, // Gets the currently installed version. On Windows, if |critical_update| is not // NULL, also retrieves the critical update version info if available. -base::Version GetCurrentlyInstalledVersionImpl(Version* critical_update) { +base::Version GetCurrentlyInstalledVersionImpl(base::Version* critical_update) { base::ThreadRestrictions::AssertIOAllowed(); - Version installed_version; + base::Version installed_version; #if defined(OS_WIN) // Get the version of the currently *installed* instance of Chrome, // which might be newer than the *running* instance if we have been @@ -170,8 +170,8 @@ base::Version GetCurrentlyInstalledVersionImpl(Version* critical_update) { critical_update); } #elif defined(OS_MACOSX) - installed_version = - Version(base::UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); + installed_version = base::Version( + base::UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); #elif defined(OS_POSIX) // POSIX but not Mac OS X: Linux, etc. base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); @@ -183,7 +183,7 @@ base::Version GetCurrentlyInstalledVersionImpl(Version* critical_update) { } base::TrimWhitespaceASCII(reply, base::TRIM_ALL, &reply); - installed_version = Version(reply); + installed_version = base::Version(reply); #endif return installed_version; } @@ -313,12 +313,12 @@ void UpgradeDetectorImpl::DetectUpgradeTask( base::WeakPtr upgrade_detector) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - Version critical_update; - Version installed_version = + base::Version critical_update; + base::Version installed_version = GetCurrentlyInstalledVersionImpl(&critical_update); // Get the version of the currently *running* instance of Chrome. - Version running_version(version_info::GetVersionNumber()); + base::Version running_version(version_info::GetVersionNumber()); if (!running_version.IsValid()) { NOTREACHED(); return; diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index bc33c6275c21ff..1c3ca162412c2a 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -368,7 +368,7 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { if (!manifest_value->GetAsDictionary(&manifest)) return false; - Version version; + base::Version version; if (!chrome::CheckPepperFlashManifest(*manifest, &version)) return false; @@ -455,7 +455,7 @@ content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( auto it = std::max_element( plugins.begin(), plugins.end(), [](content::PepperPluginInfo* x, content::PepperPluginInfo* y) { - Version version_x(x->version); + base::Version version_x(x->version); DCHECK(version_x.IsValid()); return version_x.IsOlderThan(y->version); }); 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 bedbf960c7e786..0bcc65e60d1723 100644 --- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc +++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc @@ -33,13 +33,13 @@ bool MinimumChromeVersionChecker::Parse(Extension* extension, return false; } - Version minimum_version(minimum_version_string); + base::Version minimum_version(minimum_version_string); if (!minimum_version.IsValid()) { *error = base::ASCIIToUTF16(errors::kInvalidMinimumChromeVersion); return false; } - Version current_version(version_info::GetVersionNumber()); + base::Version current_version(version_info::GetVersionNumber()); if (!current_version.IsValid()) { NOTREACHED(); return false; diff --git a/chrome/common/pepper_flash.cc b/chrome/common/pepper_flash.cc index 16b4328d933e48..232d26fd45eee5 100644 --- a/chrome/common/pepper_flash.cc +++ b/chrome/common/pepper_flash.cc @@ -88,7 +88,7 @@ bool CheckPepperFlashInterfaces(const base::DictionaryValue& manifest) { } // namespace bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, - Version* version_out) { + base::Version* version_out) { std::string name; manifest.GetStringASCII("name", &name); // TODO(viettrungluu): Support WinFlapper for now, while we change the format @@ -99,7 +99,7 @@ bool CheckPepperFlashManifest(const base::DictionaryValue& manifest, std::string proposed_version; manifest.GetStringASCII("version", &proposed_version); - Version version(proposed_version.c_str()); + base::Version version(proposed_version.c_str()); if (!version.IsValid()) return false; diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc index 9bb3464ca8865b..f26dd0aba45c90 100644 --- a/chrome/common/service_process_util.cc +++ b/chrome/common/service_process_util.cc @@ -71,13 +71,13 @@ ServiceProcessRunningState GetServiceProcessRunningState( if (service_version_out) *service_version_out = version; - Version service_version(version); + base::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; // Get the version of the currently *running* instance of Chrome. - Version running_version(version_info::GetVersionNumber()); + base::Version running_version(version_info::GetVersionNumber()); 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 5a229eb017d404..517dcdf9baf82d 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -203,12 +203,12 @@ bool CheckServiceProcessReady() { if (!GetServiceProcessData(&version, &pid)) { return false; } - Version service_version(version); + base::Version service_version(version); bool ready = true; if (!service_version.IsValid()) { ready = false; } else { - Version running_version(version_info::GetVersionNumber()); + base::Version running_version(version_info::GetVersionNumber()); 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 60e368b5f10f49..b94576330a9edf 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -183,8 +183,8 @@ installer::InstallStatus InstallNewVersion( const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const Version& new_version, - scoped_ptr* current_version) { + const base::Version& new_version, + scoped_ptr* current_version) { DCHECK(current_version); installer_state.UpdateStage(installer::BUILDING); @@ -280,7 +280,7 @@ void EscapeXmlAttributeValueInSingleQuotes(base::string16* att_value) { } bool CreateVisualElementsManifest(const base::FilePath& src_path, - const Version& version) { + const base::Version& version) { // Construct the relative path to the versioned VisualElements directory. base::string16 elements_dir(base::ASCIIToUTF16(version.GetString())); elements_dir.push_back(base::FilePath::kSeparators[0]); @@ -489,7 +489,7 @@ InstallStatus InstallOrUpdateProduct( const base::FilePath& src_path, const base::FilePath& prefs_path, const MasterPreferences& prefs, - const Version& new_version) { + const base::Version& new_version) { DCHECK(!installer_state.products().empty()); // TODO(robertshield): Removing the pending on-reboot moves should be done @@ -506,7 +506,7 @@ InstallStatus InstallOrUpdateProduct( installer_state.UpdateStage(installer::CREATING_VISUAL_MANIFEST); CreateVisualElementsManifest(src_path, new_version); - scoped_ptr existing_version; + scoped_ptr 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 5eac8e21d5b4d2..a2c9b55e5312c3 100644 --- a/chrome/installer/setup/install.h +++ b/chrome/installer/setup/install.h @@ -59,7 +59,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 Version& version); + const base::Version& version); // Overwrites shortcuts (desktop, quick launch, and start menu) if they are // present on the system. @@ -115,7 +115,7 @@ InstallStatus InstallOrUpdateProduct( const base::FilePath& src_path, const base::FilePath& prefs_path, const installer::MasterPreferences& prefs, - const Version& new_version); + const base::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 dc9f5d1c2197cc..7d29f79bd2ad78 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_ = Version("0.0.0.0"); + version_ = base::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. - Version version_; + base::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 4ed8a72c4cf009..a1eea40b3e16a7 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -79,8 +79,8 @@ void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { // 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 Version* old_version, - const Version& new_version, + const base::Version* old_version, + const base::Version& new_version, WorkItemList* work_item_list) { // First collect the list of DLLs to be registered from each product. std::vector com_dll_list; @@ -122,7 +122,7 @@ void AddInstallerCopyTasks(const InstallerState& installer_state, const base::FilePath& setup_path, const base::FilePath& archive_path, const base::FilePath& temp_path, - const Version& new_version, + const base::Version& new_version, WorkItemList* install_list) { DCHECK(install_list); base::FilePath installer_dir( @@ -225,7 +225,7 @@ void AddFirewallRulesWorkItems(const InstallerState& installer_state, void AddProductSpecificWorkItems(const InstallationState& original_state, const InstallerState& installer_state, const base::FilePath& setup_path, - const Version& new_version, + const base::Version& new_version, bool is_new_install, bool add_language_identifier, WorkItemList* list) { @@ -308,8 +308,8 @@ void AddChromeWorkItems(const InstallationState& original_state, const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const Version* current_version, - const Version& new_version, + const base::Version* current_version, + const base::Version& new_version, WorkItemList* install_list) { const base::FilePath& target_path = installer_state.target_path(); @@ -503,7 +503,7 @@ void CleanupBadCanaryDelegateExecuteRegistration( // state key if running under an MSI installer. void AddUninstallShortcutWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const Version& new_version, + const base::Version& new_version, const Product& product, WorkItemList* install_list) { HKEY reg_root = installer_state.root_key(); @@ -650,7 +650,7 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, void AddVersionKeyWorkItems(HKEY root, const base::string16& version_key, const base::string16& product_name, - const Version& new_version, + const base::Version& new_version, bool add_language_identifier, WorkItemList* list) { list->AddCreateRegKeyWorkItem(root, version_key, KEY_WOW64_32KEY); @@ -987,8 +987,8 @@ void AddMigrateUsageStatesWorkItems(const InstallationState& original_state, bool AppendPostInstallTasks(const InstallerState& installer_state, const base::FilePath& setup_path, - const Version* current_version, - const Version& new_version, + const base::Version* current_version, + const base::Version& new_version, const base::FilePath& temp_path, WorkItemList* post_install_task_list) { DCHECK(post_install_task_list); @@ -1010,7 +1010,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. - Version critical_version(installer_state.DetermineCriticalVersion( + base::Version critical_version(installer_state.DetermineCriticalVersion( current_version, new_version)); base::FilePath installer_path( installer_state.GetInstallerDirectory(new_version).Append( @@ -1138,8 +1138,8 @@ void AddInstallWorkItems(const InstallationState& original_state, const base::FilePath& archive_path, const base::FilePath& src_path, const base::FilePath& temp_path, - const Version* current_version, - const Version& new_version, + const base::Version* current_version, + const base::Version& new_version, WorkItemList* install_list) { DCHECK(install_list); @@ -1283,7 +1283,7 @@ void AddSetMsiMarkerWorkItem(const InstallerState& installer_state, void AddDelegateExecuteWorkItems(const InstallerState& installer_state, const base::FilePath& target_path, - const Version& new_version, + const base::Version& new_version, const Product& product, WorkItemList* list) { base::string16 handler_class_uuid; @@ -1354,7 +1354,7 @@ void AddDelegateExecuteWorkItems(const InstallerState& installer_state, } void AddActiveSetupWorkItems(const InstallerState& installer_state, - const Version& new_version, + const base::Version& new_version, const Product& product, WorkItemList* list) { DCHECK(installer_state.operation() != InstallerState::UNINSTALL); @@ -1468,7 +1468,7 @@ void RefreshElevationPolicy() { void AddOsUpgradeWorkItems(const InstallerState& installer_state, const base::FilePath& setup_path, - const Version& new_version, + const base::Version& new_version, const Product& product, WorkItemList* install_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 8ff63c36d62310..01328b78bee539 100644 --- a/chrome/installer/setup/install_worker_unittest.cc +++ b/chrome/installer/setup/install_worker_unittest.cc @@ -119,7 +119,7 @@ class MockWorkItemList : public WorkItemList { class MockProductState : public ProductState { public: // Takes ownership of |version|. - void set_version(Version* version) { version_.reset(version); } + void set_version(base::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) { @@ -186,8 +186,8 @@ class MockInstallerState : public InstallerState { class InstallWorkerTest : public testing::Test { public: void SetUp() override { - current_version_.reset(new Version("1.0.0.0")); - new_version_.reset(new Version("42.0.0.0")); + current_version_.reset(new base::Version("1.0.0.0")); + new_version_.reset(new base::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 @@ -213,7 +213,7 @@ class InstallWorkerTest : public testing::Test { if (installation_state->GetProductState( system_level, BrowserDistribution::CHROME_BINARIES) == NULL) { MockProductState product_state; - product_state.set_version(new Version(*current_version_)); + product_state.set_version(new base::Version(*current_version_)); product_state.set_brand(L"TEST"); product_state.set_multi_install(true); BrowserDistribution* dist = @@ -242,7 +242,7 @@ class InstallWorkerTest : public testing::Test { if (multi_install) MaybeAddBinariesToInstallationState(system_level, installation_state); MockProductState product_state; - product_state.set_version(new Version(*current_version_)); + product_state.set_version(new base::Version(*current_version_)); product_state.set_multi_install(multi_install); product_state.set_brand(L"TEST"); product_state.set_eula_accepted(1); @@ -275,7 +275,7 @@ class InstallWorkerTest : public testing::Test { if (multi_install) MaybeAddBinariesToInstallationState(system_level, installation_state); MockProductState product_state; - product_state.set_version(new Version(*current_version_)); + product_state.set_version(new base::Version(*current_version_)); product_state.set_multi_install(multi_install); BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( @@ -436,8 +436,8 @@ class InstallWorkerTest : public testing::Test { } protected: - scoped_ptr current_version_; - scoped_ptr new_version_; + scoped_ptr current_version_; + scoped_ptr new_version_; base::FilePath archive_path_; base::FilePath installation_path_; base::FilePath setup_path_; @@ -569,7 +569,7 @@ TEST_F(InstallWorkerTest, GoogleUpdateWorkItemsTest) { BuildChromeInstallationState(system_level, false)); MockProductState cf_state; - cf_state.set_version(new Version(*current_version_)); + cf_state.set_version(new base::Version(*current_version_)); cf_state.set_multi_install(false); // Per-machine single-install Chrome Frame is installed. @@ -641,7 +641,7 @@ TEST_F(InstallWorkerTest, AddUsageStatsWorkItems) { BuildChromeInstallationState(system_level, multi_install)); MockProductState chrome_state; - chrome_state.set_version(new Version(*current_version_)); + chrome_state.set_version(new base::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 8bdd55c692be09..f288649f339395 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -894,7 +894,7 @@ installer::InstallStatus RegisterDevChrome( scoped_ptr delegate_execute_list( WorkItem::CreateWorkItemList()); installer::AddDelegateExecuteWorkItems( - installer_state, chrome_exe.DirName(), Version(), chrome, + installer_state, chrome_exe.DirName(), base::Version(), chrome, delegate_execute_list.get()); delegate_execute_list->Do(); if (ShellUtil::CanMakeChromeDefaultUnattended()) { @@ -1125,7 +1125,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. - Version installed_version; + base::Version installed_version; InstallUtil::GetChromeVersion(browser_dist, true, &installed_version); if (!installed_version.IsValid()) { LOG(ERROR) << "No installation of " @@ -1389,9 +1389,8 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state, } VLOG(1) << "unpacked to " << unpack_path.value(); - base::FilePath src_path( - unpack_path.Append(kInstallSourceChromeDir)); - scoped_ptr + base::FilePath src_path(unpack_path.Append(kInstallSourceChromeDir)); + scoped_ptr 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 0565488cc33bd1..20b73e6aa4b6a7 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -142,22 +142,22 @@ int BsdiffPatchFiles(const base::FilePath& src, return exit_code; } -Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) { +base::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 max_version(new Version("0.0.0.0")); + scoped_ptr max_version(new base::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 found_version( - new Version(base::UTF16ToASCII(find_data.GetName().value()))); + scoped_ptr found_version( + new base::Version(base::UTF16ToASCII(find_data.GetName().value()))); if (found_version->IsValid() && found_version->CompareTo(*max_version.get()) > 0) { max_version.reset(found_version.release()); @@ -190,7 +190,7 @@ base::FilePath FindArchiveToPatch(const InstallationState& original_state, if (base::PathExists(patch_source)) return patch_source; } - scoped_ptr version( + scoped_ptr version( installer::GetMaxVersionFromArchiveDir(installer_state.target_path())); if (version) { patch_source = installer_state.GetInstallerDirectory(*version) @@ -263,7 +263,7 @@ bool DeleteFileFromTempProcess(const base::FilePath& path, bool GetExistingHigherInstaller( const InstallationState& original_state, bool system_install, - const Version& installer_version, + const base::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 0b04b7b7812936..110ef441be0c2a 100644 --- a/chrome/installer/setup/setup_util.h +++ b/chrome/installer/setup/setup_util.h @@ -49,7 +49,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. -Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); +base::Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); // Returns the uncompressed archive of the installed version that serves as the // source for patching. If |desired_version| is valid, only the path to that diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index 91ab75452bd147..c91cd682db4792 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -95,7 +95,7 @@ TEST(SetupUtilTest, 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 version( + scoped_ptr version( installer::GetMaxVersionFromArchiveDir(test_dir.path())); ASSERT_EQ(version->GetString(), "1.0.0.0"); @@ -269,9 +269,9 @@ class FindArchiveToPatchTest : public testing::Test { return static_cast(const_cast(product)); } - void set_version(const Version& version) { + void set_version(const base::Version& version) { if (version.IsValid()) - version_.reset(new Version(version)); + version_.reset(new base::Version(version)); else version_.reset(); } @@ -287,8 +287,8 @@ class FindArchiveToPatchTest : public testing::Test { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER); registry_override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE); - product_version_ = Version("30.0.1559.0"); - max_version_ = Version("47.0.1559.0"); + product_version_ = base::Version("30.0.1559.0"); + max_version_ = base::Version("47.0.1559.0"); // Install the product according to the version. original_state_.reset(new FakeInstallationState()); @@ -315,7 +315,7 @@ class FindArchiveToPatchTest : public testing::Test { original_state_.reset(); } - base::FilePath GetArchivePath(const Version& version) const { + base::FilePath GetArchivePath(const base::Version& version) const { return test_dir_.path() .AppendASCII(version.GetString()) .Append(installer::kInstallerDir) @@ -349,14 +349,14 @@ class FindArchiveToPatchTest : public testing::Test { FakeProductState::FromProductState( original_state_->GetNonVersionedProductState(kSystemInstall_, kProductType_)) - ->set_version(Version()); + ->set_version(base::Version()); } static const bool kSystemInstall_; static const BrowserDistribution::Type kProductType_; base::ScopedTempDir test_dir_; - Version product_version_; - Version max_version_; + base::Version product_version_; + base::Version max_version_; scoped_ptr original_state_; scoped_ptr installer_state_; diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 0404b79140a31f..509dd3a9e80ef5 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -156,8 +156,8 @@ void ProcessOnOsUpgradeWorkItems(const InstallerState& installer_state, const Product& product) { scoped_ptr work_item_list( WorkItem::CreateNoRollbackWorkItemList()); - AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, - work_item_list.get()); + AddOsUpgradeWorkItems(installer_state, base::FilePath(), base::Version(), + product, work_item_list.get()); if (!work_item_list->Do()) LOG(ERROR) << "Failed to remove on-os-upgrade command."; } @@ -698,8 +698,8 @@ void RemoveFiletypeRegistration(const InstallerState& installer_state, bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, const Product& product) { scoped_ptr item_list(WorkItem::CreateNoRollbackWorkItemList()); - AddDelegateExecuteWorkItems(installer_state, base::FilePath(), Version(), - product, item_list.get()); + AddDelegateExecuteWorkItems(installer_state, base::FilePath(), + base::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 2e967377664948..a2467b917f38af 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(low)); } static ChromeVersion FromString(const std::string& version_string) { - Version version(version_string); + base::Version version(version_string); DCHECK(version.IsValid()); const std::vector& c(version.components()); return ChromeVersion(static_cast(c[0]) << 48 | @@ -669,7 +669,7 @@ bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, return false; } - Version new_version(base::UTF16ToASCII(ctx.new_version_str)); + base::Version new_version(base::UTF16ToASCII(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 Version& version) { + const base::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 4189fd96b60e4c..bf37f7c92c8e6c 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -142,9 +142,9 @@ base::string16 BrowserDistribution::GetVersionKey() const { } void BrowserDistribution::DoPostUninstallOperations( - const Version& version, const base::FilePath& local_data_path, - const base::string16& distribution_data) { -} + const base::Version& version, + const base::FilePath& local_data_path, + const base::string16& distribution_data) {} base::string16 BrowserDistribution::GetActiveSetupGuid() { return kChromiumActiveSetupGuid; diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index ac3780bf210781..6eb5eba3817569 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -64,7 +64,7 @@ class BrowserDistribution { base::string16 GetVersionKey() const; virtual void DoPostUninstallOperations( - const Version& version, + const base::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 c81cc5b5cfe44c..d7018352e91eba 100644 --- a/chrome/installer/util/fake_installation_state.h +++ b/chrome/installer/util/fake_installation_state.h @@ -18,7 +18,9 @@ namespace installer { class FakeInstallationState : public InstallationState { public: // Takes ownership of |version|. - void AddChrome(bool system_install, bool multi_install, Version* version) { + void AddChrome(bool system_install, + bool multi_install, + base::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 8b6e866fb3c0b9..c1819165edb18f 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(Version* version) { version_.reset(version); } + void set_version(base::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 17d761dfdea4ce..310d9dcb05a32e 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -70,7 +70,7 @@ GoogleChromeDistribution::GoogleChromeDistribution( } void GoogleChromeDistribution::DoPostUninstallOperations( - const Version& version, + const base::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 4f21d88c148154..f29d9c66e9bb17 100644 --- a/chrome/installer/util/google_chrome_distribution.h +++ b/chrome/installer/util/google_chrome_distribution.h @@ -30,7 +30,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. void DoPostUninstallOperations( - const Version& version, + const base::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 ad63b6685f8815..e52225a83ace7d 100644 --- a/chrome/installer/util/google_chrome_distribution_dummy.cc +++ b/chrome/installer/util/google_chrome_distribution_dummy.cc @@ -31,7 +31,7 @@ GoogleChromeDistribution::GoogleChromeDistribution( } void GoogleChromeDistribution::DoPostUninstallOperations( - const Version& version, + const base::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 529c05567baca9..25f418ce8c93e0 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -798,7 +798,8 @@ base::string16 GoogleUpdateSettings::GetUninstallCommandLine( return cmd_line; } -Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { +base::Version GoogleUpdateSettings::GetGoogleUpdateVersion( + bool system_install) { const HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; base::string16 version; RegKey key; @@ -808,10 +809,10 @@ Version GoogleUpdateSettings::GetGoogleUpdateVersion(bool system_install) { KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS && key.ReadValue(google_update::kRegGoogleUpdateVersion, &version) == ERROR_SUCCESS) { - return Version(base::UTF16ToUTF8(version)); + return base::Version(base::UTF16ToUTF8(version)); } - return Version(); + return base::Version(); } base::Time GoogleUpdateSettings::GetGoogleUpdateLastStartedAU( diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index e3a01685f1974c..39896ef60b9031 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h @@ -271,7 +271,7 @@ class GoogleUpdateSettings { static base::string16 GetUninstallCommandLine(bool system_install); // Returns the version of Google Update that is installed. - static Version GetGoogleUpdateVersion(bool system_install); + static base::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 314084bbfbbcaa..c38258c527b313 100644 --- a/chrome/installer/util/google_update_settings_unittest.cc +++ b/chrome/installer/util/google_update_settings_unittest.cc @@ -583,7 +583,7 @@ TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { // Chrome is installed. machine_state.AddChrome(system_level, multi_install, - new Version(chrome::kChromeVersion)); + new base::Version(chrome::kChromeVersion)); RegKey key; DWORD value; @@ -1090,7 +1090,7 @@ TEST_P(GetGoogleUpdateVersion, TestEmptyValue) { TEST_P(GetGoogleUpdateVersion, TestRealValue) { RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); - Version expected(base::UTF16ToUTF8(kDummyVersion)); + base::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 f3998752ececaf..b5fdddf9c72f62 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -230,7 +230,7 @@ base::CommandLine InstallUtil::GetChromeUninstallCmd( void InstallUtil::GetChromeVersion(BrowserDistribution* dist, bool system_install, - Version* version) { + base::Version* version) { DCHECK(dist); RegKey key; HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; @@ -242,11 +242,11 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS) result = key.ReadValue(google_update::kRegVersionField, &version_str); - *version = Version(); + *version = base::Version(); if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Existing " << dist->GetDisplayName() << " version found " << version_str; - *version = Version(base::UTF16ToASCII(version_str)); + *version = base::Version(base::UTF16ToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetDisplayName() @@ -256,7 +256,7 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, bool system_install, - Version* version) { + base::Version* version) { DCHECK(dist); RegKey key; HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; @@ -269,11 +269,11 @@ void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, result = key.ReadValue(google_update::kRegCriticalVersionField, &version_str); - *version = Version(); + *version = base::Version(); if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Critical Update version for " << dist->GetDisplayName() << " found " << version_str; - *version = Version(base::UTF16ToASCII(version_str)); + *version = base::Version(base::UTF16ToASCII(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 a926435daf1adb..cee44940f65de0 100644 --- a/chrome/installer/util/installation_state.cc +++ b/chrome/installer/util/installation_state.cc @@ -65,7 +65,7 @@ bool ProductState::Initialize(bool system_install, base::string16 version_str; if (key.ReadValue(google_update::kRegVersionField, &version_str) == ERROR_SUCCESS) { - version_.reset(new Version(base::UTF16ToASCII(version_str))); + version_.reset(new base::Version(base::UTF16ToASCII(version_str))); if (!version_->IsValid()) version_.reset(); } @@ -75,7 +75,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 Version(base::UTF16ToASCII(version_str))); + old_version_.reset(new base::Version(base::UTF16ToASCII(version_str))); if (!old_version_->IsValid()) old_version_.reset(); } @@ -151,16 +151,17 @@ base::FilePath ProductState::GetSetupPath() const { return uninstall_command_.GetProgram(); } -const Version& ProductState::version() const { +const base::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 Version(*other.version_) : NULL); + version_.reset(other.version_.get() ? new base::Version(*other.version_) + : NULL); old_version_.reset( - other.old_version_.get() ? new Version(*other.old_version_) : NULL); + other.old_version_.get() ? new base::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 cdfa4bc284ac08..d9346a335e8ea6 100644 --- a/chrome/installer/util/installation_state.h +++ b/chrome/installer/util/installation_state.h @@ -105,8 +105,8 @@ class ProductState { AppCommands* commands); ChannelInfo channel_; - scoped_ptr version_; - scoped_ptr old_version_; + scoped_ptr version_; + scoped_ptr old_version_; std::wstring brand_; std::wstring rename_cmd_; std::wstring oem_install_; diff --git a/chrome/installer/util/installation_validator_unittest.cc b/chrome/installer/util/installation_validator_unittest.cc index 65b9756aec4933..85ff8b637021a5 100644 --- a/chrome/installer/util/installation_validator_unittest.cc +++ b/chrome/installer/util/installation_validator_unittest.cc @@ -167,7 +167,7 @@ void FakeProductState::SetChannel(const wchar_t* base, int channel_modifiers) { } void FakeProductState::SetVersion(const char* version) { - version_.reset(version == NULL ? NULL : new Version(version)); + version_.reset(version == NULL ? NULL : new base::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 37e6abc1d347ae..6215bf6ce20397 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -159,7 +159,7 @@ void InstallerState::Initialize(const base::CommandLine& command_line, // Parse --critical-update-version=W.X.Y.Z std::string critical_version_value( command_line.GetSwitchValueASCII(switches::kCriticalUpdateVersion)); - critical_update_version_ = Version(critical_version_value); + critical_update_version_ = base::Version(critical_version_value); } void InstallerState::set_level(Level level) { @@ -367,10 +367,10 @@ const Product* InstallerState::FindProduct( return NULL; } -Version* InstallerState::GetCurrentVersion( +base::Version* InstallerState::GetCurrentVersion( const InstallationState& machine_state) const { DCHECK(!products_.empty()); - scoped_ptr current_version; + scoped_ptr 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 @@ -402,7 +402,7 @@ Version* InstallerState::GetCurrentVersion( machine_state.GetProductState(level_ == SYSTEM_LEVEL, prod_type); if (product_state != NULL) { - const Version* version = NULL; + const base::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 @@ -413,15 +413,15 @@ Version* InstallerState::GetCurrentVersion( if (version == NULL) version = &product_state->version(); - current_version.reset(new Version(*version)); + current_version.reset(new base::Version(*version)); } return current_version.release(); } -Version InstallerState::DetermineCriticalVersion( - const Version* current_version, - const Version& new_version) const { +base::Version InstallerState::DetermineCriticalVersion( + const base::Version* current_version, + const base::Version& new_version) const { DCHECK(current_version == NULL || current_version->IsValid()); DCHECK(new_version.IsValid()); if (critical_update_version_.IsValid() && @@ -430,7 +430,7 @@ Version InstallerState::DetermineCriticalVersion( new_version.CompareTo(critical_update_version_) >= 0) { return critical_update_version_; } - return Version(); + return base::Version(); } bool InstallerState::IsChromeFrameRunning( @@ -447,7 +447,7 @@ bool InstallerState::AreBinariesInUse( } base::FilePath InstallerState::GetInstallerDirectory( - const Version& version) const { + const base::Version& version) const { return target_path().AppendASCII(version.GetString()).Append(kInstallerDir); } @@ -494,7 +494,7 @@ bool InstallerState::AnyExistsAndIsInUse( // Check only for the current version (i.e., the version we are upgrading // _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. - scoped_ptr current_version(GetCurrentVersion(machine_state)); + scoped_ptr current_version(GetCurrentVersion(machine_state)); if (!current_version) return false; base::FilePath directory( @@ -531,10 +531,10 @@ void InstallerState::GetExistingExeVersions( } void InstallerState::RemoveOldVersionDirectories( - const Version& new_version, - Version* existing_version, + const base::Version& new_version, + base::Version* existing_version, const base::FilePath& temp_path) const { - Version version; + base::Version version; scoped_ptr item; std::set existing_version_strings; @@ -552,7 +552,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 = Version(base::UTF16ToASCII(dir_name.value())); + version = base::Version(base::UTF16ToASCII(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 1d608296fc49e8..abb642c86f21dc 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 Version& critical_update_version() const { + const base::Version& critical_update_version() const { return critical_update_version_; } void GetExistingExeVersions(std::set* existing_version_strings) { @@ -140,7 +140,7 @@ TEST_F(InstallerStateTest, Delete) { MockInstallerState installer_state; BuildSingleChromeState(chrome_dir, &installer_state); - Version latest_version("1.0.4.0"); + base::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); - Version latest_version("1.0.4.0"); - Version existing_version("1.0.1.0"); + base::Version latest_version("1.0.4.0"); + base::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"; - Version new_version(kNewVersion); - Version old_version(kOldVersion); + base::Version new_version(kNewVersion); + base::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"; - Version current_version(kCurrentVersion); + base::Version current_version(kCurrentVersion); HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; EXPECT_EQ(root, installer_state.root_key()); @@ -363,7 +363,8 @@ TEST_F(InstallerStateTest, WithProduct) { current_version.GetString()).c_str()); machine_state.Initialize(); // TODO(tommi): Also test for when there exists a new_chrome.exe. - Version found_version(*installer_state.GetCurrentVersion(machine_state)); + base::Version found_version( + *installer_state.GetCurrentVersion(machine_state)); EXPECT_TRUE(found_version.IsValid()); if (found_version.IsValid()) EXPECT_TRUE(current_version.Equals(found_version)); @@ -454,7 +455,7 @@ TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { // Pretend that this version of single-install Chrome is already installed. machine_state.AddChrome(system_install, false, - new Version(chrome::kChromeVersion)); + new base::Version(chrome::kChromeVersion)); // Now we're invoked to install multi Chrome. base::CommandLine cmd_line( @@ -464,7 +465,8 @@ TEST_F(InstallerStateTest, GetCurrentVersionMigrateChrome) { installer_state.Initialize(cmd_line, prefs, machine_state); // Is the Chrome version picked up? - scoped_ptr version(installer_state.GetCurrentVersion(machine_state)); + scoped_ptr version( + installer_state.GetCurrentVersion(machine_state)); EXPECT_TRUE(version.get() != NULL); } @@ -506,11 +508,11 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { const char kChromeExeVersion[] = "2.1.1.1"; const char kNewChromeExeVersion[] = "3.0.0.0"; - 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); + 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); ASSERT_TRUE(new_version.IsValid()); ASSERT_TRUE(old_version.IsValid()); @@ -544,7 +546,7 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { struct target_info { base::FilePath target_file; - const Version& target_version; + const base::Version& target_version; } targets[] = { { installer_state.target_path().Append(installer::kChromeOldExe), old_chrome_exe_version }, @@ -588,7 +590,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()); - Version version(base::UTF16ToASCII(dir_name.value())); + base::Version version(base::UTF16ToASCII(dir_name.value())); if (version.IsValid()) { EXPECT_TRUE(expected_remaining_dirs.erase(version.GetString())) << "Unexpected version dir found: " << version.GetString(); @@ -680,11 +682,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { // Creates a set of versions for use by all test runs. static void SetUpTestCase() { - 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"); + 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"); } // Cleans up versions used by all test runs. @@ -699,7 +701,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 Version* version) { + MockInstallerState& Initialize(const base::Version* version) { cmd_line_ = version == NULL ? base::CommandLine::FromString(L"setup.exe") : base::CommandLine::FromString( L"setup.exe --critical-update-version=" + @@ -710,11 +712,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { return installer_state_; } - static Version* low_version_; - static Version* opv_version_; - static Version* middle_version_; - static Version* pv_version_; - static Version* high_version_; + 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_; base::CommandLine cmd_line_; scoped_ptr prefs_; @@ -722,11 +724,11 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { MockInstallerState installer_state_; }; -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; +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; // 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_unittest.cc b/chrome/installer/util/product_unittest.cc index d499548046a0d3..45fc1dbb420b6a 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -92,7 +92,7 @@ TEST_F(ProductTest, ProductInstallBasic) { ASSERT_TRUE(version_key.Valid()); const char kCurrentVersion[] = "1.2.3.4"; - Version current_version(kCurrentVersion); + base::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 80112758b1d362..246b3649a1c2de 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc @@ -148,7 +148,7 @@ void GetSupportedCodecsForPepperCdm( static void AddPepperBasedWidevine( std::vector* concrete_key_systems) { #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) - Version glibc_version(gnu_get_libc_version()); + base::Version glibc_version(gnu_get_libc_version()); DCHECK(glibc_version.IsValid()); if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) return; diff --git a/components/component_updater/component_updater_service_unittest.cc b/components/component_updater/component_updater_service_unittest.cc index c44c63b7c1482c..c66103ec8e3df4 100644 --- a/components/component_updater/component_updater_service_unittest.cc +++ b/components/component_updater/component_updater_service_unittest.cc @@ -236,12 +236,12 @@ TEST_F(ComponentUpdaterTest, RegisterComponent) { CrxComponent crx_component1; crx_component1.pk_hash.assign(abag_hash, abag_hash + arraysize(abag_hash)); - crx_component1.version = Version("1.0"); + crx_component1.version = base::Version("1.0"); crx_component1.installer = installer; CrxComponent crx_component2; crx_component2.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx_component2.version = Version("0.9"); + crx_component2.version = base::Version("0.9"); crx_component2.installer = installer; // Quit after two update checks have fired. @@ -294,7 +294,7 @@ TEST_F(ComponentUpdaterTest, OnDemandUpdate) { using update_client::jebg_hash; CrxComponent crx_component; crx_component.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx_component.version = Version("0.9"); + crx_component.version = base::Version("0.9"); crx_component.installer = installer; LoopHandler loop_handler(1, quit_closure()); @@ -338,7 +338,7 @@ TEST_F(ComponentUpdaterTest, MaybeThrottle) { using update_client::jebg_hash; CrxComponent crx_component; crx_component.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx_component.version = Version("0.9"); + crx_component.version = base::Version("0.9"); crx_component.installer = installer; LoopHandler loop_handler(1, quit_closure()); diff --git a/components/update_client/action_update_check.cc b/components/update_client/action_update_check.cc index d68940e335e670..aeb455b62acefc 100644 --- a/components/update_client/action_update_check.cc +++ b/components/update_client/action_update_check.cc @@ -26,8 +26,8 @@ namespace update_client { namespace { // Returns true if the |proposed| version is newer than |current| version. -bool IsVersionNewer(const Version& current, const std::string& proposed) { - Version proposed_ver(proposed); +bool IsVersionNewer(const base::Version& current, const std::string& proposed) { + base::Version proposed_ver(proposed); return proposed_ver.IsValid() && current.CompareTo(proposed_ver) < 0; } @@ -68,7 +68,7 @@ void ActionUpdateCheck::Run(UpdateContext* update_context, Callback callback) { item->crx_urls.clear(); item->crx_diffurls.clear(); item->previous_version = crx_component.version; - item->next_version = Version(); + item->next_version = base::Version(); item->previous_fp = crx_component.fingerprint; item->next_fp.clear(); item->on_demand = update_context->is_foreground; @@ -154,7 +154,7 @@ void ActionUpdateCheck::OnUpdateCheckSucceeded( } // Parse the members of the result and queue an upgrade for this CRX. - crx->next_version = Version(it->manifest.version); + crx->next_version = base::Version(it->manifest.version); VLOG(1) << "Update found for CRX: " << crx->id; diff --git a/components/update_client/crx_update_item.h b/components/update_client/crx_update_item.h index a9cf171bb5b99a..34fed9dfb51b45 100644 --- a/components/update_client/crx_update_item.h +++ b/components/update_client/crx_update_item.h @@ -85,8 +85,8 @@ struct CrxUpdateItem { std::vector crx_diffurls; // The from/to version and fingerprint values. - Version previous_version; - Version next_version; + base::Version previous_version; + base::Version next_version; std::string previous_fp; std::string next_fp; diff --git a/components/update_client/test_installer.cc b/components/update_client/test_installer.cc index ad6015b980083c..7a291994bc582c 100644 --- a/components/update_client/test_installer.cc +++ b/components/update_client/test_installer.cc @@ -62,7 +62,7 @@ bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest, const base::FilePath& unpack_path) { std::string version_string; manifest.GetStringASCII("version", &version_string); - Version version(version_string.c_str()); + base::Version version(version_string); base::FilePath path; path = install_directory_.AppendASCII(version.GetString()); diff --git a/components/update_client/test_installer.h b/components/update_client/test_installer.h index 44a6f280346ff9..17ea2901a1b742 100644 --- a/components/update_client/test_installer.h +++ b/components/update_client/test_installer.h @@ -76,7 +76,7 @@ class VersionedTestInstaller : public TestInstaller { ~VersionedTestInstaller() override; base::FilePath install_directory_; - Version current_version_; + base::Version current_version_; }; } // namespace update_client diff --git a/components/update_client/update_client.h b/components/update_client/update_client.h index 29b80e065812cf..012a59d5f8686d 100644 --- a/components/update_client/update_client.h +++ b/components/update_client/update_client.h @@ -188,7 +188,7 @@ struct CrxComponent { // The current version if the CRX is updated. Otherwise, "0" or "0.0" if // the CRX is installed. - Version version; + base::Version version; std::string fingerprint; // Optional. std::string name; // Optional. diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc index 0ae4cc2188255c..73c586fa1a6148 100644 --- a/components/update_client/update_client_unittest.cc +++ b/components/update_client/update_client_unittest.cc @@ -202,7 +202,7 @@ TEST_F(UpdateClientTest, OneCrxNoUpdate) { CrxComponent crx; crx.name = "test_jebg"; crx.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx.version = Version("0.9"); + crx.version = base::Version("0.9"); crx.installer = new TestInstaller; components->push_back(crx); } @@ -302,13 +302,13 @@ TEST_F(UpdateClientTest, TwoCrxUpdateNoUpdate) { CrxComponent crx1; crx1.name = "test_jebg"; crx1.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx1.version = Version("0.9"); + crx1.version = base::Version("0.9"); crx1.installer = new TestInstaller; CrxComponent crx2; crx2.name = "test_abag"; crx2.pk_hash.assign(abag_hash, abag_hash + arraysize(abag_hash)); - crx2.version = Version("2.2"); + crx2.version = base::Version("2.2"); crx2.installer = new TestInstaller; components->push_back(crx1); @@ -485,13 +485,13 @@ TEST_F(UpdateClientTest, TwoCrxUpdate) { CrxComponent crx1; crx1.name = "test_jebg"; crx1.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx1.version = Version("0.9"); + crx1.version = base::Version("0.9"); crx1.installer = new TestInstaller; CrxComponent crx2; crx2.name = "test_ihfo"; crx2.pk_hash.assign(ihfo_hash, ihfo_hash + arraysize(ihfo_hash)); - crx2.version = Version("0.8"); + crx2.version = base::Version("0.8"); crx2.installer = new TestInstaller; components->push_back(crx1); @@ -726,13 +726,13 @@ TEST_F(UpdateClientTest, TwoCrxUpdateDownloadTimeout) { CrxComponent crx1; crx1.name = "test_jebg"; crx1.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx1.version = Version("0.9"); + crx1.version = base::Version("0.9"); crx1.installer = new TestInstaller; CrxComponent crx2; crx2.name = "test_ihfo"; crx2.pk_hash.assign(ihfo_hash, ihfo_hash + arraysize(ihfo_hash)); - crx2.version = Version("0.8"); + crx2.version = base::Version("0.8"); crx2.installer = new TestInstaller; components->push_back(crx1); @@ -973,9 +973,9 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdate) { crx.pk_hash.assign(ihfo_hash, ihfo_hash + arraysize(ihfo_hash)); crx.installer = installer; if (num_calls == 1) { - crx.version = Version("0.8"); + crx.version = base::Version("0.8"); } else if (num_calls == 2) { - crx.version = Version("1.0"); + crx.version = base::Version("1.0"); } else { NOTREACHED(); } @@ -1258,7 +1258,7 @@ TEST_F(UpdateClientTest, OneCrxInstallError) { CrxComponent crx; crx.name = "test_jebg"; crx.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx.version = Version("0.9"); + crx.version = base::Version("0.9"); crx.installer = installer; components->push_back(crx); } @@ -1435,9 +1435,9 @@ TEST_F(UpdateClientTest, OneCrxDiffUpdateFailsFullUpdateSucceeds) { crx.pk_hash.assign(ihfo_hash, ihfo_hash + arraysize(ihfo_hash)); crx.installer = installer; if (num_calls == 1) { - crx.version = Version("0.8"); + crx.version = base::Version("0.8"); } else if (num_calls == 2) { - crx.version = Version("1.0"); + crx.version = base::Version("1.0"); } else { NOTREACHED(); } @@ -1713,7 +1713,7 @@ TEST_F(UpdateClientTest, OneCrxNoUpdateQueuedCall) { CrxComponent crx; crx.name = "test_jebg"; crx.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx.version = Version("0.9"); + crx.version = base::Version("0.9"); crx.installer = new TestInstaller; components->push_back(crx); } @@ -1818,7 +1818,7 @@ TEST_F(UpdateClientTest, OneCrxInstall) { CrxComponent crx; crx.name = "test_jebg"; crx.pk_hash.assign(jebg_hash, jebg_hash + arraysize(jebg_hash)); - crx.version = Version("0.0"); + crx.version = base::Version("0.0"); crx.installer = new TestInstaller; components->push_back(crx); diff --git a/components/update_client/update_response.cc b/components/update_client/update_response.cc index c0996fc98c6b2c..e2ceaf984c8c8f 100644 --- a/components/update_client/update_response.cc +++ b/components/update_client/update_response.cc @@ -156,7 +156,7 @@ bool ParseManifestTag(xmlNode* manifest, *error = "Missing version for manifest."; return false; } - Version version(result->manifest.version); + base::Version version(result->manifest.version); if (!version.IsValid()) { *error = "Invalid version: '"; *error += result->manifest.version; @@ -168,7 +168,7 @@ bool ParseManifestTag(xmlNode* manifest, result->manifest.browser_min_version = GetAttribute(manifest, "prodversionmin"); if (result->manifest.browser_min_version.length()) { - Version browser_min_version(result->manifest.browser_min_version); + base::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/components/variations/processed_study.cc b/components/variations/processed_study.cc index 5f065d8e1e88ac..c8966ecbd79c5c 100644 --- a/components/variations/processed_study.cc +++ b/components/variations/processed_study.cc @@ -26,13 +26,13 @@ bool ValidateStudyAndComputeTotalProbability( return false; } if (study.filter().has_min_version() && - !Version::IsValidWildcardString(study.filter().min_version())) { + !base::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() && - !Version::IsValidWildcardString(study.filter().max_version())) { + !base::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/study_filtering_unittest.cc b/components/variations/study_filtering_unittest.cc index 29b7c93ed89365..0c6c3786c9bfe0 100644 --- a/components/variations/study_filtering_unittest.cc +++ b/components/variations/study_filtering_unittest.cc @@ -275,8 +275,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) { for (size_t i = 0; i < arraysize(min_test_cases); ++i) { filter.set_min_version(min_test_cases[i].min_version); - const bool result = - internal::CheckStudyVersion(filter, Version(min_test_cases[i].version)); + const bool result = internal::CheckStudyVersion( + filter, base::Version(min_test_cases[i].version)); EXPECT_EQ(min_test_cases[i].expected_result, result) << "Min. version case " << i << " failed!"; } @@ -284,8 +284,8 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) { for (size_t i = 0; i < arraysize(max_test_cases); ++i) { filter.set_max_version(max_test_cases[i].max_version); - const bool result = - internal::CheckStudyVersion(filter, Version(max_test_cases[i].version)); + const bool result = internal::CheckStudyVersion( + filter, base::Version(max_test_cases[i].version)); EXPECT_EQ(max_test_cases[i].expected_result, result) << "Max version case " << i << " failed!"; } @@ -297,16 +297,14 @@ TEST(VariationsStudyFilteringTest, CheckStudyVersion) { filter.set_max_version(max_test_cases[j].max_version); if (!min_test_cases[i].expected_result) { - const bool result = - internal::CheckStudyVersion( - filter, Version(min_test_cases[i].version)); + const bool result = internal::CheckStudyVersion( + filter, base::Version(min_test_cases[i].version)); EXPECT_FALSE(result) << "Case " << i << "," << j << " failed!"; } if (!max_test_cases[j].expected_result) { - const bool result = - internal::CheckStudyVersion( - filter, Version(max_test_cases[j].version)); + const bool result = internal::CheckStudyVersion( + filter, base::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 03850027d86a93..70eba9d2bc5a19 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -76,7 +76,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); - Version os_version(version_str); + base::Version os_version(version_str); if (os_version.IsValid() && os_version.components().size() >= 2) { const std::vector& 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 e192327b8e512a..b5912645400036 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -47,10 +47,10 @@ void PluginDataRemover::GetSupportedPlugins( std::vector plugins; PluginService::GetInstance()->GetPluginInfoArray( GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); - Version min_version(kMinFlashVersion); + base::Version min_version(kMinFlashVersion); for (std::vector::iterator it = plugins.begin(); it != plugins.end(); ++it) { - Version version; + base::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 d64af01c4fdb98..468ca188c16651 100644 --- a/content/child/npapi/webplugin_delegate_impl_win.cc +++ b/content/child/npapi/webplugin_delegate_impl_win.cc @@ -187,7 +187,7 @@ std::wstring GetKeyPath(HKEY key) { } uint32_t GetPluginMajorVersion(const WebPluginInfo& plugin_info) { - Version plugin_version; + base::Version plugin_version; WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); uint32_t major_version = 0; diff --git a/content/common/webplugininfo_unittest.cc b/content/common/webplugininfo_unittest.cc index 1d659c30b25674..e067e45acc65f9 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++) { - Version version; + base::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 d12dfd744ec279..4f6bb66a327b7f 100644 --- a/content/public/common/webplugininfo.cc +++ b/content/public/common/webplugininfo.cc @@ -97,7 +97,7 @@ void WebPluginInfo::CreateVersionFromString( } } - *parsed_version = Version(no_leading_zeros_version); + *parsed_version = base::Version(no_leading_zeros_version); } } // namespace content diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc index 443f93682b6d46..544bf58c82e598 100644 --- a/extensions/browser/api/runtime/runtime_api.cc +++ b/extensions/browser/api/runtime/runtime_api.cc @@ -191,7 +191,7 @@ void RuntimeAPI::OnExtensionLoaded(content::BrowserContext* browser_context, base::Bind(&RuntimeEventRouter::DispatchOnInstalledEvent, browser_context_, extension->id(), - Version(), + base::Version(), true)); } @@ -206,7 +206,7 @@ void RuntimeAPI::OnExtensionWillBeInstalled( if (util::IsEphemeralApp(extension->id(), browser_context_)) return; - Version old_version = delegate_->GetPreviousExtensionVersion(extension); + base::Version old_version = delegate_->GetPreviousExtensionVersion(extension); // Dispatch the onInstalled event. base::MessageLoop::current()->PostTask( @@ -287,7 +287,7 @@ void RuntimeEventRouter::DispatchOnStartupEvent( void RuntimeEventRouter::DispatchOnInstalledEvent( content::BrowserContext* context, const std::string& extension_id, - const Version& old_version, + const base::Version& old_version, bool chrome_updated) { if (!ExtensionsBrowserClient::Get()->IsValidContext(context)) return; diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc index d1d6468b0c94dc..eebe259dc60310 100644 --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc @@ -146,9 +146,9 @@ bool IncrementAuthUserIndex(GURL* url) { } // namespace -UpdateDetails::UpdateDetails(const std::string& id, const Version& version) - : id(id), version(version) { -} +UpdateDetails::UpdateDetails(const std::string& id, + const base::Version& version) + : id(id), version(version) {} UpdateDetails::~UpdateDetails() { } @@ -232,7 +232,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). - Version version("0.0.0.0"); + base::Version version("0.0.0.0"); DCHECK(version.IsValid()); return AddExtensionData(id, @@ -296,7 +296,7 @@ void ExtensionDownloader::SetWebstoreIdentityProvider( bool ExtensionDownloader::AddExtensionData( const std::string& id, - const Version& version, + const base::Version& version, Manifest::Type extension_type, const GURL& extension_update_url, const std::string& update_url_data, @@ -661,8 +661,8 @@ void ExtensionDownloader::DetermineUpdates( // We should skip the version check if update was forced. if (!fetch_data.DidForceUpdate(id)) { - Version existing_version(version); - Version update_version(update->version); + base::Version existing_version(version); + base::Version update_version(update->version); if (!update_version.IsValid() || update_version.CompareTo(existing_version) <= 0) { continue; @@ -878,7 +878,7 @@ void ExtensionDownloader::NotifyExtensionsDownloadFailed( void ExtensionDownloader::NotifyUpdateFound(const std::string& id, const std::string& version) { - UpdateDetails updateInfo(id, Version(version)); + UpdateDetails updateInfo(id, base::Version(version)); content::NotificationService::current()->Notify( extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, content::NotificationService::AllBrowserContextsAndSources(), diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc index 785e7c858ba340..e3b46b4048ddd8 100644 --- a/extensions/browser/user_script_loader.cc +++ b/extensions/browser/user_script_loader.cc @@ -99,7 +99,7 @@ bool UserScriptLoader::ParseMetadataHeader(const base::StringPiece& script_text, } else if (GetDeclarationValue(line, kNameDeclaration, &value)) { script->set_name(value); } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) { - Version version(value); + base::Version version(value); if (version.IsValid()) script->set_version(version.GetString()); } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) { diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index b6803857ef917a..06544e861a4db3 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc @@ -576,7 +576,7 @@ bool Extension::LoadVersion(base::string16* error) { *error = base::ASCIIToUTF16(errors::kInvalidVersion); return false; } - version_.reset(new Version(version_str)); + version_.reset(new base::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 99efe8828fdc9f..edac89199603c6 100644 --- a/extensions/common/manifest_handlers/shared_module_info.cc +++ b/extensions/common/manifest_handlers/shared_module_info.cc @@ -183,7 +183,7 @@ bool SharedModuleInfo::Parse(const Extension* extension, return false; } imports_.back().minimum_version = min_version; - Version v(min_version); + base::Version v(min_version); if (!v.IsValid()) { *error = ErrorUtils::FormatErrorMessageUTF16( errors::kInvalidImportVersion, base::IntToString(i)); diff --git a/extensions/common/update_manifest.cc b/extensions/common/update_manifest.cc index 57162da71e7bc0..20a55914526f7e 100644 --- a/extensions/common/update_manifest.cc +++ b/extensions/common/update_manifest.cc @@ -167,7 +167,7 @@ static bool ParseSingleAppTag(xmlNode* app_node, xmlNs* xml_namespace, *error_detail = "Missing version for updatecheck."; return false; } - Version version(result->version); + base::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()) { - Version browser_min_version(result->browser_min_version); + base::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/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc index 23d52169f12798..c035b46fc11bf5 100644 --- a/gpu/config/gpu_info.cc +++ b/gpu/config/gpu_info.cc @@ -82,7 +82,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const { bool optimus; bool amd_switchable; bool lenovo_dcute; - Version display_link_version; + base::Version display_link_version; GPUDevice gpu; std::vector secondary_gpus; uint64 adapter_luid; diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h index d6f61fd60f79e0..a43540c153bedf 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h @@ -119,7 +119,7 @@ struct GPU_EXPORT GPUInfo { // Version of DisplayLink driver installed. Zero if not installed. // http://crbug.com/177611. - Version display_link_version; + base::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 f51764da823fb5..26a8f030d7c2de 100644 --- a/gpu/config/gpu_info_collector_win.cc +++ b/gpu/config/gpu_info_collector_win.cc @@ -53,23 +53,23 @@ enum DisplayLinkInstallationStatus { // Returns the display link driver version or an invalid version if it is // not installed. -Version DisplayLinkVersion() { +base::Version DisplayLinkVersion() { base::win::RegKey key; if (key.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY)) - return Version(); + return base::Version(); if (key.OpenKey(L"DisplayLink", KEY_READ | KEY_WOW64_64KEY)) - return Version(); + return base::Version(); if (key.OpenKey(L"Core", KEY_READ | KEY_WOW64_64KEY)) - return Version(); + return base::Version(); base::string16 version; if (key.ReadValue(L"Version", &version)) - return Version(); + return base::Version(); - return Version(base::UTF16ToASCII(version)); + return base::Version(base::UTF16ToASCII(version)); } // Returns whether Lenovo dCute is installed.