| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHILD_QUOTA_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_QUOTA_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_QUOTA_DISPATCHER_H_ | 6 #define CONTENT_CHILD_QUOTA_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class Callback { | 38 class Callback { |
| 39 public: | 39 public: |
| 40 virtual ~Callback() {} | 40 virtual ~Callback() {} |
| 41 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) = 0; | 41 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) = 0; |
| 42 virtual void DidGrantStorageQuota(int64 usage, int64 granted_quota) = 0; | 42 virtual void DidGrantStorageQuota(int64 usage, int64 granted_quota) = 0; |
| 43 virtual void DidFail(storage::QuotaStatusCode status) = 0; | 43 virtual void DidFail(storage::QuotaStatusCode status) = 0; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 QuotaDispatcher(ThreadSafeSender* thread_safe_sender, | 46 QuotaDispatcher(ThreadSafeSender* thread_safe_sender, |
| 47 QuotaMessageFilter* quota_message_filter); | 47 QuotaMessageFilter* quota_message_filter); |
| 48 virtual ~QuotaDispatcher(); | 48 ~QuotaDispatcher() override; |
| 49 | 49 |
| 50 // |thread_safe_sender| and |quota_message_filter| are used if | 50 // |thread_safe_sender| and |quota_message_filter| are used if |
| 51 // calling this leads to construction. | 51 // calling this leads to construction. |
| 52 static QuotaDispatcher* ThreadSpecificInstance( | 52 static QuotaDispatcher* ThreadSpecificInstance( |
| 53 ThreadSafeSender* thread_safe_sender, | 53 ThreadSafeSender* thread_safe_sender, |
| 54 QuotaMessageFilter* quota_message_filter); | 54 QuotaMessageFilter* quota_message_filter); |
| 55 | 55 |
| 56 // WorkerTaskRunner::Observer implementation. | 56 // WorkerTaskRunner::Observer implementation. |
| 57 virtual void OnWorkerRunLoopStopped() override; | 57 void OnWorkerRunLoopStopped() override; |
| 58 | 58 |
| 59 void OnMessageReceived(const IPC::Message& msg); | 59 void OnMessageReceived(const IPC::Message& msg); |
| 60 | 60 |
| 61 void QueryStorageUsageAndQuota(const GURL& gurl, | 61 void QueryStorageUsageAndQuota(const GURL& gurl, |
| 62 storage::StorageType type, | 62 storage::StorageType type, |
| 63 Callback* callback); | 63 Callback* callback); |
| 64 void RequestStorageQuota(int render_view_id, | 64 void RequestStorageQuota(int render_view_id, |
| 65 const GURL& gurl, | 65 const GURL& gurl, |
| 66 storage::StorageType type, | 66 storage::StorageType type, |
| 67 uint64 requested_size, | 67 uint64 requested_size, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 86 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 87 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 87 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); | 89 DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace content | 92 } // namespace content |
| 93 | 93 |
| 94 #endif // CONTENT_CHILD_QUOTA_DISPATCHER_H_ | 94 #endif // CONTENT_CHILD_QUOTA_DISPATCHER_H_ |
| OLD | NEW |