| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 , m_wasFetchedViaSPDY(false) | 97 , m_wasFetchedViaSPDY(false) |
| 98 , m_wasNpnNegotiated(false) | 98 , m_wasNpnNegotiated(false) |
| 99 , m_wasAlternateProtocolAvailable(false) | 99 , m_wasAlternateProtocolAvailable(false) |
| 100 , m_wasFetchedViaProxy(false) | 100 , m_wasFetchedViaProxy(false) |
| 101 , m_wasFetchedViaServiceWorker(false) | 101 , m_wasFetchedViaServiceWorker(false) |
| 102 , m_wasFetchedViaForeignFetch(false) | 102 , m_wasFetchedViaForeignFetch(false) |
| 103 , m_wasFallbackRequiredByServiceWorker(false) | 103 , m_wasFallbackRequiredByServiceWorker(false) |
| 104 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) | 104 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) |
| 105 , m_responseTime(0) | 105 , m_responseTime(0) |
| 106 , m_remotePort(0) | 106 , m_remotePort(0) |
| 107 , m_encodedDataLength(0) |
| 107 , m_encodedBodyLength(0) | 108 , m_encodedBodyLength(0) |
| 108 , m_decodedBodyLength(0) | 109 , m_decodedBodyLength(0) |
| 109 { | 110 { |
| 110 } | 111 } |
| 111 | 112 |
| 112 ResourceResponse::ResourceResponse(const KURL& url, const AtomicString& mimeType
, long long expectedLength, const AtomicString& textEncodingName, const String&
filename) | 113 ResourceResponse::ResourceResponse(const KURL& url, const AtomicString& mimeType
, long long expectedLength, const AtomicString& textEncodingName, const String&
filename) |
| 113 : m_url(url) | 114 : m_url(url) |
| 114 , m_mimeType(mimeType) | 115 , m_mimeType(mimeType) |
| 115 , m_expectedContentLength(expectedLength) | 116 , m_expectedContentLength(expectedLength) |
| 116 , m_textEncodingName(textEncodingName) | 117 , m_textEncodingName(textEncodingName) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 136 , m_wasFetchedViaSPDY(false) | 137 , m_wasFetchedViaSPDY(false) |
| 137 , m_wasNpnNegotiated(false) | 138 , m_wasNpnNegotiated(false) |
| 138 , m_wasAlternateProtocolAvailable(false) | 139 , m_wasAlternateProtocolAvailable(false) |
| 139 , m_wasFetchedViaProxy(false) | 140 , m_wasFetchedViaProxy(false) |
| 140 , m_wasFetchedViaServiceWorker(false) | 141 , m_wasFetchedViaServiceWorker(false) |
| 141 , m_wasFetchedViaForeignFetch(false) | 142 , m_wasFetchedViaForeignFetch(false) |
| 142 , m_wasFallbackRequiredByServiceWorker(false) | 143 , m_wasFallbackRequiredByServiceWorker(false) |
| 143 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) | 144 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) |
| 144 , m_responseTime(0) | 145 , m_responseTime(0) |
| 145 , m_remotePort(0) | 146 , m_remotePort(0) |
| 147 , m_encodedDataLength(0) |
| 146 , m_encodedBodyLength(0) | 148 , m_encodedBodyLength(0) |
| 147 , m_decodedBodyLength(0) | 149 , m_decodedBodyLength(0) |
| 148 { | 150 { |
| 149 } | 151 } |
| 150 | 152 |
| 151 ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data) | 153 ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data) |
| 152 : ResourceResponse() | 154 : ResourceResponse() |
| 153 { | 155 { |
| 154 setURL(data->m_url); | 156 setURL(data->m_url); |
| 155 setMimeType(AtomicString(data->m_mimeType)); | 157 setMimeType(AtomicString(data->m_mimeType)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; | 190 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; |
| 189 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; | 191 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; |
| 190 m_wasFetchedViaForeignFetch = data->m_wasFetchedViaForeignFetch; | 192 m_wasFetchedViaForeignFetch = data->m_wasFetchedViaForeignFetch; |
| 191 m_wasFallbackRequiredByServiceWorker = data->m_wasFallbackRequiredByServiceW
orker; | 193 m_wasFallbackRequiredByServiceWorker = data->m_wasFallbackRequiredByServiceW
orker; |
| 192 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType; | 194 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType; |
| 193 m_originalURLViaServiceWorker = data->m_originalURLViaServiceWorker; | 195 m_originalURLViaServiceWorker = data->m_originalURLViaServiceWorker; |
| 194 m_cacheStorageCacheName = data->m_cacheStorageCacheName; | 196 m_cacheStorageCacheName = data->m_cacheStorageCacheName; |
| 195 m_responseTime = data->m_responseTime; | 197 m_responseTime = data->m_responseTime; |
| 196 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress); | 198 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress); |
| 197 m_remotePort = data->m_remotePort; | 199 m_remotePort = data->m_remotePort; |
| 200 m_encodedDataLength = data->m_encodedDataLength; |
| 198 m_encodedBodyLength = data->m_encodedBodyLength; | 201 m_encodedBodyLength = data->m_encodedBodyLength; |
| 199 m_decodedBodyLength = data->m_decodedBodyLength; | 202 m_decodedBodyLength = data->m_decodedBodyLength; |
| 200 m_downloadedFilePath = data->m_downloadedFilePath; | 203 m_downloadedFilePath = data->m_downloadedFilePath; |
| 201 m_downloadedFileHandle = data->m_downloadedFileHandle; | 204 m_downloadedFileHandle = data->m_downloadedFileHandle; |
| 202 | 205 |
| 203 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support | 206 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support |
| 204 // whatever values may be present in the opaque m_extraData structure. | 207 // whatever values may be present in the opaque m_extraData structure. |
| 205 } | 208 } |
| 206 | 209 |
| 207 ResourceResponse::ResourceResponse(const ResourceResponse&) = default; | 210 ResourceResponse::ResourceResponse(const ResourceResponse&) = default; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; | 249 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; |
| 247 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; | 250 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; |
| 248 data->m_wasFetchedViaForeignFetch = m_wasFetchedViaForeignFetch; | 251 data->m_wasFetchedViaForeignFetch = m_wasFetchedViaForeignFetch; |
| 249 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; | 252 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; |
| 250 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType; | 253 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType; |
| 251 data->m_originalURLViaServiceWorker = m_originalURLViaServiceWorker.copy(); | 254 data->m_originalURLViaServiceWorker = m_originalURLViaServiceWorker.copy(); |
| 252 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); | 255 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); |
| 253 data->m_responseTime = m_responseTime; | 256 data->m_responseTime = m_responseTime; |
| 254 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); | 257 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); |
| 255 data->m_remotePort = m_remotePort; | 258 data->m_remotePort = m_remotePort; |
| 259 data->m_encodedDataLength = m_encodedDataLength; |
| 256 data->m_encodedBodyLength = m_encodedBodyLength; | 260 data->m_encodedBodyLength = m_encodedBodyLength; |
| 257 data->m_decodedBodyLength = m_decodedBodyLength; | 261 data->m_decodedBodyLength = m_decodedBodyLength; |
| 258 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); | 262 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); |
| 259 data->m_downloadedFileHandle = m_downloadedFileHandle; | 263 data->m_downloadedFileHandle = m_downloadedFileHandle; |
| 260 | 264 |
| 261 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support | 265 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support |
| 262 // whatever values may be present in the opaque m_extraData structure. | 266 // whatever values may be present in the opaque m_extraData structure. |
| 263 | 267 |
| 264 return data; | 268 return data; |
| 265 } | 269 } |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const | 602 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const |
| 599 { | 603 { |
| 600 return m_resourceLoadInfo.get(); | 604 return m_resourceLoadInfo.get(); |
| 601 } | 605 } |
| 602 | 606 |
| 603 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) | 607 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) |
| 604 { | 608 { |
| 605 m_resourceLoadInfo = loadInfo; | 609 m_resourceLoadInfo = loadInfo; |
| 606 } | 610 } |
| 607 | 611 |
| 608 void ResourceResponse::addToEncodedBodyLength(int value) | 612 void ResourceResponse::addToEncodedDataLength(long long value) |
| 613 { |
| 614 m_encodedDataLength += value; |
| 615 } |
| 616 |
| 617 void ResourceResponse::addToEncodedBodyLength(long long value) |
| 609 { | 618 { |
| 610 m_encodedBodyLength += value; | 619 m_encodedBodyLength += value; |
| 611 } | 620 } |
| 612 | 621 |
| 613 void ResourceResponse::addToDecodedBodyLength(int value) | 622 void ResourceResponse::addToDecodedBodyLength(long long value) |
| 614 { | 623 { |
| 615 m_decodedBodyLength += value; | 624 m_decodedBodyLength += value; |
| 616 } | 625 } |
| 617 | 626 |
| 618 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath) | 627 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath) |
| 619 { | 628 { |
| 620 m_downloadedFilePath = downloadedFilePath; | 629 m_downloadedFilePath = downloadedFilePath; |
| 621 if (m_downloadedFilePath.isEmpty()) { | 630 if (m_downloadedFilePath.isEmpty()) { |
| 622 m_downloadedFileHandle.clear(); | 631 m_downloadedFileHandle.clear(); |
| 623 return; | 632 return; |
| 624 } | 633 } |
| 625 std::unique_ptr<BlobData> blobData = BlobData::create(); | 634 std::unique_ptr<BlobData> blobData = BlobData::create(); |
| 626 blobData->appendFile(m_downloadedFilePath); | 635 blobData->appendFile(m_downloadedFilePath); |
| 627 blobData->detachFromCurrentThread(); | 636 blobData->detachFromCurrentThread(); |
| 628 m_downloadedFileHandle = BlobDataHandle::create(std::move(blobData), -1); | 637 m_downloadedFileHandle = BlobDataHandle::create(std::move(blobData), -1); |
| 629 } | 638 } |
| 630 | 639 |
| 640 void ResourceResponse::appendRedirectResponse(const ResourceResponse& response) |
| 641 { |
| 642 m_redirectResponses.append(response); |
| 643 } |
| 644 |
| 631 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse
& b) | 645 bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse
& b) |
| 632 { | 646 { |
| 633 if (a.isNull() != b.isNull()) | 647 if (a.isNull() != b.isNull()) |
| 634 return false; | 648 return false; |
| 635 if (a.url() != b.url()) | 649 if (a.url() != b.url()) |
| 636 return false; | 650 return false; |
| 637 if (a.mimeType() != b.mimeType()) | 651 if (a.mimeType() != b.mimeType()) |
| 638 return false; | 652 return false; |
| 639 if (a.expectedContentLength() != b.expectedContentLength()) | 653 if (a.expectedContentLength() != b.expectedContentLength()) |
| 640 return false; | 654 return false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 653 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 667 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
| 654 return false; | 668 return false; |
| 655 if (a.encodedBodyLength() != b.encodedBodyLength()) | 669 if (a.encodedBodyLength() != b.encodedBodyLength()) |
| 656 return false; | 670 return false; |
| 657 if (a.decodedBodyLength() != b.decodedBodyLength()) | 671 if (a.decodedBodyLength() != b.decodedBodyLength()) |
| 658 return false; | 672 return false; |
| 659 return true; | 673 return true; |
| 660 } | 674 } |
| 661 | 675 |
| 662 } // namespace blink | 676 } // namespace blink |
| OLD | NEW |