Bug 47389 - IndexedDB does not have a quota mechanism.
Summary: IndexedDB does not have a quota mechanism.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 18:38 PDT by Andrei Popescu
Modified: 2010-10-08 14:28 PDT (History)
2 users (show)

See Also:


Attachments
Patch (60.54 KB, patch)
2010-10-07 18:41 PDT, Andrei Popescu
no flags Details | Formatted Diff | Diff
Patch (67.30 KB, patch)
2010-10-08 11:36 PDT, Andrei Popescu
jorlow: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Popescu 2010-10-07 18:38:46 PDT
IndexedDB does not have a quota mechanism.
Comment 1 Andrei Popescu 2010-10-07 18:41:58 PDT
Created attachment 70184 [details]
Patch
Comment 2 WebKit Review Bot 2010-10-07 18:47:48 PDT
Attachment 70184 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/storage/IDBDatabaseBackendImpl.cpp:156:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Jeremy Orlow 2010-10-07 22:51:23 PDT
Comment on attachment 70184 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=70184&action=review

close

> LayoutTests/storage/indexeddb/database-basics.html:124
> +function checkQuotaEnforcing()

I think this stuff would be best in its own test.

> WebCore/storage/IDBDatabaseBackendImpl.cpp:155
> +        transaction->abort();

return?

> WebCore/storage/IDBDatabaseBackendImpl.cpp:230
> +        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));

Add a fixme to spec this.

> WebCore/storage/IDBObjectStoreBackendImpl.cpp:136
> +    return (resultCode != SQLResultOk) && (resultCode != SQLResultDone);

don't need ()'s

When could a result be either one or the other?  Isn't it always defined which it'll be in a non-error case?

> WebCore/storage/IDBObjectStoreBackendImpl.cpp:192
> +    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;

um..you put the Ptr suffix in the wrong place  :-)

> WebCore/storage/IDBObjectStoreBackendImpl.cpp:246
> +        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));

fixmes...here and anywhere u use unkown_err

> WebKit/chromium/src/WebIDBFactoryImpl.cpp:61
> +void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize)

int64 should work, i think.  i'm pretty sure i used it somewhere else in this
Comment 4 Andrei Popescu 2010-10-08 11:36:55 PDT
Created attachment 70272 [details]
Patch
Comment 5 Jeremy Orlow 2010-10-08 11:43:02 PDT
Comment on attachment 70272 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=70272&action=review

r=me

> WebCore/storage/IDBObjectStoreBackendImpl.cpp:303
> +    if (!insert.prepare()) {

compare against the constants

> WebCore/storage/IDBObjectStoreBackendImpl.cpp:311
> +    if (!insert.step()) {

compare against the constants

> WebCore/storage/IDBObjectStoreBackendImpl.h:86
> +    static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface> transaction);

don't need the word transaction
Comment 6 Andrei Popescu 2010-10-08 14:28:25 PDT
Committed r69421: <http://trac.webkit.org/changeset/69421>