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