| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void DeprecatedStorageInfo::queryUsageAndQuota( | 47 void DeprecatedStorageInfo::queryUsageAndQuota( |
| 48 ScriptState* scriptState, | 48 ScriptState* scriptState, |
| 49 int storageType, | 49 int storageType, |
| 50 StorageUsageCallback* successCallback, | 50 StorageUsageCallback* successCallback, |
| 51 StorageErrorCallback* errorCallback) { | 51 StorageErrorCallback* errorCallback) { |
| 52 // Dispatching the request to DeprecatedStorageQuota, as this interface is | 52 // Dispatching the request to DeprecatedStorageQuota, as this interface is |
| 53 // deprecated in favor of DeprecatedStorageQuota. | 53 // deprecated in favor of DeprecatedStorageQuota. |
| 54 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); | 54 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); |
| 55 if (!storageQuota) { | 55 if (!storageQuota) { |
| 56 // Unknown storage type is requested. | 56 // Unknown storage type is requested. |
| 57 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, | 57 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, scriptState) |
| 58 scriptState->getExecutionContext()) | |
| 59 ->postTask(BLINK_FROM_HERE, StorageErrorCallback::createSameThreadTask( | 58 ->postTask(BLINK_FROM_HERE, StorageErrorCallback::createSameThreadTask( |
| 60 errorCallback, NotSupportedError)); | 59 errorCallback, NotSupportedError)); |
| 61 return; | 60 return; |
| 62 } | 61 } |
| 63 storageQuota->queryUsageAndQuota(scriptState, successCallback, errorCallback); | 62 storageQuota->queryUsageAndQuota(scriptState, successCallback, errorCallback); |
| 64 } | 63 } |
| 65 | 64 |
| 66 void DeprecatedStorageInfo::requestQuota(ScriptState* scriptState, | 65 void DeprecatedStorageInfo::requestQuota(ScriptState* scriptState, |
| 67 int storageType, | 66 int storageType, |
| 68 unsigned long long newQuotaInBytes, | 67 unsigned long long newQuotaInBytes, |
| 69 StorageQuotaCallback* successCallback, | 68 StorageQuotaCallback* successCallback, |
| 70 StorageErrorCallback* errorCallback) { | 69 StorageErrorCallback* errorCallback) { |
| 71 // Dispatching the request to DeprecatedStorageQuota, as this interface is | 70 // Dispatching the request to DeprecatedStorageQuota, as this interface is |
| 72 // deprecated in favor of DeprecatedStorageQuota. | 71 // deprecated in favor of DeprecatedStorageQuota. |
| 73 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); | 72 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); |
| 74 if (!storageQuota) { | 73 if (!storageQuota) { |
| 75 // Unknown storage type is requested. | 74 // Unknown storage type is requested. |
| 76 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, | 75 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, scriptState) |
| 77 scriptState->getExecutionContext()) | |
| 78 ->postTask(BLINK_FROM_HERE, StorageErrorCallback::createSameThreadTask( | 76 ->postTask(BLINK_FROM_HERE, StorageErrorCallback::createSameThreadTask( |
| 79 errorCallback, NotSupportedError)); | 77 errorCallback, NotSupportedError)); |
| 80 return; | 78 return; |
| 81 } | 79 } |
| 82 storageQuota->requestQuota(scriptState, newQuotaInBytes, successCallback, | 80 storageQuota->requestQuota(scriptState, newQuotaInBytes, successCallback, |
| 83 errorCallback); | 81 errorCallback); |
| 84 } | 82 } |
| 85 | 83 |
| 86 DeprecatedStorageQuota* DeprecatedStorageInfo::getStorageQuota( | 84 DeprecatedStorageQuota* DeprecatedStorageInfo::getStorageQuota( |
| 87 int storageType) { | 85 int storageType) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 99 } | 97 } |
| 100 return 0; | 98 return 0; |
| 101 } | 99 } |
| 102 | 100 |
| 103 DEFINE_TRACE(DeprecatedStorageInfo) { | 101 DEFINE_TRACE(DeprecatedStorageInfo) { |
| 104 visitor->trace(m_temporaryStorage); | 102 visitor->trace(m_temporaryStorage); |
| 105 visitor->trace(m_persistentStorage); | 103 visitor->trace(m_persistentStorage); |
| 106 } | 104 } |
| 107 | 105 |
| 108 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |