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