<?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>211589</bug_id>
          
          <creation_ts>2020-05-07 12:10:26 -0700</creation_ts>
          <short_desc>Add missing null-check of page in ResourceLoader::loadDataURL</short_desc>
          <delta_ts>2020-05-09 09:07:54 -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>Page Loading</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="Darin Adler">darin</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>achristensen</cc>
    
    <cc>andersca</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>japhet</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1650271</commentid>
    <comment_count>0</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:10:26 -0700</bug_when>
    <thetext>Add missing null-check of page in ResourceLoader::loadDataURL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650272</commentid>
    <comment_count>1</comment_count>
      <attachid>398774</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:10:55 -0700</bug_when>
    <thetext>Created attachment 398774
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650273</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:11:23 -0700</bug_when>
    <thetext>rdar://57213601</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650284</commentid>
    <comment_count>3</comment_count>
      <attachid>398774</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2020-05-07 12:23:56 -0700</bug_when>
    <thetext>Comment on attachment 398774
Patch

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

&gt; Source/WebCore/loader/ResourceLoader.cpp:274
&gt; +    if (auto page = m_frame-&gt;page()) {
&gt; +        if (auto scheduledPairs = page-&gt;scheduledRunLoopPairs())
&gt; +            scheduleContext.scheduledPairs = *scheduledPairs;
&gt; +    }

What&apos;s the effect to the rest of this function is page is null? When HAVE(RUNLOOP_TIMER) is enabled and you don&apos;t set scheduledPairs, does the call to DataURLDecoder::decode continue to work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650290</commentid>
    <comment_count>4</comment_count>
      <attachid>398774</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:32:08 -0700</bug_when>
    <thetext>Comment on attachment 398774
Patch

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

&gt;&gt; Source/WebCore/loader/ResourceLoader.cpp:274
&gt;&gt; +    }
&gt; 
&gt; What&apos;s the effect to the rest of this function is page is null? When HAVE(RUNLOOP_TIMER) is enabled and you don&apos;t set scheduledPairs, does the call to DataURLDecoder::decode continue to work?

Three thoughts:

1) This mostly happens when scheduling a load during tear-down, and so I think the load never completes and gets torn down.
2) Another way to ask this is to ask what happens to all the scheduled stuff when the frame detaches from the page.
3) Is all of this for legacy WebKit on Cocoa platforms only?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650296</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:45:03 -0700</bug_when>
    <thetext>I suspect the real answer is (1) above.

This is just one of multiple ways to harmlessly do nothing. Could also return and do nothing harmlessly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650299</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-07 12:45:43 -0700</bug_when>
    <thetext>And test results seem to confirm that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650497</commentid>
    <comment_count>7</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2020-05-07 21:51:45 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #4)
&gt; 3) Is all of this for legacy WebKit on Cocoa platforms only?
Yes.

While we&apos;re at it, why don&apos;t we null check the frame?  I see that null checked elsewhere in this file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650614</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-08 09:05:20 -0700</bug_when>
    <thetext>(In reply to Alex Christensen from comment #7)
&gt; While we&apos;re at it, why don&apos;t we null check the frame?  I see that null
&gt; checked elsewhere in this file.

Seems fine to do that. Good to do it more consistently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650913</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-09 06:36:16 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #8)
&gt; Seems fine to do that. Good to do it more consistently.

But can I do that in a separate patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650929</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-05-09 09:07:53 -0700</bug_when>
    <thetext>Committed r261438: &lt;https://trac.webkit.org/changeset/261438&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398774.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>398774</attachid>
            <date>2020-05-07 12:10:55 -0700</date>
            <delta_ts>2020-05-09 09:07:53 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-211589-20200507121055.patch</filename>
            <type>text/plain</type>
            <size>1640</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjYxMzIzCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMzJmOTM1N2M3MGNlZTc0
NzQ3OWQzZDVjYmY4ZTU5MTgzNzQyNmU3Yy4uZjE1MjMwNWQ2ZWI5ZGFlOGM4MTBhMDcyODMyYzM0
NjUzZjc1NzQ3OSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE0IEBACisyMDIwLTA1LTA3ICBEYXJp
biBBZGxlciAgPGRhcmluQGFwcGxlLmNvbT4KKworICAgICAgICBBZGQgbWlzc2luZyBudWxsLWNo
ZWNrIG9mIHBhZ2UgaW4gUmVzb3VyY2VMb2FkZXI6OmxvYWREYXRhVVJMCisgICAgICAgIGh0dHBz
Oi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yMTE1ODkKKyAgICAgICAgcmRhcjov
LzU3MjEzNjAxCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAg
ICAgKiBsb2FkZXIvUmVzb3VyY2VMb2FkZXIuY3BwOgorICAgICAgICAoV2ViQ29yZTo6UmVzb3Vy
Y2VMb2FkZXI6OmxvYWREYXRhVVJMKTogQWRkIG51bGwgY2hlY2sgYmVmb3JlIHVzaW5nIHBhZ2Uu
CisKIDIwMjAtMDUtMDcgIERhcmluIEFkbGVyICA8ZGFyaW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