| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebStorageQuotaCallbacks_h | 31 #ifndef WebStorageQuotaCallbacks_h |
| 32 #define WebStorageQuotaCallbacks_h | 32 #define WebStorageQuotaCallbacks_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 #include "WebPrivatePtr.h" | 35 #include "WebPrivatePtr.h" |
| 36 #include "WebStorageQuotaError.h" | 36 #include "WebStorageQuotaError.h" |
| 37 | 37 |
| 38 namespace blink { | |
| 39 class StorageQuotaCallbacks; | |
| 40 } | |
| 41 | |
| 42 namespace WTF { template <typename T> class PassOwnPtr; } | 38 namespace WTF { template <typename T> class PassOwnPtr; } |
| 43 | 39 |
| 44 namespace blink { | 40 namespace blink { |
| 45 | 41 |
| 42 class StorageQuotaCallbacks; |
| 46 class WebStorageQuotaCallbacksPrivate; | 43 class WebStorageQuotaCallbacksPrivate; |
| 47 | 44 |
| 48 class WebStorageQuotaCallbacks { | 45 class WebStorageQuotaCallbacks { |
| 49 public: | 46 public: |
| 50 ~WebStorageQuotaCallbacks() { reset(); } | 47 ~WebStorageQuotaCallbacks() { reset(); } |
| 51 WebStorageQuotaCallbacks() { } | 48 WebStorageQuotaCallbacks() { } |
| 52 WebStorageQuotaCallbacks(const WebStorageQuotaCallbacks& c) { assign(c); } | 49 WebStorageQuotaCallbacks(const WebStorageQuotaCallbacks& c) { assign(c); } |
| 53 WebStorageQuotaCallbacks& operator=(const WebStorageQuotaCallbacks& c) | 50 WebStorageQuotaCallbacks& operator=(const WebStorageQuotaCallbacks& c) |
| 54 { | 51 { |
| 55 assign(c); | 52 assign(c); |
| 56 return *this; | 53 return *this; |
| 57 } | 54 } |
| 58 | 55 |
| 59 BLINK_PLATFORM_EXPORT void reset(); | 56 BLINK_PLATFORM_EXPORT void reset(); |
| 60 BLINK_PLATFORM_EXPORT void assign(const WebStorageQuotaCallbacks&); | 57 BLINK_PLATFORM_EXPORT void assign(const WebStorageQuotaCallbacks&); |
| 61 | 58 |
| 62 #if INSIDE_BLINK | 59 #if INSIDE_BLINK |
| 63 BLINK_PLATFORM_EXPORT WebStorageQuotaCallbacks(const WTF::PassOwnPtr<blink::
StorageQuotaCallbacks>&); | 60 BLINK_PLATFORM_EXPORT WebStorageQuotaCallbacks(const WTF::PassOwnPtr<Storage
QuotaCallbacks>&); |
| 64 #endif | 61 #endif |
| 65 | 62 |
| 66 // Callback for WebFrameClient::queryStorageUsageAndQuota. | 63 // Callback for WebFrameClient::queryStorageUsageAndQuota. |
| 67 BLINK_PLATFORM_EXPORT void didQueryStorageUsageAndQuota(unsigned long long u
sageInBytes, unsigned long long quotaInBytes); | 64 BLINK_PLATFORM_EXPORT void didQueryStorageUsageAndQuota(unsigned long long u
sageInBytes, unsigned long long quotaInBytes); |
| 68 | 65 |
| 69 // Callback for WebFrameClient::requestStorageQuota. | 66 // Callback for WebFrameClient::requestStorageQuota. |
| 70 // This may return a smaller amount of quota than the requested. | 67 // This may return a smaller amount of quota than the requested. |
| 71 BLINK_PLATFORM_EXPORT void didGrantStorageQuota(unsigned long long usageInBy
tes, unsigned long long grantedQuotaInBytes); | 68 BLINK_PLATFORM_EXPORT void didGrantStorageQuota(unsigned long long usageInBy
tes, unsigned long long grantedQuotaInBytes); |
| 72 | 69 |
| 73 BLINK_PLATFORM_EXPORT void didFail(WebStorageQuotaError); | 70 BLINK_PLATFORM_EXPORT void didFail(WebStorageQuotaError); |
| 74 | 71 |
| 75 private: | 72 private: |
| 76 WebPrivatePtr<WebStorageQuotaCallbacksPrivate> m_private; | 73 WebPrivatePtr<WebStorageQuotaCallbacksPrivate> m_private; |
| 77 }; | 74 }; |
| 78 | 75 |
| 79 } // namespace blink | 76 } // namespace blink |
| 80 | 77 |
| 81 #endif // WebStorageQuotaCallbacks_h | 78 #endif // WebStorageQuotaCallbacks_h |
| OLD | NEW |