Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: storage/browser/blob/blob_url_request_job.cc

Issue 2346623002: [BlobStorage] Adding error code translations for cache storage metadata. (Closed)
Patch Set: moved to internal server error Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698