| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/common/devtools_messages.h" | |
| 6 | |
| 7 namespace IPC { | |
| 8 | |
| 9 void ParamTraits<content::ConsoleMessageLevel>::Write(Message* m, | |
| 10 const param_type& p) { | |
| 11 m->WriteInt(static_cast<int>(p)); | |
| 12 } | |
| 13 | |
| 14 bool ParamTraits<content::ConsoleMessageLevel>::Read(const Message* m, | |
| 15 PickleIterator* iter, | |
| 16 param_type* p) { | |
| 17 int type; | |
| 18 if (!m->ReadInt(iter, &type)) | |
| 19 return false; | |
| 20 *p = static_cast<param_type>(type); | |
| 21 return true; | |
| 22 } | |
| 23 | |
| 24 void ParamTraits<content::ConsoleMessageLevel>::Log(const param_type& p, | |
| 25 std::string* l) { | |
| 26 std::string level; | |
| 27 switch (p) { | |
| 28 case content::CONSOLE_MESSAGE_LEVEL_TIP: | |
| 29 level = "CONSOLE_MESSAGE_LEVEL_TIP"; | |
| 30 break; | |
| 31 case content::CONSOLE_MESSAGE_LEVEL_LOG: | |
| 32 level = "CONSOLE_MESSAGE_LEVEL_LOG"; | |
| 33 break; | |
| 34 case content::CONSOLE_MESSAGE_LEVEL_WARNING: | |
| 35 level = "CONSOLE_MESSAGE_LEVEL_WARNING"; | |
| 36 break; | |
| 37 case content::CONSOLE_MESSAGE_LEVEL_ERROR: | |
| 38 level = "CONSOLE_MESSAGE_LEVEL_ERROR"; | |
| 39 break; | |
| 40 } | |
| 41 LogParam(level, l); | |
| 42 } | |
| 43 | |
| 44 } // namespace IPC | |
| OLD | NEW |