<?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>106587</bug_id>
          
          <creation_ts>2013-01-10 11:44:13 -0800</creation_ts>
          <short_desc>HTMLMediaElement::resume() should schedule a load rather than load immediately</short_desc>
          <delta_ts>2013-01-10 14:33:18 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yong Li">yong.li.webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric.carlson</cc>
    
    <cc>feature-media-reviews</cc>
    
    <cc>ojan.autocc</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>804592</commentid>
    <comment_count>0</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2013-01-10 11:44:13 -0800</bug_when>
    <thetext>Generally, those resume() methods should only schedule the resumed jobs by timers. This is because:

1) It is not always safe to start the jobs at the time resume() is called. That is why the jobs are suspended.

For example, when ActiveDOMObjects are suspended for nested event loop, the sequence is like this:

- The stack is on top of document parsing, javascript execution, so it is not safe to run some jobs in the nested event loop.
- suspend all scheduled jobs so they won&apos;t run in the event loop
- run the nested event loop
- resume (re-schedule those jobs). However, it is still not safe at this point to run those jobs!
...
- Stack unwinds back to main event loop
....
- Timers fire and scheduled jobs get done.

Another case is PageCache. ActiveDOMObjects are suspended while a document is in the page cache. When it is being restored, resume() is called upon every ActiveDOMObject. However I don&apos;t think the page is guaranteed ready at this point to start the resumed jobs immediately.

2) It is also good for performance, as the objects may be suspended again after being resumed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804613</commentid>
    <comment_count>1</comment_count>
      <attachid>182186</attachid>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2013-01-10 12:00:37 -0800</bug_when>
    <thetext>Created attachment 182186
the proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804617</commentid>
    <comment_count>2</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2013-01-10 12:03:22 -0800</bug_when>
    <thetext>+Eric Carlson

Does the patch make sense?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804623</commentid>
    <comment_count>3</comment_count>
      <attachid>182186</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2013-01-10 12:10:24 -0800</bug_when>
    <thetext>Comment on attachment 182186
the proposed patch

This change looks good, but please wait until the bots have had a chance to exercise the change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804624</commentid>
    <comment_count>4</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2013-01-10 12:10:43 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 182186 [details])
&gt; This change looks good, but please wait until the bots have had a chance to exercise the change.

Sure. thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804735</commentid>
    <comment_count>5</comment_count>
      <attachid>182186</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-10 14:33:14 -0800</bug_when>
    <thetext>Comment on attachment 182186
the proposed patch

Clearing flags on attachment: 182186

Committed r139371: &lt;http://trac.webkit.org/changeset/139371&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804736</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2013-01-10 14:33:18 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>182186</attachid>
            <date>2013-01-10 12:00:37 -0800</date>
            <delta_ts>2013-01-10 14:33:14 -0800</delta_ts>
            <desc>the proposed patch</desc>
            <filename>106587.diff</filename>
            <type>text/plain</type>
            <size>1779</size>
            <attacher name="Yong Li">yong.li.webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAzNmI2Mzc5Li5jM2JiMzEzIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTkg
QEAKKzIwMTMtMDEtMTAgIFlvbmcgTGkgIDx5b2xpQHJpbS5jb20+CisKKyAgICAgICAgSFRNTE1l
ZGlhRWxlbWVudDo6cmVzdW1lKCkgc2hvdWxkIHNjaGVkdWxlIGEgbG9hZCByYXRoZXIgdGhhbiBs
b2FkIGltbWVkaWF0ZWx5CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD0xMDY1ODcKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKwor
ICAgICAgICBJdCBpcyBub3QgYWx3YXlzIHNhZmUgdG8gc3RhcnQgdGhlIGpvYnMgYXQgdGhlIHRp
bWUgcmVzdW1lKCkgaXMgY2FsbGVkLiBUaGF0IGlzIHdoeSB0aGUgam9icyBhcmUKKyAgICAgICAg
c3VzcGV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