diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 13:33:04 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 13:33:04 +0000 |
commit | d814a88597a01bf8249e36983f55a5f880154642 (patch) | |
tree | b38b92bb3f3dd40285f1a5d652f3c8c6609e4279 /base/values.h | |
parent | bc00c1d1ae16e1cd82430320d89daaaaea5ded67 (diff) | |
download | chromium_src-d814a88597a01bf8249e36983f55a5f880154642.zip chromium_src-d814a88597a01bf8249e36983f55a5f880154642.tar.gz chromium_src-d814a88597a01bf8249e36983f55a5f880154642.tar.bz2 |
Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams.
TBR=pneubeck@chromium.org,scottbyer@chromium.org
BUG=263894
Review URL: https://chromiumcodereview.appspot.com/21030009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215885 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r-- | base/values.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/base/values.h b/base/values.h index 06e9458..4025c75 100644 --- a/base/values.h +++ b/base/values.h @@ -311,16 +311,16 @@ class BASE_EXPORT DictionaryValue : public Value { // Removes the Value with the specified path from this dictionary (or one // of its child dictionaries, if the path is more than just a local key). - // If |out_value| is non-NULL, the removed Value AND ITS OWNERSHIP will be - // passed out via out_value. If |out_value| is NULL, the removed value will - // be deleted. This method returns true if |path| is a valid path; otherwise - // it will return false and the DictionaryValue object will be unchanged. - virtual bool Remove(const std::string& path, Value** out_value); + // If |out_value| is non-NULL, the removed Value will be passed out via + // |out_value|. If |out_value| is NULL, the removed value will be deleted. + // This method returns true if |path| is a valid path; otherwise it will + // return false and the DictionaryValue object will be unchanged. + virtual bool Remove(const std::string& path, scoped_ptr<Value>* out_value); // Like Remove(), but without special treatment of '.'. This allows e.g. URLs // to be used as paths. virtual bool RemoveWithoutPathExpansion(const std::string& key, - Value** out_value); + scoped_ptr<Value>* out_value); // Makes a copy of |this| but doesn't include empty dictionaries and lists in // the copy. This never returns NULL, even if |this| itself is empty. @@ -414,7 +414,7 @@ class BASE_EXPORT ListValue : public Value { // passed out via |out_value|. If |out_value| is NULL, the removed value will // be deleted. This method returns true if |index| is valid; otherwise // it will return false and the ListValue object will be unchanged. - virtual bool Remove(size_t index, Value** out_value); + virtual bool Remove(size_t index, scoped_ptr<Value>* out_value); // Removes the first instance of |value| found in the list, if any, and // deletes it. |index| is the location where |value| was found. Returns false @@ -425,7 +425,7 @@ class BASE_EXPORT ListValue : public Value { // deleted, otherwise ownership of the value is passed back to the caller. // Returns an iterator pointing to the location of the element that // followed the erased element. - iterator Erase(iterator iter, Value** out_value); + iterator Erase(iterator iter, scoped_ptr<Value>* out_value); // Appends a Value to the end of the list. void Append(Value* in_value); |