OLD | NEW |
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 #ifndef PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ | 5 #ifndef PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ |
6 #define PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ | 6 #define PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 void Delete(const PP_Var& key); | 38 void Delete(const PP_Var& key); |
39 PP_Bool HasKey(const PP_Var& key) const; | 39 PP_Bool HasKey(const PP_Var& key) const; |
40 // The returned PP_Var has had a ref added on behalf of the caller. | 40 // The returned PP_Var has had a ref added on behalf of the caller. |
41 PP_Var GetKeys() const; | 41 PP_Var GetKeys() const; |
42 | 42 |
43 // Returns false and keeps the dictionary unchanged if |key| is not a valid | 43 // Returns false and keeps the dictionary unchanged if |key| is not a valid |
44 // UTF-8 string. | 44 // UTF-8 string. |
45 bool SetWithStringKey(const std::string& utf8_key, const PP_Var& value); | 45 bool SetWithStringKey(const std::string& utf8_key, const PP_Var& value); |
46 void DeleteWithStringKey(const std::string& utf8_key); | 46 void DeleteWithStringKey(const std::string& utf8_key); |
47 | 47 |
48 const KeyValueMap& key_value_map() const { | 48 const KeyValueMap& key_value_map() const { return key_value_map_; } |
49 return key_value_map_; | |
50 } | |
51 | 49 |
52 protected: | 50 protected: |
53 virtual ~DictionaryVar(); | 51 virtual ~DictionaryVar(); |
54 | 52 |
55 private: | 53 private: |
56 KeyValueMap key_value_map_; | 54 KeyValueMap key_value_map_; |
57 | 55 |
58 DISALLOW_COPY_AND_ASSIGN(DictionaryVar); | 56 DISALLOW_COPY_AND_ASSIGN(DictionaryVar); |
59 }; | 57 }; |
60 | 58 |
61 } // namespace ppapi | 59 } // namespace ppapi |
62 | 60 |
63 #endif // PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ | 61 #endif // PPAPI_SHARED_IMPL_DICTIONARY_VAR_H_ |
OLD | NEW |