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 // IPC messages for resource loading. | 5 // IPC messages for resource loading. |
6 | 6 |
7 // Multiply-included message file, hence no include guard. | 7 // Multiply-included message file, hence no include guard. |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "content/common/content_param_traits_macros.h" |
9 #include "content/public/common/common_param_traits.h" | 10 #include "content/public/common/common_param_traits.h" |
10 #include "content/public/common/resource_response.h" | 11 #include "content/public/common/resource_response.h" |
11 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
12 #include "webkit/glue/resource_request_body.h" | 13 #include "webkit/glue/resource_request_body.h" |
13 | 14 |
| 15 #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 16 #define CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 17 |
| 18 namespace webkit_glue { |
| 19 struct ResourceDevToolsInfo; |
| 20 struct ResourceLoadTimingInfo; |
| 21 } |
| 22 |
| 23 namespace IPC { |
| 24 |
| 25 template <> |
| 26 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { |
| 27 typedef scoped_refptr<net::HttpResponseHeaders> param_type; |
| 28 static void Write(Message* m, const param_type& p); |
| 29 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 30 static void Log(const param_type& p, std::string* l); |
| 31 }; |
| 32 |
| 33 template <> |
| 34 struct CONTENT_EXPORT ParamTraits<webkit_base::DataElement> { |
| 35 typedef webkit_base::DataElement param_type; |
| 36 static void Write(Message* m, const param_type& p); |
| 37 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 38 static void Log(const param_type& p, std::string* l); |
| 39 }; |
| 40 |
| 41 template <> |
| 42 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { |
| 43 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; |
| 44 static void Write(Message* m, const param_type& p); |
| 45 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 46 static void Log(const param_type& p, std::string* l); |
| 47 }; |
| 48 |
| 49 template <> |
| 50 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> { |
| 51 typedef webkit_glue::ResourceLoadTimingInfo param_type; |
| 52 static void Write(Message* m, const param_type& p); |
| 53 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 54 static void Log(const param_type& p, std::string* l); |
| 55 }; |
| 56 |
| 57 template <> |
| 58 struct ParamTraits<scoped_refptr<webkit_glue::ResourceRequestBody> > { |
| 59 typedef scoped_refptr<webkit_glue::ResourceRequestBody> param_type; |
| 60 static void Write(Message* m, const param_type& p); |
| 61 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 62 static void Log(const param_type& p, std::string* l); |
| 63 }; |
| 64 |
| 65 } // namespace IPC |
| 66 |
| 67 #endif // CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 68 |
| 69 |
14 #define IPC_MESSAGE_START ResourceMsgStart | 70 #define IPC_MESSAGE_START ResourceMsgStart |
15 #undef IPC_MESSAGE_EXPORT | 71 #undef IPC_MESSAGE_EXPORT |
16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 72 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
17 | 73 |
18 IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead) | 74 IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead) |
19 IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo) | 75 IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo) |
20 IPC_STRUCT_TRAITS_MEMBER(error_code) | 76 IPC_STRUCT_TRAITS_MEMBER(error_code) |
21 IPC_STRUCT_TRAITS_MEMBER(request_start) | 77 IPC_STRUCT_TRAITS_MEMBER(request_start) |
22 IPC_STRUCT_TRAITS_MEMBER(response_start) | 78 IPC_STRUCT_TRAITS_MEMBER(response_start) |
23 IPC_STRUCT_TRAITS_END() | 79 IPC_STRUCT_TRAITS_END() |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 int /* request_id */) | 283 int /* request_id */) |
228 | 284 |
229 // Sent by the renderer process to acknowledge receipt of a | 285 // Sent by the renderer process to acknowledge receipt of a |
230 // UploadProgress message. | 286 // UploadProgress message. |
231 IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK, | 287 IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK, |
232 int /* request_id */) | 288 int /* request_id */) |
233 | 289 |
234 // Sent when the renderer process deletes a resource loader. | 290 // Sent when the renderer process deletes a resource loader. |
235 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, | 291 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, |
236 int /* request_id */) | 292 int /* request_id */) |
OLD | NEW |