OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
10 #include "content/public/browser/browser_message_filter.h" | 10 #include "content/public/browser/browser_message_filter.h" |
11 #include "webkit/quota/quota_types.h" | 11 #include "webkit/quota/quota_types.h" |
12 | 12 |
13 class GURL; | 13 class GURL; |
14 | 14 |
| 15 namespace content { |
| 16 class QuotaPermissionContext; |
| 17 } |
| 18 |
15 namespace IPC { | 19 namespace IPC { |
16 class Message; | 20 class Message; |
17 } | 21 } |
18 | 22 |
19 namespace quota { | 23 namespace quota { |
20 class QuotaManager; | 24 class QuotaManager; |
21 } | 25 } |
22 | 26 |
23 class QuotaPermissionContext; | |
24 | |
25 class QuotaDispatcherHost : public content::BrowserMessageFilter { | 27 class QuotaDispatcherHost : public content::BrowserMessageFilter { |
26 public: | 28 public: |
27 QuotaDispatcherHost(int process_id, | 29 QuotaDispatcherHost(int process_id, |
28 quota::QuotaManager* quota_manager, | 30 quota::QuotaManager* quota_manager, |
29 QuotaPermissionContext* permission_context); | 31 content::QuotaPermissionContext* permission_context); |
30 virtual ~QuotaDispatcherHost(); | 32 virtual ~QuotaDispatcherHost(); |
31 virtual bool OnMessageReceived(const IPC::Message& message, | 33 virtual bool OnMessageReceived(const IPC::Message& message, |
32 bool* message_was_ok) OVERRIDE; | 34 bool* message_was_ok) OVERRIDE; |
33 | 35 |
34 private: | 36 private: |
35 class RequestDispatcher; | 37 class RequestDispatcher; |
36 class QueryUsageAndQuotaDispatcher; | 38 class QueryUsageAndQuotaDispatcher; |
37 class RequestQuotaDispatcher; | 39 class RequestQuotaDispatcher; |
38 | 40 |
39 void OnQueryStorageUsageAndQuota( | 41 void OnQueryStorageUsageAndQuota( |
40 int request_id, | 42 int request_id, |
41 const GURL& origin_url, | 43 const GURL& origin_url, |
42 quota::StorageType type); | 44 quota::StorageType type); |
43 void OnRequestStorageQuota( | 45 void OnRequestStorageQuota( |
44 int render_view_id, | 46 int render_view_id, |
45 int request_id, | 47 int request_id, |
46 const GURL& origin_url, | 48 const GURL& origin_url, |
47 quota::StorageType type, | 49 quota::StorageType type, |
48 int64 requested_size); | 50 int64 requested_size); |
49 | 51 |
50 // The ID of this process. | 52 // The ID of this process. |
51 int process_id_; | 53 int process_id_; |
52 | 54 |
53 quota::QuotaManager* quota_manager_; | 55 quota::QuotaManager* quota_manager_; |
54 scoped_refptr<QuotaPermissionContext> permission_context_; | 56 scoped_refptr<content::QuotaPermissionContext> permission_context_; |
55 | 57 |
56 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; | 58 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; |
57 | 59 |
58 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); | 60 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); |
59 }; | 61 }; |
60 | 62 |
61 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ | 63 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |
OLD | NEW |