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

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: fixed switch statement Created 4 years, 9 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_data_handle.h
diff --git a/storage/browser/blob/blob_data_handle.h b/storage/browser/blob/blob_data_handle.h
index b60cf823d2eaa84b58e3ed9f0c3ffc3a19ba7f53..c189962bf639da068671de92ec8c10389428ef72 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);
-
- scoped_ptr<BlobDataSnapshot> CreateSnapshot() const;
-
private:
friend class base::DeleteHelper<BlobDataHandleShared>;
friend class base::RefCountedThreadSafe<BlobDataHandleShared>;

Powered by Google App Engine
This is Rietveld 408576698