OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 StorageQuotaCallbacksImpl::StorageQuotaCallbacksImpl( | 38 StorageQuotaCallbacksImpl::StorageQuotaCallbacksImpl( |
39 ScriptPromiseResolver* resolver) | 39 ScriptPromiseResolver* resolver) |
40 : m_resolver(resolver) {} | 40 : m_resolver(resolver) {} |
41 | 41 |
42 StorageQuotaCallbacksImpl::~StorageQuotaCallbacksImpl() {} | 42 StorageQuotaCallbacksImpl::~StorageQuotaCallbacksImpl() {} |
43 | 43 |
44 void StorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota( | 44 void StorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota( |
45 unsigned long long usageInBytes, | 45 unsigned long long usageInBytes, |
46 unsigned long long quotaInBytes) { | 46 unsigned long long quotaInBytes) { |
47 m_resolver->resolve(StorageInfo::create(usageInBytes, quotaInBytes)); | 47 StorageInfo info; |
| 48 info.setUsage(usageInBytes); |
| 49 info.setQuota(quotaInBytes); |
| 50 m_resolver->resolve(info); |
48 } | 51 } |
49 | 52 |
50 void StorageQuotaCallbacksImpl::didGrantStorageQuota( | 53 void StorageQuotaCallbacksImpl::didGrantStorageQuota( |
51 unsigned long long usageInBytes, | 54 unsigned long long usageInBytes, |
52 unsigned long long grantedQuotaInBytes) { | 55 unsigned long long grantedQuotaInBytes) { |
53 m_resolver->resolve(StorageInfo::create(usageInBytes, grantedQuotaInBytes)); | 56 StorageInfo info; |
| 57 info.setUsage(usageInBytes); |
| 58 info.setQuota(grantedQuotaInBytes); |
| 59 m_resolver->resolve(info); |
54 } | 60 } |
55 | 61 |
56 void StorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error) { | 62 void StorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error) { |
57 m_resolver->reject(DOMError::create(static_cast<ExceptionCode>(error))); | 63 m_resolver->reject(DOMError::create(static_cast<ExceptionCode>(error))); |
58 } | 64 } |
59 | 65 |
60 DEFINE_TRACE(StorageQuotaCallbacksImpl) { | 66 DEFINE_TRACE(StorageQuotaCallbacksImpl) { |
61 visitor->trace(m_resolver); | 67 visitor->trace(m_resolver); |
62 StorageQuotaCallbacks::trace(visitor); | 68 StorageQuotaCallbacks::trace(visitor); |
63 } | 69 } |
64 | 70 |
65 } // namespace blink | 71 } // namespace blink |
OLD | NEW |