| 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 // NOTE: All messages must send an |int request_id| as their first parameter. | 7 // NOTE: All messages must send an |int request_id| as their first parameter. |
| 8 | 8 |
| 9 // Multiply-included message file, hence no include guard. | 9 // Multiply-included message file, hence no include guard. |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "content/common/content_param_traits_macros.h" | 12 #include "content/common/content_param_traits_macros.h" |
| 13 #include "content/public/common/common_param_traits.h" | 13 #include "content/public/common/common_param_traits.h" |
| 14 #include "content/public/common/resource_response.h" | 14 #include "content/public/common/resource_response.h" |
| 15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "net/base/request_priority.h" | 16 #include "net/base/request_priority.h" |
| 17 #include "webkit/glue/resource_request_body.h" | 17 #include "webkit/glue/resource_request_body.h" |
| 18 | 18 |
| 19 #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_ | 19 #ifndef CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 20 #define CONTENT_COMMON_RESOURCE_MESSAGES_H_ | 20 #define CONTENT_COMMON_RESOURCE_MESSAGES_H_ |
| 21 | 21 |
| 22 namespace net { |
| 23 struct LoadTimingInfo; |
| 24 } |
| 25 |
| 22 namespace webkit_glue { | 26 namespace webkit_glue { |
| 23 struct ResourceDevToolsInfo; | 27 struct ResourceDevToolsInfo; |
| 24 struct ResourceLoadTimingInfo; | |
| 25 } | 28 } |
| 26 | 29 |
| 27 namespace IPC { | 30 namespace IPC { |
| 28 | 31 |
| 29 template <> | 32 template <> |
| 30 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { | 33 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { |
| 31 typedef scoped_refptr<net::HttpResponseHeaders> param_type; | 34 typedef scoped_refptr<net::HttpResponseHeaders> param_type; |
| 32 static void Write(Message* m, const param_type& p); | 35 static void Write(Message* m, const param_type& p); |
| 33 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 36 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 34 static void Log(const param_type& p, std::string* l); | 37 static void Log(const param_type& p, std::string* l); |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 template <> | 40 template <> |
| 38 struct CONTENT_EXPORT ParamTraits<webkit_base::DataElement> { | 41 struct CONTENT_EXPORT ParamTraits<webkit_base::DataElement> { |
| 39 typedef webkit_base::DataElement param_type; | 42 typedef webkit_base::DataElement param_type; |
| 40 static void Write(Message* m, const param_type& p); | 43 static void Write(Message* m, const param_type& p); |
| 41 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 44 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 42 static void Log(const param_type& p, std::string* l); | 45 static void Log(const param_type& p, std::string* l); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 template <> | 48 template <> |
| 46 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { | 49 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { |
| 47 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; | 50 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; |
| 48 static void Write(Message* m, const param_type& p); | 51 static void Write(Message* m, const param_type& p); |
| 49 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 52 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 50 static void Log(const param_type& p, std::string* l); | 53 static void Log(const param_type& p, std::string* l); |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 template <> | 56 template <> |
| 54 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> { | 57 struct ParamTraits<net::LoadTimingInfo> { |
| 55 typedef webkit_glue::ResourceLoadTimingInfo param_type; | 58 typedef net::LoadTimingInfo param_type; |
| 56 static void Write(Message* m, const param_type& p); | 59 static void Write(Message* m, const param_type& p); |
| 57 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 60 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 58 static void Log(const param_type& p, std::string* l); | 61 static void Log(const param_type& p, std::string* l); |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 template <> | 64 template <> |
| 62 struct ParamTraits<scoped_refptr<webkit_glue::ResourceRequestBody> > { | 65 struct ParamTraits<scoped_refptr<webkit_glue::ResourceRequestBody> > { |
| 63 typedef scoped_refptr<webkit_glue::ResourceRequestBody> param_type; | 66 typedef scoped_refptr<webkit_glue::ResourceRequestBody> param_type; |
| 64 static void Write(Message* m, const param_type& p); | 67 static void Write(Message* m, const param_type& p); |
| 65 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 68 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 92 IPC_STRUCT_TRAITS_MEMBER(request_time) | 95 IPC_STRUCT_TRAITS_MEMBER(request_time) |
| 93 IPC_STRUCT_TRAITS_MEMBER(response_time) | 96 IPC_STRUCT_TRAITS_MEMBER(response_time) |
| 94 IPC_STRUCT_TRAITS_MEMBER(headers) | 97 IPC_STRUCT_TRAITS_MEMBER(headers) |
| 95 IPC_STRUCT_TRAITS_MEMBER(mime_type) | 98 IPC_STRUCT_TRAITS_MEMBER(mime_type) |
| 96 IPC_STRUCT_TRAITS_MEMBER(charset) | 99 IPC_STRUCT_TRAITS_MEMBER(charset) |
| 97 IPC_STRUCT_TRAITS_MEMBER(security_info) | 100 IPC_STRUCT_TRAITS_MEMBER(security_info) |
| 98 IPC_STRUCT_TRAITS_MEMBER(content_length) | 101 IPC_STRUCT_TRAITS_MEMBER(content_length) |
| 99 IPC_STRUCT_TRAITS_MEMBER(encoded_data_length) | 102 IPC_STRUCT_TRAITS_MEMBER(encoded_data_length) |
| 100 IPC_STRUCT_TRAITS_MEMBER(appcache_id) | 103 IPC_STRUCT_TRAITS_MEMBER(appcache_id) |
| 101 IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url) | 104 IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url) |
| 102 IPC_STRUCT_TRAITS_MEMBER(connection_id) | |
| 103 IPC_STRUCT_TRAITS_MEMBER(connection_reused) | |
| 104 IPC_STRUCT_TRAITS_MEMBER(load_timing) | 105 IPC_STRUCT_TRAITS_MEMBER(load_timing) |
| 105 IPC_STRUCT_TRAITS_MEMBER(devtools_info) | 106 IPC_STRUCT_TRAITS_MEMBER(devtools_info) |
| 106 IPC_STRUCT_TRAITS_MEMBER(download_file_path) | 107 IPC_STRUCT_TRAITS_MEMBER(download_file_path) |
| 107 IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy) | 108 IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy) |
| 108 IPC_STRUCT_TRAITS_MEMBER(was_npn_negotiated) | 109 IPC_STRUCT_TRAITS_MEMBER(was_npn_negotiated) |
| 109 IPC_STRUCT_TRAITS_MEMBER(was_alternate_protocol_available) | 110 IPC_STRUCT_TRAITS_MEMBER(was_alternate_protocol_available) |
| 110 IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_proxy) | 111 IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_proxy) |
| 111 IPC_STRUCT_TRAITS_MEMBER(npn_negotiated_protocol) | 112 IPC_STRUCT_TRAITS_MEMBER(npn_negotiated_protocol) |
| 112 IPC_STRUCT_TRAITS_MEMBER(socket_address) | 113 IPC_STRUCT_TRAITS_MEMBER(socket_address) |
| 113 IPC_STRUCT_TRAITS_END() | 114 IPC_STRUCT_TRAITS_END() |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 int /* request_id */) | 300 int /* request_id */) |
| 300 | 301 |
| 301 // Sent when the renderer process deletes a resource loader. | 302 // Sent when the renderer process deletes a resource loader. |
| 302 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, | 303 IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile, |
| 303 int /* request_id */) | 304 int /* request_id */) |
| 304 | 305 |
| 305 // Sent by the renderer when a resource request changes priority. | 306 // Sent by the renderer when a resource request changes priority. |
| 306 IPC_MESSAGE_ROUTED2(ResourceHostMsg_DidChangePriority, | 307 IPC_MESSAGE_ROUTED2(ResourceHostMsg_DidChangePriority, |
| 307 int /* request_id */, | 308 int /* request_id */, |
| 308 net::RequestPriority) | 309 net::RequestPriority) |
| OLD | NEW |