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

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceResponse.cpp

Issue 2516353002: Introduce url_list to the Response scheme of CacheStorage. (Closed)
Patch Set: incorpodated cmumford@'s comment Created 4 years 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 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 m_multipartBoundary = data->m_multipartBoundary; 178 m_multipartBoundary = data->m_multipartBoundary;
179 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY; 179 m_wasFetchedViaSPDY = data->m_wasFetchedViaSPDY;
180 m_wasNpnNegotiated = data->m_wasNpnNegotiated; 180 m_wasNpnNegotiated = data->m_wasNpnNegotiated;
181 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; 181 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable;
182 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; 182 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy;
183 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; 183 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker;
184 m_wasFetchedViaForeignFetch = data->m_wasFetchedViaForeignFetch; 184 m_wasFetchedViaForeignFetch = data->m_wasFetchedViaForeignFetch;
185 m_wasFallbackRequiredByServiceWorker = 185 m_wasFallbackRequiredByServiceWorker =
186 data->m_wasFallbackRequiredByServiceWorker; 186 data->m_wasFallbackRequiredByServiceWorker;
187 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType; 187 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType;
188 m_originalURLViaServiceWorker = data->m_originalURLViaServiceWorker; 188 m_urlListViaServiceWorker = data->m_urlListViaServiceWorker;
189 m_cacheStorageCacheName = data->m_cacheStorageCacheName; 189 m_cacheStorageCacheName = data->m_cacheStorageCacheName;
190 m_responseTime = data->m_responseTime; 190 m_responseTime = data->m_responseTime;
191 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress); 191 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress);
192 m_remotePort = data->m_remotePort; 192 m_remotePort = data->m_remotePort;
193 m_encodedDataLength = data->m_encodedDataLength; 193 m_encodedDataLength = data->m_encodedDataLength;
194 m_encodedBodyLength = data->m_encodedBodyLength; 194 m_encodedBodyLength = data->m_encodedBodyLength;
195 m_decodedBodyLength = data->m_decodedBodyLength; 195 m_decodedBodyLength = data->m_decodedBodyLength;
196 m_downloadedFilePath = data->m_downloadedFilePath; 196 m_downloadedFilePath = data->m_downloadedFilePath;
197 m_downloadedFileHandle = data->m_downloadedFileHandle; 197 m_downloadedFileHandle = data->m_downloadedFileHandle;
198 198
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 data->m_multipartBoundary = m_multipartBoundary; 243 data->m_multipartBoundary = m_multipartBoundary;
244 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY; 244 data->m_wasFetchedViaSPDY = m_wasFetchedViaSPDY;
245 data->m_wasNpnNegotiated = m_wasNpnNegotiated; 245 data->m_wasNpnNegotiated = m_wasNpnNegotiated;
246 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; 246 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable;
247 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; 247 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy;
248 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; 248 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker;
249 data->m_wasFetchedViaForeignFetch = m_wasFetchedViaForeignFetch; 249 data->m_wasFetchedViaForeignFetch = m_wasFetchedViaForeignFetch;
250 data->m_wasFallbackRequiredByServiceWorker = 250 data->m_wasFallbackRequiredByServiceWorker =
251 m_wasFallbackRequiredByServiceWorker; 251 m_wasFallbackRequiredByServiceWorker;
252 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType; 252 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType;
253 data->m_originalURLViaServiceWorker = m_originalURLViaServiceWorker.copy(); 253 data->m_urlListViaServiceWorker.resize(m_urlListViaServiceWorker.size());
254 std::transform(m_urlListViaServiceWorker.begin(),
255 m_urlListViaServiceWorker.end(),
256 data->m_urlListViaServiceWorker.begin(),
257 [](const KURL& url) { return url.copy(); });
254 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); 258 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy();
255 data->m_responseTime = m_responseTime; 259 data->m_responseTime = m_responseTime;
256 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); 260 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy();
257 data->m_remotePort = m_remotePort; 261 data->m_remotePort = m_remotePort;
258 data->m_encodedDataLength = m_encodedDataLength; 262 data->m_encodedDataLength = m_encodedDataLength;
259 data->m_encodedBodyLength = m_encodedBodyLength; 263 data->m_encodedBodyLength = m_encodedBodyLength;
260 data->m_decodedBodyLength = m_decodedBodyLength; 264 data->m_decodedBodyLength = m_decodedBodyLength;
261 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); 265 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy();
262 data->m_downloadedFileHandle = m_downloadedFileHandle; 266 data->m_downloadedFileHandle = m_downloadedFileHandle;
263 267
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 596
593 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const { 597 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const {
594 return m_resourceLoadInfo.get(); 598 return m_resourceLoadInfo.get();
595 } 599 }
596 600
597 void ResourceResponse::setResourceLoadInfo( 601 void ResourceResponse::setResourceLoadInfo(
598 PassRefPtr<ResourceLoadInfo> loadInfo) { 602 PassRefPtr<ResourceLoadInfo> loadInfo) {
599 m_resourceLoadInfo = loadInfo; 603 m_resourceLoadInfo = loadInfo;
600 } 604 }
601 605
606 KURL ResourceResponse::originalURLViaServiceWorker() const {
607 if (m_urlListViaServiceWorker.isEmpty())
608 return KURL();
609 return m_urlListViaServiceWorker.back();
610 }
611
602 void ResourceResponse::setEncodedDataLength(long long value) { 612 void ResourceResponse::setEncodedDataLength(long long value) {
603 m_encodedDataLength = value; 613 m_encodedDataLength = value;
604 } 614 }
605 615
606 void ResourceResponse::addToEncodedBodyLength(long long value) { 616 void ResourceResponse::addToEncodedBodyLength(long long value) {
607 m_encodedBodyLength += value; 617 m_encodedBodyLength += value;
608 } 618 }
609 619
610 void ResourceResponse::addToDecodedBodyLength(long long value) { 620 void ResourceResponse::addToDecodedBodyLength(long long value) {
611 m_decodedBodyLength += value; 621 m_decodedBodyLength += value;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 if (a.resourceLoadTiming() != b.resourceLoadTiming()) 665 if (a.resourceLoadTiming() != b.resourceLoadTiming())
656 return false; 666 return false;
657 if (a.encodedBodyLength() != b.encodedBodyLength()) 667 if (a.encodedBodyLength() != b.encodedBodyLength())
658 return false; 668 return false;
659 if (a.decodedBodyLength() != b.decodedBodyLength()) 669 if (a.decodedBodyLength() != b.decodedBodyLength())
660 return false; 670 return false;
661 return true; 671 return true;
662 } 672 }
663 673
664 } // namespace blink 674 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698