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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: storage/browser/blob/blob_slice.h
diff --git a/storage/browser/blob/blob_slice.h b/storage/browser/blob/blob_slice.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d83510a9d4e618a6dfe676d225c13e0154d8173
--- /dev/null
+++ b/storage/browser/blob/blob_slice.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef STORAGE_BROWSER_BLOB_BLOB_SLICE_H_
+#define STORAGE_BROWSER_BLOB_BLOB_SLICE_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "storage/browser/storage_browser_export.h"
+
+namespace storage {
+class InternalBlobData;
+class ShareableBlobDataItem;
+
+// Here we try to handle the cases where the slice partially intersects with
+// either a data item (which we want to copy instead of share when it's partial
+// intersection) or a 'future file item', which isn't populated yet in the
+// 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
+struct STORAGE_EXPORT BlobSlice {
+ BlobSlice(const InternalBlobData& source,
+ uint64_t slice_offset,
+ uint64_t slice_size);
+ ~BlobSlice();
+
+ // The is the amount of memory we'll be copying from the source blob, as we
+ // can't share a partial data item. This can happen on the first and/or last
+ // item our slice is intersecting.
+ size_t copying_memory_size = 0;
+
+ size_t first_item_slice_offset = 0;
+ // Populated if our first slice item is a temporary item that we'll copy to
+ // later from this |first_source_item|, at offset |first_item_slice_offset|.
+ scoped_refptr<ShareableBlobDataItem> first_source_item;
+ // Populated if our last slice item is a temporary item that we'll copy to
+ // later from this |last_source_item|.
+ scoped_refptr<ShareableBlobDataItem> last_source_item;
+
+ std::vector<scoped_refptr<ShareableBlobDataItem>> dest_items;
+};
+
+} // namespace storage
+#endif // STORAGE_BROWSER_BLOB_BLOB_SLICE_H_

Powered by Google App Engine
This is Rietveld 408576698