diff options
author | jkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 08:27:25 +0000 |
---|---|---|
committer | jkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 08:27:25 +0000 |
commit | b566c11eaf8873572ff82f2cc1482a4591634e2a (patch) | |
tree | 576395bee6f999d65caff437a637f024876ed185 /base | |
parent | ca7b5f504a9383ed53cfeff1346d92766bd917f2 (diff) | |
download | chromium_src-b566c11eaf8873572ff82f2cc1482a4591634e2a.zip chromium_src-b566c11eaf8873572ff82f2cc1482a4591634e2a.tar.gz chromium_src-b566c11eaf8873572ff82f2cc1482a4591634e2a.tar.bz2 |
Bugfixes for recent PluginGroup refactoring.
BUG=66505
TEST=test_shell_tests: PluginGroupTest.*; manual: check that issues reported and screenshotted in bug 66505 no longer occur
Review URL: http://codereview.chromium.org/5918003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/version.cc | 10 | ||||
-rw-r--r-- | base/version.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/base/version.cc b/base/version.cc index fe224eb..6ad0cbe 100644 --- a/base/version.cc +++ b/base/version.cc @@ -4,6 +4,8 @@ #include "base/version.h" +#include <algorithm> + #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/string_split.h" @@ -32,6 +34,14 @@ Version::Version() : is_valid_(false) {} Version::~Version() {} +Version* Version::Clone() const { + DCHECK(is_valid_); + Version* copy = new Version(); + copy->components_ = components_; + copy->is_valid_ = true; + return copy; +} + bool Version::Equals(const Version& that) const { DCHECK(is_valid_); DCHECK(that.is_valid_); diff --git a/base/version.h b/base/version.h index 2b182bb..f034c03 100644 --- a/base/version.h +++ b/base/version.h @@ -27,6 +27,9 @@ class Version { ~Version(); + // Creates a copy of this version. Caller takes ownership. + Version* Clone() const; + bool Equals(const Version& other) const; // Returns -1, 0, 1 for <, ==, >. |