| 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_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/browser/browser_message_filter.h" | 10 #include "content/browser/browser_message_filter.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h
" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.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 } | 21 } |
| 22 | 22 |
| 23 class QuotaDispatcherHost : public BrowserMessageFilter { | 23 class QuotaDispatcherHost : public BrowserMessageFilter { |
| 24 public: | 24 public: |
| 25 QuotaDispatcherHost(quota::QuotaManager* quota_manager); | 25 QuotaDispatcherHost(quota::QuotaManager* quota_manager); |
| 26 ~QuotaDispatcherHost(); | 26 virtual ~QuotaDispatcherHost(); |
| 27 virtual bool OnMessageReceived(const IPC::Message& message, | 27 virtual bool OnMessageReceived(const IPC::Message& message, |
| 28 bool* message_was_ok); | 28 bool* message_was_ok); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 void OnQueryStorageUsageAndQuota( | 31 void OnQueryStorageUsageAndQuota( |
| 32 int request_id, | 32 int request_id, |
| 33 const GURL& origin_url, | 33 const GURL& origin_url, |
| 34 WebKit::WebStorageQuotaType type); | 34 WebKit::WebStorageQuotaType type); |
| 35 void OnRequestStorageQuota( | 35 void OnRequestStorageQuota( |
| 36 int request_id, | 36 int request_id, |
| 37 const GURL& origin_url, | 37 const GURL& origin_url, |
| 38 WebKit::WebStorageQuotaType type, | 38 WebKit::WebStorageQuotaType type, |
| 39 int64 requested_size); | 39 int64 requested_size); |
| 40 | 40 |
| 41 quota::QuotaManager* quota_manager_; | 41 quota::QuotaManager* quota_manager_; |
| 42 | 42 |
| 43 class RequestDispatcher; | 43 class RequestDispatcher; |
| 44 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; | 44 IDMap<RequestDispatcher, IDMapOwnPointer> outstanding_requests_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ | 47 #endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |
| OLD | NEW |