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

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

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added bug for test re: Android Created 5 years, 9 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_storage_context.cc ('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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 NotifyFailure(net::ERR_FAILED); 327 NotifyFailure(net::ERR_FAILED);
328 return false; 328 return false;
329 } 329 }
330 330
331 // Compute the bytes to read for current item. 331 // Compute the bytes to read for current item.
332 int bytes_to_read = ComputeBytesToRead(); 332 int bytes_to_read = ComputeBytesToRead();
333 333
334 // If nothing to read for current item, advance to next item. 334 // If nothing to read for current item, advance to next item.
335 if (bytes_to_read == 0) { 335 if (bytes_to_read == 0) {
336 AdvanceItem(); 336 AdvanceItem();
337 return ReadItem(); 337 return true;
338 } 338 }
339 339
340 // Do the reading. 340 // Do the reading.
341 const BlobDataItem& item = *items.at(current_item_index_); 341 const BlobDataItem& item = *items.at(current_item_index_);
342 if (item.type() == DataElement::TYPE_BYTES) 342 if (item.type() == DataElement::TYPE_BYTES)
343 return ReadBytesItem(item, bytes_to_read); 343 return ReadBytesItem(item, bytes_to_read);
344 if (IsFileType(item.type())) { 344 if (IsFileType(item.type())) {
345 return ReadFileItem(GetFileStreamReader(current_item_index_), 345 return ReadFileItem(GetFileStreamReader(current_item_index_),
346 bytes_to_read); 346 bytes_to_read);
347 } 347 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 .release(); 601 .release();
602 break; 602 break;
603 default: 603 default:
604 NOTREACHED(); 604 NOTREACHED();
605 } 605 }
606 DCHECK(reader); 606 DCHECK(reader);
607 index_to_reader_[index] = reader; 607 index_to_reader_[index] = reader;
608 } 608 }
609 609
610 } // namespace storage 610 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_storage_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698