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

Side by Side Diff: content/child/blob_storage/blob_message_filter.h

Issue 1414123002: [BlobAsync] Renderer support for blob file writing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-hookup
Patch Set: and one more rebase error :/ Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
6 #define CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_ 6 #define CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h"
14 #include "base/memory/shared_memory.h" 16 #include "base/memory/shared_memory.h"
15 #include "ipc/ipc_platform_file.h" 17 #include "ipc/ipc_platform_file.h"
16 #include "ipc/message_filter.h" 18 #include "ipc/message_filter.h"
17 #include "storage/common/blob_storage/blob_storage_constants.h" 19 #include "storage/common/blob_storage/blob_storage_constants.h"
18 20
21 namespace base {
22 class TaskRunner;
23 }
24
19 namespace IPC { 25 namespace IPC {
20 class Sender; 26 class Sender;
21 class Message; 27 class Message;
22 } 28 }
23 29
24 namespace storage { 30 namespace storage {
25 struct BlobItemBytesRequest; 31 struct BlobItemBytesRequest;
32 struct BlobItemBytesResponse;
26 } 33 }
27 34
28 namespace content { 35 namespace content {
29 36
30 // MessageFilter that handles Blob IPCs and delegates them to the 37 // MessageFilter that handles Blob IPCs and delegates them to the
31 // BlobTransportController singleton. Created on the render thread, and then 38 // BlobTransportController singleton. Created on the render thread, and then
32 // operated on by the IO thread. 39 // operated on by the IO thread.
33 class BlobMessageFilter : public IPC::MessageFilter { 40 class BlobMessageFilter : public IPC::MessageFilter {
34 public: 41 public:
35 BlobMessageFilter(); 42 BlobMessageFilter(scoped_refptr<base::TaskRunner> file_runner);
36 43
44 void OnChannelClosing() override;
37 void OnFilterAdded(IPC::Sender* sender) override; 45 void OnFilterAdded(IPC::Sender* sender) override;
38 bool OnMessageReceived(const IPC::Message& message) override; 46 bool OnMessageReceived(const IPC::Message& message) override;
39 bool GetSupportedMessageClasses( 47 bool GetSupportedMessageClasses(
40 std::vector<uint32_t>* supported_message_classes) const override; 48 std::vector<uint32_t>* supported_message_classes) const override;
41 49
42 protected: 50 protected:
43 ~BlobMessageFilter() override; 51 ~BlobMessageFilter() override;
44 52
45 private: 53 private:
46 void OnRequestMemoryItem( 54 void OnRequestMemoryItem(
47 const std::string& uuid, 55 const std::string& uuid,
48 const std::vector<storage::BlobItemBytesRequest>& requests, 56 const std::vector<storage::BlobItemBytesRequest>& requests,
49 std::vector<base::SharedMemoryHandle> memory_handles, 57 std::vector<base::SharedMemoryHandle> memory_handles,
50 const std::vector<IPC::PlatformFileForTransit>& file_handles); 58 const std::vector<IPC::PlatformFileForTransit>& file_handles);
51 59
52 void OnCancelBuildingBlob(const std::string& uuid, 60 void OnCancelBuildingBlob(const std::string& uuid,
53 storage::IPCBlobCreationCancelCode code); 61 storage::IPCBlobCreationCancelCode code);
54 62
55 void OnDoneBuildingBlob(const std::string& uuid); 63 void OnDoneBuildingBlob(const std::string& uuid);
56 64
57 IPC::Sender* sender_; 65 IPC::Sender* sender_;
66 scoped_refptr<base::TaskRunner> file_runner_;
58 67
59 DISALLOW_COPY_AND_ASSIGN(BlobMessageFilter); 68 DISALLOW_COPY_AND_ASSIGN(BlobMessageFilter);
60 }; 69 };
61 70
62 } // namespace content 71 } // namespace content
63 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_ 72 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/child/blob_storage/blob_consolidation_unittest.cc ('k') | content/child/blob_storage/blob_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698