OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/common/resource_response.h" | 5 #include "content/public/common/resource_response.h" |
6 | 6 |
7 #include "net/http/http_response_headers.h" | 7 #include "net/http/http_response_headers.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 scoped_refptr<ResourceResponse> ResourceResponse::DeepCopy() const { | 11 scoped_refptr<ResourceResponse> ResourceResponse::DeepCopy() const { |
12 scoped_refptr<ResourceResponse> new_response(new ResourceResponse); | 12 scoped_refptr<ResourceResponse> new_response(new ResourceResponse); |
13 new_response->head.request_time = head.request_time; | 13 new_response->head.request_time = head.request_time; |
14 new_response->head.response_time = head.response_time; | 14 new_response->head.response_time = head.response_time; |
15 if (head.headers.get()) { | 15 if (head.headers.get()) { |
16 new_response->head.headers = | 16 new_response->head.headers = |
17 new net::HttpResponseHeaders(head.headers->raw_headers()); | 17 new net::HttpResponseHeaders(head.headers->raw_headers()); |
18 } | 18 } |
19 new_response->head.mime_type = head.mime_type; | 19 new_response->head.mime_type = head.mime_type; |
20 new_response->head.charset = head.charset; | 20 new_response->head.charset = head.charset; |
21 new_response->head.security_info = head.security_info; | 21 new_response->head.security_info = head.security_info; |
22 new_response->head.has_major_certificate_errors = | 22 new_response->head.has_major_certificate_errors = |
23 head.has_major_certificate_errors; | 23 head.has_major_certificate_errors; |
24 new_response->head.content_length = head.content_length; | 24 new_response->head.content_length = head.content_length; |
25 new_response->head.encoded_data_length = head.encoded_data_length; | 25 new_response->head.encoded_data_length = head.encoded_data_length; |
| 26 new_response->head.encoded_body_length = head.encoded_body_length; |
26 new_response->head.appcache_id = head.appcache_id; | 27 new_response->head.appcache_id = head.appcache_id; |
27 new_response->head.appcache_manifest_url = head.appcache_manifest_url; | 28 new_response->head.appcache_manifest_url = head.appcache_manifest_url; |
28 new_response->head.load_timing = head.load_timing; | 29 new_response->head.load_timing = head.load_timing; |
29 if (head.devtools_info.get()) { | 30 if (head.devtools_info.get()) { |
30 new_response->head.devtools_info = head.devtools_info->DeepCopy(); | 31 new_response->head.devtools_info = head.devtools_info->DeepCopy(); |
31 } | 32 } |
32 new_response->head.download_file_path = head.download_file_path; | 33 new_response->head.download_file_path = head.download_file_path; |
33 new_response->head.was_fetched_via_spdy = head.was_fetched_via_spdy; | 34 new_response->head.was_fetched_via_spdy = head.was_fetched_via_spdy; |
34 new_response->head.was_npn_negotiated = head.was_npn_negotiated; | 35 new_response->head.was_npn_negotiated = head.was_npn_negotiated; |
35 new_response->head.was_alternate_protocol_available = | 36 new_response->head.was_alternate_protocol_available = |
(...skipping 17 matching lines...) Expand all Loading... |
53 head.service_worker_ready_time; | 54 head.service_worker_ready_time; |
54 new_response->head.is_using_lofi = head.is_using_lofi; | 55 new_response->head.is_using_lofi = head.is_using_lofi; |
55 new_response->head.effective_connection_type = head.effective_connection_type; | 56 new_response->head.effective_connection_type = head.effective_connection_type; |
56 new_response->head.signed_certificate_timestamps = | 57 new_response->head.signed_certificate_timestamps = |
57 head.signed_certificate_timestamps; | 58 head.signed_certificate_timestamps; |
58 new_response->head.cors_exposed_header_names = head.cors_exposed_header_names; | 59 new_response->head.cors_exposed_header_names = head.cors_exposed_header_names; |
59 return new_response; | 60 return new_response; |
60 } | 61 } |
61 | 62 |
62 } // namespace content | 63 } // namespace content |
OLD | NEW |