OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ |
6 #define EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 scoped_ptr<base::Value> ToValue() const override { | 140 scoped_ptr<base::Value> ToValue() const override { |
141 base::ListValue* list = new base::ListValue(); | 141 base::ListValue* list = new base::ListValue(); |
142 typename std::set<PermissionDataType>::const_iterator i; | 142 typename std::set<PermissionDataType>::const_iterator i; |
143 for (i = data_set_.begin(); i != data_set_.end(); ++i) { | 143 for (i = data_set_.begin(); i != data_set_.end(); ++i) { |
144 scoped_ptr<base::Value> item_value(i->ToValue()); | 144 scoped_ptr<base::Value> item_value(i->ToValue()); |
145 list->Append(item_value.release()); | 145 list->Append(item_value.release()); |
146 } | 146 } |
147 return scoped_ptr<base::Value>(list); | 147 return scoped_ptr<base::Value>(list); |
148 } | 148 } |
149 | 149 |
150 void Write(IPC::Message* m) const override { | 150 void Write(base::Pickle* m) const override { IPC::WriteParam(m, data_set_); } |
151 IPC::WriteParam(m, data_set_); | |
152 } | |
153 | 151 |
154 bool Read(const IPC::Message* m, base::PickleIterator* iter) override { | 152 bool Read(const base::Pickle* m, base::PickleIterator* iter) override { |
155 return IPC::ReadParam(m, iter, &data_set_); | 153 return IPC::ReadParam(m, iter, &data_set_); |
156 } | 154 } |
157 | 155 |
158 void Log(std::string* log) const override { | 156 void Log(std::string* log) const override { |
159 IPC::LogParam(data_set_, log); | 157 IPC::LogParam(data_set_, log); |
160 } | 158 } |
161 | 159 |
162 protected: | 160 protected: |
163 std::set<PermissionDataType> data_set_; | 161 std::set<PermissionDataType> data_set_; |
164 }; | 162 }; |
165 | 163 |
166 } // namespace extensions | 164 } // namespace extensions |
167 | 165 |
168 #endif // EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ | 166 #endif // EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ |
OLD | NEW |