From eb17272b128154f96f9a20107d21f90cc2c01f1f Mon Sep 17 00:00:00 2001 From: Tom Tung Date: Fri, 5 May 2017 13:59:42 +0800 Subject: [PATCH] Bug 1348050 - Part 5: Mark channel as urgent-start for embed element. r=baku This patch is mainly for ObjectLoadingContent. Since there is no any runnable between setting src and creating channel, I check urgent-start just after creating channel. MozReview-Commit-ID: IoishRqENBM --HG-- extra : rebase_source : 25799e27c6a2eb50d5ee3aded0d66fe6bb05c52b --- dom/base/nsObjectLoadingContent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 8ba71a45ea14..0e3f1effcf8b 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -11,6 +11,7 @@ // Interface headers #include "imgLoader.h" +#include "nsIClassOfService.h" #include "nsIConsoleService.h" #include "nsIContent.h" #include "nsIContentInlines.h" @@ -84,6 +85,7 @@ #include "mozilla/dom/PluginCrashedEvent.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/EventDispatcher.h" +#include "mozilla/EventStateManager.h" #include "mozilla/EventStates.h" #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/dom/HTMLObjectElementBinding.h" @@ -2548,6 +2550,11 @@ nsObjectLoadingContent::OpenChannel() if (timedChannel) { timedChannel->SetInitiatorType(thisContent->LocalName()); } + + nsCOMPtr cos(do_QueryInterface(httpChan)); + if (cos && EventStateManager::IsHandlingUserInput()) { + cos->AddClassFlags(nsIClassOfService::UrgentStart); + } } nsCOMPtr scriptChannel = do_QueryInterface(chan);