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_data_item.h

Issue 1528233004: [Blob] Blob paging to disk patch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-disk1
Patch Set: Created 5 years 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> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 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(); } 56 DataElement* data_element_ptr() { return item_.get(); }
57 57
58 disk_cache::Entry* disk_cache_entry() const { return disk_cache_entry_; } 58 disk_cache::Entry* disk_cache_entry() const { return disk_cache_entry_; }
59 int disk_cache_stream_index() const { return disk_cache_stream_index_; } 59 int disk_cache_stream_index() const { return disk_cache_stream_index_; }
60 60
61 private: 61 private:
62 friend class BlobDataBuilder; 62 friend class BlobDataBuilder;
63 friend class BlobStorageContext; 63 friend class BlobStorageContext;
64 friend class base::RefCounted<BlobDataItem>; 64 friend class base::RefCounted<BlobDataItem>;
65 friend class BlobMemoryController;
65 friend STORAGE_EXPORT void PrintTo(const BlobDataItem& x, ::std::ostream* os); 66 friend STORAGE_EXPORT void PrintTo(const BlobDataItem& x, ::std::ostream* os);
66 67
67 explicit BlobDataItem(scoped_ptr<DataElement> item); 68 explicit BlobDataItem(scoped_ptr<DataElement> item);
68 BlobDataItem(scoped_ptr<DataElement> item, 69 BlobDataItem(scoped_ptr<DataElement> item,
69 const scoped_refptr<DataHandle>& data_handle); 70 const scoped_refptr<DataHandle>& data_handle);
70 BlobDataItem(scoped_ptr<DataElement> item, 71 BlobDataItem(scoped_ptr<DataElement> item,
71 const scoped_refptr<DataHandle>& data_handle, 72 const scoped_refptr<DataHandle>& data_handle,
72 disk_cache::Entry* entry, 73 disk_cache::Entry* entry,
73 int disk_cache_stream_index_); 74 int disk_cache_stream_index_);
74 virtual ~BlobDataItem(); 75 virtual ~BlobDataItem();
75 76
76 scoped_ptr<DataElement> item_; 77 scoped_ptr<DataElement> item_;
77 scoped_refptr<DataHandle> data_handle_; 78 scoped_refptr<DataHandle> data_handle_;
78 79
79 // This naked pointer is safe because the scope is protected by the DataHandle 80 // This naked pointer is safe because the scope is protected by the DataHandle
80 // instance for disk cache entries during the lifetime of this BlobDataItem. 81 // instance for disk cache entries during the lifetime of this BlobDataItem.
81 disk_cache::Entry* disk_cache_entry_; 82 disk_cache::Entry* disk_cache_entry_;
82 int disk_cache_stream_index_; // For TYPE_DISK_CACHE_ENTRY. 83 int disk_cache_stream_index_; // For TYPE_DISK_CACHE_ENTRY.
84
85 // This is a temporary file from the Blob system, and we need to call
86 // DecrementTempFileRefCount on the BlobMemoryController when this item
87 // is destructed.
88 bool temp_file_;
83 }; 89 };
84 90
85 STORAGE_EXPORT bool operator==(const BlobDataItem& a, const BlobDataItem& b); 91 STORAGE_EXPORT bool operator==(const BlobDataItem& a, const BlobDataItem& b);
86 STORAGE_EXPORT bool operator!=(const BlobDataItem& a, const BlobDataItem& b); 92 STORAGE_EXPORT bool operator!=(const BlobDataItem& a, const BlobDataItem& b);
87 93
88 } // namespace storage 94 } // namespace storage
89 95
90 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ 96 #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