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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 DeprecatedStorageInfo::DeprecatedStorageInfo() {} | 43 DeprecatedStorageInfo::DeprecatedStorageInfo() {} |
44 | 44 |
45 void DeprecatedStorageInfo::queryUsageAndQuota( | 45 void DeprecatedStorageInfo::queryUsageAndQuota( |
46 ExecutionContext* executionContext, | 46 ExecutionContext* executionContext, |
47 int storageType, | 47 int storageType, |
48 StorageUsageCallback* successCallback, | 48 StorageUsageCallback* successCallback, |
49 StorageErrorCallback* errorCallback) { | 49 StorageErrorCallback* errorCallback) { |
50 // Dispatching the request to DeprecatedStorageQuota, as this interface is dep
recated in favor of DeprecatedStorageQuota. | 50 // Dispatching the request to DeprecatedStorageQuota, as this interface is |
| 51 // deprecated in favor of DeprecatedStorageQuota. |
51 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); | 52 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); |
52 if (!storageQuota) { | 53 if (!storageQuota) { |
53 // Unknown storage type is requested. | 54 // Unknown storage type is requested. |
54 executionContext->postTask(BLINK_FROM_HERE, | 55 executionContext->postTask(BLINK_FROM_HERE, |
55 StorageErrorCallback::createSameThreadTask( | 56 StorageErrorCallback::createSameThreadTask( |
56 errorCallback, NotSupportedError)); | 57 errorCallback, NotSupportedError)); |
57 return; | 58 return; |
58 } | 59 } |
59 storageQuota->queryUsageAndQuota(executionContext, successCallback, | 60 storageQuota->queryUsageAndQuota(executionContext, successCallback, |
60 errorCallback); | 61 errorCallback); |
61 } | 62 } |
62 | 63 |
63 void DeprecatedStorageInfo::requestQuota(ExecutionContext* executionContext, | 64 void DeprecatedStorageInfo::requestQuota(ExecutionContext* executionContext, |
64 int storageType, | 65 int storageType, |
65 unsigned long long newQuotaInBytes, | 66 unsigned long long newQuotaInBytes, |
66 StorageQuotaCallback* successCallback, | 67 StorageQuotaCallback* successCallback, |
67 StorageErrorCallback* errorCallback) { | 68 StorageErrorCallback* errorCallback) { |
68 // Dispatching the request to DeprecatedStorageQuota, as this interface is dep
recated in favor of DeprecatedStorageQuota. | 69 // Dispatching the request to DeprecatedStorageQuota, as this interface is |
| 70 // deprecated in favor of DeprecatedStorageQuota. |
69 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); | 71 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); |
70 if (!storageQuota) { | 72 if (!storageQuota) { |
71 // Unknown storage type is requested. | 73 // Unknown storage type is requested. |
72 executionContext->postTask(BLINK_FROM_HERE, | 74 executionContext->postTask(BLINK_FROM_HERE, |
73 StorageErrorCallback::createSameThreadTask( | 75 StorageErrorCallback::createSameThreadTask( |
74 errorCallback, NotSupportedError)); | 76 errorCallback, NotSupportedError)); |
75 return; | 77 return; |
76 } | 78 } |
77 storageQuota->requestQuota(executionContext, newQuotaInBytes, successCallback, | 79 storageQuota->requestQuota(executionContext, newQuotaInBytes, successCallback, |
78 errorCallback); | 80 errorCallback); |
(...skipping 15 matching lines...) Expand all Loading... |
94 } | 96 } |
95 return 0; | 97 return 0; |
96 } | 98 } |
97 | 99 |
98 DEFINE_TRACE(DeprecatedStorageInfo) { | 100 DEFINE_TRACE(DeprecatedStorageInfo) { |
99 visitor->trace(m_temporaryStorage); | 101 visitor->trace(m_temporaryStorage); |
100 visitor->trace(m_persistentStorage); | 102 visitor->trace(m_persistentStorage); |
101 } | 103 } |
102 | 104 |
103 } // namespace blink | 105 } // namespace blink |
OLD | NEW |