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

Side by Side Diff: storage/browser/blob/blob_data_item.h

Issue 1288373002: [BlobAsync] Patch 2: Common Constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async1
Patch Set: comments Created 5 years, 1 month 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_data_builder.cc ('k') | storage/browser/blob/blob_data_item.cc » ('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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 #ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_
6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ 6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_
7 7
8 #include <ostream>
9 #include <string>
10
8 #include "base/basictypes.h" 11 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
10 #include "storage/browser/storage_browser_export.h" 13 #include "storage/browser/storage_browser_export.h"
11 #include "storage/common/data_element.h" 14 #include "storage/common/data_element.h"
12 15
13 namespace disk_cache { 16 namespace disk_cache {
14 class Entry; 17 class Entry;
15 } 18 }
16 19
17 namespace storage { 20 namespace storage {
(...skipping 25 matching lines...) Expand all
43 const base::FilePath& path() const { return item_->path(); } 46 const base::FilePath& path() const { return item_->path(); }
44 const GURL& filesystem_url() const { return item_->filesystem_url(); } 47 const GURL& filesystem_url() const { return item_->filesystem_url(); }
45 const std::string& blob_uuid() const { return item_->blob_uuid(); } 48 const std::string& blob_uuid() const { return item_->blob_uuid(); }
46 uint64 offset() const { return item_->offset(); } 49 uint64 offset() const { return item_->offset(); }
47 uint64 length() const { return item_->length(); } 50 uint64 length() const { return item_->length(); }
48 const base::Time& expected_modification_time() const { 51 const base::Time& expected_modification_time() const {
49 return item_->expected_modification_time(); 52 return item_->expected_modification_time();
50 } 53 }
51 const DataElement& data_element() const { return *item_; } 54 const DataElement& data_element() const { return *item_; }
52 const DataElement* data_element_ptr() const { return item_.get(); } 55 const DataElement* data_element_ptr() const { return item_.get(); }
56 DataElement* data_element_ptr() { return item_.get(); }
53 57
54 disk_cache::Entry* disk_cache_entry() const { return disk_cache_entry_; } 58 disk_cache::Entry* disk_cache_entry() const { return disk_cache_entry_; }
55 int disk_cache_stream_index() const { return disk_cache_stream_index_; } 59 int disk_cache_stream_index() const { return disk_cache_stream_index_; }
56 60
57 private: 61 private:
58 friend class BlobDataBuilder; 62 friend class BlobDataBuilder;
59 friend class BlobStorageContext; 63 friend class BlobStorageContext;
60 friend class base::RefCounted<BlobDataItem>; 64 friend class base::RefCounted<BlobDataItem>;
65 friend STORAGE_EXPORT void PrintTo(const BlobDataItem& x, ::std::ostream* os);
61 66
62 BlobDataItem(scoped_ptr<DataElement> item); 67 explicit BlobDataItem(scoped_ptr<DataElement> item);
63 BlobDataItem(scoped_ptr<DataElement> item, 68 BlobDataItem(scoped_ptr<DataElement> item,
64 const scoped_refptr<DataHandle>& data_handle); 69 const scoped_refptr<DataHandle>& data_handle);
65 BlobDataItem(scoped_ptr<DataElement> item, 70 BlobDataItem(scoped_ptr<DataElement> item,
66 const scoped_refptr<DataHandle>& data_handle, 71 const scoped_refptr<DataHandle>& data_handle,
67 disk_cache::Entry* entry, 72 disk_cache::Entry* entry,
68 int disk_cache_stream_index_); 73 int disk_cache_stream_index_);
69 virtual ~BlobDataItem(); 74 virtual ~BlobDataItem();
70 75
71 scoped_ptr<DataElement> item_; 76 scoped_ptr<DataElement> item_;
72 scoped_refptr<DataHandle> data_handle_; 77 scoped_refptr<DataHandle> data_handle_;
(...skipping 12 matching lines...) Expand all
85 } 90 }
86 91
87 inline bool operator!=(const BlobDataItem& a, const BlobDataItem& b) { 92 inline bool operator!=(const BlobDataItem& a, const BlobDataItem& b) {
88 return !(a == b); 93 return !(a == b);
89 } 94 }
90 #endif // defined(UNIT_TEST) 95 #endif // defined(UNIT_TEST)
91 96
92 } // namespace storage 97 } // namespace storage
93 98
94 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ 99 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_data_builder.cc ('k') | storage/browser/blob/blob_data_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698