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

Unified Diff: content/browser/blob_storage/blob_dispatcher_host.h

Issue 2340133006: [WIP] Hack on Blob mojom (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | content/browser/blob_storage/blob_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/blob_storage/blob_dispatcher_host.h
diff --git a/content/browser/blob_storage/blob_dispatcher_host.h b/content/browser/blob_storage/blob_dispatcher_host.h
index f9d1a98881e7556a12bf96bee12bb74c5975db21..b3bf551296d3d930eeb506f0d9e0269ea08b0434 100644
--- a/content/browser/blob_storage/blob_dispatcher_host.h
+++ b/content/browser/blob_storage/blob_dispatcher_host.h
@@ -15,7 +15,10 @@
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory_handle.h"
#include "content/common/content_export.h"
+#include "content/common/blob.mojom.h"
+#include "content/public/browser/browser_associated_interface.h"
#include "content/public/browser/browser_message_filter.h"
+#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "storage/browser/blob/blob_async_builder_host.h"
#include "storage/browser/blob/blob_transport_result.h"
#include "storage/common/blob_storage/blob_storage_constants.h"
@@ -44,7 +47,11 @@ class ChromeBlobStorageContext;
// that process go away upon destruction of the instance.
// This lives in the browser process, is single threaded (IO thread), and there
// is one per child process.
-class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter {
+class CONTENT_EXPORT BlobDispatcherHost
+ : public BrowserMessageFilter,
+ public BrowserAssociatedInterface<mojom::BlobFactory>,
+ public mojom::BlobFactory,
+ public mojom::Blob {
public:
BlobDispatcherHost(
int process_id,
@@ -100,18 +107,17 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter {
typedef std::map<std::string, int> BlobReferenceMap;
- void OnRegisterBlobUUID(const std::string& uuid,
- const std::string& content_type,
- const std::string& content_disposition,
- const std::set<std::string>& referenced_blob_uuids);
- void OnStartBuildingBlob(
- const std::string& uuid,
- const std::vector<storage::DataElement>& descriptions);
+ // mojom::BlobFactory:
+ void BuildBlob(const std::string& uuid,
+ const std::string& content_type,
+ const std::string& content_disposition,
+ const std::vector<std::string>& referenced_blob_uuids,
+ const std::vector<storage::DataElement>& item_descriptions,
+ const BuildBlobCallback& callback);
+
void OnMemoryItemResponse(
const std::string& uuid,
const std::vector<storage::BlobItemBytesResponse>& response);
- void OnCancelBuildingBlob(const std::string& uuid,
- const storage::IPCBlobCreationCancelCode code);
void OnIncrementBlobRefCount(const std::string& uuid);
void OnDecrementBlobRefCount(const std::string& uuid);
@@ -127,7 +133,7 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter {
std::unique_ptr<std::vector<base::File>> files);
// Send the appropriate IPC response to the renderer for the given result.
- void SendIPCResponse(const std::string& uuid,
+ void SendIPCResponse(const BuildBlobCallback& callback,
storage::BlobTransportResult result);
bool IsInUseInHost(const std::string& uuid);
@@ -149,7 +155,11 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter {
scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
storage::BlobAsyncBuilderHost async_builder_;
+ mojo::AssociatedBindingSet<mojom::Blob> blob_bindings_;
+
DISALLOW_COPY_AND_ASSIGN(BlobDispatcherHost);
};
+
} // namespace content
+
#endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_
« no previous file with comments | « no previous file | content/browser/blob_storage/blob_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698