OLD | NEW |
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 "content/public/common/common_param_traits.h" | 5 #include "content/public/common/common_param_traits.h" |
6 | 6 |
7 #include "content/public/common/content_constants.h" | 7 #include "content/public/common/content_constants.h" |
| 8 #include "content/public/common/referrer.h" |
8 #include "net/base/host_port_pair.h" | 9 #include "net/base/host_port_pair.h" |
9 #include "net/base/upload_data.h" | 10 #include "net/base/upload_data.h" |
10 #include "net/http/http_response_headers.h" | 11 #include "net/http/http_response_headers.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/base/range/range.h" | 13 #include "ui/base/range/range.h" |
13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 struct SkBitmap_Data { | 18 struct SkBitmap_Data { |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 LogParam(p.is_directory, l); | 439 LogParam(p.is_directory, l); |
439 l->append(","); | 440 l->append(","); |
440 LogParam(p.last_modified.ToDoubleT(), l); | 441 LogParam(p.last_modified.ToDoubleT(), l); |
441 l->append(","); | 442 l->append(","); |
442 LogParam(p.last_accessed.ToDoubleT(), l); | 443 LogParam(p.last_accessed.ToDoubleT(), l); |
443 l->append(","); | 444 l->append(","); |
444 LogParam(p.creation_time.ToDoubleT(), l); | 445 LogParam(p.creation_time.ToDoubleT(), l); |
445 l->append(")"); | 446 l->append(")"); |
446 } | 447 } |
447 | 448 |
| 449 void ParamTraits<content::Referrer>::Write( |
| 450 Message* m, const param_type& p) { |
| 451 WriteParam(m, p.url); |
| 452 WriteParam(m, p.policy); |
| 453 } |
| 454 |
| 455 bool ParamTraits<content::Referrer>::Read( |
| 456 const Message* m, PickleIterator* iter, param_type* r) { |
| 457 return ReadParam(m, iter, &r->url) && ReadParam(m, iter, &r->policy); |
| 458 } |
| 459 |
| 460 void ParamTraits<content::Referrer>::Log( |
| 461 const param_type& p, std::string* l) { |
| 462 l->append("("); |
| 463 LogParam(p.url, l); |
| 464 l->append(","); |
| 465 LogParam(p.policy, l); |
| 466 l->append(")"); |
| 467 } |
| 468 |
448 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { | 469 void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { |
449 m->WriteInt(p.x()); | 470 m->WriteInt(p.x()); |
450 m->WriteInt(p.y()); | 471 m->WriteInt(p.y()); |
451 } | 472 } |
452 | 473 |
453 bool ParamTraits<gfx::Point>::Read(const Message* m, PickleIterator* iter, | 474 bool ParamTraits<gfx::Point>::Read(const Message* m, PickleIterator* iter, |
454 gfx::Point* r) { | 475 gfx::Point* r) { |
455 int x, y; | 476 int x, y; |
456 if (!m->ReadInt(iter, &x) || | 477 if (!m->ReadInt(iter, &x) || |
457 !m->ReadInt(iter, &y)) | 478 !m->ReadInt(iter, &y)) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 const SkBitmap_Data* bmp_data = | 590 const SkBitmap_Data* bmp_data = |
570 reinterpret_cast<const SkBitmap_Data*>(fixed_data); | 591 reinterpret_cast<const SkBitmap_Data*>(fixed_data); |
571 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); | 592 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); |
572 } | 593 } |
573 | 594 |
574 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { | 595 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { |
575 l->append("<SkBitmap>"); | 596 l->append("<SkBitmap>"); |
576 } | 597 } |
577 | 598 |
578 } // namespace IPC | 599 } // namespace IPC |
OLD | NEW |