summaryrefslogtreecommitdiffstats
path: root/base/values.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 20:37:55 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-20 20:37:55 +0000
commit09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e (patch)
tree78feb2452b9537b514c13fffa8e849700ac74547 /base/values.h
parent368be757a0f915b50048dc82e8ed9801c7a8a2b7 (diff)
downloadchromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.zip
chromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.tar.gz
chromium_src-09d7a3aa84aa2b5f71c4ae65cb63c26e81bfb05e.tar.bz2
Add copy and assignment to FundamentalValue and StringValue.
Also get rid of use of CreateStringValue in chromeos/ directory. This is a retry of r167808, but adding the copy and assign constructors fixes a clang compile error. BUG=160586 Review URL: https://chromiumcodereview.appspot.com/11418048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r--base/values.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/base/values.h b/base/values.h
index d7263df..e105818 100644
--- a/base/values.h
+++ b/base/values.h
@@ -66,10 +66,9 @@ class BASE_EXPORT Value {
virtual ~Value();
- // Convenience methods for creating Value objects for various
- // kinds of values without thinking about which class implements them.
- // These can always be expected to return a valid Value*.
static Value* CreateNullValue();
+ // DEPRECATED: Do not use the following 5 functions. Instead, use
+ // new FundamentalValue or new StringValue.
static FundamentalValue* CreateBooleanValue(bool in_value);
static FundamentalValue* CreateIntegerValue(int in_value);
static FundamentalValue* CreateDoubleValue(double in_value);
@@ -115,16 +114,13 @@ class BASE_EXPORT Value {
static bool Equals(const Value* a, const Value* b);
protected:
- // This isn't safe for end-users (they should use the Create*Value()
- // static methods above), but it's useful for subclasses.
+ // These aren't safe for end-users, but they are useful for subclasses.
explicit Value(Type type);
+ Value(const Value& that);
+ Value& operator=(const Value& that);
private:
- Value();
-
Type type_;
-
- DISALLOW_COPY_AND_ASSIGN(Value);
};
// FundamentalValue represents the simple fundamental types of values.
@@ -148,8 +144,6 @@ class BASE_EXPORT FundamentalValue : public Value {
int integer_value_;
double double_value_;
};
-
- DISALLOW_COPY_AND_ASSIGN(FundamentalValue);
};
class BASE_EXPORT StringValue : public Value {
@@ -170,8 +164,6 @@ class BASE_EXPORT StringValue : public Value {
private:
std::string value_;
-
- DISALLOW_COPY_AND_ASSIGN(StringValue);
};
class BASE_EXPORT BinaryValue: public Value {