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

Side by Side Diff: content/browser/blob_storage/blob_dispatcher_host.h

Issue 2214293002: [BlobStorage] Added back security policy for files in blobs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 28
29 namespace storage { 29 namespace storage {
30 class DataElement; 30 class DataElement;
31 class BlobDataBuilder; 31 class BlobDataBuilder;
32 struct BlobItemBytesRequest; 32 struct BlobItemBytesRequest;
33 struct BlobItemBytesResponse; 33 struct BlobItemBytesResponse;
34 class BlobStorageContext; 34 class BlobStorageContext;
35 } 35 }
36 36
37 namespace content { 37 namespace content {
38 class ChildProcessSecurityPolicyImpl;
38 class ChromeBlobStorageContext; 39 class ChromeBlobStorageContext;
39 40
40 // This class's responsibility is to listen for and dispatch blob storage 41 // This class's responsibility is to listen for and dispatch blob storage
41 // messages and handle logistics of blob storage for a single child process. 42 // messages and handle logistics of blob storage for a single child process.
42 // When the child process terminates all blob references attributable to 43 // When the child process terminates all blob references attributable to
43 // that process go away upon destruction of the instance. 44 // that process go away upon destruction of the instance.
44 // This lives in the browser process, is single threaded (IO thread), and there 45 // This lives in the browser process, is single threaded (IO thread), and there
45 // is one per child process. 46 // is one per child process.
46 class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter { 47 class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter {
47 public: 48 public:
48 explicit BlobDispatcherHost(ChromeBlobStorageContext* blob_storage_context); 49 BlobDispatcherHost(int process_id,
50 ChromeBlobStorageContext* blob_storage_context);
49 51
50 // BrowserMessageFilter implementation. 52 // BrowserMessageFilter implementation.
51 void OnChannelClosing() override; 53 void OnChannelClosing() override;
52 bool OnMessageReceived(const IPC::Message& message) override; 54 bool OnMessageReceived(const IPC::Message& message) override;
53 55
54 protected: 56 protected:
55 ~BlobDispatcherHost() override; 57 ~BlobDispatcherHost() override;
56 58
57 // For testing use only. 59 // For testing use only.
58 void SetMemoryConstantsForTesting(size_t max_ipc_memory_size, 60 void SetMemoryConstantsForTesting(size_t max_ipc_memory_size,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Send the appropriate IPC response to the renderer for the given result. 127 // Send the appropriate IPC response to the renderer for the given result.
126 void SendIPCResponse(const std::string& uuid, 128 void SendIPCResponse(const std::string& uuid,
127 storage::BlobTransportResult result); 129 storage::BlobTransportResult result);
128 130
129 bool IsInUseInHost(const std::string& uuid); 131 bool IsInUseInHost(const std::string& uuid);
130 bool IsUrlRegisteredInHost(const GURL& blob_url); 132 bool IsUrlRegisteredInHost(const GURL& blob_url);
131 133
132 // Unregisters all blobs and urls that were registered in this host. 134 // Unregisters all blobs and urls that were registered in this host.
133 void ClearHostFromBlobStorageContext(); 135 void ClearHostFromBlobStorageContext();
134 136
137 int process_id_;
138 ChildProcessSecurityPolicyImpl* security_policy_;
139
135 // Collection of blob ids and a count of how many usages 140 // Collection of blob ids and a count of how many usages
136 // of that id are attributable to this consumer. 141 // of that id are attributable to this consumer.
137 BlobReferenceMap blobs_inuse_map_; 142 BlobReferenceMap blobs_inuse_map_;
138 143
139 // The set of public blob urls coined by this consumer. 144 // The set of public blob urls coined by this consumer.
140 std::set<GURL> public_blob_urls_; 145 std::set<GURL> public_blob_urls_;
141 146
142 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; 147 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
143 storage::BlobAsyncBuilderHost async_builder_; 148 storage::BlobAsyncBuilderHost async_builder_;
144 149
145 DISALLOW_COPY_AND_ASSIGN(BlobDispatcherHost); 150 DISALLOW_COPY_AND_ASSIGN(BlobDispatcherHost);
146 }; 151 };
147 } // namespace content 152 } // namespace content
148 #endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_ 153 #endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698