WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
155052
Add new categories to WKWebsiteData
https://bugs.webkit.org/show_bug.cgi?id=155052
Summary
Add new categories to WKWebsiteData
John Wilander
Reported
2016-03-04 16:42:57 PST
Add new categories to WKWebsiteData – PrevalentResource, UserInteraction, EmbeddedUnderOrigins, and EmbedsOrigins
Attachments
Patch
(18.70 KB, patch)
2016-03-04 17:11 PST
,
John Wilander
no flags
Details
Formatted Diff
Diff
Patch
(18.51 KB, patch)
2016-03-05 17:26 PST
,
John Wilander
no flags
Details
Formatted Diff
Diff
Patch
(19.06 KB, patch)
2016-03-05 18:25 PST
,
John Wilander
no flags
Details
Formatted Diff
Diff
Patch
(20.46 KB, patch)
2016-03-07 13:54 PST
,
John Wilander
no flags
Details
Formatted Diff
Diff
Patch
(20.52 KB, patch)
2016-03-07 14:54 PST
,
John Wilander
sam
: review-
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
John Wilander
Comment 1
2016-03-04 16:43:48 PST
rdar://problem/23845874
John Wilander
Comment 2
2016-03-04 17:11:34 PST
Created
attachment 273058
[details]
Patch
Brent Fulgham
Comment 3
2016-03-04 17:27:20 PST
Comment on
attachment 273058
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273058&action=review
This patch is close, but it will bog down the main GUI thread with needless copying and other computations. Please correct that.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:465 > +
No blank line here, please.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:482 > +
No blank line here, please.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:491 > + websiteData.entries.append(WebsiteData::Entry { WTFMove(origin), WebsiteDataType::WebsiteDataTypeUserInteraction, 0, 0, 0 });
Why are you doing all of this copying on the main thread? I think the copy step should be done outside the RunLoop::main().dispatch so that we don't lock up the GUI process.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:499 > +
No blank line here, please.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:508 > + websiteData.entries.append(WebsiteData::Entry { WTFMove(origin), WebsiteDataType::WebsiteDataTypeEmbeddedUnderOrigins, 0, originsAndEmbeddedUnderOrigins.get(origin), 0 });
Ditto regarding copying on main thread.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:516 > +
No blank line here.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:525 > + websiteData.entries.append(WebsiteData::Entry { WTFMove(origin), WebsiteDataType::WebsiteDataTypeEmbedsOrigins, 0, originsAndOriginsTheyEmbed.get(origin), 0});
Ditto regarding copying on the main thread.
John Wilander
Comment 4
2016-03-05 17:26:07 PST
Created
attachment 273113
[details]
Patch
John Wilander
Comment 5
2016-03-05 17:26:59 PST
Thanks for the review! All of Brent's comments addressed.
Brent Fulgham
Comment 6
2016-03-05 17:56:34 PST
Comment on
attachment 273113
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273113&action=review
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1190 > + // FIXME: Not implemented
A small nit: we tend to want a Radar or Bugzilla bug number whenever we have a FIXME comment.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1199 > + // FIXME: Not implemented
Ditto.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1208 > + // FIXME: Not implemented
Ditto.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:1217 > + // FIXME: Not implemented
Ditto.
Brent Fulgham
Comment 7
2016-03-05 17:57:44 PST
This patch looks good to me, but we need Andy to give a final WebKit2 approval.
John Wilander
Comment 8
2016-03-05 18:25:16 PST
Created
attachment 273115
[details]
Patch
John Wilander
Comment 9
2016-03-05 18:26:36 PST
Fixed the FIXMEs with a reference to
rdar://problem/24996840
.
Sam Weinig
Comment 10
2016-03-06 15:28:09 PST
Comment on
attachment 273115
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273115&action=review
> Source/WebKit2/ChangeLog:30 > + * DatabaseProcess/DatabaseProcess.cpp: > + (WebKit::DatabaseProcess::fetchWebsiteData): > + * NetworkProcess/NetworkProcess.cpp: > + (WebKit::fetchDiskCacheEntries): > + * Shared/WebsiteData/WebsiteData.h: > + * Shared/WebsiteData/WebsiteDataType.h: > + * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: > + (dataTypesToString): > + * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: > + (WebKit::toWebsiteDataType): > + (WebKit::toWKWebsiteDataTypes): > + * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: > + * UIProcess/WebsiteData/WebsiteDataStore.cpp: > + (WebKit::WebsiteDataStore::fetchData): > + (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): > + (WebKit::WebsiteDataStore::prevalentResourceOrigins): > + (WebKit::WebsiteDataStore::userInteractionOrigins): > + (WebKit::WebsiteDataStore::embeddedUnderOrigins): > + (WebKit::WebsiteDataStore::embedsOrigins): > + * UIProcess/WebsiteData/WebsiteDataStore.h: > + * WebProcess/WebProcess.cpp: > + (WebKit::WebProcess::fetchWebsiteData):
Please provide detailed changelog comments.
> Source/WebKit2/Shared/WebsiteData/WebsiteData.h:49 > + unsigned embeddedUnderOrigins; > + unsigned embedsOrigins;
What are embeddedUnderOrigins and embedsOrigins? What do these counts represent?
> Source/WebKit2/Shared/WebsiteData/WebsiteDataType.h:50 > + WebsiteDataTypePrevalentResource = 1 << 14,
What is a PrevalentResource?
> Source/WebKit2/Shared/WebsiteData/WebsiteDataType.h:51 > + WebsiteDataTypeUserInteraction = 1 << 15,
How can a a piece of data be of type UserInteraction?
> Source/WebKit2/Shared/WebsiteData/WebsiteDataType.h:53 > + WebsiteDataTypeEmbeddedUnderOrigins = 1 << 16, > + WebsiteDataTypeEmbedsOrigins = 1 << 16,
Same question as above.
> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h:118 > + static Vector<RefPtr<WebCore::SecurityOrigin>> prevalentResourceOrigins(); > + static Vector<RefPtr<WebCore::SecurityOrigin>> userInteractionOrigins(); > + static HashMap<RefPtr<WebCore::SecurityOrigin>, unsigned> embeddedUnderOrigins(); > + static HashMap<RefPtr<WebCore::SecurityOrigin>, unsigned> embedsOrigins();
Why are these static?
John Wilander
Comment 11
2016-03-07 13:54:02 PST
Created
attachment 273208
[details]
Patch
John Wilander
Comment 12
2016-03-07 13:57:02 PST
Added changelog comments per file. Renamed types and associated functions to make them more clear. The getter functions are static since I believe the data source will be a static single ton. I'll change those if static doesn't turn out to be the correct choice.
Andy Estes
Comment 13
2016-03-07 14:06:44 PST
(In reply to
comment #12
)
> Added changelog comments per file. > Renamed types and associated functions to make them more clear. > > The getter functions are static since I believe the data source will be a > static single ton. I'll change those if static doesn't turn out to be the > correct choice.
Won't the data source be WebsiteDataStore::m_resourceLoadStatistics in this case? That's not a singleton.
John Wilander
Comment 14
2016-03-07 14:51:35 PST
You are absolutely correct. Uploading new patch.
John Wilander
Comment 15
2016-03-07 14:54:14 PST
Created
attachment 273217
[details]
Patch
Sam Weinig
Comment 16
2016-03-14 12:56:29 PDT
I still don't understand why these new categories are needed. If all the data is being stored as part of the resource load statistics, that seems like the only category you need.
Sam Weinig
Comment 17
2016-03-20 14:10:13 PDT
Comment on
attachment 273217
[details]
Patch r-ing because I don't understand why we need these new types.
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