Bug 127401 - IDB: Support "put"
Summary: IDB: Support "put"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks: 124521
  Show dependency treegraph
 
Reported: 2014-01-21 20:32 PST by Brady Eidson
Modified: 2014-01-22 15:44 PST (History)
10 users (show)

See Also:


Attachments
Patch v1 (53.26 KB, patch)
2014-01-21 22:36 PST, Brady Eidson
ap: review+
Details | Formatted Diff | Diff
EWS run to check the builds (58.40 KB, patch)
2014-01-22 14:47 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Maybe fix EWS builds (58.42 KB, patch)
2014-01-22 15:13 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-01-21 20:32:49 PST
IDB: Support "put"

In radar as <rdar://problem/15779643>
Comment 1 Brady Eidson 2014-01-21 22:36:48 PST
Created attachment 221829 [details]
Patch v1
Comment 2 WebKit Commit Bot 2014-01-21 22:38:10 PST
Attachment 221829 [details] did not pass style-queue:


ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:409:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:410:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:80:  The parameter name "key" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:122:  The parameter name "key" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:78:  Non-label code inside switch statements should be indented.  [whitespace/indent] [4]
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:78:  The parameter name "key" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 6 in 29 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alexey Proskuryakov 2014-01-22 13:56:56 PST
Comment on attachment 221829 [details]
Patch v1

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

Please fix non-Mac builds.

> Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:13
> + * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY

I'm not sure if these headers are correct. Did you get it from webkit.org?

This says "Apple Inc." in copyright line, but "APPLE, INC." with a comma inside.

> Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:69
> +PassRefPtr<IDBKey> IDBKeyData::maybeCreateIDBKey() const

maybe?

> Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp:57
> +RefPtr<WebCore::SharedBuffer> serializeIDBKey(const WebCore::IDBKey& key)

We should have "using namespace WebCore" in this file if we don't yet.

> Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:396
> +void UniqueIDBDatabase::putRecord(const IDBTransactionIdentifier& identifier, int64_t objectStoreID, const WebCore::IDBKeyData& keyData, const IPC::DataReference& value, int64_t putMode, const Vector<int64_t>& indexIDs, const Vector<Vector<WebCore::IDBKeyData>>& indexKeys, std::function<void(const IDBKeyData&, uint32_t, const String&)> callback)

Ditto.

> Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:409
> +    }, [this, callback]() {

Hopefully something protects "this" while the request is in progress.

> Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:528
> +    // FIXME: The LevelDB post performs "makeIndexWriters" here. Necessary?

"post" looks like a typo.
Comment 4 Brady Eidson 2014-01-22 14:44:28 PST
(In reply to comment #3)
> (From update of attachment 221829 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221829&action=review
> 
> Please fix non-Mac builds.
> 
> > Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:13
> > + * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
> 
> I'm not sure if these headers are correct. Did you get it from webkit.org?
> 
> This says "Apple Inc." in copyright line, but "APPLE, INC." with a comma inside.

Grabbed from another newly added file.  I see there's subtle variations floating around, not sure if any are canonical.  I removed the comma.

> 
> > Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:69
> > +PassRefPtr<IDBKey> IDBKeyData::maybeCreateIDBKey() const
> 
> maybe?

Definitely might return nullptr to represent a null IDBKey
> 
> > Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp:57
> > +RefPtr<WebCore::SharedBuffer> serializeIDBKey(const WebCore::IDBKey& key)
> 
> We should have "using namespace WebCore" in this file if we don't yet.

Okay!


> > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:396
> > +void UniqueIDBDatabase::putRecord(const IDBTransactionIdentifier& identifier, int64_t objectStoreID, const WebCore::IDBKeyData& keyData, const IPC::DataReference& value, int64_t putMode, const Vector<int64_t>& indexIDs, const Vector<Vector<WebCore::IDBKeyData>>& indexKeys, std::function<void(const IDBKeyData&, uint32_t, const String&)> callback)
> 
> Ditto.

Okay!

> > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:409
> > +    }, [this, callback]() {
> 
> Hopefully something protects "this" while the request is in progress.

Yup, the connection outlives requests.

> > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:528
> > +    // FIXME: The LevelDB post performs "makeIndexWriters" here. Necessary?
> 
> "post" looks like a typo.

Because it is!  s/post/port/

Thanks!
Comment 5 Brady Eidson 2014-01-22 14:47:08 PST
Created attachment 221906 [details]
EWS run to check the builds
Comment 6 WebKit Commit Bot 2014-01-22 14:49:26 PST
Attachment 221906 [details] did not pass style-queue:


ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:409:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 33 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Brady Eidson 2014-01-22 15:13:42 PST
Created attachment 221914 [details]
Maybe fix EWS builds
Comment 8 WebKit Commit Bot 2014-01-22 15:15:31 PST
Attachment 221914 [details] did not pass style-queue:


ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:409:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 33 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Brady Eidson 2014-01-22 15:44:45 PST
http://trac.webkit.org/changeset/162566