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

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

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finished comments, added new pending enum state Created 4 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef STORAGE_BROWSER_BLOB_BLOB_SLICE_H_
6 #define STORAGE_BROWSER_BLOB_BLOB_SLICE_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include <string>
12 #include <vector>
13
14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h"
16 #include "storage/browser/storage_browser_export.h"
17
18 namespace storage {
19 class InternalBlobData;
20 class ShareableBlobDataItem;
21
22 // Here we try to handle the cases where the slice partially intersects with
23 // either a data item (which we want to copy instead of share when it's partial
24 // intersection) or a 'future file item', which isn't populated yet in the
25 // source blob so we need to copy it over later when it's completed.
kinuko 2016/07/17 16:15:47 Is this used only in BlobFlattener other than in i
dmurph 2016/07/19 02:26:28 If you're ok with having 5 output arguments then s
michaeln 2016/08/15 22:44:42 I feel similarly about "BlobFlatterner". The addit
26 struct STORAGE_EXPORT BlobSlice {
27 BlobSlice(const InternalBlobData& source,
28 uint64_t slice_offset,
29 uint64_t slice_size);
30 ~BlobSlice();
31
32 // The is the amount of memory we'll be copying from the source blob, as we
33 // can't share a partial data item. This can happen on the first and/or last
34 // item our slice is intersecting.
35 size_t copying_memory_size = 0;
36
37 size_t first_item_slice_offset = 0;
38 // Populated if our first slice item is a temporary item that we'll copy to
39 // later from this |first_source_item|, at offset |first_item_slice_offset|.
40 scoped_refptr<ShareableBlobDataItem> first_source_item;
41 // Populated if our last slice item is a temporary item that we'll copy to
42 // later from this |last_source_item|.
43 scoped_refptr<ShareableBlobDataItem> last_source_item;
44
45 std::vector<scoped_refptr<ShareableBlobDataItem>> dest_items;
46 };
47
48 } // namespace storage
49 #endif // STORAGE_BROWSER_BLOB_BLOB_SLICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698