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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 break; | 254 break; |
255 case net::ERR_FILE_NOT_FOUND: | 255 case net::ERR_FILE_NOT_FOUND: |
256 status_code = net::HTTP_NOT_FOUND; | 256 status_code = net::HTTP_NOT_FOUND; |
257 break; | 257 break; |
258 case net::ERR_METHOD_NOT_SUPPORTED: | 258 case net::ERR_METHOD_NOT_SUPPORTED: |
259 status_code = net::HTTP_METHOD_NOT_ALLOWED; | 259 status_code = net::HTTP_METHOD_NOT_ALLOWED; |
260 break; | 260 break; |
261 case net::ERR_REQUEST_RANGE_NOT_SATISFIABLE: | 261 case net::ERR_REQUEST_RANGE_NOT_SATISFIABLE: |
262 status_code = net::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE; | 262 status_code = net::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE; |
263 break; | 263 break; |
| 264 case net::ERR_INVALID_ARGUMENT: |
| 265 status_code = net::HTTP_BAD_REQUEST; |
| 266 break; |
| 267 case net::ERR_CACHE_READ_FAILURE: |
| 268 case net::ERR_CACHE_CHECKSUM_READ_FAILURE: |
| 269 case net::ERR_UNEXPECTED: |
264 case net::ERR_FAILED: | 270 case net::ERR_FAILED: |
265 break; | 271 break; |
266 default: | 272 default: |
267 DCHECK(false); | 273 DCHECK(false) << "Error code not supported: " << error_code; |
268 break; | 274 break; |
269 } | 275 } |
270 HeadersCompleted(status_code); | 276 HeadersCompleted(status_code); |
271 } | 277 } |
272 | 278 |
273 void BlobURLRequestJob::HeadersCompleted(net::HttpStatusCode status_code) { | 279 void BlobURLRequestJob::HeadersCompleted(net::HttpStatusCode status_code) { |
274 std::string status("HTTP/1.1 "); | 280 std::string status("HTTP/1.1 "); |
275 status.append(base::IntToString(status_code)); | 281 status.append(base::IntToString(status_code)); |
276 status.append(" "); | 282 status.append(" "); |
277 status.append(net::GetHttpReasonPhrase(status_code)); | 283 status.append(net::GetHttpReasonPhrase(status_code)); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 321 |
316 response_info_.reset(new net::HttpResponseInfo()); | 322 response_info_.reset(new net::HttpResponseInfo()); |
317 response_info_->headers = headers; | 323 response_info_->headers = headers; |
318 if (blob_reader_) | 324 if (blob_reader_) |
319 response_info_->metadata = blob_reader_->side_data(); | 325 response_info_->metadata = blob_reader_->side_data(); |
320 | 326 |
321 NotifyHeadersComplete(); | 327 NotifyHeadersComplete(); |
322 } | 328 } |
323 | 329 |
324 } // namespace storage | 330 } // namespace storage |
OLD | NEW |