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

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

Issue 2670413002: Remove BlobURLRequestJob::GetResponseCode(). (Closed)
Patch Set: Created 3 years, 10 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 | « storage/browser/blob/blob_url_request_job.h ('k') | 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return false; 116 return false;
117 117
118 return response_info_->headers->GetMimeType(mime_type); 118 return response_info_->headers->GetMimeType(mime_type);
119 } 119 }
120 120
121 void BlobURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { 121 void BlobURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) {
122 if (response_info_) 122 if (response_info_)
123 *info = *response_info_; 123 *info = *response_info_;
124 } 124 }
125 125
126 int BlobURLRequestJob::GetResponseCode() const {
127 if (!response_info_)
128 return -1;
129
130 return response_info_->headers->response_code();
131 }
132
133 void BlobURLRequestJob::SetExtraRequestHeaders( 126 void BlobURLRequestJob::SetExtraRequestHeaders(
134 const net::HttpRequestHeaders& headers) { 127 const net::HttpRequestHeaders& headers) {
135 std::string range_header; 128 std::string range_header;
136 if (headers.GetHeader(net::HttpRequestHeaders::kRange, &range_header)) { 129 if (headers.GetHeader(net::HttpRequestHeaders::kRange, &range_header)) {
137 // We only care about "Range" header here. 130 // We only care about "Range" header here.
138 std::vector<net::HttpByteRange> ranges; 131 std::vector<net::HttpByteRange> ranges;
139 if (net::HttpUtil::ParseRangeHeader(range_header, &ranges)) { 132 if (net::HttpUtil::ParseRangeHeader(range_header, &ranges)) {
140 if (ranges.size() == 1) { 133 if (ranges.size() == 1) {
141 byte_range_set_ = true; 134 byte_range_set_ = true;
142 byte_range_ = ranges[0]; 135 byte_range_ = ranges[0];
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 314
322 response_info_.reset(new net::HttpResponseInfo()); 315 response_info_.reset(new net::HttpResponseInfo());
323 response_info_->headers = headers; 316 response_info_->headers = headers;
324 if (blob_reader_) 317 if (blob_reader_)
325 response_info_->metadata = blob_reader_->side_data(); 318 response_info_->metadata = blob_reader_->side_data();
326 319
327 NotifyHeadersComplete(); 320 NotifyHeadersComplete();
328 } 321 }
329 322
330 } // namespace storage 323 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_url_request_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698