| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 StorageQuotaCallbacks* callbacks = DeprecatedStorageQuotaCallbacksImpl::
create(successCallback, errorCallback); | 68 StorageQuotaCallbacks* callbacks = DeprecatedStorageQuotaCallbacksImpl::
create(successCallback, errorCallback); |
| 69 webFrame->client()->requestStorageQuota(webFrame, storageType, newQuotaI
nBytes, callbacks); | 69 webFrame->client()->requestStorageQuota(webFrame, storageType, newQuotaI
nBytes, callbacks); |
| 70 } else { | 70 } else { |
| 71 // Requesting quota in Worker is not supported. | 71 // Requesting quota in Worker is not supported. |
| 72 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); | 72 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 ScriptPromise StorageQuotaClientImpl::requestPersistentQuota(ScriptState* script
State, unsigned long long newQuotaInBytes) | 76 ScriptPromise StorageQuotaClientImpl::requestPersistentQuota(ScriptState* script
State, unsigned long long newQuotaInBytes) |
| 77 { | 77 { |
| 78 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); | 78 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
| 79 ScriptPromise promise = resolver->promise(); | 79 ScriptPromise promise = resolver->promise(); |
| 80 | 80 |
| 81 if (scriptState->executionContext()->isDocument()) { | 81 if (scriptState->executionContext()->isDocument()) { |
| 82 Document* document = toDocument(scriptState->executionContext()); | 82 Document* document = toDocument(scriptState->executionContext()); |
| 83 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->fra
me()); | 83 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->fra
me()); |
| 84 StorageQuotaCallbacks* callbacks = StorageQuotaCallbacksImpl::create(res
olver); | 84 StorageQuotaCallbacks* callbacks = StorageQuotaCallbacksImpl::create(res
olver); |
| 85 webFrame->client()->requestStorageQuota(webFrame, WebStorageQuotaTypePer
sistent, newQuotaInBytes, callbacks); | 85 webFrame->client()->requestStorageQuota(webFrame, WebStorageQuotaTypePer
sistent, newQuotaInBytes, callbacks); |
| 86 } else { | 86 } else { |
| 87 // Requesting quota in Worker is not supported. | 87 // Requesting quota in Worker is not supported. |
| 88 resolver->reject(DOMError::create(NotSupportedError)); | 88 resolver->reject(DOMError::create(NotSupportedError)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 return promise; | 91 return promise; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| OLD | NEW |