| 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 "content/public/common/referrer.h" |
| 9 #include "net/base/host_port_pair.h" | 9 #include "net/base/host_port_pair.h" |
| 10 #include "net/base/upload_data.h" | 10 #include "net/base/upload_data.h" |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 const SkBitmap_Data* bmp_data = | 547 const SkBitmap_Data* bmp_data = |
| 548 reinterpret_cast<const SkBitmap_Data*>(fixed_data); | 548 reinterpret_cast<const SkBitmap_Data*>(fixed_data); |
| 549 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); | 549 return bmp_data->InitSkBitmapFromData(r, variable_data, variable_data_size); |
| 550 } | 550 } |
| 551 | 551 |
| 552 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { | 552 void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { |
| 553 l->append("<SkBitmap>"); | 553 l->append("<SkBitmap>"); |
| 554 } | 554 } |
| 555 | 555 |
| 556 void ParamTraits<content::ConsoleMessageLevel>::Write(Message* m, |
| 557 const param_type& p) { |
| 558 m->WriteInt(static_cast<int>(p)); |
| 559 } |
| 560 |
| 561 bool ParamTraits<content::ConsoleMessageLevel>::Read(const Message* m, |
| 562 PickleIterator* iter, |
| 563 param_type* p) { |
| 564 int type; |
| 565 if (!m->ReadInt(iter, &type)) |
| 566 return false; |
| 567 *p = static_cast<param_type>(type); |
| 568 return true; |
| 569 } |
| 570 |
| 571 void ParamTraits<content::ConsoleMessageLevel>::Log(const param_type& p, |
| 572 std::string* l) { |
| 573 std::string level; |
| 574 switch (p) { |
| 575 case content::CONSOLE_MESSAGE_LEVEL_TIP: |
| 576 level = "CONSOLE_MESSAGE_LEVEL_TIP"; |
| 577 break; |
| 578 case content::CONSOLE_MESSAGE_LEVEL_LOG: |
| 579 level = "CONSOLE_MESSAGE_LEVEL_LOG"; |
| 580 break; |
| 581 case content::CONSOLE_MESSAGE_LEVEL_WARNING: |
| 582 level = "CONSOLE_MESSAGE_LEVEL_WARNING"; |
| 583 break; |
| 584 case content::CONSOLE_MESSAGE_LEVEL_ERROR: |
| 585 level = "CONSOLE_MESSAGE_LEVEL_ERROR"; |
| 586 break; |
| 587 } |
| 588 LogParam(level, l); |
| 589 } |
| 590 |
| 556 } // namespace IPC | 591 } // namespace IPC |
| OLD | NEW |