<?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>66230</bug_id>
          
          <creation_ts>2011-08-15 08:46:56 -0700</creation_ts>
          <short_desc>Also release media resources when media is completely loaded.</short_desc>
          <delta_ts>2012-06-24 00:59:51 -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>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>89720</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>66687</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Hao Zheng">zhenghao</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>hclam</cc>
    
    <cc>jer.noble</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>451077</commentid>
    <comment_count>0</comment_count>
    <who name="Hao Zheng">zhenghao</who>
    <bug_when>2011-08-15 08:46:56 -0700</bug_when>
    <thetext>DRT will not release resources of media player in the old page when opening a new page. It will only release resources when GC is needed (see stacktrace GC). But actually DRT will try to release media resources explicitly if it is not completely loaded (see stacktrace EXPLICIT). It may not be a problem on other platforms, but it will cause unstable behavior on platforms with limited resources e.g. mobile phones, especially when running consecutive tests in DRT. If we release media which is not completely loaded, it&apos;s better to also release completely loaded media.

GC:
#0  webkit_glue::WebMediaPlayerImpl::Destroy (this=0x7fffea161930) at Source/WebKit/chromium/webkit/glue/webmediaplayer_impl.cc:1004
#1  0x000000000195e01c in webkit_glue::WebMediaPlayerImpl::~WebMediaPlayerImpl (this=0x7fffea161930, __in_chrg=&lt;value optimized out&gt;)
   at Source/WebKit/chromium/webkit/glue/webmediaplayer_impl.cc:424
#2  0x0000000000506477 in WTF::deleteOwnedPtr&lt;WebKit::WebMediaPlayer&gt; (ptr=0x7fffea161930) at Source/JavaScriptCore/wtf/OwnPtrCommon.h:65
#3  0x0000000000505eb5 in WTF::OwnPtr&lt;WebKit::WebMediaPlayer&gt;::~OwnPtr (this=0x7fffea0a8660, __in_chrg=&lt;value optimized out&gt;) at Source/JavaScriptCore/wtf/OwnPtr.h:54
#4  0x0000000000503aea in WebKit::WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl (this=0x7fffea0a8640, __in_chrg=&lt;value optimized out&gt;)
   at Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:108
#5  0x0000000000ff31e2 in WTF::deleteOwnedPtr&lt;WebCore::MediaPlayerPrivateInterface&gt; (ptr=0x7fffea0a8640) at Source/JavaScriptCore/wtf/OwnPtrCommon.h:65
#6  0x0000000000ff2f63 in WTF::OwnPtr&lt;WebCore::MediaPlayerPrivateInterface&gt;::~OwnPtr (this=0x7fffea104af0, __in_chrg=&lt;value optimized out&gt;)
   at Source/JavaScriptCore/wtf/OwnPtr.h:54
#7  0x0000000000ff0f1e in WebCore::MediaPlayer::~MediaPlayer (this=0x7fffea104aa0, __in_chrg=&lt;value optimized out&gt;) at Source/WebCore/platform/graphics/MediaPlayer.cpp:318
#8  0x0000000000ebd891 in WTF::deleteOwnedPtr&lt;WebCore::MediaPlayer&gt; (ptr=0x7fffea104aa0) at Source/JavaScriptCore/wtf/OwnPtrCommon.h:65
#9  0x0000000000ebd4ef in WTF::OwnPtr&lt;WebCore::MediaPlayer&gt;::~OwnPtr (this=0x7ffff7e8cb40, __in_chrg=&lt;value optimized out&gt;) at Source/JavaScriptCore/wtf/OwnPtr.h:54
#10 0x0000000000eb41eb in WebCore::HTMLMediaElement::~HTMLMediaElement (this=0x7ffff7e8c8c0, __in_chrg=&lt;value optimized out&gt;) at Source/WebCore/html/HTMLMediaElement.cpp:201
#11 0x000000000211445b in WebCore::HTMLAudioElement::~HTMLAudioElement (this=0x7ffff7e8c8c0, __in_chrg=&lt;value optimized out&gt;) at Source/WebCore/html/HTMLAudioElement.h:38
#12 0x0000000000d943fc in WebCore::TreeShared&lt;WebCore::ContainerNode&gt;::removedLastRef (this=0x7ffff7e8c8c8) at Source/WebCore/platform/TreeShared.h:118
#13 0x0000000000476865 in WebCore::TreeShared&lt;WebCore::ContainerNode&gt;::deref (this=0x7ffff7e8c8c8) at Source/WebCore/platform/TreeShared.h:79
#14 0x0000000001569a72 in WebCore::DOMDataStore::weakNodeCallback (value=..., domObject=0x7ffff7e8c8c0) at Source/WebCore/bindings/v8/DOMDataStore.cpp:153
#15 0x0000000000a47232 in v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing (this=0x7ffff7e5cc00, isolate=0x7ffff7e44000, global_handles=0x7ffff7e74000)
   at Source/WebKit/chromium/v8/src/global-handles.cc:233
#16 0x0000000000a45b9d in v8::internal::GlobalHandles::PostGarbageCollectionProcessing (this=0x7ffff7e74000, collector=v8::internal::MARK_COMPACTOR)
   at Source/WebKit/chromium/v8/src/global-handles.cc:555
#17 0x0000000000a57ad0 in v8::internal::Heap::PerformGarbageCollection (this=0x7ffff7e44098, collector=v8::internal::MARK_COMPACTOR, tracer=0x7fffffffaa40)
   at Source/WebKit/chromium/v8/src/heap.cc:771
#18 0x0000000000a57089 in v8::internal::Heap::CollectGarbage (this=0x7ffff7e44098, space=v8::internal::NEW_SPACE, collector=v8::internal::MARK_COMPACTOR)
   at Source/WebKit/chromium/v8/src/heap.cc:508
#19 0x0000000000a11789 in v8::internal::Heap::CollectGarbage (this=0x7ffff7e44098, space=v8::internal::NEW_SPACE) at Source/WebKit/chromium/v8/src/heap-inl.h:427
#20 0x0000000000a4acea in v8::internal::SetProperty (object=..., key=..., value=..., attributes=READ_ONLY, strict_mode=v8::internal::kNonStrictMode)
   at Source/WebKit/chromium/v8/src/handles.cc:269
#21 0x0000000000b883cc in v8::internal::Runtime::SetObjectProperty (isolate=0x7ffff7e44000, object=..., key=..., value=..., attr=READ_ONLY,     strict_mode=v8::internal::kNonStrictMode) at Source/WebKit/chromium/v8/src/runtime.cc:4135
#22 0x0000000000b88b62 in v8::internal::Runtime_SetProperty (args=..., isolate=0x7ffff7e44000) at Source/WebKit/chromium/v8/src/runtime.cc:4270

EXPLICIT:
#10 0x002fb5a0 in ~MediaPlayer (this=0x12adb18, __in_chrg=&lt;value optimized out&gt;) at third_party/WebKit/Source/WebCore/platform/graphics/MediaPlayer.cpp:318
#11 0x0000cb2a in WTF::deleteOwnedPtr&lt;CppBoundClass::Callback&gt; (ptr=0x12adb18) at third_party/WebKit/Source/JavaScriptCore/wtf/OwnPtrCommon.h:65
#12 0x002a6f20 in WTF::OwnPtr&lt;WebCore::MediaPlayer&gt;::clear (this=0x123b840) at third_party/WebKit/Source/JavaScriptCore/wtf/OwnPtr.h:99
#13 WebCore::HTMLMediaElement::userCancelledLoad (this=0x123b840) at third_party/WebKit/Source/WebCore/html/HTMLMediaElement.cpp:2343
#14 0x002a9212 in WebCore::HTMLMediaElement::stop (this=0x123b840) at third_party/WebKit/Source/WebCore/html/HTMLMediaElement.cpp:2388
#15 0x0028e07c in WebCore::ScriptExecutionContext::stopActiveDOMObjects (this=0x1247c58) at third_party/WebKit/Source/WebCore/dom/ScriptExecutionContext.cpp:271
#16 0x00276930 in WebCore::Document::detach (this=0x1247bd0) at third_party/WebKit/Source/WebCore/dom/Document.cpp:1787
#17 0x003edc1e in WebCore::Frame::setView (this=0x12334c8, view=...) at third_party/WebKit/Source/WebCore/page/Frame.cpp:275
#18 0x00024104 in WebKit::WebFrameImpl::createFrameView (this=0x1233378) at third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.cpp:2308
#19 0x0003a71c in WebKit::FrameLoaderClientImpl::makeDocumentView (this=&lt;value optimized out&gt;)
   at third_party/WebKit/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:254
#20 WebKit::FrameLoaderClientImpl::transitionToCommittedForNewPage (this=&lt;value optimized out&gt;)
   at third_party/WebKit/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:1395
#21 0x003c8ecc in WebCore::FrameLoader::transitionToCommitted (this=0x1233508, cachedPage=...) at third_party/WebKit/Source/WebCore/loader/FrameLoader.cpp:1892
#22 0x003c8fca in WebCore::FrameLoader::commitProvisionalLoad (this=0x1233508) at third_party/WebKit/Source/WebCore/loader/FrameLoader.cpp:1739
#23 0x003c056a in WebCore::DocumentLoader::commitIfReady (this=&lt;value optimized out&gt;) at third_party/WebKit/Source/WebCore/loader/DocumentLoader.cpp:279
#24 0x003c058c in WebCore::DocumentLoader::commitLoad (this=0x12c22d8,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506) at third_party/WebKit/Source/WebCore/loader/DocumentLoader.cpp:300
#25 0x003c060e in WebCore::DocumentLoader::receivedData (this=0x12c22d8,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506) at third_party/WebKit/Source/WebCore/loader/DocumentLoader.cpp:334
#26 0x003cdc6e in WebCore::MainResourceLoader::addData (this=0x12c3100,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506, allAtOnce=&lt;value optimized out&gt;)
   at third_party/WebKit/Source/WebCore/loader/MainResourceLoader.cpp:168
#27 0x003d2270 in WebCore::ResourceLoader::didReceiveData (this=0x12c3100,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506, encodedDataLength=&lt;value optimized out&gt;, allAtOnce=false)
   at third_party/WebKit/Source/WebCore/loader/ResourceLoader.cpp:304
#28 0x003cdc4a in WebCore::MainResourceLoader::didReceiveData (this=0x12c3100,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506, encodedDataLength=-1, allAtOnce=false)
   at third_party/WebKit/Source/WebCore/loader/MainResourceLoader.cpp:464
#29 0x003d2098 in WebCore::ResourceLoader::didReceiveData (this=0x12c3100,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., length=506, encodedDataLength=-1) at third_party/WebKit/Source/WebCore/loader/ResourceLoader.cpp:462
#30 0x0057306e in WebCore::ResourceHandleInternal::didReceiveData (this=0x12c3870,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., dataLength=506, encodedDataLength=-1) at third_party/WebKit/Source/WebKit/chromium/src/ResourceHandle.cpp:172
#31 0x005372a0 in webkit_glue::WebURLLoaderImpl::Context::OnReceivedData (this=0x128a148,
   data=0x12c9b20 &quot;&lt;body&gt;\n&lt;p&gt;Test that Audio(\&quot;url\&quot;) constructor loads the specified resource.&lt;/p&gt;\n&lt;script src=media-file.js&gt;&lt;/script&gt;\n&lt;script src=video-test.js&gt;&lt;/script&gt;\n&lt;script&gt;\n    var audioFile = findMediaFile(\&quot;audio&quot;..., data_length=506, encoded_data_length=&lt;value optimized out&gt;) at webkit/glue/weburlloader_impl.cc:619
#32 0x0056c376 in NotifyReceivedData (this=&lt;value optimized out&gt;, bytes_read=506) at webkit/tools/test_shell/simple_resource_loader_bridge.cc:280
#33 0x0056a62c in DispatchToMethod&lt;&lt;unnamed&gt;::RequestProxy, void (&lt;unnamed&gt;::RequestProxy::*)(int), int&gt; (this=0x1fa) at ./base/tuple.h:551
#34 Run (this=0x1fa) at ./base/task.h:338
#35 0x0012651c in Run (this=0x12c8c40) at base/message_loop.cc:109
#36 0x001265c6 in DoInvoke (base=&lt;value optimized out&gt;) at ./base/bind_internal.h:595</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451082</commentid>
    <comment_count>1</comment_count>
      <attachid>103918</attachid>
    <who name="Hao Zheng">zhenghao</who>
    <bug_when>2011-08-15 08:57:17 -0700</bug_when>
    <thetext>Created attachment 103918
Proposed patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451320</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-08-15 15:18:34 -0700</bug_when>
    <thetext>Does this mean that the resource will be unavailable in browser when going back to a page that contains it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451338</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-15 15:42:13 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Does this mean that the resource will be unavailable in browser when going back to a page that contains it?

Yes it does. With this patch leaving a page will cause all HTMLMediaElement state to be reset and the media engine to be deleted, so when a user goes back the media engine must be recreated, media data will reloaded, all events will be retired, etc.

The existing logic is from http://www.w3.org/TR/html5/video.html#dfnReturnLink-2, see the paragraph after &quot;If the media data fetching process is aborted by the user&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451341</commentid>
    <comment_count>4</comment_count>
      <attachid>103918</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-15 15:45:03 -0700</bug_when>
    <thetext>Comment on attachment 103918
Proposed patch.

Changing the behavior everywhere, in a way that breaks compatibility with the spec, is the wrong way to fix a problem that only happens in DRT on some platforms.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451668</commentid>
    <comment_count>5</comment_count>
    <who name="Hin-Chung Lam">hclam</who>
    <bug_when>2011-08-16 09:31:58 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 103918 [details])
&gt; Changing the behavior everywhere, in a way that breaks compatibility with the spec, is the wrong way to fix a problem that only happens in DRT on some platforms.

I suppose that a media resource never is loaded unless it&apos;s from a local file system. This effectively means that in all cases except for file:// URLs MediaPlayer is deleted.

If this is the final result then why do we treat file:// differently? This seems to fall into a grey area where the spec doesn&apos;t specify the behavior regarding media resources / cache when user leave the page.

I think we should just treat the logic for file:// the same as other URLs. Logic in this piece of code seems to be coming the old spec where there was a loaded event.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451714</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-16 10:20:29 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (From update of attachment 103918 [details] [details])
&gt; &gt; Changing the behavior everywhere, in a way that breaks compatibility with the spec, is the wrong way to fix a problem that only happens in DRT on some platforms.
&gt; 
&gt; I suppose that a media resource never is loaded unless it&apos;s from a local file system. This effectively means that in all cases except for file:// URLs MediaPlayer is deleted.
&gt; 

  No, what makes you say that? 

  HTMLMediaElement::m_completelyLoaded is set when the media engine reports that the networkState is MediaPlayer::Loaded. This can potentially happen for any file, it is up to the media engine.

&gt; If this is the final result then why do we treat file:// differently? This seems to fall into a grey area where the spec doesn&apos;t specify the behavior regarding media resources / cache when user leave the page.
&gt; 
  I don&apos;t think the spec is at all vague. It says to run the steps we have in HTMLMediaElement::userCancelledLoad if the &quot;fetching process is aborted by the user&quot;. To me this means the steps should not be run if the fetching process is not aborted, hence if the data has all been fetched we do not run it.

&gt; I think we should just treat the logic for file:// the same as other URLs. Logic in this piece of code seems to be coming the old spec where there was a loaded event.

  As noted this is not caused by file: urls, and it does not come from the old spec. 

  I think this is a usability issue. When navigating back to a page it is a good thing if the page can reload without having to refetch the media, eg. the user&apos;s place in the media is not reset so they can resume watching/listening where they were, etc.

  If you don&apos;t like this behavior, change your media engine so the networkState never reaches MediaPlayer::Loaded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451728</commentid>
    <comment_count>7</comment_count>
    <who name="Hin-Chung Lam">hclam</who>
    <bug_when>2011-08-16 10:36:04 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; (From update of attachment 103918 [details] [details] [details])
&gt; &gt; &gt; Changing the behavior everywhere, in a way that breaks compatibility with the spec, is the wrong way to fix a problem that only happens in DRT on some platforms.
&gt; &gt; 
&gt; &gt; I suppose that a media resource never is loaded unless it&apos;s from a local file system. This effectively means that in all cases except for file:// URLs MediaPlayer is deleted.
&gt; &gt; 
&gt; 
&gt;   No, what makes you say that? 
&gt; 
&gt;   HTMLMediaElement::m_completelyLoaded is set when the media engine reports that the networkState is MediaPlayer::Loaded. This can potentially happen for any file, it is up to the media engine.
&gt; 
&gt; &gt; If this is the final result then why do we treat file:// differently? This seems to fall into a grey area where the spec doesn&apos;t specify the behavior regarding media resources / cache when user leave the page.
&gt; &gt; 
&gt;   I don&apos;t think the spec is at all vague. It says to run the steps we have in HTMLMediaElement::userCancelledLoad if the &quot;fetching process is aborted by the user&quot;. To me this means the steps should not be run if the fetching process is not aborted, hence if the data has all been fetched we do not run it.
&gt; 
&gt; &gt; I think we should just treat the logic for file:// the same as other URLs. Logic in this piece of code seems to be coming the old spec where there was a loaded event.
&gt; 
&gt;   As noted this is not caused by file: urls, and it does not come from the old spec. 
&gt; 
&gt;   I think this is a usability issue. When navigating back to a page it is a good thing if the page can reload without having to refetch the media, eg. the user&apos;s place in the media is not reset so they can resume watching/listening where they were, etc.
&gt; 
&gt;   If you don&apos;t like this behavior, change your media engine so the networkState never reaches MediaPlayer::Loaded.

If the media resource is loaded from a data: URL, going to a loaded state is the right thing to do since there&apos;s no network activity and no progress event. When a site loads some data: URL objects for games, and user leaves the page that would leave a lot of media engines remain in memory, which can be quite heavy.

Currently there&apos;s no way for a media engine to know that it can clean up safely once it reached loaded state, what about we call cancelLoad() and let the media engine to decide what to do with its internal resources?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451745</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-16 11:03:58 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; If the media resource is loaded from a data: URL, going to a loaded state is the right thing to do since there&apos;s no network activity and no progress event. When a site loads some data: URL objects for games, and user leaves the page that would leave a lot of media engines remain in memory, which can be quite heavy.
&gt; 
&gt; Currently there&apos;s no way for a media engine to know that it can clean up safely once it reached loaded state, what about we call cancelLoad() and let the media engine to decide what to do with its internal resources?

That isn&apos;t a good idea, cancelLoad() is currently called from HTMLMediaElement::prepareForLoad to tell a media engine to clean up in preparation for a new url. Apple&apos;s media engines dispose of all assets in cancelLoad, so all state is lost. I assume at least some others do the same.

We could add a new media engine function that is called when its document becomes active/inactive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>452181</commentid>
    <comment_count>9</comment_count>
      <attachid>104161</attachid>
    <who name="Hao Zheng">zhenghao</who>
    <bug_when>2011-08-17 02:38:50 -0700</bug_when>
    <thetext>Created attachment 104161
Proposed patch 2.

Good idea. Actually, I noticed Document::detach() said:

    // Send out documentWillBecomeInactive() notifications to registered elements,
    // in order to stop media elements
    documentWillBecomeInactive();

But HTMLMediaElement has not overridden related methods. Please help review my new patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>452229</commentid>
    <comment_count>10</comment_count>
      <attachid>104161</attachid>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-17 07:05:14 -0700</bug_when>
    <thetext>Comment on attachment 104161
Proposed patch 2.

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

&gt; Source/WebCore/html/HTMLMediaElement.cpp:2654
&gt; +void HTMLMediaElement::documentWillBecomeInactive()
&gt; +{
&gt; +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
&gt; +    LOG(Media, &quot;HTMLMediaElement::documentWillBecomeInactive&quot;);
&gt; +    if (m_player)
&gt; +        m_player-&gt;willBecomeInactive();
&gt; +#endif
&gt; +}
&gt; +
&gt; +void HTMLMediaElement::documentDidBecomeActive()
&gt; +{
&gt; +#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
&gt; +    LOG(Media, &quot;HTMLMediaElement::documentDidBecomeActive&quot;);
&gt; +    if (m_player)
&gt; +        m_player-&gt;didBecomeActive();
&gt; +#endif
&gt; +}
&gt; +

These new methods are unnecessary. documentWillBecomeInactive is called by Document::detach, *after* it calls stopActiveDOMObjects(). HTMLMediaElement is an ActiveDOMObject.

&gt; Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp:243
&gt; +void WebMediaPlayerClientImpl::willBecomeInactive()
&gt; +{
&gt; +    if (m_webMediaPlayer.get())
&gt; +        m_webMediaPlayer-&gt;willBecomeInactive();
&gt; +}
&gt; +
&gt; +void WebMediaPlayerClientImpl::didBecomeActive()
&gt; +{
&gt; +    if (m_webMediaPlayer.get())
&gt; +        m_webMediaPlayer-&gt;didBecomeActive();
&gt; +}
&gt; +

I assume that the Chromium media player sets network and ready states correctly when it unloads cached media data? Where are the tests to show that the behavior is correct.?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>452345</commentid>
    <comment_count>11</comment_count>
    <who name="Hin-Chung Lam">hclam</who>
    <bug_when>2011-08-17 10:41:03 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; (From update of attachment 103918 [details] [details] [details])
&gt; &gt; &gt; Changing the behavior everywhere, in a way that breaks compatibility with the spec, is the wrong way to fix a problem that only happens in DRT on some platforms.
&gt; &gt; 
&gt; &gt; I suppose that a media resource never is loaded unless it&apos;s from a local file system. This effectively means that in all cases except for file:// URLs MediaPlayer is deleted.
&gt; &gt; 
&gt; 
&gt;   No, what makes you say that? 
&gt; 
&gt;   HTMLMediaElement::m_completelyLoaded is set when the media engine reports that the networkState is MediaPlayer::Loaded. This can potentially happen for any file, it is up to the media engine.
&gt; 
&gt; &gt; If this is the final result then why do we treat file:// differently? This seems to fall into a grey area where the spec doesn&apos;t specify the behavior regarding media resources / cache when user leave the page.
&gt; &gt; 
&gt;   I don&apos;t think the spec is at all vague. It says to run the steps we have in HTMLMediaElement::userCancelledLoad if the &quot;fetching process is aborted by the user&quot;. To me this means the steps should not be run if the fetching process is not aborted, hence if the data has all been fetched we do not run it.
&gt; 
&gt; &gt; I think we should just treat the logic for file:// the same as other URLs. Logic in this piece of code seems to be coming the old spec where there was a loaded event.
&gt; 
&gt;   As noted this is not caused by file: urls, and it does not come from the old spec. 
&gt; 
&gt;   I think this is a usability issue. When navigating back to a page it is a good thing if the page can reload without having to refetch the media, eg. the user&apos;s place in the media is not reset so they can resume watching/listening where they were, etc.
&gt; 
&gt;   If you don&apos;t like this behavior, change your media engine so the networkState never reaches MediaPlayer::Loaded.

(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; If the media resource is loaded from a data: URL, going to a loaded state is the right thing to do since there&apos;s no network activity and no progress event. When a site loads some data: URL objects for games, and user leaves the page that would leave a lot of media engines remain in memory, which can be quite heavy.
&gt; &gt; 
&gt; &gt; Currently there&apos;s no way for a media engine to know that it can clean up safely once it reached loaded state, what about we call cancelLoad() and let the media engine to decide what to do with its internal resources?
&gt; 
&gt; That isn&apos;t a good idea, cancelLoad() is currently called from HTMLMediaElement::prepareForLoad to tell a media engine to clean up in preparation for a new url. Apple&apos;s media engines dispose of all assets in cancelLoad, so all state is lost. I assume at least some others do the same.
&gt; 
&gt; We could add a new media engine function that is called when its document becomes active/inactive.

That seems to be a better solution in terms of flexibility for the media engine to unload resources if it chooses to.

Also my other question is that instead of a m_player.clear(), should it be a cancelLoad()? Conceptually doing a destruction seems to be doing more than just cancel the resource fetch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>452364</commentid>
    <comment_count>12</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2011-08-17 11:00:47 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; 
&gt; Also my other question is that instead of a m_player.clear(), should it be a cancelLoad()? Conceptually doing a destruction seems to be doing more than just cancel the resource fetch.

The problem that while they are conceptually very similar, clear() deletes the player so *everything* gets cleaned up and all state is reset. cancelLoad do the same, but testing that will be difficult because AFIK not all ports have leaks bots.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>656175</commentid>
    <comment_count>13</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-06-24 00:59:51 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 89720 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>103918</attachid>
            <date>2011-08-15 08:57:17 -0700</date>
            <delta_ts>2011-08-17 02:38:50 -0700</delta_ts>
            <desc>Proposed patch.</desc>
            <filename>release.patch</filename>
            <type>text/plain</type>
            <size>2421</size>
            <attacher name="Hao Zheng">zhenghao</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDkzMDQzKQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTEtMDgtMTUgIEhhbyBaaGVu
ZyAgPHpoZW5naGFvQGNocm9taXVtLm9yZz4KKworICAgICAgICBBbHNvIHJlbGVhc2UgbWVkaWEg
cmVzb3VyY2VzIHdoZW4gbWVkaWEgaXMgY29tcGxldGVseSBsb2FkZWQuCisgICAgICAgIGh0dHBz
Oi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD02NjIzMAorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogaHRtbC9IVE1MTWVkaWFFbGVtZW50
LmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OkhUTUxNZWRpYUVsZW1lbnQ6OnVzZXJDYW5jZWxsZWRM
b2FkKToKKwogMjAxMS0wOC0xNSAgQWRhbSBSb2JlbiAgPGFyb2JlbkBhcHBsZS5jb20+CiAKICAg
ICAgICAgUmVuYW1lIGFuIGluc3RhbmNlIG9mIH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iArMjM3Myw3IEBAIHZvaWQgSFRNTE1l
ZGlhRWxlbWVudDo6dXNlckNhbmNlbGxlZExvYWQKIAogICAgIC8vIFJlc2V0IG1fcmVhZHlTdGF0
ZSBzaW5jZSBtX3BsYXllciBpcyBnb25lLgogICAgIG1fcmVhZHlTdGF0ZSA9IEhBVkVfTk9USElO
RzsKKyAgICBtX2NvbXBsZXRlbHlMb2FkZWQgPSBmYWxzZTsKIH0KIAogYm9vbCBIVE1MTWVkaWFF
bGVtZW50OjpjYW5TdXNwZW5kKCkgY29uc3QK
</data>
<flag name="review"
          id="99631"
          type_id="1"
          status="-"
          setter="eric.carlson"
    />
    <flag name="commit-queue"
          id="99632"
          type_id="3"
          status="-"
          setter="eric.carlson"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>104161</attachid>
            <date>2011-08-17 02:38:50 -0700</date>
            <delta_ts>2011-08-17 07:05:14 -0700</delta_ts>
            <desc>Proposed patch 2.</desc>
            <filename>expose.patch</filename>
            <type>text/plain</type>
            <size>7611</size>
            <attacher name="Hao Zheng">zhenghao</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDkzMTk3KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMjUgQEAKKzIwMTEtMDgtMTcgIEhhbyBaaGVu
ZyAgPHpoZW5naGFvQGNocm9taXVtLm9yZz4KKworICAgICAgICBBZGQgbWV0aG9kcyB0byBpbmZv
cm0gbWVkaWEgZW5naW5lIHdoZW4gaXRzIGRvY3VtZW50IGJlY29tZXMgYWN0aXZlL2luYWN0aXZl
LgorICAgIC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YXllci5nZXQoKSkKKyAgICAgICAgbV93ZWJNZWRpYVBsYXllci0+ZGlkQmVjb21lQWN0aXZlKCk7
Cit9CisKICNpZiBVU0UoQUNDRUxFUkFURURfQ09NUE9TSVRJTkcpCiBQbGF0Zm9ybUxheWVyKiBX
ZWJNZWRpYVBsYXllckNsaWVudEltcGw6OnBsYXRmb3JtTGF5ZXIoKSBjb25zdAogewpJbmRleDog
U291cmNlL1dlYktpdC9jaHJvbWl1bS9zcmMvV2ViTWVkaWFQbGF5ZXJDbGllbnRJbXBsLmgKPT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQotLS0gU291cmNlL1dlYktpdC9jaHJvbWl1bS9zcmMvV2ViTWVkaWFQbGF5ZXJDbGll
bnRJbXBsLmgJKHJldmlzaW9uIDkzMDQyKQorKysgU291cmNlL1dlYktpdC9jaHJvbWl1bS9zcmMv
V2ViTWVkaWFQbGF5ZXJDbGllbnRJbXBsLmgJKHdvcmtpbmcgY29weSkKQEAgLTgyLDYgKzgyLDgg
QEAgcHVibGljOgogICAgIC8vIE1lZGlhUGxheWVyUHJpdmF0ZUludGVyZmFjZSBtZXRob2RzOgog
ICAgIHZpcnR1YWwgdm9pZCBsb2FkKGNvbnN0IFdURjo6U3RyaW5nJiB1cmwpOwogICAgIHZpcnR1
YWwgdm9pZCBjYW5jZWxMb2FkKCk7CisgICAgdmlydHVhbCB2b2lkIHdpbGxCZWNvbWVJbmFjdGl2
ZSgpOworICAgIHZpcnR1YWwgdm9pZCBkaWRCZWNvbWVBY3RpdmUoKTsKICNpZiBVU0UoQUNDRUxF
UkFURURfQ09NUE9TSVRJTkcpCiAgICAgdmlydHVhbCBXZWJDb3JlOjpQbGF0Zm9ybUxheWVyKiBw
bGF0Zm9ybUxheWVyKCkgY29uc3Q7CiAjZW5kaWYK
</data>
<flag name="review"
          id="99913"
          type_id="1"
          status="-"
          setter="eric.carlson"
    />
    <flag name="commit-queue"
          id="99914"
          type_id="3"
          status="-"
          setter="eric.carlson"
    />
          </attachment>
      

    </bug>

</bugzilla>