| Summary: | IDB: Support IDBFactory.deleteDatabase() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jon Lee <jonlee> | ||||
| Component: | WebCore Misc. | Assignee: | Brady Eidson <beidson> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | alecflett, commit-queue, jsbell, mjs, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 124521 | ||||||
| Attachments: |
|
||||||
|
Description
Jon Lee
2014-02-01 19:57:43 PST
Created attachment 222918 [details]
Patch v1
Touches the filesystem (delete), so requires extra scrutiny.
Attachment 222918 [details] did not pass style-queue:
ERROR: Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:202: Place brace on its own line for function definitions. [whitespace/braces] [4]
ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:44: Missing space after , [whitespace/comma] [3]
Total errors found: 2 in 17 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 222918 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=222918&action=review r=me > Source/WebCore/Modules/indexeddb/IDBFactory.cpp:164 > - m_backend->deleteDatabase(name, request, context->securityOrigin(), context, getIndexedDBDatabasePath(context)); > + m_backend->deleteDatabase(name, *(context->securityOrigin()), *(context->topOrigin()), request, context, getIndexedDBDatabasePath(context)); It feels like instead of *(context->securityOrigin()), you could just say *context->securityOrigin(). The extra parens make me initially expect something sneaky to be going on even though it's pretty straight-forward. Comment on attachment 222918 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=222918&action=review Count me as a pair of eyes. > Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp:558 > -void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> callbacks) > +void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> prpCallbacks) Hungarian notation!? > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:166 > + LOG(IDB, "UniqueIDBDatabase::shutdownBackingStore would deleting file '%s' on disk", dbFilename.utf8().data()); would deleting file? Comment on attachment 222918 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=222918&action=review >> Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp:558 >> +void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> prpCallbacks) > > Hungarian notation!? It is the sanctioned prefix for PassRefPtr when you want to put it into a RefPtr in the function. http://www.webkit.org/coding/RefPtr.html (In reply to comment #4) > (From update of attachment 222918 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=222918&action=review > > Count me as a pair of eyes. > > > Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp:558 > > -void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> callbacks) > > +void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> prpCallbacks) > > Hungarian notation!? Tim already pointed out this is the PassRefPtr standard. > > Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:166 > > + LOG(IDB, "UniqueIDBDatabase::shutdownBackingStore would deleting file '%s' on disk", dbFilename.utf8().data()); > > would deleting file? Yikes. Thanks! (In reply to comment #3) > > Source/WebCore/Modules/indexeddb/IDBFactory.cpp:164 > > - m_backend->deleteDatabase(name, request, context->securityOrigin(), context, getIndexedDBDatabasePath(context)); > > + m_backend->deleteDatabase(name, *(context->securityOrigin()), *(context->topOrigin()), request, context, getIndexedDBDatabasePath(context)); > > It feels like instead of *(context->securityOrigin()), you could just say *context->securityOrigin(). The extra parens make me initially expect something sneaky to be going on even though it's pretty straight-forward. You're right. Thanks! (In reply to comment #5) > (From update of attachment 222918 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=222918&action=review > > >> Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp:558 > >> +void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> prpCallbacks) > > > > Hungarian notation!? > > It is the sanctioned prefix for PassRefPtr when you want to put it into a RefPtr in the function. http://www.webkit.org/coding/RefPtr.html What a weird choice. I get the desire to distinguish the name from the actually used one, but I'd use something like "passCallbacks" or "callbacksParam" or "callbacksArg" to make this clear. I will have to ask Darin why he used "prp" in the RefPtr guide. Comment on attachment 222918 [details]
Patch v1
I don't see any issues besides those spotted by others. r=me
|