WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
200895
Use a strongly typed identifier for StorageNamespace's identifier
https://bugs.webkit.org/show_bug.cgi?id=200895
Summary
Use a strongly typed identifier for StorageNamespace's identifier
Chris Dumez
Reported
2019-08-19 13:33:09 PDT
Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t.
Attachments
Patch
(48.27 KB, patch)
2019-08-19 13:36 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(49.89 KB, patch)
2019-08-20 09:03 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2019-08-19 13:36:44 PDT
Created
attachment 376705
[details]
Patch
Chris Dumez
Comment 2
2019-08-20 08:25:15 PDT
ping review?
youenn fablet
Comment 3
2019-08-20 08:38:29 PDT
Comment on
attachment 376705
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376705&action=review
> Source/WebCore/storage/StorageNamespace.h:45 > + virtual Ref<StorageNamespace> copy(Page* newPage) = 0; // Only valid for session storage.
Comment is not really clear to me. I am not sure how it relates to the current patch. If we want to precise the meaning of copy, maybe we should precise the name of the method?
> Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp:195 > +StorageArea* StorageManager::createLocalStorageArea(StorageNamespaceIdentifier storageNamespaceID, WebCore::SecurityOriginData&& origin, Ref<WorkQueue>&& workQueue)
We can probably remove WebCore:: here.
> Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp:205 > +StorageArea* StorageManager::createTransientLocalStorageArea(StorageNamespaceIdentifier storageNamespaceID, WebCore::SecurityOriginData&& topLevelOrigin, WebCore::SecurityOriginData&& origin, Ref<WorkQueue>&& workQueue)
Ditto.
> Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp:216 > +StorageArea* StorageManager::createSessionStorageArea(StorageNamespaceIdentifier storageNamespaceID, WebCore::SecurityOriginData&& origin, Ref<WorkQueue>&& workQueue)
Ditto.
> Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp:114 > + return makeObjectIdentifier<PageIdentifierType>(m_storageNamespaceID.toUInt64());
This is preexisting code but seems a bit odd to me.
> Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:54 > return storageNamespaceProvider;
HashMap::ensure maybe
Chris Dumez
Comment 4
2019-08-20 08:45:58 PDT
Comment on
attachment 376705
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376705&action=review
>> Source/WebCore/storage/StorageNamespace.h:45 >> + virtual Ref<StorageNamespace> copy(Page* newPage) = 0; // Only valid for session storage. > > Comment is not really clear to me. I am not sure how it relates to the current patch. > If we want to precise the meaning of copy, maybe we should precise the name of the method?
I noticed while writing this patch (because it was made obvious by the new code factoring) that the implementation of this function is only correct if the StorageNamespace object is for session storage. If the StorageNamespace object is used for local storage, then it does not do the right thing. I think that ideally, this would be moved to a subclass (e.g. SessionStorageNamespace which we would need to create) but this is a bit out of scope of this patch, so I merely put in a comment.
youenn fablet
Comment 5
2019-08-20 08:47:47 PDT
Maybe a FIXME would be more adequate then.
Chris Dumez
Comment 6
2019-08-20 09:03:01 PDT
Created
attachment 376773
[details]
Patch
WebKit Commit Bot
Comment 7
2019-08-20 09:35:02 PDT
Comment on
attachment 376773
[details]
Patch Clearing flags on attachment: 376773 Committed
r248901
: <
https://trac.webkit.org/changeset/248901
>
WebKit Commit Bot
Comment 8
2019-08-20 09:35:04 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9
2019-08-20 09:36:18 PDT
<
rdar://problem/54514978
>
Simon Fraser (smfr)
Comment 10
2021-08-20 15:46:27 PDT
Comment on
attachment 376773
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376773&action=review
> Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp:120 > + ASSERT(m_storageType == StorageType::Local || m_storageType == StorageType::TransientLocal); > + return m_storageNamespaceID.toUInt64();
Why is this returning the m_storageNamespaceID as a page group identifier?
Alex Christensen
Comment 11
2021-08-20 15:47:20 PDT
Comment on
attachment 376773
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=376773&action=review
>> Source/WebKit/WebProcess/WebStorage/StorageNamespaceImpl.cpp:120 >> + return m_storageNamespaceID.toUInt64(); > > Why is this returning the m_storageNamespaceID as a page group identifier?
This is among the many reasons I've been working to remove page groups from WebKit2.
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