Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 1965013002: Implement headers attributes in ForeignFetchResponse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using instead of typedef Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/child/web_url_loader_impl.h" 5 #include "content/child/web_url_loader_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 response->setWasFetchedViaServiceWorker(info.was_fetched_via_service_worker); 948 response->setWasFetchedViaServiceWorker(info.was_fetched_via_service_worker);
949 response->setWasFallbackRequiredByServiceWorker( 949 response->setWasFallbackRequiredByServiceWorker(
950 info.was_fallback_required_by_service_worker); 950 info.was_fallback_required_by_service_worker);
951 response->setServiceWorkerResponseType(info.response_type_via_service_worker); 951 response->setServiceWorkerResponseType(info.response_type_via_service_worker);
952 response->setOriginalURLViaServiceWorker( 952 response->setOriginalURLViaServiceWorker(
953 info.original_url_via_service_worker); 953 info.original_url_via_service_worker);
954 response->setCacheStorageCacheName( 954 response->setCacheStorageCacheName(
955 info.is_in_cache_storage 955 info.is_in_cache_storage
956 ? blink::WebString::fromUTF8(info.cache_storage_cache_name) 956 ? blink::WebString::fromUTF8(info.cache_storage_cache_name)
957 : blink::WebString()); 957 : blink::WebString());
958 blink::WebVector<blink::WebString> cors_exposed_header_names(
959 info.cors_exposed_header_names.size());
960 std::transform(
961 info.cors_exposed_header_names.begin(),
962 info.cors_exposed_header_names.end(), cors_exposed_header_names.begin(),
963 [](const std::string& h) { return blink::WebString::fromLatin1(h); });
964 response->setCorsExposedHeaderNames(cors_exposed_header_names);
958 965
959 SetSecurityStyleAndDetails(url, info.security_info, response, 966 SetSecurityStyleAndDetails(url, info.security_info, response,
960 report_security_info); 967 report_security_info);
961 968
962 WebURLResponseExtraDataImpl* extra_data = 969 WebURLResponseExtraDataImpl* extra_data =
963 new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol); 970 new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol);
964 response->setExtraData(extra_data); 971 response->setExtraData(extra_data);
965 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); 972 extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy);
966 extra_data->set_was_npn_negotiated(info.was_npn_negotiated); 973 extra_data->set_was_npn_negotiated(info.was_npn_negotiated);
967 extra_data->set_was_alternate_protocol_available( 974 extra_data->set_was_alternate_protocol_available(
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 response->clearHTTPHeaderField(webStringName); 1196 response->clearHTTPHeaderField(webStringName);
1190 while (response_headers->EnumerateHeader(&iterator, name, &value)) { 1197 while (response_headers->EnumerateHeader(&iterator, name, &value)) {
1191 response->addHTTPHeaderField(webStringName, 1198 response->addHTTPHeaderField(webStringName,
1192 WebString::fromLatin1(value)); 1199 WebString::fromLatin1(value));
1193 } 1200 }
1194 } 1201 }
1195 return true; 1202 return true;
1196 } 1203 }
1197 1204
1198 } // namespace content 1205 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job_unittest.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698