OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/public/common/resource_response.h" | |
6 | |
7 #include "net/http/http_response_headers.h" | |
8 | |
9 namespace content { | |
10 | |
11 scoped_refptr<ResourceResponse> ResourceResponse::DeepCopy() const { | |
12 scoped_refptr<ResourceResponse> new_response(new ResourceResponse); | |
13 new_response->head.request_time = head.request_time; | |
14 new_response->head.response_time = head.response_time; | |
15 if (head.headers.get()) { | |
16 new_response->head.headers = | |
17 new net::HttpResponseHeaders(head.headers->raw_headers()); | |
18 } | |
19 new_response->head.mime_type = head.mime_type; | |
20 new_response->head.charset = head.charset; | |
21 new_response->head.security_info = head.security_info; | |
22 new_response->head.content_length = head.content_length; | |
23 new_response->head.encoded_data_length = head.encoded_data_length; | |
24 new_response->head.appcache_id = head.appcache_id; | |
25 new_response->head.appcache_manifest_url = head.appcache_manifest_url; | |
26 new_response->head.load_timing = head.load_timing; | |
27 if (head.devtools_info.get()) { | |
28 new_response->head.devtools_info = head.devtools_info->DeepCopy(); | |
29 } | |
30 new_response->head.download_file_path = head.download_file_path; | |
31 new_response->head.was_fetched_via_spdy = head.was_fetched_via_spdy; | |
32 new_response->head.was_npn_negotiated = head.was_npn_negotiated; | |
33 new_response->head.was_alternate_protocol_available = | |
34 new_response->head.was_alternate_protocol_available; | |
35 new_response->head.connection_info = head.connection_info; | |
36 new_response->head.was_fetched_via_proxy = head.was_fetched_via_proxy; | |
37 new_response->head.npn_negotiated_protocol = head.npn_negotiated_protocol; | |
38 new_response->head.socket_address = head.socket_address; | |
39 new_response->head.was_fetched_via_service_worker = | |
40 head.was_fetched_via_service_worker; | |
41 new_response->head.was_fallback_required_by_service_worker = | |
42 head.was_fallback_required_by_service_worker; | |
43 new_response->head.original_url_via_service_worker = | |
44 head.original_url_via_service_worker; | |
nasko
2014/10/23 22:36:17
I don't see response_type_via_service_worker being
davidben
2014/10/27 20:46:05
Aargh, they keep adding things. Done. (I... very..
| |
45 new_response->head.service_worker_fetch_start = | |
46 head.service_worker_fetch_start; | |
47 new_response->head.service_worker_fetch_ready = | |
48 head.service_worker_fetch_ready; | |
49 new_response->head.service_worker_fetch_end = head.service_worker_fetch_end; | |
50 return new_response; | |
51 } | |
52 | |
53 } // namespace content | |
OLD | NEW |