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

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

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/common_param_traits.h" 5 #include "chrome/common/common_param_traits.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "chrome/common/chrome_constants.h" 8 #include "chrome/common/chrome_constants.h"
9 #include "chrome/common/content_settings.h" 9 #include "chrome/common/content_settings.h"
10 #include "chrome/common/geoposition.h" 10 #include "chrome/common/geoposition.h"
11 #include "chrome/common/thumbnail_score.h" 11 #include "chrome/common/thumbnail_score.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 return true; 285 return true;
286 } 286 }
287 287
288 void ParamTraits<WebApplicationInfo>::Log(const WebApplicationInfo& p, 288 void ParamTraits<WebApplicationInfo>::Log(const WebApplicationInfo& p,
289 std::string* l) { 289 std::string* l) {
290 l->append("<WebApplicationInfo>"); 290 l->append("<WebApplicationInfo>");
291 } 291 }
292 292
293 void ParamTraits<URLRequestStatus>::Write(Message* m, const param_type& p) { 293 void ParamTraits<net::URLRequestStatus>::Write(Message* m,
294 const param_type& p) {
294 WriteParam(m, static_cast<int>(p.status())); 295 WriteParam(m, static_cast<int>(p.status()));
295 WriteParam(m, p.os_error()); 296 WriteParam(m, p.os_error());
296 } 297 }
297 298
298 bool ParamTraits<URLRequestStatus>::Read(const Message* m, void** iter, 299 bool ParamTraits<net::URLRequestStatus>::Read(const Message* m, void** iter,
299 param_type* r) { 300 param_type* r) {
300 int status, os_error; 301 int status, os_error;
301 if (!ReadParam(m, iter, &status) || 302 if (!ReadParam(m, iter, &status) ||
302 !ReadParam(m, iter, &os_error)) 303 !ReadParam(m, iter, &os_error))
303 return false; 304 return false;
304 r->set_status(static_cast<URLRequestStatus::Status>(status)); 305 r->set_status(static_cast<net::URLRequestStatus::Status>(status));
305 r->set_os_error(os_error); 306 r->set_os_error(os_error);
306 return true; 307 return true;
307 } 308 }
308 309
309 void ParamTraits<URLRequestStatus>::Log(const param_type& p, std::string* l) { 310 void ParamTraits<net::URLRequestStatus>::Log(const param_type& p,
311 std::string* l) {
310 std::string status; 312 std::string status;
311 switch (p.status()) { 313 switch (p.status()) {
312 case URLRequestStatus::SUCCESS: 314 case net::URLRequestStatus::SUCCESS:
313 status = "SUCCESS"; 315 status = "SUCCESS";
314 break; 316 break;
315 case URLRequestStatus::IO_PENDING: 317 case net::URLRequestStatus::IO_PENDING:
316 status = "IO_PENDING "; 318 status = "IO_PENDING ";
317 break; 319 break;
318 case URLRequestStatus::HANDLED_EXTERNALLY: 320 case net::URLRequestStatus::HANDLED_EXTERNALLY:
319 status = "HANDLED_EXTERNALLY"; 321 status = "HANDLED_EXTERNALLY";
320 break; 322 break;
321 case URLRequestStatus::CANCELED: 323 case net::URLRequestStatus::CANCELED:
322 status = "CANCELED"; 324 status = "CANCELED";
323 break; 325 break;
324 case URLRequestStatus::FAILED: 326 case net::URLRequestStatus::FAILED:
325 status = "FAILED"; 327 status = "FAILED";
326 break; 328 break;
327 default: 329 default:
328 status = "UNKNOWN"; 330 status = "UNKNOWN";
329 break; 331 break;
330 } 332 }
331 if (p.status() == URLRequestStatus::FAILED) 333 if (p.status() == net::URLRequestStatus::FAILED)
332 l->append("("); 334 l->append("(");
333 335
334 LogParam(status, l); 336 LogParam(status, l);
335 337
336 if (p.status() == URLRequestStatus::FAILED) { 338 if (p.status() == net::URLRequestStatus::FAILED) {
337 l->append(", "); 339 l->append(", ");
338 LogParam(p.os_error(), l); 340 LogParam(p.os_error(), l);
339 l->append(")"); 341 l->append(")");
340 } 342 }
341 } 343 }
342 344
343 // Only the net::UploadData ParamTraits<> definition needs this definition, so 345 // Only the net::UploadData ParamTraits<> definition needs this definition, so
344 // keep this in the implementation file so we can forward declare UploadData in 346 // keep this in the implementation file so we can forward declare UploadData in
345 // the header. 347 // the header.
346 template <> 348 template <>
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 l->append(","); 673 l->append(",");
672 LogParam(p.caps_mime_type, l); 674 LogParam(p.caps_mime_type, l);
673 l->append(","); 675 l->append(",");
674 LogParam(p.printer_defaults, l); 676 LogParam(p.printer_defaults, l);
675 l->append(","); 677 l->append(",");
676 LogParam(p.defaults_mime_type, l); 678 LogParam(p.defaults_mime_type, l);
677 l->append(")"); 679 l->append(")");
678 } 680 }
679 681
680 } // namespace IPC 682 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/common_param_traits.h ('k') | chrome/common/extensions/extension_localization_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698