| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
| 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
| 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // data to a file-handle directly in the browser process. We get | 364 // data to a file-handle directly in the browser process. We get |
| 365 // the file-path from the ResourceResponse directly instead of | 365 // the file-path from the ResourceResponse directly instead of |
| 366 // copying the bytes between the browser and the renderer. | 366 // copying the bytes between the browser and the renderer. |
| 367 response_blob_ = Blob::Create(CreateBlobDataHandleFromResponse()); | 367 response_blob_ = Blob::Create(CreateBlobDataHandleFromResponse()); |
| 368 } else { | 368 } else { |
| 369 std::unique_ptr<BlobData> blob_data = BlobData::Create(); | 369 std::unique_ptr<BlobData> blob_data = BlobData::Create(); |
| 370 size_t size = 0; | 370 size_t size = 0; |
| 371 if (binary_response_builder_ && binary_response_builder_->size()) { | 371 if (binary_response_builder_ && binary_response_builder_->size()) { |
| 372 size = binary_response_builder_->size(); | 372 size = binary_response_builder_->size(); |
| 373 blob_data->AppendBytes(binary_response_builder_->Data(), size); | 373 blob_data->AppendBytes(binary_response_builder_->Data(), size); |
| 374 blob_data->SetContentType(FinalResponseMIMETypeWithFallback().Lower()); | 374 blob_data->SetContentType( |
| 375 FinalResponseMIMETypeWithFallback().DeprecatedLower()); |
| 375 binary_response_builder_.Clear(); | 376 binary_response_builder_.Clear(); |
| 376 } | 377 } |
| 377 response_blob_ = | 378 response_blob_ = |
| 378 Blob::Create(BlobDataHandle::Create(std::move(blob_data), size)); | 379 Blob::Create(BlobDataHandle::Create(std::move(blob_data), size)); |
| 379 } | 380 } |
| 380 } | 381 } |
| 381 | 382 |
| 382 return response_blob_; | 383 return response_blob_; |
| 383 } | 384 } |
| 384 | 385 |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1610 DCHECK(downloading_to_file_); | 1611 DCHECK(downloading_to_file_); |
| 1611 std::unique_ptr<BlobData> blob_data = BlobData::Create(); | 1612 std::unique_ptr<BlobData> blob_data = BlobData::Create(); |
| 1612 String file_path = response_.DownloadedFilePath(); | 1613 String file_path = response_.DownloadedFilePath(); |
| 1613 // If we errored out or got no data, we return an empty handle. | 1614 // If we errored out or got no data, we return an empty handle. |
| 1614 if (!file_path.IsEmpty() && length_downloaded_to_file_) { | 1615 if (!file_path.IsEmpty() && length_downloaded_to_file_) { |
| 1615 blob_data->AppendFile(file_path, 0, length_downloaded_to_file_, | 1616 blob_data->AppendFile(file_path, 0, length_downloaded_to_file_, |
| 1616 InvalidFileTime()); | 1617 InvalidFileTime()); |
| 1617 // FIXME: finalResponseMIMETypeWithFallback() defaults to | 1618 // FIXME: finalResponseMIMETypeWithFallback() defaults to |
| 1618 // text/xml which may be incorrect. Replace it with | 1619 // text/xml which may be incorrect. Replace it with |
| 1619 // finalResponseMIMEType() after compatibility investigation. | 1620 // finalResponseMIMEType() after compatibility investigation. |
| 1620 blob_data->SetContentType(FinalResponseMIMETypeWithFallback().Lower()); | 1621 blob_data->SetContentType( |
| 1622 FinalResponseMIMETypeWithFallback().DeprecatedLower()); |
| 1621 } | 1623 } |
| 1622 return BlobDataHandle::Create(std::move(blob_data), | 1624 return BlobDataHandle::Create(std::move(blob_data), |
| 1623 length_downloaded_to_file_); | 1625 length_downloaded_to_file_); |
| 1624 } | 1626 } |
| 1625 | 1627 |
| 1626 void XMLHttpRequest::NotifyParserStopped() { | 1628 void XMLHttpRequest::NotifyParserStopped() { |
| 1627 ScopedEventDispatchProtect protect(&event_dispatch_recursion_level_); | 1629 ScopedEventDispatchProtect protect(&event_dispatch_recursion_level_); |
| 1628 | 1630 |
| 1629 // This should only be called when response document is parsed asynchronously. | 1631 // This should only be called when response document is parsed asynchronously. |
| 1630 DCHECK(response_document_parser_); | 1632 DCHECK(response_document_parser_); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 visitor->TraceWrappers(response_document_); | 1891 visitor->TraceWrappers(response_document_); |
| 1890 visitor->TraceWrappers(response_array_buffer_); | 1892 visitor->TraceWrappers(response_array_buffer_); |
| 1891 XMLHttpRequestEventTarget::TraceWrappers(visitor); | 1893 XMLHttpRequestEventTarget::TraceWrappers(visitor); |
| 1892 } | 1894 } |
| 1893 | 1895 |
| 1894 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { | 1896 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { |
| 1895 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); | 1897 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); |
| 1896 } | 1898 } |
| 1897 | 1899 |
| 1898 } // namespace blink | 1900 } // namespace blink |
| OLD | NEW |