| 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/common/content_param_traits.h" | 5 #include "content/common/content_param_traits.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "content/common/input/web_input_event_traits.h" | 10 #include "content/common/input/web_input_event_traits.h" |
| 11 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 12 | 12 |
| 13 namespace IPC { | 13 namespace IPC { |
| 14 | 14 |
| 15 void ParamTraits<WebInputEventPointer>::Write(Message* m, const param_type& p) { | 15 void ParamTraits<WebInputEventPointer>::Write(base::Pickle* m, |
| 16 const param_type& p) { |
| 16 m->WriteData(reinterpret_cast<const char*>(p), p->size); | 17 m->WriteData(reinterpret_cast<const char*>(p), p->size); |
| 17 } | 18 } |
| 18 | 19 |
| 19 bool ParamTraits<WebInputEventPointer>::Read(const Message* m, | 20 bool ParamTraits<WebInputEventPointer>::Read(const base::Pickle* m, |
| 20 base::PickleIterator* iter, | 21 base::PickleIterator* iter, |
| 21 param_type* r) { | 22 param_type* r) { |
| 22 const char* data; | 23 const char* data; |
| 23 int data_length; | 24 int data_length; |
| 24 if (!iter->ReadData(&data, &data_length)) { | 25 if (!iter->ReadData(&data, &data_length)) { |
| 25 NOTREACHED(); | 26 NOTREACHED(); |
| 26 return false; | 27 return false; |
| 27 } | 28 } |
| 28 if (data_length < static_cast<int>(sizeof(blink::WebInputEvent))) { | 29 if (data_length < static_cast<int>(sizeof(blink::WebInputEvent))) { |
| 29 NOTREACHED(); | 30 NOTREACHED(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ | 72 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ |
| 72 #include "content/common/content_param_traits_macros.h" | 73 #include "content/common/content_param_traits_macros.h" |
| 73 } // namespace IPC | 74 } // namespace IPC |
| 74 | 75 |
| 75 // Generate param traits log methods. | 76 // Generate param traits log methods. |
| 76 #include "ipc/param_traits_log_macros.h" | 77 #include "ipc/param_traits_log_macros.h" |
| 77 namespace IPC { | 78 namespace IPC { |
| 78 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ | 79 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ |
| 79 #include "content/common/content_param_traits_macros.h" | 80 #include "content/common/content_param_traits_macros.h" |
| 80 } // namespace IPC | 81 } // namespace IPC |
| OLD | NEW |