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

Side by Side Diff: ppapi/shared_impl/dictionary_var.cc

Issue 270183002: Move IsStringUTF8/ASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor nit Created 6 years, 7 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 | « net/proxy/proxy_resolver_v8.cc ('k') | ppapi/shared_impl/file_ref_util.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ppapi/shared_impl/dictionary_var.h" 5 #include "ppapi/shared_impl/dictionary_var.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "ppapi/shared_impl/array_var.h" 9 #include "ppapi/shared_impl/array_var.h"
10 #include "ppapi/shared_impl/ppapi_globals.h" 10 #include "ppapi/shared_impl/ppapi_globals.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 iter != key_value_map_.end(); 83 iter != key_value_map_.end();
84 ++iter) { 84 ++iter) {
85 array_var->elements().push_back(ScopedPPVar( 85 array_var->elements().push_back(ScopedPPVar(
86 ScopedPPVar::PassRef(), StringVar::StringToPPVar(iter->first))); 86 ScopedPPVar::PassRef(), StringVar::StringToPPVar(iter->first)));
87 } 87 }
88 return array_var->GetPPVar(); 88 return array_var->GetPPVar();
89 } 89 }
90 90
91 bool DictionaryVar::SetWithStringKey(const std::string& utf8_key, 91 bool DictionaryVar::SetWithStringKey(const std::string& utf8_key,
92 const PP_Var& value) { 92 const PP_Var& value) {
93 if (!IsStringUTF8(utf8_key)) 93 if (!base::IsStringUTF8(utf8_key))
94 return false; 94 return false;
95 95
96 key_value_map_[utf8_key] = value; 96 key_value_map_[utf8_key] = value;
97 return true; 97 return true;
98 } 98 }
99 99
100 void DictionaryVar::DeleteWithStringKey(const std::string& utf8_key) { 100 void DictionaryVar::DeleteWithStringKey(const std::string& utf8_key) {
101 key_value_map_.erase(utf8_key); 101 key_value_map_.erase(utf8_key);
102 } 102 }
103 103
104 } // namespace ppapi 104 } // namespace ppapi
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | ppapi/shared_impl/file_ref_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698