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

Side by Side Diff: webkit/blob/blob_data.cc

Issue 10828252: Support FileSystem URL in File object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/blob/blob_data.h ('k') | webkit/blob/blob_storage_controller.h » ('j') | 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 "webkit/blob/blob_data.h" 5 #include "webkit/blob/blob_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 18 matching lines...) Expand all
29 items_.back().SetToFilePathRange(file_path, offset, length, 29 items_.back().SetToFilePathRange(file_path, offset, length,
30 expected_modification_time); 30 expected_modification_time);
31 } 31 }
32 32
33 void BlobData::AppendBlob(const GURL& blob_url, uint64 offset, uint64 length) { 33 void BlobData::AppendBlob(const GURL& blob_url, uint64 offset, uint64 length) {
34 DCHECK(length > 0); 34 DCHECK(length > 0);
35 items_.push_back(Item()); 35 items_.push_back(Item());
36 items_.back().SetToBlobUrlRange(blob_url, offset, length); 36 items_.back().SetToBlobUrlRange(blob_url, offset, length);
37 } 37 }
38 38
39 void BlobData::AppendFileSystemFile(
40 const GURL& url, uint64 offset,
41 uint64 length,
42 const base::Time& expected_modification_time) {
43 DCHECK(length > 0);
44 items_.push_back(Item());
45 items_.back().SetToFileSystemUrlRange(url, offset, length,
46 expected_modification_time);
47 }
48
39 int64 BlobData::GetMemoryUsage() const { 49 int64 BlobData::GetMemoryUsage() const {
40 int64 memory = 0; 50 int64 memory = 0;
41 for (std::vector<Item>::const_iterator iter = items_.begin(); 51 for (std::vector<Item>::const_iterator iter = items_.begin();
42 iter != items_.end(); ++iter) { 52 iter != items_.end(); ++iter) {
43 if (iter->type() == Item::TYPE_BYTES) 53 if (iter->type() == Item::TYPE_BYTES)
44 memory += iter->length(); 54 memory += iter->length();
45 } 55 }
46 return memory; 56 return memory;
47 } 57 }
48 58
49 } // namespace webkit_blob 59 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/blob/blob_data.h ('k') | webkit/blob/blob_storage_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698