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

Side by Side Diff: chrome/common/automation_messages.cc

Issue 11275223: net: Change type of UploadData::elements from std::vector to ScopedVector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ParamTraits to ipc_message_utils.h Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 #include "ui/base/models/menu_model.h" 5 #include "ui/base/models/menu_model.h"
6 6
7 // Get basic type definitions. 7 // Get basic type definitions.
8 #define IPC_MESSAGE_IMPL 8 #define IPC_MESSAGE_IMPL
9 #include "chrome/common/automation_messages.h" 9 #include "chrome/common/automation_messages.h"
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 static void Log(const param_type& p, std::string* l) { 219 static void Log(const param_type& p, std::string* l) {
220 l->append("<net::UploadElement>"); 220 l->append("<net::UploadElement>");
221 } 221 }
222 }; 222 };
223 223
224 void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m, 224 void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m,
225 const param_type& p) { 225 const param_type& p) {
226 WriteParam(m, p.get() != NULL); 226 WriteParam(m, p.get() != NULL);
227 if (p) { 227 if (p) {
228 WriteParam(m, *p->elements()); 228 WriteParam(m, p->elements());
229 WriteParam(m, p->identifier()); 229 WriteParam(m, p->identifier());
230 WriteParam(m, p->is_chunked()); 230 WriteParam(m, p->is_chunked());
231 WriteParam(m, p->last_chunk_appended()); 231 WriteParam(m, p->last_chunk_appended());
232 } 232 }
233 } 233 }
234 234
235 bool ParamTraits<scoped_refptr<net::UploadData> >::Read(const Message* m, 235 bool ParamTraits<scoped_refptr<net::UploadData> >::Read(const Message* m,
236 PickleIterator* iter, 236 PickleIterator* iter,
237 param_type* r) { 237 param_type* r) {
238 bool has_object; 238 bool has_object;
239 if (!ReadParam(m, iter, &has_object)) 239 if (!ReadParam(m, iter, &has_object))
240 return false; 240 return false;
241 if (!has_object) 241 if (!has_object)
242 return true; 242 return true;
243 std::vector<net::UploadElement> elements; 243 ScopedVector<net::UploadElement> elements;
244 if (!ReadParam(m, iter, &elements)) 244 if (!ReadParam(m, iter, &elements))
245 return false; 245 return false;
246 int64 identifier; 246 int64 identifier;
247 if (!ReadParam(m, iter, &identifier)) 247 if (!ReadParam(m, iter, &identifier))
248 return false; 248 return false;
249 bool is_chunked = false; 249 bool is_chunked = false;
250 if (!ReadParam(m, iter, &is_chunked)) 250 if (!ReadParam(m, iter, &is_chunked))
251 return false; 251 return false;
252 bool last_chunk_appended = false; 252 bool last_chunk_appended = false;
253 if (!ReadParam(m, iter, &last_chunk_appended)) 253 if (!ReadParam(m, iter, &last_chunk_appended))
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 LogParam(status, l); 308 LogParam(status, l);
309 309
310 if (p.status() == net::URLRequestStatus::FAILED) { 310 if (p.status() == net::URLRequestStatus::FAILED) {
311 l->append(", "); 311 l->append(", ");
312 LogParam(p.error(), l); 312 LogParam(p.error(), l);
313 l->append(")"); 313 l->append(")");
314 } 314 }
315 } 315 }
316 316
317 } // namespace IPC 317 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698