Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the header."
This is a speculative revert of r242414.
BUG=330681
TEST=as in bug
[email protected]
Review URL: https://codereview.chromium.org/109673004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242889 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index fe8965e..9a19ceb 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -356,7 +356,7 @@
// TODO(tommi): Check if using the default distribution is always the right
// thing to do.
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- base::Version version;
+ Version version;
InstallUtil::GetChromeVersion(dist, true, &version);
if (version.IsValid()) {
base::FilePath exe_path;
diff --git a/chrome/browser/chromeos/extensions/external_cache.cc b/chrome/browser/chromeos/extensions/external_cache.cc
index 75cf2c4..5818916 100644
--- a/chrome/browser/chromeos/extensions/external_cache.cc
+++ b/chrome/browser/chromeos/extensions/external_cache.cc
@@ -341,7 +341,7 @@
id.clear();
}
- if (!base::Version(version).IsValid()) {
+ if (!Version(version).IsValid()) {
LOG(ERROR) << "Bad extension version in ExternalCache: " << version;
version.clear();
}
@@ -376,8 +376,8 @@
&prev_version_string) &&
entry->GetString(extensions::ExternalProviderImpl::kExternalCrx,
&prev_crx)) {
- base::Version prev_version(prev_version_string);
- base::Version curr_version(version);
+ Version prev_version(prev_version_string);
+ Version curr_version(version);
DCHECK(prev_version.IsValid());
DCHECK(curr_version.IsValid());
if (prev_version.CompareTo(curr_version) <= 0) {
@@ -472,7 +472,7 @@
const std::string& id,
const base::FilePath& path,
const std::string& version) {
- base::Version version_validator(version);
+ Version version_validator(version);
if (!version_validator.IsValid()) {
LOG(ERROR) << "ExternalCache downloaded extension " << id << " but got bad "
<< "version: " << version;
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index a5907a3..5cd162c 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -19,6 +19,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "base/version.h"
#include "chrome/browser/accessibility/accessibility_events.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index 9782431..5325d60 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -73,8 +73,8 @@
}
// Returns true if the |proposed| version is newer than |current| version.
-bool IsVersionNewer(const base::Version& current, const std::string& proposed) {
- base::Version proposed_ver(proposed);
+bool IsVersionNewer(const Version& current, const std::string& proposed) {
+ Version proposed_ver(proposed);
return proposed_ver.IsValid() && current.CompareTo(proposed_ver) < 0;
}
@@ -329,7 +329,7 @@
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
- const base::Version chrome_version_;
+ const Version chrome_version_;
bool running_;
@@ -738,7 +738,7 @@
item->crx_urls.clear();
item->crx_diffurls.clear();
item->previous_version = item->component.version;
- item->next_version = base::Version();
+ item->next_version = Version();
item->previous_fp = item->component.fingerprint;
item->next_fp.clear();
item->diff_update_failed = false;
@@ -849,7 +849,7 @@
}
// Parse the members of the result and queue an upgrade for this component.
- crx->next_version = base::Version(it->manifest.version);
+ crx->next_version = Version(it->manifest.version);
typedef component_updater::
UpdateResponse::Result::Manifest::Package Package;
diff --git a/chrome/browser/component_updater/component_updater_service.h b/chrome/browser/component_updater/component_updater_service.h
index 1a14940..8f3f8b6 100644
--- a/chrome/browser/component_updater/component_updater_service.h
+++ b/chrome/browser/component_updater/component_updater_service.h
@@ -100,7 +100,7 @@
std::vector<uint8> pk_hash;
ComponentInstaller* installer;
ComponentObserver* observer;
- base::Version version;
+ Version version;
std::string fingerprint;
std::string name;
CrxComponent();
diff --git a/chrome/browser/component_updater/crx_update_item.h b/chrome/browser/component_updater/crx_update_item.h
index be79e48..477da9a 100644
--- a/chrome/browser/component_updater/crx_update_item.h
+++ b/chrome/browser/component_updater/crx_update_item.h
@@ -84,8 +84,8 @@
std::vector<GURL> crx_diffurls;
// The from/to version and fingerprint values.
- base::Version previous_version;
- base::Version next_version;
+ Version previous_version;
+ Version next_version;
std::string previous_fp;
std::string next_fp;
diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc
index ccfd49e..f21234b 100644
--- a/chrome/browser/component_updater/pepper_flash_component_installer.cc
+++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc
@@ -96,7 +96,7 @@
// |latest_version| returns the corresponding version number. |older_dirs|
// returns directories of all older versions.
bool GetPepperFlashDirectory(base::FilePath* latest_dir,
- base::Version* latest_version,
+ Version* latest_version,
std::vector<base::FilePath>* older_dirs) {
base::FilePath base_dir = GetPepperFlashBaseDirectory();
bool found = false;
@@ -104,7 +104,7 @@
file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES);
for (base::FilePath path = file_enumerator.Next(); !path.value().empty();
path = file_enumerator.Next()) {
- base::Version version(path.BaseName().MaybeAsASCII());
+ Version version(path.BaseName().MaybeAsASCII());
if (!version.IsValid())
continue;
if (found) {
@@ -138,7 +138,7 @@
}
bool MakePepperFlashPluginInfo(const base::FilePath& flash_path,
- const base::Version& flash_version,
+ const Version& flash_version,
bool out_of_process,
content::PepperPluginInfo* plugin_info) {
if (!flash_version.IsValid())
@@ -179,7 +179,7 @@
}
void RegisterPepperFlashWithChrome(const base::FilePath& path,
- const base::Version& version) {
+ const Version& version) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
content::PepperPluginInfo plugin_info;
if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info))
@@ -193,7 +193,7 @@
continue;
// Do it only if the version we're trying to register is newer.
- base::Version registered_version(base::UTF16ToUTF8(it->version));
+ Version registered_version(base::UTF16ToUTF8(it->version));
if (registered_version.IsValid() &&
version.CompareTo(registered_version) <= 0) {
return;
@@ -245,7 +245,7 @@
class PepperFlashComponentInstaller : public ComponentInstaller {
public:
- explicit PepperFlashComponentInstaller(const base::Version& version);
+ explicit PepperFlashComponentInstaller(const Version& version);
virtual ~PepperFlashComponentInstaller() {}
@@ -258,11 +258,11 @@
base::FilePath* installed_file) OVERRIDE;
private:
- base::Version current_version_;
+ Version current_version_;
};
PepperFlashComponentInstaller::PepperFlashComponentInstaller(
- const base::Version& version) : current_version_(version) {
+ const Version& version) : current_version_(version) {
DCHECK(version.IsValid());
}
@@ -273,7 +273,7 @@
bool PepperFlashComponentInstaller::Install(
const base::DictionaryValue& manifest,
const base::FilePath& unpack_path) {
- base::Version version;
+ Version version;
if (!CheckPepperFlashManifest(manifest, &version))
return false;
if (current_version_.CompareTo(version) > 0)
@@ -305,7 +305,7 @@
}
bool CheckPepperFlashManifest(const base::DictionaryValue& manifest,
- base::Version* version_out) {
+ Version* version_out) {
std::string name;
manifest.GetStringASCII("name", &name);
// TODO(viettrungluu): Support WinFlapper for now, while we change the format
@@ -316,7 +316,7 @@
std::string proposed_version;
manifest.GetStringASCII("version", &proposed_version);
- base::Version version(proposed_version.c_str());
+ Version version(proposed_version.c_str());
if (!version.IsValid())
return false;
@@ -347,7 +347,7 @@
#if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX)
void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus,
- const base::Version& version) {
+ const Version& version) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CrxComponent pepflash;
pepflash.name = "pepper_flash";
@@ -369,7 +369,7 @@
}
}
- base::Version version(kNullVersion);
+ Version version(kNullVersion);
std::vector<base::FilePath> older_dirs;
if (GetPepperFlashDirectory(&path, &version, &older_dirs)) {
path = path.Append(chrome::kPepperFlashPluginFilename);
@@ -378,7 +378,7 @@
BrowserThread::UI, FROM_HERE,
base::Bind(&RegisterPepperFlashWithChrome, path, version));
} else {
- version = base::Version(kNullVersion);
+ version = Version(kNullVersion);
}
}
diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
index b7e9d2d4..2f9a10e36e 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
@@ -90,7 +90,7 @@
bool GetLatestPnaclDirectory(PnaclComponentInstaller* pci,
base::FilePath* latest_dir,
- base::Version* latest_version,
+ Version* latest_version,
std::vector<base::FilePath>* older_dirs) {
// Enumerate all versions starting from the base directory.
base::FilePath base_dir = pci->GetPnaclBaseDirectory();
@@ -99,7 +99,7 @@
file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES);
for (base::FilePath path = file_enumerator.Next(); !path.value().empty();
path = file_enumerator.Next()) {
- base::Version version(path.BaseName().MaybeAsASCII());
+ Version version(path.BaseName().MaybeAsASCII());
if (!version.IsValid())
continue;
if (found) {
@@ -155,7 +155,7 @@
// PNaCl manifest indicates this is the correct arch-specific package.
bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
const base::DictionaryValue& pnacl_manifest,
- base::Version* version_out) {
+ Version* version_out) {
// Make sure we have the right |manifest| file.
std::string name;
if (!manifest.GetStringASCII("name", &name)) {
@@ -177,7 +177,7 @@
LOG(WARNING) << "'version' field is missing from manifest!";
return false;
}
- base::Version version(proposed_version.c_str());
+ Version version(proposed_version.c_str());
if (!version.IsValid()) {
LOG(WARNING) << "'version' field in manifest is invalid "
<< version.GetString();
@@ -259,7 +259,7 @@
return false;
}
- base::Version version;
+ Version version;
if (!CheckPnaclComponentManifest(manifest, *pnacl_manifest, &version)) {
LOG(WARNING) << "CheckPnaclComponentManifest failed, not installing.";
return false;
@@ -297,7 +297,7 @@
// |installed_file| actually exists.
bool PnaclComponentInstaller::GetInstalledFile(
const std::string& file, base::FilePath* installed_file) {
- if (current_version().Equals(base::Version(kNullVersion)))
+ if (current_version().Equals(Version(kNullVersion)))
return false;
*installed_file = GetPnaclBaseDirectory().AppendASCII(
@@ -318,7 +318,7 @@
namespace {
-void FinishPnaclUpdateRegistration(const base::Version& current_version,
+void FinishPnaclUpdateRegistration(const Version& current_version,
const std::string& current_fingerprint,
PnaclComponentInstaller* pci) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -347,7 +347,7 @@
}
}
- base::Version current_version(kNullVersion);
+ Version current_version(kNullVersion);
std::string current_fingerprint;
std::vector<base::FilePath> older_dirs;
if (GetLatestPnaclDirectory(pci, &path, ¤t_version, &older_dirs)) {
@@ -355,7 +355,7 @@
ReadComponentManifest(path));
scoped_ptr<base::DictionaryValue> pnacl_manifest(
ReadPnaclManifest(path));
- base::Version manifest_version;
+ Version manifest_version;
// Check that the component manifest and PNaCl manifest files
// are legit, and that the indicated version matches the one
// encoded within the path name.
@@ -364,7 +364,7 @@
*pnacl_manifest,
&manifest_version)
|| !current_version.Equals(manifest_version)) {
- current_version = base::Version(kNullVersion);
+ current_version = Version(kNullVersion);
} else {
OverrideDirPnaclComponent(path);
base::ReadFileToString(path.AppendASCII("manifest.fingerprint"),
diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc
index 3d04f29..db620fe 100644
--- a/chrome/browser/component_updater/recovery_component_installer.cc
+++ b/chrome/browser/component_updater/recovery_component_installer.cc
@@ -46,7 +46,7 @@
class RecoveryComponentInstaller : public ComponentInstaller {
public:
- explicit RecoveryComponentInstaller(const base::Version& version,
+ explicit RecoveryComponentInstaller(const Version& version,
PrefService* prefs);
virtual ~RecoveryComponentInstaller() {}
@@ -60,14 +60,14 @@
base::FilePath* installed_file) OVERRIDE;
private:
- base::Version current_version_;
+ Version current_version_;
PrefService* prefs_;
};
void RecoveryRegisterHelper(ComponentUpdateService* cus,
PrefService* prefs) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- base::Version version(prefs->GetString(prefs::kRecoveryComponentVersion));
+ Version version(prefs->GetString(prefs::kRecoveryComponentVersion));
if (!version.IsValid()) {
NOTREACHED();
return;
@@ -83,14 +83,13 @@
}
}
-void RecoveryUpdateVersionHelper(const base::Version& version,
- PrefService* prefs) {
+void RecoveryUpdateVersionHelper(const Version& version, PrefService* prefs) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString());
}
RecoveryComponentInstaller::RecoveryComponentInstaller(
- const base::Version& version, PrefService* prefs)
+ const Version& version, PrefService* prefs)
: current_version_(version), prefs_(prefs){
DCHECK(version.IsValid());
}
@@ -107,7 +106,7 @@
return false;
std::string proposed_version;
manifest.GetStringASCII("version", &proposed_version);
- base::Version version(proposed_version.c_str());
+ Version version(proposed_version.c_str());
if (!version.IsValid())
return false;
if (current_version_.CompareTo(version) >= 0)
diff --git a/chrome/browser/component_updater/swiftshader_component_installer.cc b/chrome/browser/component_updater/swiftshader_component_installer.cc
index 4e63685..038c294e 100644
--- a/chrome/browser/component_updater/swiftshader_component_installer.cc
+++ b/chrome/browser/component_updater/swiftshader_component_installer.cc
@@ -60,7 +60,7 @@
// On success it returns something like:
// <profile>\AppData\Local\Google\Chrome\User Data\SwiftShader\10.3.44.555\.
bool GetLatestSwiftShaderDirectory(base::FilePath* result,
- base::Version* latest,
+ Version* latest,
std::vector<base::FilePath>* older_dirs) {
base::FilePath base_dir = GetSwiftShaderBaseDirectory();
bool found = false;
@@ -68,7 +68,7 @@
file_enumerator(base_dir, false, base::FileEnumerator::DIRECTORIES);
for (base::FilePath path = file_enumerator.Next(); !path.value().empty();
path = file_enumerator.Next()) {
- base::Version version(path.BaseName().MaybeAsASCII());
+ Version version(path.BaseName().MaybeAsASCII());
if (!version.IsValid())
continue;
if (version.CompareTo(*latest) > 0 &&
@@ -96,7 +96,7 @@
class SwiftShaderComponentInstaller : public ComponentInstaller {
public:
- explicit SwiftShaderComponentInstaller(const base::Version& version);
+ explicit SwiftShaderComponentInstaller(const Version& version);
virtual ~SwiftShaderComponentInstaller() {}
@@ -109,11 +109,11 @@
base::FilePath* installed_file) OVERRIDE;
private:
- base::Version current_version_;
+ Version current_version_;
};
SwiftShaderComponentInstaller::SwiftShaderComponentInstaller(
- const base::Version& version) : current_version_(version) {
+ const Version& version) : current_version_(version) {
DCHECK(version.IsValid());
}
@@ -130,7 +130,7 @@
return false;
std::string proposed_version;
manifest.GetStringASCII("version", &proposed_version);
- base::Version version(proposed_version.c_str());
+ Version version(proposed_version.c_str());
if (!version.IsValid())
return false;
if (current_version_.CompareTo(version) >= 0)
@@ -158,7 +158,7 @@
}
void FinishSwiftShaderUpdateRegistration(ComponentUpdateService* cus,
- const base::Version& version) {
+ const Version& version) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CrxComponent swiftshader;
@@ -195,7 +195,7 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::FilePath path = GetSwiftShaderBaseDirectory();
- base::Version version(kNullVersion);
+ Version version(kNullVersion);
GetLatestSwiftShaderDirectory(&path, &version, NULL);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
@@ -215,7 +215,7 @@
}
}
- base::Version version(kNullVersion);
+ Version version(kNullVersion);
std::vector<base::FilePath> older_dirs;
if (GetLatestSwiftShaderDirectory(&path, &version, &older_dirs))
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/component_updater/test/component_installers_unittest.cc b/chrome/browser/component_updater/test/component_installers_unittest.cc
index f4d77a1..e9c86d67 100644
--- a/chrome/browser/component_updater/test/component_installers_unittest.cc
+++ b/chrome/browser/component_updater/test/component_installers_unittest.cc
@@ -78,7 +78,7 @@
ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
// This checks that the whole manifest is compatible.
- base::Version version;
+ Version version;
EXPECT_TRUE(CheckPepperFlashManifest(*root, &version));
EXPECT_TRUE(version.IsValid());
}
diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
index bcb0c42..3889db2 100644
--- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc
+++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
@@ -209,7 +209,7 @@
ComponentUpdateService::Status ComponentUpdaterTest::RegisterComponent(
CrxComponent* com,
TestComponents component,
- const base::Version& version,
+ const Version& version,
TestInstaller* installer) {
if (component == kTestComponent_abag) {
com->name = "test_abag";
@@ -288,7 +288,7 @@
EXPECT_EQ(ComponentUpdateService::kOk,
RegisterComponent(&com,
kTestComponent_abag,
- base::Version("1.1"),
+ Version("1.1"),
&installer));
// We loop twice, but there are no updates so we expect two sleep messages.
@@ -426,13 +426,11 @@
TestInstaller installer1;
CrxComponent com1;
com1.observer = &observer1;
- RegisterComponent(
- &com1, kTestComponent_jebg, base::Version("0.9"), &installer1);
+ RegisterComponent(&com1, kTestComponent_jebg, Version("0.9"), &installer1);
TestInstaller installer2;
CrxComponent com2;
com2.observer = &observer2;
- RegisterComponent(
- &com2, kTestComponent_abag, base::Version("2.2"), &installer2);
+ RegisterComponent(&com2, kTestComponent_abag, Version("2.2"), &installer2);
test_configurator()->SetLoopCount(2);
component_updater()->Start();
@@ -497,8 +495,7 @@
TestInstaller installer;
CrxComponent com;
- RegisterComponent(
- &com, kTestComponent_jebg, base::Version("0.9"), &installer);
+ RegisterComponent(&com, kTestComponent_jebg, Version("0.9"), &installer);
test_configurator()->SetLoopCount(1);
component_updater()->Start();
@@ -588,13 +585,11 @@
TestInstaller installer1;
CrxComponent com1;
com1.observer = &observer1;
- RegisterComponent(
- &com1, kTestComponent_abag, base::Version("2.2"), &installer1);
+ RegisterComponent(&com1, kTestComponent_abag, Version("2.2"), &installer1);
TestInstaller installer2;
CrxComponent com2;
com2.observer = &observer2;
- RegisterComponent(
- &com2, kTestComponent_jebg, base::Version("0.9"), &installer2);
+ RegisterComponent(&com2, kTestComponent_jebg, Version("0.9"), &installer2);
// No update normally.
test_configurator()->SetLoopCount(1);
@@ -815,13 +810,11 @@
TestInstaller installer1;
CrxComponent com1;
com1.observer = &observer1;
- RegisterComponent(
- &com1, kTestComponent_jebg, base::Version("0.9"), &installer1);
+ RegisterComponent(&com1, kTestComponent_jebg, Version("0.9"), &installer1);
TestInstaller installer2;
CrxComponent com2;
com2.observer = &observer2;
- RegisterComponent(
- &com2, kTestComponent_abag, base::Version("2.2"), &installer2);
+ RegisterComponent(&com2, kTestComponent_abag, Version("2.2"), &installer2);
// Loop twice to issue two checks: (1) with original 0.9 version, update to
// 1.0, and do the second check (2) with the updated 1.0 version.
@@ -891,7 +884,7 @@
EXPECT_EQ(ComponentUpdateService::kReplaced,
RegisterComponent(&com1,
kTestComponent_jebg,
- base::Version("2.2"),
+ Version("2.2"),
&installer3));
// Loop once just to notice the check happening with the re-register version.
@@ -949,8 +942,7 @@
VersionedTestInstaller installer;
CrxComponent com;
- RegisterComponent(
- &com, kTestComponent_ihfo, base::Version("0.0"), &installer);
+ RegisterComponent(&com, kTestComponent_ihfo, Version("0.0"), &installer);
test_configurator()->SetLoopCount(3);
component_updater()->Start();
@@ -1021,8 +1013,7 @@
TestInstaller installer;
CrxComponent com;
- RegisterComponent(
- &com, kTestComponent_ihfo, base::Version("1.0"), &installer);
+ RegisterComponent(&com, kTestComponent_ihfo, Version("1.0"), &installer);
test_configurator()->SetLoopCount(2);
component_updater()->Start();
@@ -1088,8 +1079,7 @@
// Loop twice to issue two checks: (1) with original 0.9 version
// and (2), which should retry with 0.9.
CrxComponent com;
- RegisterComponent(
- &com, kTestComponent_jebg, base::Version("0.9"), &installer);
+ RegisterComponent(&com, kTestComponent_jebg, Version("0.9"), &installer);
test_configurator()->SetLoopCount(2);
component_updater()->Start();
@@ -1177,8 +1167,7 @@
VersionedTestInstaller installer;
CrxComponent com;
- RegisterComponent(
- &com, kTestComponent_ihfo, base::Version("0.0"), &installer);
+ RegisterComponent(&com, kTestComponent_ihfo, Version("0.0"), &installer);
test_configurator()->SetLoopCount(3);
component_updater()->Start();
@@ -1283,7 +1272,7 @@
EXPECT_EQ(ComponentUpdateService::kOk,
RegisterComponent(&com,
kTestComponent_abag,
- base::Version("1.1"),
+ Version("1.1"),
&installer));
// The following two calls ensure that we don't do an update check via the
// timer, so the only update check should be the on-demand one.
@@ -1368,7 +1357,7 @@
EXPECT_EQ(ComponentUpdateService::kOk,
RegisterComponent(&com,
kTestComponent_abag,
- base::Version("1.1"),
+ Version("1.1"),
&installer));
// The following two calls ensure that we don't do an update check via the
// timer, so the only update check should be the on-demand one.
diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.h b/chrome/browser/component_updater/test/component_updater_service_unittest.h
index e26e1bb7..b776f29 100644
--- a/chrome/browser/component_updater/test/component_updater_service_unittest.h
+++ b/chrome/browser/component_updater/test/component_updater_service_unittest.h
@@ -128,7 +128,7 @@
ComponentUpdateService::Status RegisterComponent(CrxComponent* com,
TestComponents component,
- const base::Version& version,
+ const Version& version,
TestInstaller* installer);
protected:
diff --git a/chrome/browser/component_updater/test/test_installer.cc b/chrome/browser/component_updater/test/test_installer.cc
index e6796f2a..62ae494 100644
--- a/chrome/browser/component_updater/test/test_installer.cc
+++ b/chrome/browser/component_updater/test/test_installer.cc
@@ -59,7 +59,7 @@
const base::FilePath& unpack_path) {
std::string version_string;
manifest.GetStringASCII("version", &version_string);
- base::Version version(version_string.c_str());
+ Version version(version_string.c_str());
base::FilePath path;
path = install_directory_.AppendASCII(version.GetString());
diff --git a/chrome/browser/component_updater/test/test_installer.h b/chrome/browser/component_updater/test/test_installer.h
index 11d0419cc..2233d88 100644
--- a/chrome/browser/component_updater/test/test_installer.h
+++ b/chrome/browser/component_updater/test/test_installer.h
@@ -67,7 +67,7 @@
private:
base::FilePath install_directory_;
- base::Version current_version_;
+ Version current_version_;
};
#endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_TEST_INSTALLER_H_
diff --git a/chrome/browser/component_updater/update_response.cc b/chrome/browser/component_updater/update_response.cc
index f1f4b2c..cf93658 100644
--- a/chrome/browser/component_updater/update_response.cc
+++ b/chrome/browser/component_updater/update_response.cc
@@ -146,7 +146,7 @@
*error = "Missing version for manifest.";
return false;
}
- base::Version version(result->manifest.version);
+ Version version(result->manifest.version);
if (!version.IsValid()) {
*error = "Invalid version: '";
*error += result->manifest.version;
@@ -158,7 +158,7 @@
result->manifest.browser_min_version =
GetAttribute(manifest, "prodversionmin");
if (result->manifest.browser_min_version.length()) {
- base::Version browser_min_version(result->manifest.browser_min_version);
+ Version browser_min_version(result->manifest.browser_min_version);
if (!browser_min_version.IsValid()) {
*error = "Invalid prodversionmin: '";
*error += result->manifest.browser_min_version;
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index 746cc070..80fa255 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -384,9 +384,9 @@
location_hash == blacklisted.location)) {
// We have a name match against the blacklist (and possibly location match
// also), so check version.
- base::Version module_version(UTF16ToASCII(module.version));
- base::Version version_min(blacklisted.version_from);
- base::Version version_max(blacklisted.version_to);
+ Version module_version(UTF16ToASCII(module.version));
+ Version version_min(blacklisted.version_from);
+ Version version_max(blacklisted.version_to);
bool version_ok = !version_min.IsValid() && !version_max.IsValid();
if (!version_ok) {
bool too_low = version_min.IsValid() &&
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc
index 95cc8ee..03ce5ce 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.cc
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc
@@ -215,7 +215,7 @@
base::Bind(&RuntimeEventRouter::DispatchOnInstalledEvent,
browser_context_,
extension->id(),
- base::Version(),
+ Version(),
true));
}
@@ -224,7 +224,7 @@
ExtensionService* service = ExtensionSystem::GetForBrowserContext(
browser_context_)->extension_service();
const Extension* old = service->GetExtensionById(extension->id(), true);
- base::Version old_version;
+ Version old_version;
if (old)
old_version = *old->version();
@@ -269,7 +269,7 @@
void RuntimeEventRouter::DispatchOnInstalledEvent(
content::BrowserContext* context,
const std::string& extension_id,
- const base::Version& old_version,
+ const Version& old_version,
bool chrome_updated) {
if (!ExtensionsBrowserClient::Get()->IsValidContext(context))
return;
@@ -477,10 +477,9 @@
return;
DCHECK(type == chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND);
- typedef const std::pair<std::string, base::Version> UpdateDetails;
+ typedef const std::pair<std::string, Version> UpdateDetails;
const std::string& id = content::Details<UpdateDetails>(details)->first;
- const base::Version& version =
- content::Details<UpdateDetails>(details)->second;
+ const Version& version = content::Details<UpdateDetails>(details)->second;
if (id == extension_id()) {
ReplyUpdateFound(version.GetString());
}
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index b4189a6..e5d5e50 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -153,7 +153,7 @@
expected_id_ = approval->extension_id;
}
if (approval->minimum_version.get()) {
- expected_version_.reset(new base::Version(*approval->minimum_version));
+ expected_version_.reset(new Version(*approval->minimum_version));
expected_version_strict_checking_ = false;
}
@@ -482,7 +482,7 @@
SharedModuleInfo::GetImports(extension());
std::vector<SharedModuleInfo::ImportInfo>::const_iterator i;
for (i = imports.begin(); i != imports.end(); ++i) {
- base::Version version_required(i->minimum_version);
+ Version version_required(i->minimum_version);
const Extension* imported_module =
service->GetExtensionById(i->extension_id, true);
if (imported_module &&
@@ -660,7 +660,7 @@
DCHECK(installer_task_runner_->RunsTasksOnCurrentThread());
if (!current_version_.empty()) {
- base::Version current_version(current_version_);
+ Version current_version(current_version_);
if (current_version.CompareTo(*(extension()->version())) > 0) {
ReportFailureFromFileThread(
CrxInstallerError(
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h
index 87f650b..7facb81 100644
--- a/chrome/browser/extensions/crx_installer.h
+++ b/chrome/browser/extensions/crx_installer.h
@@ -125,8 +125,8 @@
const std::string& expected_id() const { return expected_id_; }
void set_expected_id(const std::string& val) { expected_id_ = val; }
- void set_expected_version(const base::Version& val) {
- expected_version_.reset(new base::Version(val));
+ void set_expected_version(const Version& val) {
+ expected_version_.reset(new Version(val));
expected_version_strict_checking_ = true;
}
@@ -297,7 +297,7 @@
// installing. Important for external sources, where claiming the wrong
// version could cause unnecessary unpacking of an extension at every
// restart.
- scoped_ptr<base::Version> expected_version_;
+ scoped_ptr<Version> expected_version_;
// If true, the actual version should be same with the |expected_version_|,
// Otherwise the actual version should be equal to or newer than
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index fdfde83..7eff5d92 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1827,7 +1827,7 @@
void ExtensionService::AddComponentExtension(const Extension* extension) {
const std::string old_version_string(
extension_prefs_->GetVersionString(extension->id()));
- const base::Version old_version(old_version_string);
+ const Version old_version(old_version_string);
VLOG(1) << "AddComponentExtension " << extension->name();
if (!old_version.IsValid() || !old_version.Equals(*extension->version())) {
@@ -2003,7 +2003,7 @@
SharedModuleInfo::GetImports(extension);
std::vector<SharedModuleInfo::ImportInfo>::const_iterator i;
for (i = imports.begin(); i != imports.end(); ++i) {
- base::Version version_required(i->minimum_version);
+ Version version_required(i->minimum_version);
const Extension* imported_module =
GetExtensionById(i->extension_id, true);
if (!imported_module) {
@@ -2400,7 +2400,7 @@
bool ExtensionService::OnExternalExtensionFileFound(
const std::string& id,
- const base::Version* version,
+ const Version* version,
const base::FilePath& path,
Manifest::Location location,
int creation_flags,
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 6dae5fc..eafc32d 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -250,7 +250,7 @@
visit_count_++;
for (DataMap::const_iterator i = extension_map_.begin();
i != extension_map_.end(); ++i) {
- base::Version version(i->second.first);
+ Version version(i->second.first);
visitor_->OnExternalExtensionFileFound(
i->first, &version, i->second.second, location_,
@@ -266,13 +266,13 @@
virtual bool GetExtensionDetails(
const std::string& id,
Manifest::Location* location,
- scoped_ptr<base::Version>* version) const OVERRIDE {
+ scoped_ptr<Version>* version) const OVERRIDE {
DataMap::const_iterator it = extension_map_.find(id);
if (it == extension_map_.end())
return false;
if (version)
- version->reset(new base::Version(it->second.first));
+ version->reset(new Version(it->second.first));
if (location)
*location = location_;
@@ -361,7 +361,7 @@
}
virtual bool OnExternalExtensionFileFound(const std::string& id,
- const base::Version* version,
+ const Version* version,
const base::FilePath& path,
Manifest::Location unused,
int creation_flags,
@@ -385,13 +385,13 @@
// Ask provider if the extension we got back is registered.
Manifest::Location location = Manifest::INVALID_LOCATION;
- scoped_ptr<base::Version> v1;
+ scoped_ptr<Version> v1;
base::FilePath crx_path;
EXPECT_TRUE(provider_->GetExtensionDetails(id, NULL, &v1));
EXPECT_STREQ(version->GetString().c_str(), v1->GetString().c_str());
- scoped_ptr<base::Version> v2;
+ scoped_ptr<Version> v2;
EXPECT_TRUE(provider_->GetExtensionDetails(id, &location, &v2));
EXPECT_STREQ(version->GetString().c_str(), v1->GetString().c_str());
EXPECT_STREQ(version->GetString().c_str(), v2->GetString().c_str());
@@ -421,7 +421,7 @@
EXPECT_TRUE(provider_->HasExtension(id));
// External extensions with update URLs do not have versions.
- scoped_ptr<base::Version> v1;
+ scoped_ptr<Version> v1;
Manifest::Location location1 = Manifest::INVALID_LOCATION;
EXPECT_TRUE(provider_->GetExtensionDetails(id, &location1, &v1));
EXPECT_FALSE(v1.get());
@@ -1777,7 +1777,7 @@
set_extensions_enabled(true);
// Register and install an external extension.
- base::Version version("1.0.0.0");
+ Version version("1.0.0.0");
content::WindowedNotificationObserver observer(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
@@ -1813,7 +1813,7 @@
set_extensions_enabled(true);
// Install an external extension.
- base::Version version("1.0.0.0");
+ Version version("1.0.0.0");
content::WindowedNotificationObserver observer(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
@@ -1839,7 +1839,7 @@
ValidateIntegerPref(good_crx, "location",
Extension::EXTERNAL_EXTENSION_UNINSTALLED);
- version = base::Version("1.0.0.1");
+ version = Version("1.0.0.1");
// Repeat the same thing with a newer version of the extension.
path = data_dir_.AppendASCII("good2.crx");
service_->OnExternalExtensionFileFound(good_crx, &version,
@@ -1895,7 +1895,7 @@
base::FilePath path = data_dir_.AppendASCII("good.crx");
set_extensions_enabled(true);
- base::Version version("1.0.0.0");
+ Version version("1.0.0.0");
const std::string wrong_id = all_zero;
const std::string correct_id = good_crx;
@@ -1933,7 +1933,7 @@
// Install an external extension with a version from the external
// source that is not equal to the version in the extension manifest.
- base::Version wrong_version("1.2.3.4");
+ Version wrong_version("1.2.3.4");
content::WindowedNotificationObserver observer(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
@@ -1946,7 +1946,7 @@
// Try again with the right version. Expect success.
service_->pending_extension_manager()->Remove(good_crx);
- base::Version correct_version("1.0.0.0");
+ Version correct_version("1.0.0.0");
content::WindowedNotificationObserver observer2(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
@@ -3351,7 +3351,7 @@
// Use AddExtensionImpl() as AddFrom*() would balk.
service_->pending_extension_manager()->AddExtensionImpl(
good->id(), extensions::ManifestURL::GetUpdateURL(good),
- base::Version(), &IsExtension, kGoodIsFromSync,
+ Version(), &IsExtension, kGoodIsFromSync,
kGoodInstallSilently, Manifest::INTERNAL,
Extension::NO_FLAGS, false);
UpdateExtension(good->id(), path, ENABLED);
@@ -6076,8 +6076,8 @@
}
TEST_F(ExtensionServiceTest, InstallPriorityExternalLocalFile) {
- base::Version older_version("0.1.0.0");
- base::Version newer_version("2.0.0.0");
+ Version older_version("0.1.0.0");
+ Version newer_version("2.0.0.0");
// We don't want the extension to be installed. A path that doesn't
// point to a valid CRX ensures this.
@@ -6255,9 +6255,9 @@
}
TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) {
- base::Version kVersion123("1.2.3");
- base::Version kVersion124("1.2.4");
- base::Version kVersion125("1.2.5");
+ Version kVersion123("1.2.3");
+ Version kVersion124("1.2.4");
+ Version kVersion125("1.2.5");
const base::FilePath kInvalidPathToCrx = base::FilePath();
const int kCreationFlags = 0;
const bool kDontMarkAcknowledged = false;
@@ -6361,7 +6361,7 @@
// Fake an external file from external_extensions.json.
bool AddPendingExternalPrefFileInstall() {
- base::Version version("1.0.0.0");
+ Version version("1.0.0.0");
return service_->OnExternalExtensionFileFound(
crx_id_, &version, crx_path_, Manifest::EXTERNAL_PREF,
diff --git a/chrome/browser/extensions/extension_sync_data.cc b/chrome/browser/extensions/extension_sync_data.cc
index 09d0358..2371867 100644
--- a/chrome/browser/extensions/extension_sync_data.cc
+++ b/chrome/browser/extensions/extension_sync_data.cc
@@ -79,7 +79,7 @@
LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics.";
}
- base::Version specifics_version(specifics.version());
+ Version specifics_version(specifics.version());
if (!specifics_version.IsValid())
LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics.";
diff --git a/chrome/browser/extensions/extension_sync_data.h b/chrome/browser/extensions/extension_sync_data.h
index 1f89794..8fbe73a 100644
--- a/chrome/browser/extensions/extension_sync_data.h
+++ b/chrome/browser/extensions/extension_sync_data.h
@@ -59,7 +59,7 @@
// Version-dependent properties (i.e., should be used only when the
// version of the currenty-installed extension matches |version|).
- const base::Version& version() const { return version_; }
+ const Version& version() const { return version_; }
const GURL& update_url() const { return update_url_; }
// Used only for debugging.
const std::string& name() const { return name_; }
@@ -72,7 +72,7 @@
bool uninstalled_;
bool enabled_;
bool incognito_enabled_;
- base::Version version_;
+ Version version_;
GURL update_url_;
std::string name_;
};
diff --git a/chrome/browser/extensions/extension_sync_data_unittest.cc b/chrome/browser/extensions/extension_sync_data_unittest.cc
index 70cf3a2..46b3549 100644
--- a/chrome/browser/extensions/extension_sync_data_unittest.cc
+++ b/chrome/browser/extensions/extension_sync_data_unittest.cc
@@ -6,6 +6,7 @@
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
+#include "base/version.h"
#include "sync/protocol/extension_specifics.pb.h"
#include "sync/protocol/sync.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc
index f889f75b..8f70dba 100644
--- a/chrome/browser/extensions/external_policy_loader_unittest.cc
+++ b/chrome/browser/extensions/external_policy_loader_unittest.cc
@@ -70,7 +70,7 @@
}
virtual bool OnExternalExtensionFileFound(const std::string& id,
- const base::Version* version,
+ const Version* version,
const base::FilePath& path,
Manifest::Location unused,
int unused2,
@@ -87,7 +87,7 @@
// Provider returns the correct location when asked.
Manifest::Location location1;
- scoped_ptr<base::Version> version1;
+ scoped_ptr<Version> version1;
provider_->GetExtensionDetails(id, &location1, &version1);
EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1);
EXPECT_FALSE(version1.get());
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index 1eebfc1..1a85f5f 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -246,7 +246,7 @@
path = base_path.Append(external_crx);
}
- base::Version version(external_version);
+ Version version(external_version);
if (!version.IsValid()) {
LOG(WARNING) << "Malformed extension dictionary for extension: "
<< extension_id.c_str() << ". Invalid version string \""
@@ -305,7 +305,7 @@
bool ExternalProviderImpl::GetExtensionDetails(
const std::string& id, Manifest::Location* location,
- scoped_ptr<base::Version>* version) const {
+ scoped_ptr<Version>* version) const {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CHECK(prefs_.get());
CHECK(ready_);
@@ -325,7 +325,7 @@
return false;
if (version)
- version->reset(new base::Version(external_version));
+ version->reset(new Version(external_version));
} else {
NOTREACHED(); // Chrome should not allow prefs to get into this state.
diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc
index 95eab906..ed8e2c0 100644
--- a/chrome/browser/extensions/external_registry_loader_win.cc
+++ b/chrome/browser/extensions/external_registry_loader_win.cc
@@ -146,7 +146,7 @@
continue;
}
- base::Version version(WideToASCII(extension_version));
+ Version version(WideToASCII(extension_version));
if (!version.IsValid()) {
LOG(ERROR) << "Invalid version value " << extension_version
<< " for key " << key_path << ".";
diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc
index 44fee7fd..ca4193c 100644
--- a/chrome/browser/extensions/updater/extension_downloader.cc
+++ b/chrome/browser/extensions/updater/extension_downloader.cc
@@ -96,8 +96,7 @@
} // namespace
-UpdateDetails::UpdateDetails(const std::string& id,
- const base::Version& version)
+UpdateDetails::UpdateDetails(const std::string& id, const Version& version)
: id(id), version(version) {}
UpdateDetails::~UpdateDetails() {}
@@ -161,7 +160,7 @@
// Use a zero version to ensure that a pending extension will always
// be updated, and thus installed (assuming all extensions have
// non-zero versions).
- base::Version version("0.0.0.0");
+ Version version("0.0.0.0");
DCHECK(version.IsValid());
return AddExtensionData(id,
@@ -206,7 +205,7 @@
}
bool ExtensionDownloader::AddExtensionData(const std::string& id,
- const base::Version& version,
+ const Version& version,
Manifest::Type extension_type,
const GURL& extension_update_url,
const std::string& update_url_data,
@@ -531,7 +530,7 @@
std::vector<int>* result) {
// This will only be valid if one of possible_updates specifies
// browser_min_version.
- base::Version browser_version;
+ Version browser_version;
for (size_t i = 0; i < possible_updates.list.size(); i++) {
const UpdateManifest::Result* update = &possible_updates.list[i];
@@ -562,8 +561,8 @@
VLOG(2) << id << " is at '" << version << "'";
- base::Version existing_version(version);
- base::Version update_version(update->version);
+ Version existing_version(version);
+ Version update_version(update->version);
if (!update_version.IsValid() ||
update_version.CompareTo(existing_version) <= 0) {
@@ -577,9 +576,9 @@
if (!browser_version.IsValid()) {
chrome::VersionInfo version_info;
if (version_info.is_valid())
- browser_version = base::Version(version_info.Version());
+ browser_version = Version(version_info.Version());
}
- base::Version browser_min_version(update->browser_min_version);
+ Version browser_min_version(update->browser_min_version);
if (browser_version.IsValid() && browser_min_version.IsValid() &&
browser_min_version.CompareTo(browser_version) > 0) {
// TODO(asargent) - We may want this to show up in the extensions UI
@@ -706,7 +705,7 @@
void ExtensionDownloader::NotifyUpdateFound(const std::string& id,
const std::string& version) {
- UpdateDetails updateInfo(id, base::Version(version));
+ UpdateDetails updateInfo(id, Version(version));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
content::NotificationService::AllBrowserContextsAndSources(),
diff --git a/chrome/browser/extensions/updater/extension_downloader_delegate.cc b/chrome/browser/extensions/updater/extension_downloader_delegate.cc
index ee1c2fd..2cddee3 100644
--- a/chrome/browser/extensions/updater/extension_downloader_delegate.cc
+++ b/chrome/browser/extensions/updater/extension_downloader_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/updater/extension_downloader_delegate.h"
#include "base/logging.h"
+#include "base/version.h"
namespace extensions {
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index a6ef7ad0..43fadaa 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -311,7 +311,7 @@
pending_extension_manager->AddForTesting(
PendingExtensionInfo(id,
update_url,
- base::Version(),
+ Version(),
should_allow_install,
kIsFromSync,
kInstallSilently,
@@ -987,7 +987,7 @@
std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
std::string hash;
- base::Version version("0.0.1");
+ Version version("0.0.1");
std::set<int> requests;
requests.insert(0);
scoped_ptr<ExtensionDownloader::ExtensionFetch> fetch(
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 89a64a52..ebde012 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -115,7 +115,7 @@
} else if (GetDeclarationValue(line, kNameDeclaration, &value)) {
script->set_name(value);
} else if (GetDeclarationValue(line, kVersionDeclaration, &value)) {
- base::Version version(value);
+ Version version(value);
if (version.IsValid())
script->set_version(version.GetString());
} else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) {
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 5325bcfe..081226f1 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -356,7 +356,7 @@
CHECK_EQ(extension->id(), id_);
ReportSuccess();
} else {
- const base::Version version_required(info.minimum_version);
+ const Version version_required(info.minimum_version);
if (version_required.IsValid() &&
extension->version()->CompareTo(version_required) < 0) {
// It should not happen, CrxInstaller will make sure the version is
@@ -430,11 +430,11 @@
scoped_ptr<Approval> approval = Approval::CreateForSharedModule(profile_);
const SharedModuleInfo::ImportInfo& info = pending_modules_.front();
approval->extension_id = info.extension_id;
- const base::Version version_required(info.minimum_version);
+ const Version version_required(info.minimum_version);
if (version_required.IsValid()) {
approval->minimum_version.reset(
- new base::Version(version_required));
+ new Version(version_required));
}
download_item_->SetUserData(kApprovalKey, approval.release());
} else {
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index 5679623..99ede0c 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -149,7 +149,7 @@
scoped_refptr<Extension> dummy_extension;
// Required minimum version.
- scoped_ptr<base::Version> minimum_version;
+ scoped_ptr<Version> minimum_version;
// Ephemeral apps (experimental) are not permanently installed in Chrome.
bool is_ephemeral;
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc
index 3c430fd..47d7465 100644
--- a/chrome/browser/first_run/upgrade_util_win.cc
+++ b/chrome/browser/first_run/upgrade_util_win.cc
@@ -235,12 +235,12 @@
if (cmd_line.HasSwitch(switches::kChromeVersion)) {
std::string version_string =
cmd_line.GetSwitchValueASCII(switches::kChromeVersion);
- base::Version cmd_version(version_string);
+ Version cmd_version(version_string);
std::wstring pv_value;
if (key.ReadValue(google_update::kRegVersionField,
&pv_value) == ERROR_SUCCESS) {
- base::Version pv_version(WideToASCII(pv_value));
+ Version pv_version(WideToASCII(pv_value));
if (cmd_version.IsValid() && pv_version.IsValid() &&
!cmd_version.Equals(pv_version)) {
return false;
diff --git a/chrome/browser/hang_monitor/hung_plugin_action.cc b/chrome/browser/hang_monitor/hung_plugin_action.cc
index 9d57dc4..4ce6f14 100644
--- a/chrome/browser/hang_monitor/hung_plugin_action.cc
+++ b/chrome/browser/hang_monitor/hung_plugin_action.cc
@@ -40,7 +40,7 @@
// 10 * major + minor - kGTalkPluginLogMinVersion.
GTalkPluginLogVersion GetGTalkPluginVersion(const base::string16& version) {
int gtalk_plugin_version = GTALK_PLUGIN_VERSION_MIN;
- base::Version plugin_version;
+ Version plugin_version;
content::WebPluginInfo::CreateVersionFromString(version, &plugin_version);
if (plugin_version.IsValid() && plugin_version.components().size() >= 2) {
gtalk_plugin_version = 10 * plugin_version.components()[0] +
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
index e9d44d9..a14e30f 100644
--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -73,7 +73,7 @@
void RecordLinuxGlibcVersion() {
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- base::Version version(gnu_get_libc_version());
+ Version version(gnu_get_libc_version());
UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
if (version.IsValid() && version.components().size() == 2) {
diff --git a/chrome/browser/net/crl_set_fetcher.cc b/chrome/browser/net/crl_set_fetcher.cc
index c79837d..0dca1ee0 100644
--- a/chrome/browser/net/crl_set_fetcher.cc
+++ b/chrome/browser/net/crl_set_fetcher.cc
@@ -126,10 +126,10 @@
kPublicKeySHA256 + sizeof(kPublicKeySHA256));
component.installer = this;
component.name = "CRLSet";
- component.version = base::Version(base::UintToString(sequence_of_loaded_crl));
+ component.version = Version(base::UintToString(sequence_of_loaded_crl));
if (!component.version.IsValid()) {
NOTREACHED();
- component.version = base::Version("0");
+ component.version = Version("0");
}
if (cus_->RegisterComponent(component) !=
diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc
index 23ece21..31f6db5 100644
--- a/chrome/browser/plugins/plugin_finder.cc
+++ b/chrome/browser/plugins/plugin_finder.cc
@@ -119,7 +119,7 @@
PluginMetadata::SECURITY_STATUS_UP_TO_DATE;
success = PluginMetadata::ParseSecurityStatus(status_str, &status);
DCHECK(success);
- plugin->AddVersion(base::Version(version), status);
+ plugin->AddVersion(Version(version), status);
}
}
diff --git a/chrome/browser/plugins/plugin_installer.h b/chrome/browser/plugins/plugin_installer.h
index e3cf859..abcfe6f4 100644
--- a/chrome/browser/plugins/plugin_installer.h
+++ b/chrome/browser/plugins/plugin_installer.h
@@ -7,6 +7,7 @@
#include "base/observer_list.h"
#include "base/strings/string16.h"
+#include "base/version.h"
#include "chrome/browser/plugins/plugin_metadata.h"
#include "content/public/browser/download_item.h"
#include "net/base/net_errors.h"
diff --git a/chrome/browser/plugins/plugin_metadata.cc b/chrome/browser/plugins/plugin_metadata.cc
index f0fc6d4..33f83a02 100644
--- a/chrome/browser/plugins/plugin_metadata.cc
+++ b/chrome/browser/plugins/plugin_metadata.cc
@@ -39,7 +39,7 @@
PluginMetadata::~PluginMetadata() {
}
-void PluginMetadata::AddVersion(const base::Version& version,
+void PluginMetadata::AddVersion(const Version& version,
SecurityStatus status) {
DCHECK(versions_.find(version) == versions_.end());
versions_[version] = status;
@@ -97,14 +97,14 @@
return SECURITY_STATUS_REQUIRES_AUTHORIZATION;
}
- base::Version version;
+ Version version;
content::WebPluginInfo::CreateVersionFromString(plugin.version, &version);
if (!version.IsValid())
- version = base::Version("0");
+ version = Version("0");
// |lower_bound| returns the latest version that is not newer than |version|.
- std::map<base::Version, SecurityStatus, VersionComparator>::
- const_iterator it = versions_.lower_bound(version);
+ std::map<Version, SecurityStatus, VersionComparator>::const_iterator it =
+ versions_.lower_bound(version);
// If there is at least one version defined, everything older than the oldest
// defined version is considered out-of-date.
if (it == versions_.end())
@@ -113,8 +113,8 @@
return it->second;
}
-bool PluginMetadata::VersionComparator::operator() (
- const base::Version& lhs, const base::Version& rhs) const {
+bool PluginMetadata::VersionComparator::operator() (const Version& lhs,
+ const Version& rhs) const {
// Keep versions ordered by newest (biggest) first.
return lhs.CompareTo(rhs) > 0;
}
diff --git a/chrome/browser/plugins/plugin_metadata.h b/chrome/browser/plugins/plugin_metadata.h
index de49b28d..261e6e87 100644
--- a/chrome/browser/plugins/plugin_metadata.h
+++ b/chrome/browser/plugins/plugin_metadata.h
@@ -67,7 +67,7 @@
void AddMatchingMimeType(const std::string& mime_type);
// Adds information about a plug-in version.
- void AddVersion(const base::Version& version, SecurityStatus status);
+ void AddVersion(const Version& version, SecurityStatus status);
// Checks if |plugin| mime types match all |matching_mime_types_|.
// If there is no |matching_mime_types_|, |group_name_matcher_| is used
@@ -87,7 +87,7 @@
private:
struct VersionComparator {
- bool operator() (const base::Version& lhs, const base::Version& rhs) const;
+ bool operator() (const Version& lhs, const Version& rhs) const;
};
std::string identifier_;
@@ -97,7 +97,7 @@
GURL plugin_url_;
GURL help_url_;
std::string language_;
- std::map<base::Version, SecurityStatus, VersionComparator> versions_;
+ std::map<Version, SecurityStatus, VersionComparator> versions_;
std::vector<std::string> all_mime_types_;
std::vector<std::string> matching_mime_types_;
diff --git a/chrome/browser/plugins/plugin_metadata_unittest.cc b/chrome/browser/plugins/plugin_metadata_unittest.cc
index dd5ac8a2..03d57a7 100644
--- a/chrome/browser/plugins/plugin_metadata_unittest.cc
+++ b/chrome/browser/plugins/plugin_metadata_unittest.cc
@@ -41,9 +41,9 @@
EXPECT_EQ(kRequiresAuthorization,
GetSecurityStatus(&plugin_metadata, "1.2.3"));
- plugin_metadata.AddVersion(base::Version("9.4.1"), kRequiresAuthorization);
- plugin_metadata.AddVersion(base::Version("10"), kOutOfDate);
- plugin_metadata.AddVersion(base::Version("10.2.1"), kUpToDate);
+ plugin_metadata.AddVersion(Version("9.4.1"), kRequiresAuthorization);
+ plugin_metadata.AddVersion(Version("10"), kOutOfDate);
+ plugin_metadata.AddVersion(Version("10.2.1"), kUpToDate);
// Invalid version.
EXPECT_EQ(kOutOfDate, GetSecurityStatus(&plugin_metadata, "foo"));
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index e28872a..69bd418 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -256,8 +256,8 @@
bool old_profile_version =
!prefs->FindPreference(
prefs::kProfileCreatedByVersion)->IsDefaultValue() &&
- base::Version(prefs->GetString(prefs::kProfileCreatedByVersion)).
- IsOlderThan("21.0.1180.0");
+ Version(prefs->GetString(prefs::kProfileCreatedByVersion)).IsOlderThan(
+ "21.0.1180.0");
if (old_profile_version && TypeIsDefault(prefs))
prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueLast);
#endif
diff --git a/chrome/browser/profiles/chrome_version_service.cc b/chrome/browser/profiles/chrome_version_service.cc
index d4972944..5a177a6 100644
--- a/chrome/browser/profiles/chrome_version_service.cc
+++ b/chrome/browser/profiles/chrome_version_service.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/profiles/chrome_version_service.h"
#include "base/prefs/pref_service.h"
+#include "base/version.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc
index 80d197dd..affbc3a 100644
--- a/chrome/browser/profiles/profile_browsertest.cc
+++ b/chrome/browser/profiles/profile_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/platform_file.h"
#include "base/prefs/pref_service.h"
+#include "base/version.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/chrome_version_service.h"
#include "chrome/browser/profiles/profile_impl.h"
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index df8a22a..fa628f791 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -853,8 +853,8 @@
}
bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) {
- base::Version profile_version(ChromeVersionService::GetVersion(prefs_.get()));
- base::Version arg_version(version);
+ Version profile_version(ChromeVersionService::GetVersion(prefs_.get()));
+ Version arg_version(version);
return (profile_version.CompareTo(arg_version) >= 0);
}
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 6f39ab4..b02b6cd 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -9,6 +9,7 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "base/version.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/plugins/plugin_finder.h"
diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc
index 6aacfc2..5016ee2a 100644
--- a/chrome/browser/ui/startup/default_browser_prompt.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt.cc
@@ -244,11 +244,11 @@
const std::string disable_version_string =
g_browser_process->local_state()->GetString(
prefs::kBrowserSuppressDefaultBrowserPrompt);
- const base::Version disable_version(disable_version_string);
+ const Version disable_version(disable_version_string);
DCHECK(disable_version_string.empty() || disable_version.IsValid());
if (disable_version.IsValid()) {
const chrome::VersionInfo version_info;
- if (disable_version.Equals(base::Version(version_info.Version())))
+ if (disable_version.Equals(Version(version_info.Version())))
return;
}
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index e2667469..331a1a0 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -21,6 +21,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "base/version.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/devtools/devtools_window.h"
diff --git a/chrome/browser/ui/webui/help/version_updater_win.cc b/chrome/browser/ui/webui/help/version_updater_win.cc
index 1db095a4..9491e10 100644
--- a/chrome/browser/ui/webui/help/version_updater_win.cc
+++ b/chrome/browser/ui/webui/help/version_updater_win.cc
@@ -57,7 +57,7 @@
// Got the intalled version so the handling of the UPGRADE_ALREADY_UP_TO_DATE
// result case can now be completeb on the UI thread.
- void GotInstalledVersion(const base::Version& version);
+ void GotInstalledVersion(const Version& version);
// Little helper function to create google_updater_.
void CreateGoogleUpdater();
@@ -119,7 +119,7 @@
// This is the version that gets read in the FILE thread and set on the
// the updater in the UI thread.
- base::Version installed_version_;
+ Version installed_version_;
};
VersionUpdaterWin::VersionUpdaterWin()
@@ -241,7 +241,7 @@
#endif // defined(GOOGLE_CHROME_BUILD)
}
-void VersionUpdaterWin::GotInstalledVersion(const base::Version& version) {
+void VersionUpdaterWin::GotInstalledVersion(const Version& version) {
// This must be called on the UI thread so that callback_ can be called.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -252,7 +252,7 @@
// may be already up to date on disk though the running app is still
// out of date.
chrome::VersionInfo version_info;
- base::Version running_version(version_info.Version());
+ Version running_version(version_info.Version());
if (!version.IsValid() || version.CompareTo(running_version) <= 0) {
content::RecordAction(
UserMetricsAction("UpgradeCheck_AlreadyUpToDate"));
diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc
index 620acff..74a13882 100644
--- a/chrome/browser/upgrade_detector_impl.cc
+++ b/chrome/browser/upgrade_detector_impl.cc
@@ -218,8 +218,8 @@
base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- base::Version installed_version;
- base::Version critical_update;
+ Version installed_version;
+ Version critical_update;
#if defined(OS_WIN)
// Get the version of the currently *installed* instance of Chrome,
@@ -238,7 +238,7 @@
}
#elif defined(OS_MACOSX)
installed_version =
- base::Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion()));
+ Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion()));
#elif defined(OS_POSIX)
// POSIX but not Mac OS X: Linux, etc.
CommandLine command_line(*CommandLine::ForCurrentProcess());
@@ -249,7 +249,7 @@
return;
}
- installed_version = base::Version(reply);
+ installed_version = Version(reply);
#endif
// Get the version of the currently *running* instance of Chrome.
@@ -258,7 +258,7 @@
NOTREACHED() << "Failed to get current file version";
return;
}
- base::Version running_version(version_info.Version());
+ Version running_version(version_info.Version());
if (!running_version.IsValid()) {
NOTREACHED();
return;