OLD | NEW |
1 // Copyright (c) 2012 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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace quota { | 23 namespace quota { |
24 class QuotaManager; | 24 class QuotaManager; |
25 } | 25 } |
26 | 26 |
27 class QuotaDispatcherHost : public content::BrowserMessageFilter { | 27 class QuotaDispatcherHost : public content::BrowserMessageFilter { |
28 public: | 28 public: |
29 QuotaDispatcherHost(int process_id, | 29 QuotaDispatcherHost(int process_id, |
30 quota::QuotaManager* quota_manager, | 30 quota::QuotaManager* quota_manager, |
31 content::QuotaPermissionContext* permission_context); | 31 content::QuotaPermissionContext* permission_context); |
32 virtual ~QuotaDispatcherHost(); | 32 |
| 33 // content::BrowserMessageFilter: |
33 virtual bool OnMessageReceived(const IPC::Message& message, | 34 virtual bool OnMessageReceived(const IPC::Message& message, |
34 bool* message_was_ok) OVERRIDE; | 35 bool* message_was_ok) OVERRIDE; |
35 | 36 |
| 37 protected: |
| 38 virtual ~QuotaDispatcherHost(); |
| 39 |
36 private: | 40 private: |
37 class RequestDispatcher; | 41 class RequestDispatcher; |
38 class QueryUsageAndQuotaDispatcher; | 42 class QueryUsageAndQuotaDispatcher; |
39 class RequestQuotaDispatcher; | 43 class RequestQuotaDispatcher; |
40 | 44 |
41 void OnQueryStorageUsageAndQuota( | 45 void OnQueryStorageUsageAndQuota( |
42 int request_id, | 46 int request_id, |
43 const GURL& origin_url, | 47 const GURL& origin_url, |
44 quota::StorageType type); | 48 quota::StorageType type); |
45 void OnRequestStorageQuota( | 49 void OnRequestStorageQuota( |
46 int render_view_id, | 50 int render_view_id, |
47 int request_id, | 51 int request_id, |
48 const GURL& origin_url, | 52 const GURL& origin_url, |
49 quota::StorageType type, | 53 quota::StorageType type, |
50 int64 requested_size); | 54 int64 requested_size); |
51 | 55 |
52 // The ID of this process. | 56 // The ID of this process. |
53 int process_id_; | 57 int process_id_; |
54 | 58 |
55 quota::QuotaManager* quota_manager_; | 59 quota::QuotaManager* quota_manager_; |
56 scoped_refptr<content::QuotaPermissionContext> permission_context_; | 60 scoped_refptr<content::QuotaPermissionContext> permission_context_; |
57 | 61 |
58 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; | 62 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; |
59 | 63 |
60 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); | 64 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); |
61 }; | 65 }; |
62 | 66 |
63 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ | 67 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |
OLD | NEW |