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

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

Issue 1977643002: Generate param traits size methods for IPC files in chrome/ (and traits it depends on). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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
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 <memory> 10 #include <memory>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 std::unique_ptr<base::Value> ToValue() const override { 145 std::unique_ptr<base::Value> ToValue() const override {
146 base::ListValue* list = new base::ListValue(); 146 base::ListValue* list = new base::ListValue();
147 typename std::set<PermissionDataType>::const_iterator i; 147 typename std::set<PermissionDataType>::const_iterator i;
148 for (i = data_set_.begin(); i != data_set_.end(); ++i) { 148 for (i = data_set_.begin(); i != data_set_.end(); ++i) {
149 std::unique_ptr<base::Value> item_value(i->ToValue()); 149 std::unique_ptr<base::Value> item_value(i->ToValue());
150 list->Append(item_value.release()); 150 list->Append(item_value.release());
151 } 151 }
152 return std::unique_ptr<base::Value>(list); 152 return std::unique_ptr<base::Value>(list);
153 } 153 }
154 154
155 void GetSize(base::PickleSizer* s) const override {
156 IPC::GetParamSize(s, data_set_);
157 }
158
155 void Write(base::Pickle* m) const override { IPC::WriteParam(m, data_set_); } 159 void Write(base::Pickle* m) const override { IPC::WriteParam(m, data_set_); }
156 160
157 bool Read(const base::Pickle* m, base::PickleIterator* iter) override { 161 bool Read(const base::Pickle* m, base::PickleIterator* iter) override {
158 return IPC::ReadParam(m, iter, &data_set_); 162 return IPC::ReadParam(m, iter, &data_set_);
159 } 163 }
160 164
161 void Log(std::string* log) const override { 165 void Log(std::string* log) const override {
162 IPC::LogParam(data_set_, log); 166 IPC::LogParam(data_set_, log);
163 } 167 }
164 168
165 protected: 169 protected:
166 std::set<PermissionDataType> data_set_; 170 std::set<PermissionDataType> data_set_;
167 }; 171 };
168 172
169 } // namespace extensions 173 } // namespace extensions
170 174
171 #endif // EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_ 175 #endif // EXTENSIONS_COMMON_PERMISSIONS_SET_DISJUNCTION_PERMISSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698