Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot

This commit is contained in:
Boris Zbarsky
2018-04-26 23:37:34 -04:00
parent 5378e40459
commit 599ef690cf
57 changed files with 67 additions and 134 deletions

View File

@@ -52,6 +52,7 @@
#include "nsPluginStreamListenerPeer.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/FakePluginTagInitBinding.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/LoadInfo.h"
@@ -70,7 +71,6 @@
// for the dialog
#include "nsIWindowWatcher.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindow.h"
#include "nsNetCID.h"
@@ -3297,15 +3297,14 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
rv = listenerPeer->Initialize(url, aInstance, aListener);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMElement> element;
RefPtr<dom::Element> element;
nsCOMPtr<nsIDocument> doc;
if (owner) {
owner->GetDOMElement(getter_AddRefs(element));
owner->GetDocument(getter_AddRefs(doc));
}
nsCOMPtr<nsINode> requestingNode(do_QueryInterface(element));
NS_ENSURE_TRUE(requestingNode, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
nsCOMPtr<nsIChannel> channel;
// @arg loadgroup:
@@ -3314,7 +3313,7 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
// form |nsDocShell::OnLinkClickSync| bug 166613
rv = NS_NewChannel(getter_AddRefs(channel),
url,
requestingNode,
element,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OBJECT_SUBREQUEST,
@@ -3857,7 +3856,7 @@ nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin,
if (instance->GetPlugin() == aPlugin) {
// notify the content node (nsIObjectLoadingContent) that the
// plugin has crashed
nsCOMPtr<nsIDOMElement> domElement;
RefPtr<dom::Element> domElement;
instance->GetDOMElement(getter_AddRefs(domElement));
nsCOMPtr<nsIObjectLoadingContent> objectContent(do_QueryInterface(domElement));
if (objectContent) {
@@ -3952,7 +3951,7 @@ nsPluginHost::DestroyRunningInstances(nsPluginTag* aPluginTag)
nsPluginTag* pluginTag = TagForPlugin(instance->GetPlugin());
instance->SetWindow(nullptr);
nsCOMPtr<nsIDOMElement> domElement;
RefPtr<dom::Element> domElement;
instance->GetDOMElement(getter_AddRefs(domElement));
nsCOMPtr<nsIObjectLoadingContent> objectContent =
do_QueryInterface(domElement);