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

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

Issue 1110063011: WIP Durable storage, webkit side (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/StorageQuotaClientImpl.h ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ScriptPromise StorageQuotaClientImpl::requestDurability(ScriptState* scriptState )
95 {
96 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState);
97 ScriptPromise promise = resolver->promise();
98
99 if (scriptState->executionContext()->isDocument()) {
100 Document* document = toDocument(scriptState->executionContext());
101 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->fra me());
102 StorageQuotaCallbacks* callbacks = StorageQuotaCallbacksImpl::create(res olver);
103 webFrame->client()->requestDurability(webFrame, callbacks);
104 } else {
105 // Requesting quota in Worker is not supported.
106 resolver->reject(DOMError::create(NotSupportedError));
107 }
108 return promise;
109 }
110
94 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/StorageQuotaClientImpl.h ('k') | public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698