| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "storage/browser/blob/blob_url_request_job.h" | 5 #include "storage/browser/blob/blob_url_request_job.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 NotifyFailure(net::ERR_FILE_NOT_FOUND); | 167 NotifyFailure(net::ERR_FILE_NOT_FOUND); |
| 168 return; | 168 return; |
| 169 } | 169 } |
| 170 | 170 |
| 171 TRACE_EVENT_ASYNC_BEGIN1("Blob", "BlobRequest::CountSize", this, "uuid", | 171 TRACE_EVENT_ASYNC_BEGIN1("Blob", "BlobRequest::CountSize", this, "uuid", |
| 172 blob_handle_->uuid()); | 172 blob_handle_->uuid()); |
| 173 BlobReader::Status size_status = blob_reader_->CalculateSize(base::Bind( | 173 BlobReader::Status size_status = blob_reader_->CalculateSize(base::Bind( |
| 174 &BlobURLRequestJob::DidCalculateSize, weak_factory_.GetWeakPtr())); | 174 &BlobURLRequestJob::DidCalculateSize, weak_factory_.GetWeakPtr())); |
| 175 switch (size_status) { | 175 switch (size_status) { |
| 176 case BlobReader::Status::NET_ERROR: | 176 case BlobReader::Status::NET_ERROR: |
| 177 LOG(INFO) << "Got a failure"; |
| 177 NotifyFailure(blob_reader_->net_error()); | 178 NotifyFailure(blob_reader_->net_error()); |
| 178 return; | 179 return; |
| 179 case BlobReader::Status::IO_PENDING: | 180 case BlobReader::Status::IO_PENDING: |
| 180 return; | 181 return; |
| 181 case BlobReader::Status::DONE: | 182 case BlobReader::Status::DONE: |
| 182 DidCalculateSize(net::OK); | 183 DidCalculateSize(net::OK); |
| 183 return; | 184 return; |
| 184 } | 185 } |
| 185 } | 186 } |
| 186 | 187 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 314 |
| 314 response_info_.reset(new net::HttpResponseInfo()); | 315 response_info_.reset(new net::HttpResponseInfo()); |
| 315 response_info_->headers = headers; | 316 response_info_->headers = headers; |
| 316 if (blob_reader_) | 317 if (blob_reader_) |
| 317 response_info_->metadata = blob_reader_->side_data(); | 318 response_info_->metadata = blob_reader_->side_data(); |
| 318 | 319 |
| 319 NotifyHeadersComplete(); | 320 NotifyHeadersComplete(); |
| 320 } | 321 } |
| 321 | 322 |
| 322 } // namespace storage | 323 } // namespace storage |
| OLD | NEW |