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

Unified Diff: content/child/blob_storage/blob_message_filter.h

Issue 1234813004: [BlobAsync] Asynchronous Blob Construction Final Patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-protocol-change
Patch Set: comments 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: content/child/blob_storage/blob_message_filter.h
diff --git a/content/child/blob_storage/blob_message_filter.h b/content/child/blob_storage/blob_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..26266658a22e301cc61aa3f27ec15198ed1a4d96
--- /dev/null
+++ b/content/child/blob_storage/blob_message_filter.h
@@ -0,0 +1,63 @@
+// Copyright 2015 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 CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
+#define CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
+
+#include <stddef.h>
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/shared_memory.h"
+#include "ipc/ipc_platform_file.h"
+#include "ipc/message_filter.h"
+#include "storage/common/blob_storage/blob_storage_constants.h"
+
+namespace IPC {
+class Sender;
+class Message;
+}
+
+namespace storage {
+struct BlobItemBytesRequest;
+}
+
+namespace content {
+
+// MessageFilter that handles Blob IPCs and delegates them to the
+// BlobTransportController singleton. Created on the render thread, and then
+// operated on by the IO thread.
+class BlobMessageFilter : public IPC::MessageFilter {
+ public:
+ BlobMessageFilter();
+
+ void OnFilterAdded(IPC::Sender* sender) override;
+ bool OnMessageReceived(const IPC::Message& message) override;
+ bool GetSupportedMessageClasses(
+ std::vector<uint32_t>* supported_message_classes) const override;
+
+ protected:
+ ~BlobMessageFilter() override;
+
+ private:
+ void OnRequestMemoryItem(
+ const std::string& uuid,
+ const std::vector<storage::BlobItemBytesRequest>& requests,
+ std::vector<base::SharedMemoryHandle> memory_handles,
+ const std::vector<IPC::PlatformFileForTransit>& file_handles);
+
+ void OnCancelBuildingBlob(const std::string& uuid,
+ storage::IPCBlobCreationCancelCode code);
+
+ void OnDoneBuildingBlob(const std::string& uuid);
+
+ IPC::Sender* sender_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlobMessageFilter);
+};
+
+} // namespace content
+#endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698