From 83c815ee45722ed54755fd00af043a8f48675169 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 11 May 2017 07:26:08 +0200 Subject: [PATCH] Bug 1363429 - Get rid of nsIDOMLocation, r=bz, r=honza, f=ochameau --- devtools/server/actors/object.js | 2 +- dom/base/Location.cpp | 16 ++-------------- dom/base/Location.h | 6 ++---- dom/base/nsDocument.cpp | 8 -------- dom/interfaces/base/moz.build | 1 - dom/interfaces/base/nsIDOMLocation.idl | 12 ------------ dom/interfaces/core/nsIDOMDocument.idl | 6 ------ dom/xml/XMLDocument.h | 3 --- 8 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 dom/interfaces/base/nsIDOMLocation.idl diff --git a/devtools/server/actors/object.js b/devtools/server/actors/object.js index 6b2501dd8eb9..da72eae0263f 100644 --- a/devtools/server/actors/object.js +++ b/devtools/server/actors/object.js @@ -1567,7 +1567,7 @@ DebuggerServer.ObjectActorPreviewers.Object = [ function ObjectWithURL({obj, hooks}, grip, rawObj) { if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMCSSImportRule || rawObj instanceof Ci.nsIDOMCSSStyleSheet || - rawObj instanceof Ci.nsIDOMLocation || + obj.class == "Location" || rawObj instanceof Ci.nsIDOMWindow)) { return false; } diff --git a/dom/base/Location.cpp b/dom/base/Location.cpp index 17b6755e175f..4d4840a96faf 100644 --- a/dom/base/Location.cpp +++ b/dom/base/Location.cpp @@ -67,22 +67,10 @@ Location::~Location() // QueryInterface implementation for Location NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Location) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsIDOMLocation) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMLocation) + NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -NS_IMPL_CYCLE_COLLECTION_CLASS(Location) - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Location) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mInnerWindow); - NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Location) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInnerWindow) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Location) +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Location, mInnerWindow) NS_IMPL_CYCLE_COLLECTING_ADDREF(Location) NS_IMPL_CYCLE_COLLECTING_RELEASE(Location) diff --git a/dom/base/Location.h b/dom/base/Location.h index 1369b6869b19..b7de398c2caa 100644 --- a/dom/base/Location.h +++ b/dom/base/Location.h @@ -10,7 +10,6 @@ #include "js/TypeDecls.h" #include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" -#include "nsIDOMLocation.h" #include "nsIWeakReferenceUtils.h" #include "nsPIDOMWindow.h" #include "nsString.h" @@ -27,15 +26,14 @@ namespace dom { // Location: Script "location" object //***************************************************************************** -class Location final : public nsIDOMLocation +class Location final : public nsISupports , public nsWrapperCache { public: Location(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell); NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Location, - nsIDOMLocation) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Location) // WebIDL API: void Assign(const nsAString& aUrl, diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 981e24491150..f36732c9a69e 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -233,7 +233,6 @@ #include "nsIEditor.h" #include "nsIDOMCSSStyleRule.h" #include "mozilla/css/StyleRule.h" -#include "nsIDOMLocation.h" #include "nsIHttpChannelInternal.h" #include "nsISecurityConsoleMessage.h" #include "nsCharSeparatedTokenizer.h" @@ -6857,13 +6856,6 @@ nsDocument::GetDefaultView(mozIDOMWindowProxy** aDefaultView) return NS_OK; } -NS_IMETHODIMP -nsDocument::GetLocation(nsIDOMLocation **_retval) -{ - *_retval = nsIDocument::GetLocation().take(); - return NS_OK; -} - already_AddRefed nsIDocument::GetLocation() const { diff --git a/dom/interfaces/base/moz.build b/dom/interfaces/base/moz.build index 506661c65125..85bfcbcd88b0 100644 --- a/dom/interfaces/base/moz.build +++ b/dom/interfaces/base/moz.build @@ -23,7 +23,6 @@ XPIDL_SOURCES += [ 'nsIDOMCrypto.idl', 'nsIDOMGlobalPropertyInitializer.idl', 'nsIDOMHistory.idl', - 'nsIDOMLocation.idl', 'nsIDOMModalContentWindow.idl', 'nsIDOMNavigator.idl', 'nsIDOMScreen.idl', diff --git a/dom/interfaces/base/nsIDOMLocation.idl b/dom/interfaces/base/nsIDOMLocation.idl deleted file mode 100644 index 7f66c2d2cfee..000000000000 --- a/dom/interfaces/base/nsIDOMLocation.idl +++ /dev/null @@ -1,12 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "domstubs.idl" - -[scriptable, uuid(79de76e5-994e-4f6b-81aa-42d9adb6e67e)] -interface nsIDOMLocation : nsISupports -{ - // Empty interface. Location is defined using WebIDL. -}; diff --git a/dom/interfaces/core/nsIDOMDocument.idl b/dom/interfaces/core/nsIDOMDocument.idl index efa4c851ca5e..bb8816debbc3 100644 --- a/dom/interfaces/core/nsIDOMDocument.idl +++ b/dom/interfaces/core/nsIDOMDocument.idl @@ -18,7 +18,6 @@ interface mozIDOMWindowProxy; interface nsIDOMNodeIterator; interface nsIDOMNodeFilter; interface nsIDOMTreeWalker; -interface nsIDOMLocation; /** * The nsIDOMDocument interface represents the entire HTML or XML document. @@ -117,11 +116,6 @@ interface nsIDOMDocument : nsIDOMNode */ attribute DOMString dir; - /** - * @see - */ - readonly attribute nsIDOMLocation location; - /** * @see */ diff --git a/dom/xml/XMLDocument.h b/dom/xml/XMLDocument.h index 5bbffbba55cd..d968c907bfa4 100644 --- a/dom/xml/XMLDocument.h +++ b/dom/xml/XMLDocument.h @@ -73,9 +73,6 @@ public: // nsIDocument version applies to us (it's shadowed by the XPCOM thing on // nsDocument). using nsIDocument::GetLocation; - // But then we need to also pull in the nsDocument XPCOM version - // because nsXULDocument tries to forward to it. - using nsDocument::GetLocation; protected: virtual ~XMLDocument();