[webkit-reviews] review granted: [Bug 211043] IndexedDB: Support IDBFactory databases method : [Attachment 401829] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jun 15 01:15:56 PDT 2020
youenn fablet <youennf at gmail.com> has granted Darryl Pogue
<dvpdiner2 at gmail.com>'s request for review:
Bug 211043: IndexedDB: Support IDBFactory databases method
https://bugs.webkit.org/show_bug.cgi?id=211043
Attachment 401829: Patch
https://bugs.webkit.org/attachment.cgi?id=401829&action=review
--- Comment #24 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 401829
--> https://bugs.webkit.org/attachment.cgi?id=401829
Patch
LGTM
View in context: https://bugs.webkit.org/attachment.cgi?id=401829&action=review
> Source/WebCore/Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h:50
> + using InfoCallback =
CompletionHandler<void(Optional<Vector<IDBDatabaseNameAndVersion>>&&)>;
I take this suggestion back.
There is no guarantee right now that complete will be called, so it is best to
change it back to a Function.
> Source/WebCore/Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h:64
> + bool m_hasPendingActivity { true };
Should be moved with other members.
Given it stays true though, we could probably remove it.
> Source/WebCore/Modules/indexeddb/IDBFactory.h:48
> +class DeferredPromise;
Not needed?
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp:482
> + Optional<Vector<IDBDatabaseNameAndVersion>> result = WTF::nullopt;
By default optional is null, so no need for assignment here.
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp:483
> + didGetAllDatabaseNamesAndVersions(requestIdentifier,
WTFMove(result));
Can we write it as didGetAllDatabaseNamesAndVersions(requestIdentifier, { });?
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp:519
> + auto req = IDBDatabaseNameAndVersionRequest::create(context, *this,
WTFMove(callback));
s/req/newRequest/
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp:535
> + if (!req)
s/req/takenRequest/
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp:538
> + request = (*req).ptr();
request = WTFMove(*req)
> Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h:54
> +struct IDBDatabaseNameAndVersion;
Might not be needed if IDBDatabaseNameAndVersionRequest.h declares it
> Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:196
> +void WebIDBConnectionToClient::didGetAllDatabaseNamesAndVersions(const
WebCore::IDBResourceIdentifier& requestIdentifier,
Vector<WebCore::IDBDatabaseNameAndVersion>&& databases)
We can keep a const & here since that is what
Messages::WebIDBConnectionToServer::DidGetAllDatabaseNamesAndVersions is taking
> Source/WebKitLegacy/Storage/InProcessIDBServer.cpp:489
> + dispatchTaskReply([this, protectedThis = makeRef(*this),
requestIdentifier, databases = WTFMove(databases)]() mutable {
It is safer to keep isolatedCopying databases.
More information about the webkit-reviews
mailing list