summaryrefslogtreecommitdiffstats
path: root/extensions/browser/value_store
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2016-02-26 19:51:32 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-27 03:53:04 +0000
commit794d2bd77811b6d6b45048c19c287075cc9930db (patch)
treeef71bf3826d396a488ef0c72a68b3d7f4ff236d3 /extensions/browser/value_store
parent47dc6a8a0f7d36d20f90df5ac62da075d45bc9c3 (diff)
downloadchromium_src-794d2bd77811b6d6b45048c19c287075cc9930db.zip
chromium_src-794d2bd77811b6d6b45048c19c287075cc9930db.tar.gz
chromium_src-794d2bd77811b6d6b45048c19c287075cc9930db.tar.bz2
Make extensions::DictionaryBuilder and extensions::ListValue unmovable.
There's no reason for these classes to be movable. std::move() is just being used as a synonym for Build(). In addition: - Build() is fewer characters than std::move(). - clang-format works better when builder syntax is consistently used, which makes it easier for readers to visually match up deeply nested builders. - It's surprising to see std::move() used with what looks like a temporary. BUG=none Review URL: https://codereview.chromium.org/1739183003 Cr-Commit-Position: refs/heads/master@{#378107}
Diffstat (limited to 'extensions/browser/value_store')
-rw-r--r--extensions/browser/value_store/value_store_change_unittest.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/extensions/browser/value_store/value_store_change_unittest.cc b/extensions/browser/value_store/value_store_change_unittest.cc
index 123385b..895f1ac 100644
--- a/extensions/browser/value_store/value_store_change_unittest.cc
+++ b/extensions/browser/value_store/value_store_change_unittest.cc
@@ -61,7 +61,7 @@ TEST(ValueStoreChangeTest, ToJson) {
DictionaryBuilder()
.Set("key", "value")
.Set("key.with.dots", "value.with.dots")
- .Set("tricked", std::move(DictionaryBuilder().Set("you", "nodots")))
+ .Set("tricked", DictionaryBuilder().Set("you", "nodots").Build())
.Set("tricked.you", "with.dots")
.Build();
@@ -81,12 +81,14 @@ TEST(ValueStoreChangeTest, ToJson) {
DictionaryBuilder v4(*value);
scoped_ptr<base::DictionaryValue> expected_from_json =
DictionaryBuilder()
- .Set("key", std::move(DictionaryBuilder()
- .Set("oldValue", std::move(v1))
- .Set("newValue", std::move(v2))))
- .Set("key.with.dots", std::move(DictionaryBuilder()
- .Set("oldValue", std::move(v3))
- .Set("newValue", std::move(v4))))
+ .Set("key", DictionaryBuilder()
+ .Set("oldValue", v1.Build())
+ .Set("newValue", v2.Build())
+ .Build())
+ .Set("key.with.dots", DictionaryBuilder()
+ .Set("oldValue", v3.Build())
+ .Set("newValue", v4.Build())
+ .Build())
.Build();
EXPECT_TRUE(from_json->Equals(expected_from_json.get()));