Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1149)

Unified Diff: base/values.h

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index a30791bc6357c671f56c02c0c39e61027c11aabb..8654b07ba7bb123dcabf551d04df80bae9eb9faf 100644
--- a/base/values.h
+++ b/base/values.h
@@ -70,7 +70,6 @@ class BASE_EXPORT 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();
static FundamentalValue* CreateBooleanValue(bool in_value);
static FundamentalValue* CreateIntegerValue(int in_value);
static FundamentalValue* CreateDoubleValue(double in_value);
@@ -110,7 +109,7 @@ class BASE_EXPORT Value {
virtual bool Equals(const Value* other) const;
// Compares if two Value objects have equal contents. Can handle NULLs.
- // NULLs are considered equal but different from Value::CreateNullValue().
+ // NULLs are considered equal but different from NullValue().
static bool Equals(const Value* a, const Value* b);
protected:
@@ -126,7 +125,14 @@ class BASE_EXPORT Value {
DISALLOW_COPY_AND_ASSIGN(Value);
};
-// FundamentalValue represents the simple fundamental types of values.
+// Helper functions. Use TrueValue() and FalseValue() instead of:
+// new FundamentalValue() and CreateBooleanValue().
+BASE_EXPORT Value* NullValue();
+BASE_EXPORT FundamentalValue* TrueValue();
+BASE_EXPORT FundamentalValue* FalseValue();
+
+// FundamentalValue represents one of the fundamental values:
+// bool, int or double.
class BASE_EXPORT FundamentalValue : public Value {
public:
explicit FundamentalValue(bool in_value);
@@ -446,7 +452,7 @@ class BASE_EXPORT ListValue : public Value {
// deserialize Value objects.
class BASE_EXPORT ValueSerializer {
public:
- virtual ~ValueSerializer();
+ virtual ~ValueSerializer() {}
virtual bool Serialize(const Value& root) = 0;
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698