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

Side by Side Diff: extensions/common/permissions/set_disjunction_permission.h

Issue 1659003003: IPC::Message -> base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more mac fix Created 4 years, 10 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 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
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_
OLDNEW
« no previous file with comments | « extensions/common/permissions/manifest_permission.cc ('k') | extensions/common/permissions/settings_override_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698