| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 explicit ResourceResponse(CrossThreadResourceResponseData*); | 132 explicit ResourceResponse(CrossThreadResourceResponseData*); |
| 133 | 133 |
| 134 // Gets a copy of the data suitable for passing to another thread. | 134 // Gets a copy of the data suitable for passing to another thread. |
| 135 std::unique_ptr<CrossThreadResourceResponseData> copyData() const; | 135 std::unique_ptr<CrossThreadResourceResponseData> copyData() const; |
| 136 | 136 |
| 137 ResourceResponse(); | 137 ResourceResponse(); |
| 138 ResourceResponse(const KURL&, | 138 ResourceResponse(const KURL&, |
| 139 const AtomicString& mimeType, | 139 const AtomicString& mimeType, |
| 140 long long expectedLength, | 140 long long expectedLength, |
| 141 const AtomicString& textEncodingName, | 141 const AtomicString& textEncodingName); |
| 142 const String& filename); | |
| 143 ResourceResponse(const ResourceResponse&); | 142 ResourceResponse(const ResourceResponse&); |
| 144 ResourceResponse& operator=(const ResourceResponse&); | 143 ResourceResponse& operator=(const ResourceResponse&); |
| 145 | 144 |
| 146 bool isNull() const { return m_isNull; } | 145 bool isNull() const { return m_isNull; } |
| 147 bool isHTTP() const; | 146 bool isHTTP() const; |
| 148 | 147 |
| 149 // The URL of the resource. Note that if a service worker responded to the | 148 // The URL of the resource. Note that if a service worker responded to the |
| 150 // request for this resource, it may have fetched an entirely different URL | 149 // request for this resource, it may have fetched an entirely different URL |
| 151 // and responded with that resource. wasFetchedViaServiceWorker() and | 150 // and responded with that resource. wasFetchedViaServiceWorker() and |
| 152 // originalURLViaServiceWorker() can be used to determine whether and how a | 151 // originalURLViaServiceWorker() can be used to determine whether and how a |
| (...skipping 13 matching lines...) Expand all Loading... |
| 166 | 165 |
| 167 const AtomicString& mimeType() const; | 166 const AtomicString& mimeType() const; |
| 168 void setMimeType(const AtomicString&); | 167 void setMimeType(const AtomicString&); |
| 169 | 168 |
| 170 long long expectedContentLength() const; | 169 long long expectedContentLength() const; |
| 171 void setExpectedContentLength(long long); | 170 void setExpectedContentLength(long long); |
| 172 | 171 |
| 173 const AtomicString& textEncodingName() const; | 172 const AtomicString& textEncodingName() const; |
| 174 void setTextEncodingName(const AtomicString&); | 173 void setTextEncodingName(const AtomicString&); |
| 175 | 174 |
| 176 // FIXME: Should compute this on the fly. | |
| 177 // There should not be a setter exposed, as suggested file name is determined | |
| 178 // based on other headers in a manner that WebCore does not necessarily know | |
| 179 // about. | |
| 180 const String& suggestedFilename() const; | |
| 181 void setSuggestedFilename(const String&); | |
| 182 | |
| 183 int httpStatusCode() const; | 175 int httpStatusCode() const; |
| 184 void setHTTPStatusCode(int); | 176 void setHTTPStatusCode(int); |
| 185 | 177 |
| 186 const AtomicString& httpStatusText() const; | 178 const AtomicString& httpStatusText() const; |
| 187 void setHTTPStatusText(const AtomicString&); | 179 void setHTTPStatusText(const AtomicString&); |
| 188 | 180 |
| 189 const AtomicString& httpHeaderField(const AtomicString& name) const; | 181 const AtomicString& httpHeaderField(const AtomicString& name) const; |
| 190 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value); | 182 void setHTTPHeaderField(const AtomicString& name, const AtomicString& value); |
| 191 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value); | 183 void addHTTPHeaderField(const AtomicString& name, const AtomicString& value); |
| 192 void clearHTTPHeaderField(const AtomicString& name); | 184 void clearHTTPHeaderField(const AtomicString& name); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // This method doesn't compare the all members. | 375 // This method doesn't compare the all members. |
| 384 static bool compare(const ResourceResponse&, const ResourceResponse&); | 376 static bool compare(const ResourceResponse&, const ResourceResponse&); |
| 385 | 377 |
| 386 private: | 378 private: |
| 387 void updateHeaderParsedState(const AtomicString& name); | 379 void updateHeaderParsedState(const AtomicString& name); |
| 388 | 380 |
| 389 KURL m_url; | 381 KURL m_url; |
| 390 AtomicString m_mimeType; | 382 AtomicString m_mimeType; |
| 391 long long m_expectedContentLength; | 383 long long m_expectedContentLength; |
| 392 AtomicString m_textEncodingName; | 384 AtomicString m_textEncodingName; |
| 393 String m_suggestedFilename; | |
| 394 int m_httpStatusCode; | 385 int m_httpStatusCode; |
| 395 AtomicString m_httpStatusText; | 386 AtomicString m_httpStatusText; |
| 396 HTTPHeaderMap m_httpHeaderFields; | 387 HTTPHeaderMap m_httpHeaderFields; |
| 397 time_t m_lastModifiedDate; | 388 time_t m_lastModifiedDate; |
| 398 bool m_wasCached : 1; | 389 bool m_wasCached : 1; |
| 399 unsigned m_connectionID; | 390 unsigned m_connectionID; |
| 400 bool m_connectionReused : 1; | 391 bool m_connectionReused : 1; |
| 401 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; | 392 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; |
| 402 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; | 393 RefPtr<ResourceLoadInfo> m_resourceLoadInfo; |
| 403 | 394 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 struct CrossThreadResourceResponseData { | 518 struct CrossThreadResourceResponseData { |
| 528 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); | 519 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); |
| 529 USING_FAST_MALLOC(CrossThreadResourceResponseData); | 520 USING_FAST_MALLOC(CrossThreadResourceResponseData); |
| 530 | 521 |
| 531 public: | 522 public: |
| 532 CrossThreadResourceResponseData() {} | 523 CrossThreadResourceResponseData() {} |
| 533 KURL m_url; | 524 KURL m_url; |
| 534 String m_mimeType; | 525 String m_mimeType; |
| 535 long long m_expectedContentLength; | 526 long long m_expectedContentLength; |
| 536 String m_textEncodingName; | 527 String m_textEncodingName; |
| 537 String m_suggestedFilename; | |
| 538 int m_httpStatusCode; | 528 int m_httpStatusCode; |
| 539 String m_httpStatusText; | 529 String m_httpStatusText; |
| 540 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders; | 530 std::unique_ptr<CrossThreadHTTPHeaderMapData> m_httpHeaders; |
| 541 time_t m_lastModifiedDate; | 531 time_t m_lastModifiedDate; |
| 542 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; | 532 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; |
| 543 bool m_hasMajorCertificateErrors; | 533 bool m_hasMajorCertificateErrors; |
| 544 ResourceResponse::SecurityStyle m_securityStyle; | 534 ResourceResponse::SecurityStyle m_securityStyle; |
| 545 ResourceResponse::SecurityDetails m_securityDetails; | 535 ResourceResponse::SecurityDetails m_securityDetails; |
| 546 // This is |certificate| from SecurityDetails since that structure should | 536 // This is |certificate| from SecurityDetails since that structure should |
| 547 // use an AtomicString but this temporary structure is sent across threads. | 537 // use an AtomicString but this temporary structure is sent across threads. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 566 long long m_encodedDataLength; | 556 long long m_encodedDataLength; |
| 567 long long m_encodedBodyLength; | 557 long long m_encodedBodyLength; |
| 568 long long m_decodedBodyLength; | 558 long long m_decodedBodyLength; |
| 569 String m_downloadedFilePath; | 559 String m_downloadedFilePath; |
| 570 RefPtr<BlobDataHandle> m_downloadedFileHandle; | 560 RefPtr<BlobDataHandle> m_downloadedFileHandle; |
| 571 }; | 561 }; |
| 572 | 562 |
| 573 } // namespace blink | 563 } // namespace blink |
| 574 | 564 |
| 575 #endif // ResourceResponse_h | 565 #endif // ResourceResponse_h |
| OLD | NEW |