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

Unified Diff: storage/browser/blob/blob_data_handle.h

Issue 1846363002: [BlobAsync] Adding better error reporting and some new tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 8 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
« no previous file with comments | « storage/browser/blob/blob_async_builder_host.cc ('k') | storage/browser/blob/blob_data_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_data_handle.h
diff --git a/storage/browser/blob/blob_data_handle.h b/storage/browser/blob/blob_data_handle.h
index 86e9b009956e50b90c24c7e3920cfd6ef43db3cd..3f4529346b103cc0149d0a507494011e867153dc 100644
--- a/storage/browser/blob/blob_data_handle.h
+++ b/storage/browser/blob/blob_data_handle.h
@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/supports_user_data.h"
#include "storage/browser/storage_browser_export.h"
+#include "storage/common/blob_storage/blob_storage_constants.h"
namespace base {
class SequencedTaskRunner;
@@ -38,6 +39,11 @@ class FileSystemContext;
class STORAGE_EXPORT BlobDataHandle
: public base::SupportsUserData::Data {
public:
+ // True means the blob was constructed successfully, and false means that
+ // there was an error, which is reported in the second argument.
+ using BlobConstructedCallback =
+ base::Callback<void(bool, IPCBlobCreationCancelCode)>;
+
BlobDataHandle(const BlobDataHandle& other); // May be copied on any thread.
~BlobDataHandle() override; // May be deleted on any thread.
@@ -56,7 +62,7 @@ class STORAGE_EXPORT BlobDataHandle
// Must be called on IO thread. Returns if construction successful.
// Calling this multiple times results in registering multiple
// completion callbacks.
- void RunOnConstructionComplete(const base::Callback<void(bool)>& done);
+ void RunOnConstructionComplete(const BlobConstructedCallback& done);
// A BlobReader is used to read the data from the blob. This object is
// intended to be transient and should not be stored for any extended period
@@ -90,10 +96,6 @@ class STORAGE_EXPORT BlobDataHandle
const std::string& content_disposition,
BlobStorageContext* context);
- void RunOnConstructionComplete(const base::Callback<void(bool)>& done);
-
- std::unique_ptr<BlobDataSnapshot> CreateSnapshot() const;
-
private:
friend class base::DeleteHelper<BlobDataHandleShared>;
friend class base::RefCountedThreadSafe<BlobDataHandleShared>;
« no previous file with comments | « storage/browser/blob/blob_async_builder_host.cc ('k') | storage/browser/blob/blob_data_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698