Bug 170324 - Resource Load Statistics: Check if the store exists before clearing it
Summary: Resource Load Statistics: Check if the store exists before clearing it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-30 20:16 PDT by John Wilander
Modified: 2017-03-31 09:54 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.40 KB, patch)
2017-03-30 20:20 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilander 2017-03-30 20:16:33 PDT
Non-web clients may delete website data records. In such cases the shared observer will not have a store to clear so we should check that it exists.
Comment 1 John Wilander 2017-03-30 20:16:56 PDT
rdar://problem/31258505
Comment 2 John Wilander 2017-03-30 20:20:40 PDT
Created attachment 305940 [details]
Patch
Comment 3 Brent Fulgham 2017-03-31 09:04:17 PDT
Comment on attachment 305940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=305940&action=review

r=me

> Source/WebCore/loader/ResourceLoadObserver.cpp:74
> +        m_store->clearInMemoryAndPersistent();

We should audit the code for other cases like this, since we now realize there are other WK2 clients that are not browsers.
Comment 4 John Wilander 2017-03-31 09:24:33 PDT
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 305940 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=305940&action=review
> 
> r=me

Thanks!

> > Source/WebCore/loader/ResourceLoadObserver.cpp:74
> > +        m_store->clearInMemoryAndPersistent();
> 
> We should audit the code for other cases like this, since we now realize
> there are other WK2 clients that are not browsers.

Agreed. The root cause is the static sharedObserver() getter which anyone can call, no matter how they’ve set up the WebsiteDataStore. I'll land this and take another look.
Comment 5 WebKit Commit Bot 2017-03-31 09:54:44 PDT
Comment on attachment 305940 [details]
Patch

Clearing flags on attachment: 305940

Committed r214669: <http://trac.webkit.org/changeset/214669>
Comment 6 WebKit Commit Bot 2017-03-31 09:54:45 PDT
All reviewed patches have been landed.  Closing bug.