<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>170324</bug_id>
          
          <creation_ts>2017-03-30 20:16:33 -0700</creation_ts>
          <short_desc>Resource Load Statistics: Check if the store exists before clearing it</short_desc>
          <delta_ts>2017-03-31 09:54:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Wilander">wilander</reporter>
          <assigned_to name="John Wilander">wilander</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>buildbot</cc>
    
    <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dbates</cc>
    
    <cc>japhet</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1293083</commentid>
    <comment_count>0</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2017-03-30 20:16:33 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293084</commentid>
    <comment_count>1</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2017-03-30 20:16:56 -0700</bug_when>
    <thetext>rdar://problem/31258505</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293085</commentid>
    <comment_count>2</comment_count>
      <attachid>305940</attachid>
    <who name="John Wilander">wilander</who>
    <bug_when>2017-03-30 20:20:40 -0700</bug_when>
    <thetext>Created attachment 305940
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293173</commentid>
    <comment_count>3</comment_count>
      <attachid>305940</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2017-03-31 09:04:17 -0700</bug_when>
    <thetext>Comment on attachment 305940
Patch

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

r=me

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

We should audit the code for other cases like this, since we now realize there are other WK2 clients that are not browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293179</commentid>
    <comment_count>4</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2017-03-31 09:24:33 -0700</bug_when>
    <thetext>(In reply to Brent Fulgham from comment #3)
&gt; Comment on attachment 305940 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=305940&amp;action=review
&gt; 
&gt; r=me

Thanks!

&gt; &gt; Source/WebCore/loader/ResourceLoadObserver.cpp:74
&gt; &gt; +        m_store-&gt;clearInMemoryAndPersistent();
&gt; 
&gt; We should audit the code for other cases like this, since we now realize
&gt; 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&apos;ll land this and take another look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293185</commentid>
    <comment_count>5</comment_count>
      <attachid>305940</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-03-31 09:54:44 -0700</bug_when>
    <thetext>Comment on attachment 305940
Patch

Clearing flags on attachment: 305940

Committed r214669: &lt;http://trac.webkit.org/changeset/214669&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1293186</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-03-31 09:54:45 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>305940</attachid>
            <date>2017-03-30 20:20:40 -0700</date>
            <delta_ts>2017-03-31 09:54:44 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-170324-20170330202039.patch</filename>
            <type>text/plain</type>
            <size>1436</size>
            <attacher name="John Wilander">wilander</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIxNDY1NykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBACisyMDE3LTAzLTMwICBKb2huIFdp
bGFuZGVyICA8d2lsYW5kZXJAYXBwbGUuY29tPgorCisgICAgICAgIFJlc291cmNlIExvYWQgU3Rh
dGlzdGljczogQ2hlY2sgaWYgdGhlIHN0b3JlIGV4aXN0cyBiZWZvcmUgY2xlYXJpbmcgaXQKKyAg
ICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE3MDMyNAorICAg
ICAgICA8cmRhcjovL3Byb2JsZW0vMzEyNTg1MDU+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9C
T0RZIChPT1BTISkuCisKKyAgICAgICAgTm8gbmV3IHRlc3RzLiBBZGRlZCBhIG51bGwgY2hlY2su
CisKKy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