| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 { | 55 { |
| 56 ASSERT(executionContext); | 56 ASSERT(executionContext); |
| 57 | 57 |
| 58 WebStorageQuotaType storageType = static_cast<WebStorageQuotaType>(m_type); | 58 WebStorageQuotaType storageType = static_cast<WebStorageQuotaType>(m_type); |
| 59 if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorage
QuotaTypePersistent) { | 59 if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorage
QuotaTypePersistent) { |
| 60 // Unknown storage type is requested. | 60 // Unknown storage type is requested. |
| 61 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); | 61 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); |
| 62 return; | 62 return; |
| 63 } | 63 } |
| 64 | 64 |
| 65 SecurityOrigin* securityOrigin = executionContext->securityOrigin(); | 65 SecurityOrigin* securityOrigin = executionContext->getSecurityOrigin(); |
| 66 if (securityOrigin->isUnique()) { | 66 if (securityOrigin->isUnique()) { |
| 67 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); | 67 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 KURL storagePartition = KURL(KURL(), securityOrigin->toString()); | 71 KURL storagePartition = KURL(KURL(), securityOrigin->toString()); |
| 72 StorageQuotaCallbacks* callbacks = DeprecatedStorageQuotaCallbacksImpl::crea
te(successCallback, errorCallback); | 72 StorageQuotaCallbacks* callbacks = DeprecatedStorageQuotaCallbacksImpl::crea
te(successCallback, errorCallback); |
| 73 Platform::current()->queryStorageUsageAndQuota(storagePartition, storageType
, callbacks); | 73 Platform::current()->queryStorageUsageAndQuota(storagePartition, storageType
, callbacks); |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 87 StorageQuotaClient* client = StorageQuotaClient::from(executionContext); | 87 StorageQuotaClient* client = StorageQuotaClient::from(executionContext); |
| 88 if (!client) { | 88 if (!client) { |
| 89 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); | 89 executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::create
SameThreadTask(errorCallback, NotSupportedError)); |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 | 92 |
| 93 client->requestQuota(executionContext, storageType, newQuotaInBytes, success
Callback, errorCallback); | 93 client->requestQuota(executionContext, storageType, newQuotaInBytes, success
Callback, errorCallback); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace blink | 96 } // namespace blink |
| OLD | NEW |