| 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 quota { |
| 20 class QuotaManager; | 20 class QuotaManager; |
| 21 struct RequestStorageQuotaParams; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class QuotaPermissionContext; | 25 class QuotaPermissionContext; |
| 25 | 26 |
| 26 class QuotaDispatcherHost : public BrowserMessageFilter { | 27 class QuotaDispatcherHost : public BrowserMessageFilter { |
| 27 public: | 28 public: |
| 28 QuotaDispatcherHost(int process_id, | 29 QuotaDispatcherHost(int process_id, |
| 29 quota::QuotaManager* quota_manager, | 30 quota::QuotaManager* quota_manager, |
| 30 QuotaPermissionContext* permission_context); | 31 QuotaPermissionContext* permission_context); |
| 31 | 32 |
| 32 // BrowserMessageFilter: | 33 // 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 |
| 36 protected: | 37 protected: |
| 37 virtual ~QuotaDispatcherHost(); | 38 virtual ~QuotaDispatcherHost(); |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 class RequestDispatcher; | 41 class RequestDispatcher; |
| 41 class QueryUsageAndQuotaDispatcher; | 42 class QueryUsageAndQuotaDispatcher; |
| 42 class RequestQuotaDispatcher; | 43 class RequestQuotaDispatcher; |
| 43 | 44 |
| 44 void OnQueryStorageUsageAndQuota( | 45 void OnQueryStorageUsageAndQuota( |
| 45 int request_id, | 46 int request_id, |
| 46 const GURL& origin_url, | 47 const GURL& origin_url, |
| 47 quota::StorageType type); | 48 quota::StorageType type); |
| 48 void OnRequestStorageQuota( | 49 void OnRequestStorageQuota(const quota::RequestStorageQuotaParams& params); |
| 49 int render_view_id, | |
| 50 int request_id, | |
| 51 const GURL& origin_url, | |
| 52 quota::StorageType type, | |
| 53 uint64 requested_size); | |
| 54 | 50 |
| 55 // The ID of this process. | 51 // The ID of this process. |
| 56 int process_id_; | 52 int process_id_; |
| 57 | 53 |
| 58 quota::QuotaManager* quota_manager_; | 54 quota::QuotaManager* quota_manager_; |
| 59 scoped_refptr<QuotaPermissionContext> permission_context_; | 55 scoped_refptr<QuotaPermissionContext> permission_context_; |
| 60 | 56 |
| 61 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; | 57 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; |
| 62 | 58 |
| 63 base::WeakPtrFactory<QuotaDispatcherHost> weak_factory_; | 59 base::WeakPtrFactory<QuotaDispatcherHost> weak_factory_; |
| 64 | 60 |
| 65 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); | 61 DISALLOW_IMPLICIT_CONSTRUCTORS(QuotaDispatcherHost); |
| 66 }; | 62 }; |
| 67 | 63 |
| 68 } // namespace content | 64 } // namespace content |
| 69 | 65 |
| 70 #endif // CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_ | 66 #endif // CONTENT_BROWSER_QUOTA_DISPATCHER_HOST_H_ |
| OLD | NEW |