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

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

Issue 131503015: Get rid of some uses of base::Create*Value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/tile_priority.cc ('k') | rlz/chromeos/lib/rlz_value_store_chromeos.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/url_pattern_set.h" 5 #include "extensions/common/url_pattern_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 } 180 }
181 181
182 return false; 182 return false;
183 } 183 }
184 184
185 scoped_ptr<base::ListValue> URLPatternSet::ToValue() const { 185 scoped_ptr<base::ListValue> URLPatternSet::ToValue() const {
186 scoped_ptr<base::ListValue> value(new base::ListValue); 186 scoped_ptr<base::ListValue> value(new base::ListValue);
187 for (URLPatternSet::const_iterator i = patterns_.begin(); 187 for (URLPatternSet::const_iterator i = patterns_.begin();
188 i != patterns_.end(); ++i) 188 i != patterns_.end(); ++i)
189 value->AppendIfNotPresent(base::Value::CreateStringValue(i->GetAsString())); 189 value->AppendIfNotPresent(new base::StringValue(i->GetAsString()));
190 return value.Pass(); 190 return value.Pass();
191 } 191 }
192 192
193 bool URLPatternSet::Populate(const std::vector<std::string>& patterns, 193 bool URLPatternSet::Populate(const std::vector<std::string>& patterns,
194 int valid_schemes, 194 int valid_schemes,
195 bool allow_file_access, 195 bool allow_file_access,
196 std::string* error) { 196 std::string* error) {
197 ClearPatterns(); 197 ClearPatterns();
198 for (size_t i = 0; i < patterns.size(); ++i) { 198 for (size_t i = 0; i < patterns.size(); ++i) {
199 URLPattern pattern(valid_schemes); 199 URLPattern pattern(valid_schemes);
(...skipping 23 matching lines...) Expand all
223 for (size_t i = 0; i < value.GetSize(); ++i) { 223 for (size_t i = 0; i < value.GetSize(); ++i) {
224 std::string item; 224 std::string item;
225 if (!value.GetString(i, &item)) 225 if (!value.GetString(i, &item))
226 return false; 226 return false;
227 patterns.push_back(item); 227 patterns.push_back(item);
228 } 228 }
229 return Populate(patterns, valid_schemes, allow_file_access, error); 229 return Populate(patterns, valid_schemes, allow_file_access, error);
230 } 230 }
231 231
232 } // namespace extensions 232 } // namespace extensions
OLDNEW
« no previous file with comments | « cc/resources/tile_priority.cc ('k') | rlz/chromeos/lib/rlz_value_store_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698