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

Side by Side Diff: chrome/browser/extensions/api/proxy/proxy_api_helpers.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 // Implementation of helper functions for the Chrome Extensions Proxy Settings 5 // Implementation of helper functions for the Chrome Extensions Proxy Settings
6 // API. 6 // API.
7 // 7 //
8 // Throughout this code, we report errors to the user by setting an |error| 8 // Throughout this code, we report errors to the user by setting an |error|
9 // parameter, if and only if these errors can be cause by invalid input 9 // parameter, if and only if these errors can be cause by invalid input
10 // from the extension and we cannot expect that the extensions API has 10 // from the extension and we cannot expect that the extensions API has
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 pac_script_dict->SetBoolean(keys::kProxyConfigPacScriptMandatory, 488 pac_script_dict->SetBoolean(keys::kProxyConfigPacScriptMandatory,
489 pac_mandatory); 489 pac_mandatory);
490 return pac_script_dict.release(); 490 return pac_script_dict.release();
491 } 491 }
492 492
493 base::ListValue* TokenizeToStringList(const std::string& in, 493 base::ListValue* TokenizeToStringList(const std::string& in,
494 const std::string& delims) { 494 const std::string& delims) {
495 base::ListValue* out = new base::ListValue; 495 base::ListValue* out = new base::ListValue;
496 base::StringTokenizer entries(in, delims); 496 base::StringTokenizer entries(in, delims);
497 while (entries.GetNext()) 497 while (entries.GetNext())
498 out->Append(new base::StringValue(entries.token())); 498 out->AppendString(entries.token());
499 return out; 499 return out;
500 } 500 }
501 501
502 } // namespace proxy_api_helpers 502 } // namespace proxy_api_helpers
503 } // namespace extensions 503 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698