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

Side by Side Diff: extensions/common/value_builder.cc

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « extensions/common/value_builder.h ('k') | extensions/common/value_builder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/common/value_builder.h" 5 #include "extensions/common/value_builder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value)); 44 dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
45 return *this; 45 return *this;
46 } 46 }
47 47
48 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, 48 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
49 const base::string16& in_value) { 49 const base::string16& in_value) {
50 dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value)); 50 dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
51 return *this; 51 return *this;
52 } 52 }
53 53
54 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, 54 DictionaryBuilder& DictionaryBuilder::Set(
55 scoped_ptr<base::Value> in_value) { 55 const std::string& path,
56 std::unique_ptr<base::Value> in_value) {
56 dict_->SetWithoutPathExpansion(path, std::move(in_value)); 57 dict_->SetWithoutPathExpansion(path, std::move(in_value));
57 return *this; 58 return *this;
58 } 59 }
59 60
60 DictionaryBuilder& DictionaryBuilder::SetBoolean( 61 DictionaryBuilder& DictionaryBuilder::SetBoolean(
61 const std::string& path, bool in_value) { 62 const std::string& path, bool in_value) {
62 dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value)); 63 dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
63 return *this; 64 return *this;
64 } 65 }
65 66
(...skipping 17 matching lines...) Expand all
83 ListBuilder& ListBuilder::Append(const std::string& in_value) { 84 ListBuilder& ListBuilder::Append(const std::string& in_value) {
84 list_->Append(new base::StringValue(in_value)); 85 list_->Append(new base::StringValue(in_value));
85 return *this; 86 return *this;
86 } 87 }
87 88
88 ListBuilder& ListBuilder::Append(const base::string16& in_value) { 89 ListBuilder& ListBuilder::Append(const base::string16& in_value) {
89 list_->Append(new base::StringValue(in_value)); 90 list_->Append(new base::StringValue(in_value));
90 return *this; 91 return *this;
91 } 92 }
92 93
93 ListBuilder& ListBuilder::Append(scoped_ptr<base::Value> in_value) { 94 ListBuilder& ListBuilder::Append(std::unique_ptr<base::Value> in_value) {
94 list_->Append(std::move(in_value)); 95 list_->Append(std::move(in_value));
95 return *this; 96 return *this;
96 } 97 }
97 98
98 ListBuilder& ListBuilder::AppendBoolean(bool in_value) { 99 ListBuilder& ListBuilder::AppendBoolean(bool in_value) {
99 list_->Append(new base::FundamentalValue(in_value)); 100 list_->Append(new base::FundamentalValue(in_value));
100 return *this; 101 return *this;
101 } 102 }
102 103
103 } // namespace extensions 104 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/value_builder.h ('k') | extensions/common/value_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698