| 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..367482b31416ea44a7abaed82aeb070c87693885
|
| --- /dev/null
|
| +++ b/content/child/blob_storage/blob_message_filter.h
|
| @@ -0,0 +1,65 @@
|
| +// 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 <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 {
|
| +class BlobTransportController;
|
| +
|
| +// 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>* supported_message_classes) const override;
|
| + void OnChannelConnected(int32_t peer_pid) override;
|
| + void OnChannelClosing() 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_ = nullptr;
|
| + BlobTransportController* controller_ = nullptr;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(BlobMessageFilter);
|
| +};
|
| +
|
| +} // namespace content
|
| +#endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
|
|
|