WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 200526
192270
Let JSDOMGlobalObject in uniqueIDBDatabase be deleted if no database is using it
https://bugs.webkit.org/show_bug.cgi?id=192270
Summary
Let JSDOMGlobalObject in uniqueIDBDatabase be deleted if no database is using it
Sihui Liu
Reported
2018-11-30 17:13:18 PST
JSDOMGlobalObject in uniqueIDBDatabase is used for serializing and deserializing JavaScript values, so we don't have to keep it and its VM forever if there are no objects using it.
Attachments
Patch
(12.96 KB, patch)
2018-11-30 17:21 PST
,
Sihui Liu
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews117 for mac-sierra
(2.25 MB, application/zip)
2018-11-30 19:37 PST
,
EWS Watchlist
no flags
Details
Patch
(12.82 KB, patch)
2018-12-03 15:52 PST
,
Sihui Liu
ggaren
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sihui Liu
Comment 1
2018-11-30 17:21:35 PST
Created
attachment 356268
[details]
Patch
EWS Watchlist
Comment 2
2018-11-30 19:37:39 PST
Comment on
attachment 356268
[details]
Patch
Attachment 356268
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/10224031
New failing tests: imported/w3c/IndexedDB-private-browsing/idbdatabase_createObjectStore10-1000ends.html
EWS Watchlist
Comment 3
2018-11-30 19:37:41 PST
Created
attachment 356284
[details]
Archive of layout-test-results from ews117 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-sierra Platform: Mac OS X 10.12.6
Chris Dumez
Comment 4
2018-12-03 09:09:19 PST
Comment on
attachment 356268
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=356268&action=review
layout test failure looks likely related.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:90 > + , m_serializationContext(nullptr)
Not needed, the RefPtr<> default constructor does the right thing.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:967 > +void UniqueIDBDatabase::sharedIDBSerializationContext(RefPtr<IDBSerializationContext>& context)
Why isn't this returning the context instead of using an out-parameter? This looks confusing.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:974 > + if (!s_context.get().get())
Doesn't "if (!s_context)" work? At the very least "if (!s_context.get())" should.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1032 > + sharedIDBSerializationContext(m_serializationContext);
This looks super confusing.
> Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h:80 > + IDBSerializationContext();
Constructor should be private and this class should have a create() factory static function. This is the convention for RefCounted classes. Also, I'd swap the base classes order.
Sihui Liu
Comment 5
2018-12-03 15:52:18 PST
(In reply to Chris Dumez from
comment #4
)
> Comment on
attachment 356268
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=356268&action=review
> > layout test failure looks likely related. >
Fixed.
> > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:90 > > + , m_serializationContext(nullptr) > > Not needed, the RefPtr<> default constructor does the right thing. >
Removed.
> > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:967 > > +void UniqueIDBDatabase::sharedIDBSerializationContext(RefPtr<IDBSerializationContext>& context) > > Why isn't this returning the context instead of using an out-parameter? This > looks confusing. >
Changed to use a return value.
> > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:974 > > + if (!s_context.get().get()) > > Doesn't "if (!s_context)" work? At the very least "if (!s_context.get())" > should. >
s_context.get() works!
> > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1032 > > + sharedIDBSerializationContext(m_serializationContext); > > This looks super confusing. >
Ditto.
> > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h:80 > > + IDBSerializationContext(); > > Constructor should be private and this class should have a create() factory > static function. This is the convention for RefCounted classes. Also, I'd > swap the base classes order.
Done.
Sihui Liu
Comment 6
2018-12-03 15:52:23 PST
Created
attachment 356426
[details]
Patch
Geoffrey Garen
Comment 7
2019-06-19 11:46:51 PDT
Comment on
attachment 356426
[details]
Patch r=me
Sihui Liu
Comment 8
2019-08-07 18:17:58 PDT
Probably a more complete solution in
https://bugs.webkit.org/show_bug.cgi?id=200526
. *** This bug has been marked as a duplicate of
bug 200526
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug