OLD | NEW |
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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const_iterator(); | 54 const_iterator(); |
55 const_iterator(const const_iterator& other); | 55 const_iterator(const const_iterator& other); |
56 explicit const_iterator(ExtensionMap::const_iterator it); | 56 explicit const_iterator(ExtensionMap::const_iterator it); |
57 const_iterator& operator++() { | 57 const_iterator& operator++() { |
58 ++it_; | 58 ++it_; |
59 return *this; | 59 return *this; |
60 } | 60 } |
61 const scoped_refptr<const extensions::Extension> operator*() { | 61 const scoped_refptr<const extensions::Extension> operator*() { |
62 return it_->second; | 62 return it_->second; |
63 } | 63 } |
| 64 const scoped_refptr<const extensions::Extension>* operator->() { |
| 65 return &it_->second; |
| 66 } |
64 bool operator!=(const const_iterator& other) { return it_ != other.it_; } | 67 bool operator!=(const const_iterator& other) { return it_ != other.it_; } |
65 bool operator==(const const_iterator& other) { return it_ == other.it_; } | 68 bool operator==(const const_iterator& other) { return it_ == other.it_; } |
66 | 69 |
67 private: | 70 private: |
68 ExtensionMap::const_iterator it_; | 71 ExtensionMap::const_iterator it_; |
69 }; | 72 }; |
70 | 73 |
71 ExtensionSet(); | 74 ExtensionSet(); |
72 ~ExtensionSet(); | 75 ~ExtensionSet(); |
73 | 76 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 142 |
140 private: | 143 private: |
141 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); | 144 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); |
142 | 145 |
143 ExtensionMap extensions_; | 146 ExtensionMap extensions_; |
144 | 147 |
145 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 148 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
146 }; | 149 }; |
147 | 150 |
148 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 151 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
OLD | NEW |