| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 , m_appCacheID(0) | 55 , m_appCacheID(0) |
| 56 , m_wasFetchedViaSPDY(false) | 56 , m_wasFetchedViaSPDY(false) |
| 57 , m_wasNpnNegotiated(false) | 57 , m_wasNpnNegotiated(false) |
| 58 , m_wasAlternateProtocolAvailable(false) | 58 , m_wasAlternateProtocolAvailable(false) |
| 59 , m_wasFetchedViaProxy(false) | 59 , m_wasFetchedViaProxy(false) |
| 60 , m_wasFetchedViaServiceWorker(false) | 60 , m_wasFetchedViaServiceWorker(false) |
| 61 , m_wasFallbackRequiredByServiceWorker(false) | 61 , m_wasFallbackRequiredByServiceWorker(false) |
| 62 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) | 62 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) |
| 63 , m_responseTime(0) | 63 , m_responseTime(0) |
| 64 , m_remotePort(0) | 64 , m_remotePort(0) |
| 65 , m_encodedBodyLength(0) |
| 66 , m_responseBodySize(0) |
| 65 { | 67 { |
| 66 } | 68 } |
| 67 | 69 |
| 68 ResourceResponse::ResourceResponse(const KURL& url, const AtomicString& mimeType
, long long expectedLength, const AtomicString& textEncodingName, const String&
filename) | 70 ResourceResponse::ResourceResponse(const KURL& url, const AtomicString& mimeType
, long long expectedLength, const AtomicString& textEncodingName, const String&
filename) |
| 69 : m_url(url) | 71 : m_url(url) |
| 70 , m_mimeType(mimeType) | 72 , m_mimeType(mimeType) |
| 71 , m_expectedContentLength(expectedLength) | 73 , m_expectedContentLength(expectedLength) |
| 72 , m_textEncodingName(textEncodingName) | 74 , m_textEncodingName(textEncodingName) |
| 73 , m_suggestedFilename(filename) | 75 , m_suggestedFilename(filename) |
| 74 , m_httpStatusCode(0) | 76 , m_httpStatusCode(0) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 91 , m_appCacheID(0) | 93 , m_appCacheID(0) |
| 92 , m_wasFetchedViaSPDY(false) | 94 , m_wasFetchedViaSPDY(false) |
| 93 , m_wasNpnNegotiated(false) | 95 , m_wasNpnNegotiated(false) |
| 94 , m_wasAlternateProtocolAvailable(false) | 96 , m_wasAlternateProtocolAvailable(false) |
| 95 , m_wasFetchedViaProxy(false) | 97 , m_wasFetchedViaProxy(false) |
| 96 , m_wasFetchedViaServiceWorker(false) | 98 , m_wasFetchedViaServiceWorker(false) |
| 97 , m_wasFallbackRequiredByServiceWorker(false) | 99 , m_wasFallbackRequiredByServiceWorker(false) |
| 98 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) | 100 , m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault) |
| 99 , m_responseTime(0) | 101 , m_responseTime(0) |
| 100 , m_remotePort(0) | 102 , m_remotePort(0) |
| 103 , m_encodedBodyLength(0) |
| 104 , m_responseBodySize(0) |
| 101 { | 105 { |
| 102 } | 106 } |
| 103 | 107 |
| 104 ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data) | 108 ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data) |
| 105 : ResourceResponse() | 109 : ResourceResponse() |
| 106 { | 110 { |
| 107 setURL(data->m_url); | 111 setURL(data->m_url); |
| 108 setMimeType(AtomicString(data->m_mimeType)); | 112 setMimeType(AtomicString(data->m_mimeType)); |
| 109 setExpectedContentLength(data->m_expectedContentLength); | 113 setExpectedContentLength(data->m_expectedContentLength); |
| 110 setTextEncodingName(AtomicString(data->m_textEncodingName)); | 114 setTextEncodingName(AtomicString(data->m_textEncodingName)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 136 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; | 140 m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable; |
| 137 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; | 141 m_wasFetchedViaProxy = data->m_wasFetchedViaProxy; |
| 138 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; | 142 m_wasFetchedViaServiceWorker = data->m_wasFetchedViaServiceWorker; |
| 139 m_wasFallbackRequiredByServiceWorker = data->m_wasFallbackRequiredByServiceW
orker; | 143 m_wasFallbackRequiredByServiceWorker = data->m_wasFallbackRequiredByServiceW
orker; |
| 140 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType; | 144 m_serviceWorkerResponseType = data->m_serviceWorkerResponseType; |
| 141 m_originalURLViaServiceWorker = data->m_originalURLViaServiceWorker; | 145 m_originalURLViaServiceWorker = data->m_originalURLViaServiceWorker; |
| 142 m_cacheStorageCacheName = data->m_cacheStorageCacheName; | 146 m_cacheStorageCacheName = data->m_cacheStorageCacheName; |
| 143 m_responseTime = data->m_responseTime; | 147 m_responseTime = data->m_responseTime; |
| 144 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress); | 148 m_remoteIPAddress = AtomicString(data->m_remoteIPAddress); |
| 145 m_remotePort = data->m_remotePort; | 149 m_remotePort = data->m_remotePort; |
| 150 m_encodedBodyLength = data->m_encodedBodyLength; |
| 151 m_responseBodySize = data->m_responseBodySize; |
| 146 m_downloadedFilePath = data->m_downloadedFilePath; | 152 m_downloadedFilePath = data->m_downloadedFilePath; |
| 147 m_downloadedFileHandle = data->m_downloadedFileHandle; | 153 m_downloadedFileHandle = data->m_downloadedFileHandle; |
| 148 | 154 |
| 149 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support | 155 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support |
| 150 // whatever values may be present in the opaque m_extraData structure. | 156 // whatever values may be present in the opaque m_extraData structure. |
| 151 } | 157 } |
| 152 | 158 |
| 153 std::unique_ptr<CrossThreadResourceResponseData> ResourceResponse::copyData() co
nst | 159 std::unique_ptr<CrossThreadResourceResponseData> ResourceResponse::copyData() co
nst |
| 154 { | 160 { |
| 155 std::unique_ptr<CrossThreadResourceResponseData> data = wrapUnique(new Cross
ThreadResourceResponseData); | 161 std::unique_ptr<CrossThreadResourceResponseData> data = wrapUnique(new Cross
ThreadResourceResponseData); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 184 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; | 190 data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable; |
| 185 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; | 191 data->m_wasFetchedViaProxy = m_wasFetchedViaProxy; |
| 186 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; | 192 data->m_wasFetchedViaServiceWorker = m_wasFetchedViaServiceWorker; |
| 187 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; | 193 data->m_wasFallbackRequiredByServiceWorker = m_wasFallbackRequiredByServiceW
orker; |
| 188 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType; | 194 data->m_serviceWorkerResponseType = m_serviceWorkerResponseType; |
| 189 data->m_originalURLViaServiceWorker = m_originalURLViaServiceWorker.copy(); | 195 data->m_originalURLViaServiceWorker = m_originalURLViaServiceWorker.copy(); |
| 190 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); | 196 data->m_cacheStorageCacheName = cacheStorageCacheName().isolatedCopy(); |
| 191 data->m_responseTime = m_responseTime; | 197 data->m_responseTime = m_responseTime; |
| 192 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); | 198 data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy(); |
| 193 data->m_remotePort = m_remotePort; | 199 data->m_remotePort = m_remotePort; |
| 200 data->m_encodedBodyLength = m_encodedBodyLength; |
| 201 data->m_responseBodySize = m_responseBodySize; |
| 194 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); | 202 data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy(); |
| 195 data->m_downloadedFileHandle = m_downloadedFileHandle; | 203 data->m_downloadedFileHandle = m_downloadedFileHandle; |
| 196 | 204 |
| 197 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support | 205 // Bug https://bugs.webkit.org/show_bug.cgi?id=60397 this doesn't support |
| 198 // whatever values may be present in the opaque m_extraData structure. | 206 // whatever values may be present in the opaque m_extraData structure. |
| 199 | 207 |
| 200 return data; | 208 return data; |
| 201 } | 209 } |
| 202 | 210 |
| 203 bool ResourceResponse::isHTTP() const | 211 bool ResourceResponse::isHTTP() const |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const | 538 PassRefPtr<ResourceLoadInfo> ResourceResponse::resourceLoadInfo() const |
| 531 { | 539 { |
| 532 return m_resourceLoadInfo.get(); | 540 return m_resourceLoadInfo.get(); |
| 533 } | 541 } |
| 534 | 542 |
| 535 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) | 543 void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
) |
| 536 { | 544 { |
| 537 m_resourceLoadInfo = loadInfo; | 545 m_resourceLoadInfo = loadInfo; |
| 538 } | 546 } |
| 539 | 547 |
| 548 void ResourceResponse::addToEncodedBodyLength(int value) |
| 549 { |
| 550 m_encodedBodyLength += value; |
| 551 } |
| 552 |
| 553 void ResourceResponse::addToResponseBodySize(int value) |
| 554 { |
| 555 m_responseBodySize += value; |
| 556 } |
| 557 |
| 540 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath) | 558 void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath) |
| 541 { | 559 { |
| 542 m_downloadedFilePath = downloadedFilePath; | 560 m_downloadedFilePath = downloadedFilePath; |
| 543 if (m_downloadedFilePath.isEmpty()) { | 561 if (m_downloadedFilePath.isEmpty()) { |
| 544 m_downloadedFileHandle.clear(); | 562 m_downloadedFileHandle.clear(); |
| 545 return; | 563 return; |
| 546 } | 564 } |
| 547 std::unique_ptr<BlobData> blobData = BlobData::create(); | 565 std::unique_ptr<BlobData> blobData = BlobData::create(); |
| 548 blobData->appendFile(m_downloadedFilePath); | 566 blobData->appendFile(m_downloadedFilePath); |
| 549 blobData->detachFromCurrentThread(); | 567 blobData->detachFromCurrentThread(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 567 if (a.httpStatusCode() != b.httpStatusCode()) | 585 if (a.httpStatusCode() != b.httpStatusCode()) |
| 568 return false; | 586 return false; |
| 569 if (a.httpStatusText() != b.httpStatusText()) | 587 if (a.httpStatusText() != b.httpStatusText()) |
| 570 return false; | 588 return false; |
| 571 if (a.httpHeaderFields() != b.httpHeaderFields()) | 589 if (a.httpHeaderFields() != b.httpHeaderFields()) |
| 572 return false; | 590 return false; |
| 573 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin
g() == *b.resourceLoadTiming()) | 591 if (a.resourceLoadTiming() && b.resourceLoadTiming() && *a.resourceLoadTimin
g() == *b.resourceLoadTiming()) |
| 574 return true; | 592 return true; |
| 575 if (a.resourceLoadTiming() != b.resourceLoadTiming()) | 593 if (a.resourceLoadTiming() != b.resourceLoadTiming()) |
| 576 return false; | 594 return false; |
| 595 if (a.encodedBodyLength() != b.encodedBodyLength()) |
| 596 return false; |
| 597 if (a.responseBodySize() != b.responseBodySize()) |
| 598 return false; |
| 577 return true; | 599 return true; |
| 578 } | 600 } |
| 579 | 601 |
| 580 } // namespace blink | 602 } // namespace blink |
| OLD | NEW |