| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "webkit/child/worker_task_runner.h" | 14 #include "webkit/child/worker_task_runner.h" |
| 15 #include "webkit/common/quota/quota_types.h" | 15 #include "webkit/common/quota/quota_types.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 class Message; | 20 class Message; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace WebKit { | 23 namespace blink { |
| 24 class WebStorageQuotaCallbacks; | 24 class WebStorageQuotaCallbacks; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 class ThreadSafeSender; | 29 class ThreadSafeSender; |
| 30 class QuotaMessageFilter; | 30 class QuotaMessageFilter; |
| 31 | 31 |
| 32 // Dispatches and sends quota related messages sent to/from a child | 32 // Dispatches and sends quota related messages sent to/from a child |
| 33 // process from/to the main browser process. There is one instance | 33 // process from/to the main browser process. There is one instance |
| (...skipping 28 matching lines...) Expand all Loading... |
| 62 quota::StorageType type, | 62 quota::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 quota::StorageType type, | 66 quota::StorageType type, |
| 67 int64 requested_size, | 67 int64 requested_size, |
| 68 Callback* callback); | 68 Callback* callback); |
| 69 | 69 |
| 70 // Creates a new Callback instance for WebStorageQuotaCallbacks. | 70 // Creates a new Callback instance for WebStorageQuotaCallbacks. |
| 71 static Callback* CreateWebStorageQuotaCallbacksWrapper( | 71 static Callback* CreateWebStorageQuotaCallbacksWrapper( |
| 72 WebKit::WebStorageQuotaCallbacks* callbacks); | 72 blink::WebStorageQuotaCallbacks* callbacks); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // Message handlers. | 75 // Message handlers. |
| 76 void DidQueryStorageUsageAndQuota(int request_id, | 76 void DidQueryStorageUsageAndQuota(int request_id, |
| 77 int64 current_usage, | 77 int64 current_usage, |
| 78 int64 current_quota); | 78 int64 current_quota); |
| 79 void DidGrantStorageQuota(int request_id, | 79 void DidGrantStorageQuota(int request_id, |
| 80 int64 granted_quota); | 80 int64 granted_quota); |
| 81 void DidFail(int request_id, | 81 void DidFail(int request_id, |
| 82 quota::QuotaStatusCode error); | 82 quota::QuotaStatusCode error); |
| 83 | 83 |
| 84 IDMap<Callback, IDMapOwnPointer> pending_quota_callbacks_; | 84 IDMap<Callback, IDMapOwnPointer> pending_quota_callbacks_; |
| 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 |