|
@@ -64,6 +64,7 @@
|
|
|
#include "gin/handle.h"
|
|
|
#include "gin/object_template_builder.h"
|
|
|
#include "gin/wrappable.h"
|
|
|
+#include "media/base/mime_util.h"
|
|
|
#include "mojo/public/cpp/bindings/associated_remote.h"
|
|
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
|
|
#include "mojo/public/cpp/bindings/remote.h"
|
|
@@ -1762,6 +1763,16 @@ void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
|
|
|
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
|
|
const GURL& url,
|
|
|
int error_code) {
|
|
|
+ // See DocumentLoader::StartLoadingResponse() - when we navigate to a media
|
|
|
+ // resource the original request for the media resource, which resulted in a
|
|
|
+ // committed navigation, is simply discarded. The media element created
|
|
|
+ // inside the MediaDocument then makes *another new* request for the same
|
|
|
+ // media resource.
|
|
|
+ bool is_media_document =
|
|
|
+ media::IsSupportedMediaMimeType(web_contents()->GetContentsMimeType());
|
|
|
+ if (error_code == net::ERR_ABORTED && is_media_document)
|
|
|
+ return;
|
|
|
+
|
|
|
bool is_main_frame = !render_frame_host->GetParent();
|
|
|
int frame_process_id = render_frame_host->GetProcess()->GetID();
|
|
|
int frame_routing_id = render_frame_host->GetRoutingID();
|