OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_RENDERER_HOST_BLOB_DISPATCHER_HOST_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_BLOB_DISPATCHER_HOST_H_ | |
7 | |
8 #include "base/hash_tables.h" | |
9 #include "base/ref_counted.h" | |
10 | |
11 class ChromeBlobStorageContext; | |
12 class GURL; | |
13 | |
14 namespace IPC { | |
15 class Message; | |
16 } | |
17 | |
18 namespace webkit_blob { | |
19 class BlobData; | |
20 } | |
21 | |
22 class BlobDispatcherHost { | |
23 public: | |
24 BlobDispatcherHost(int process_id, | |
25 ChromeBlobStorageContext* blob_storage_context); | |
26 ~BlobDispatcherHost(); | |
27 | |
28 void Shutdown(); | |
29 bool OnMessageReceived(const IPC::Message& message, bool* msg_is_ok); | |
30 | |
31 private: | |
32 void OnRegisterBlobUrl(const GURL& url, | |
33 const scoped_refptr<webkit_blob::BlobData>& blob_data); | |
34 void OnRegisterBlobUrlFrom(const GURL& url, const GURL& src_url); | |
35 void OnUnregisterBlobUrl(const GURL& url); | |
36 | |
37 bool CheckPermission(webkit_blob::BlobData* blob_data) const; | |
38 | |
39 int process_id_; | |
40 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | |
41 | |
42 // Keep track of blob URLs registered in this process. Need to unregister | |
43 // all of them when the renderer process dies. | |
44 base::hash_set<std::string> blob_urls_; | |
45 | |
46 DISALLOW_IMPLICIT_CONSTRUCTORS(BlobDispatcherHost); | |
47 }; | |
48 | |
49 #endif // CHROME_BROWSER_RENDERER_HOST_BLOB_DISPATCHER_HOST_H_ | |
OLD | NEW |