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

Unified Diff: base/values.h

Issue 200112: Fix some styles issues reported by lint in base\values (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « no previous file | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
===================================================================
--- base/values.h (revision 26059)
+++ base/values.h (working copy)
@@ -100,23 +100,24 @@
protected:
// This isn't safe for end-users (they should use the Create*Value()
// static methods above), but it's useful for subclasses.
- Value(ValueType type) : type_(type) {}
+ explicit Value(ValueType type) : type_(type) {}
private:
- DISALLOW_EVIL_CONSTRUCTORS(Value);
Value();
ValueType type_;
+
+ DISALLOW_COPY_AND_ASSIGN(Value);
};
// FundamentalValue represents the simple fundamental types of values.
class FundamentalValue : public Value {
public:
- FundamentalValue(bool in_value)
+ explicit FundamentalValue(bool in_value)
: Value(TYPE_BOOLEAN), boolean_value_(in_value) {}
- FundamentalValue(int in_value)
+ explicit FundamentalValue(int in_value)
: Value(TYPE_INTEGER), integer_value_(in_value) {}
- FundamentalValue(double in_value)
+ explicit FundamentalValue(double in_value)
: Value(TYPE_REAL), real_value_(in_value) {}
~FundamentalValue();
@@ -128,22 +129,22 @@
virtual bool Equals(const Value* other) const;
private:
- DISALLOW_EVIL_CONSTRUCTORS(FundamentalValue);
-
union {
bool boolean_value_;
int integer_value_;
double real_value_;
};
+
+ DISALLOW_COPY_AND_ASSIGN(FundamentalValue);
};
class StringValue : public Value {
public:
// Initializes a StringValue with a UTF-8 narrow character string.
- StringValue(const std::string& in_value);
+ explicit StringValue(const std::string& in_value);
// Initializes a StringValue with a wide character string.
- StringValue(const std::wstring& in_value);
+ explicit StringValue(const std::wstring& in_value);
~StringValue();
@@ -154,13 +155,13 @@
virtual bool Equals(const Value* other) const;
private:
- DISALLOW_EVIL_CONSTRUCTORS(StringValue);
+ std::string value_;
- std::string value_;
+ DISALLOW_COPY_AND_ASSIGN(StringValue);
};
class BinaryValue: public Value {
-public:
+ public:
// Creates a Value to represent a binary buffer. The new object takes
// ownership of the pointer passed in, if successful.
// Returns NULL if buffer is NULL.
@@ -181,15 +182,15 @@
size_t GetSize() const { return size_; }
char* GetBuffer() { return buffer_; }
-private:
- DISALLOW_EVIL_CONSTRUCTORS(BinaryValue);
-
+ private:
// Constructor is private so that only objects with valid buffer pointers
// and size values can be created.
BinaryValue(char* buffer, size_t size);
char* buffer_;
size_t size_;
+
+ DISALLOW_COPY_AND_ASSIGN(BinaryValue);
};
class DictionaryValue : public Value {
@@ -264,7 +265,7 @@
class key_iterator
: private std::iterator<std::input_iterator_tag, const std::wstring> {
public:
- key_iterator(ValueMap::const_iterator itr) { itr_ = itr; }
+ explicit key_iterator(ValueMap::const_iterator itr) { itr_ = itr; }
key_iterator operator++() { ++itr_; return *this; }
const std::wstring& operator*() { return itr_->first; }
bool operator!=(const key_iterator& other) { return itr_ != other.itr_; }
@@ -278,14 +279,14 @@
key_iterator end_keys() const { return key_iterator(dictionary_.end()); }
private:
- DISALLOW_EVIL_CONSTRUCTORS(DictionaryValue);
-
// Associates the value |in_value| with the |key|. This method should be
// used instead of "dictionary_[key] = foo" so that any previous value can
// be properly deleted.
void SetInCurrentNode(const std::wstring& key, Value* in_value);
ValueMap dictionary_;
+
+ DISALLOW_COPY_AND_ASSIGN(DictionaryValue);
};
// This type of Value represents a list of other Value values.
@@ -356,9 +357,9 @@
ListValue::const_iterator end() const { return list_.end(); }
private:
- DISALLOW_EVIL_CONSTRUCTORS(ListValue);
+ ValueVector list_;
- ValueVector list_;
+ DISALLOW_COPY_AND_ASSIGN(ListValue);
};
// This interface is implemented by classes that know how to serialize and
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698