Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1405)

Side by Side Diff: Source/web/StorageQuotaClientImpl.cpp

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: keepAliveWhilePending() comment Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(FROM_HERE, StorageErrorCallback::CallbackTask ::create(errorCallback, NotSupportedError)); 72 executionContext->postTask(FROM_HERE, StorageErrorCallback::CallbackTask ::create(errorCallback, 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 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState); 78 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698