diff --git a/accessible/xpcom/xpcAccessibleTextRange.cpp b/accessible/xpcom/xpcAccessibleTextRange.cpp index 0ca9ebf8bf0..b551542d31b 100644 --- a/accessible/xpcom/xpcAccessibleTextRange.cpp +++ b/accessible/xpcom/xpcAccessibleTextRange.cpp @@ -11,6 +11,7 @@ #include "nsIMutableArray.h" #include "nsComponentManagerUtils.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/xul/XULTreeAccessible.cpp b/accessible/xul/XULTreeAccessible.cpp index eea941241f5..03b2223a674 100644 --- a/accessible/xul/XULTreeAccessible.cpp +++ b/accessible/xul/XULTreeAccessible.cpp @@ -17,6 +17,7 @@ #include "Role.h" #include "States.h" #include "XULTreeGridAccessible.h" +#include "nsQueryObject.h" #include "nsComponentManagerUtils.h" #include "nsIAccessibleRelation.h" diff --git a/accessible/xul/XULTreeGridAccessible.cpp b/accessible/xul/XULTreeGridAccessible.cpp index ddeec5d442d..8a303ef5862 100644 --- a/accessible/xul/XULTreeGridAccessible.cpp +++ b/accessible/xul/XULTreeGridAccessible.cpp @@ -13,6 +13,7 @@ #include "Relation.h" #include "Role.h" #include "States.h" +#include "nsQueryObject.h" #include "nsIBoxObject.h" #include "nsIMutableArray.h" diff --git a/chrome/nsChromeRegistry.cpp b/chrome/nsChromeRegistry.cpp index fa96f22c4c1..5c375742b16 100644 --- a/chrome/nsChromeRegistry.cpp +++ b/chrome/nsChromeRegistry.cpp @@ -15,6 +15,7 @@ #include "nsEscape.h" #include "nsNetUtil.h" #include "nsString.h" +#include "nsQueryObject.h" #include "mozilla/CSSStyleSheet.h" #include "mozilla/dom/URL.h" diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index 5e6b1e82658..5ec1c7b66df 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -13,6 +13,7 @@ #include "nsIDOMWindow.h" #include "nsNetUtil.h" #include "nsAutoPtr.h" +#include "nsQueryObject.h" #include "nsIHttpChannel.h" #include "nsIScriptSecurityManager.h" #include "nsError.h" diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 6b6fc0b5c9f..1c9081a4cae 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -57,6 +57,7 @@ #include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...) #include "nsISeekableStream.h" #include "nsAutoPtr.h" +#include "nsQueryObject.h" #include "nsIWritablePropertyBag2.h" #include "nsIAppShell.h" #include "nsWidgetsCID.h" diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 8370838006c..fe8be2f536e 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -24,6 +24,7 @@ #include "nsFrame.h" #include "mozilla/layers/ShadowLayers.h" #include "ClientLayerManager.h" +#include "nsQueryObject.h" #include "nsIScrollableFrame.h" diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index b7e6cc95fb0..a8214454b7f 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -224,6 +224,7 @@ #include "nsLocation.h" #include "mozilla/dom/FontFaceSet.h" #include "mozilla/dom/BoxObject.h" +#include "nsQueryObject.h" #ifdef MOZ_MEDIA_NAVIGATOR #include "mozilla/MediaManager.h" diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index eac1f9c76ea..a3929b7b2d8 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -42,6 +42,7 @@ #include "mozilla/dom/DOMStringList.h" #include "nsPrintfCString.h" #include "nsXULAppAPI.h" +#include "nsQueryObject.h" #include #ifdef ANDROID diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index fd91cde7504..3939adcc780 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -119,6 +119,7 @@ #include "nsIControllerContext.h" #include "nsGlobalWindowCommands.h" #include "nsAutoPtr.h" +#include "nsQueryObject.h" #include "nsContentUtils.h" #include "nsCSSProps.h" #include "nsIDOMFileList.h" diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index a1c4068aa92..74ed84c7a8c 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -58,6 +58,7 @@ #include "nsUnicharUtils.h" #include "mozilla/Preferences.h" #include "nsSandboxFlags.h" +#include "nsQueryObject.h" // Concrete classes #include "nsFrameLoader.h" diff --git a/dom/base/nsStyleLinkElement.cpp b/dom/base/nsStyleLinkElement.cpp index 0cb699bd1f4..366bf2fa5c5 100644 --- a/dom/base/nsStyleLinkElement.cpp +++ b/dom/base/nsStyleLinkElement.cpp @@ -30,6 +30,7 @@ #include "nsUnicharInputStream.h" #include "nsContentUtils.h" #include "nsStyleUtil.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp index ede76e9f654..5a2a4dcd511 100644 --- a/dom/base/nsTreeSanitizer.cpp +++ b/dom/base/nsTreeSanitizer.cpp @@ -23,6 +23,7 @@ #include "nsContentUtils.h" #include "nsIParserUtils.h" #include "nsIDocument.h" +#include "nsQueryObject.h" using namespace mozilla; diff --git a/dom/bluetooth/BluetoothRilListener.cpp b/dom/bluetooth/BluetoothRilListener.cpp index 650d3c533e6..ad85f7dafed 100644 --- a/dom/bluetooth/BluetoothRilListener.cpp +++ b/dom/bluetooth/BluetoothRilListener.cpp @@ -14,6 +14,7 @@ #include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID. #include "nsServiceManagerUtils.h" #include "nsString.h" +#include "nsQueryObject.h" USING_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth2/BluetoothRilListener.cpp b/dom/bluetooth2/BluetoothRilListener.cpp index 650d3c533e6..ad85f7dafed 100644 --- a/dom/bluetooth2/BluetoothRilListener.cpp +++ b/dom/bluetooth2/BluetoothRilListener.cpp @@ -14,6 +14,7 @@ #include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID. #include "nsServiceManagerUtils.h" #include "nsString.h" +#include "nsQueryObject.h" USING_BLUETOOTH_NAMESPACE diff --git a/dom/filehandle/FileStreamWrappers.cpp b/dom/filehandle/FileStreamWrappers.cpp index 688c315416e..a2d3637a7e0 100644 --- a/dom/filehandle/FileStreamWrappers.cpp +++ b/dom/filehandle/FileStreamWrappers.cpp @@ -17,6 +17,7 @@ #include "nsIRunnable.h" #include "nsISeekableStream.h" #include "nsThreadUtils.h" +#include "nsQueryObject.h" #ifdef DEBUG #include "nsXULAppAPI.h" diff --git a/dom/html/HTMLFieldSetElement.cpp b/dom/html/HTMLFieldSetElement.cpp index 91ca69c56b5..8bbbf650a48 100644 --- a/dom/html/HTMLFieldSetElement.cpp +++ b/dom/html/HTMLFieldSetElement.cpp @@ -9,6 +9,7 @@ #include "mozilla/dom/HTMLFieldSetElement.h" #include "mozilla/dom/HTMLFieldSetElementBinding.h" #include "nsContentList.h" +#include "nsQueryObject.h" NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet) diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index 8c9fbd33631..82da6282ab1 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -31,6 +31,7 @@ #include "nsIMutableArray.h" #include "nsIFormAutofillContentService.h" #include "mozilla/BinarySearch.h" +#include "nsQueryObject.h" // form submission #include "nsIFormSubmitObserver.h" diff --git a/dom/html/HTMLLabelElement.cpp b/dom/html/HTMLLabelElement.cpp index 0509dfe1257..dc47ca6ec05 100644 --- a/dom/html/HTMLLabelElement.cpp +++ b/dom/html/HTMLLabelElement.cpp @@ -12,6 +12,7 @@ #include "mozilla/dom/HTMLLabelElementBinding.h" #include "nsFocusManager.h" #include "nsIDOMMouseEvent.h" +#include "nsQueryObject.h" // construction, destruction diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index d34a28be9c7..7dd50b259f1 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -38,6 +38,7 @@ #include "nsIThreadInternal.h" #include "nsContentUtils.h" #include "nsIRequest.h" +#include "nsQueryObject.h" #include "nsIScriptSecurityManager.h" #include "nsIXPConnect.h" diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index 0d5cf78873d..58dd1ed8f48 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -17,6 +17,7 @@ #include "nsAttrValueInlines.h" #include "nsCOMPtr.h" #include "nsIAtom.h" +#include "nsQueryObject.h" #include "nsIContentInlines.h" #include "nsIContentViewer.h" #include "mozilla/css/StyleRule.h" diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index ed7647642c7..a92de664d2e 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -49,6 +49,7 @@ #include "nsThreadUtils.h" #include "ProfilerHelpers.h" #include "ReportInternalError.h" +#include "nsQueryObject.h" // Include this last to avoid path problems on Windows. #include "ActorsChild.h" diff --git a/dom/media/MediaDevices.cpp b/dom/media/MediaDevices.cpp index d9545bf698d..d965509820d 100644 --- a/dom/media/MediaDevices.cpp +++ b/dom/media/MediaDevices.cpp @@ -10,6 +10,7 @@ #include "nsIEventTarget.h" #include "nsIScriptGlobalObject.h" #include "nsPIDOMWindow.h" +#include "nsQueryObject.h" namespace mozilla { namespace dom { diff --git a/dom/media/MediaPermissionGonk.cpp b/dom/media/MediaPermissionGonk.cpp index dbd08d2d8c7..31f7b00d068 100644 --- a/dom/media/MediaPermissionGonk.cpp +++ b/dom/media/MediaPermissionGonk.cpp @@ -12,6 +12,7 @@ #include "nsIStringEnumerator.h" #include "nsISupportsArray.h" #include "nsJSUtils.h" +#include "nsQueryObject.h" #include "nsPIDOMWindow.h" #include "nsTArray.h" #include "GetUserMediaRequest.h" diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp index dcde7e07879..ee34e2d09f4 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.cpp +++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp @@ -21,6 +21,7 @@ #include "mozilla/dom/SpeechRecognitionEvent.h" #include "nsIObserverService.h" #include "nsServiceManagerUtils.h" +#include "nsQueryObject.h" #include diff --git a/dom/svg/DOMSVGStringList.cpp b/dom/svg/DOMSVGStringList.cpp index 4f2241048a1..6e534669fcf 100644 --- a/dom/svg/DOMSVGStringList.cpp +++ b/dom/svg/DOMSVGStringList.cpp @@ -10,6 +10,7 @@ #include "nsError.h" #include "nsCOMPtr.h" #include "nsSVGAttrTearoffTable.h" +#include "nsQueryObject.h" #include // See the architecture comment in this file's header. diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index df0e5be5c0d..ff71f32b1a7 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/nsSVGElement.cpp @@ -53,6 +53,7 @@ #include "mozilla/dom/SVGElementBinding.h" #include "mozilla/unused.h" #include "RestyleManager.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index 06189d02152..85bcd16af75 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -21,6 +21,7 @@ #include "nsNetUtil.h" #include "nsProxyRelease.h" #include "nsTArray.h" +#include "nsQueryObject.h" #include "RuntimeService.h" #include "ServiceWorker.h" diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 2f6b80a137f..c57504aa831 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -29,6 +29,7 @@ #include "nsIURL.h" #include "nsIWorkerDebugger.h" #include "nsIXPConnect.h" +#include "nsQueryObject.h" #include #include "jsfriendapi.h" diff --git a/dom/xbl/nsXBLPrototypeHandler.cpp b/dom/xbl/nsXBLPrototypeHandler.cpp index 5b40111a410..e10edbfaf70 100644 --- a/dom/xbl/nsXBLPrototypeHandler.cpp +++ b/dom/xbl/nsXBLPrototypeHandler.cpp @@ -6,6 +6,7 @@ #include "mozilla/ArrayUtils.h" #include "nsCOMPtr.h" +#include "nsQueryObject.h" #include "nsXBLPrototypeHandler.h" #include "nsXBLPrototypeBinding.h" #include "nsContentUtils.h" diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp index 6e73570451c..2bb1f064a85 100644 --- a/dom/xul/nsXULElement.cpp +++ b/dom/xul/nsXULElement.cpp @@ -93,6 +93,7 @@ #include "nsAttrValueInlines.h" #include "mozilla/Attributes.h" #include "nsIController.h" +#include "nsQueryObject.h" #include // The XUL doc interface diff --git a/editor/libeditor/IMETextTxn.cpp b/editor/libeditor/IMETextTxn.cpp index 973573aec2d..cb1b99b42e6 100644 --- a/editor/libeditor/IMETextTxn.cpp +++ b/editor/libeditor/IMETextTxn.cpp @@ -13,6 +13,7 @@ #include "nsError.h" // for NS_SUCCEEDED, NS_FAILED, etc #include "nsIPresShell.h" // nsISelectionController constants #include "nsRange.h" // local var +#include "nsQueryObject.h" // for do_QueryObject using namespace mozilla; using namespace mozilla::dom; diff --git a/editor/libeditor/InsertTextTxn.cpp b/editor/libeditor/InsertTextTxn.cpp index 4c896e2738b..4c5e95f5096 100644 --- a/editor/libeditor/InsertTextTxn.cpp +++ b/editor/libeditor/InsertTextTxn.cpp @@ -11,6 +11,7 @@ #include "nsDebug.h" // for NS_ASSERTION, etc #include "nsEditor.h" // mEditor #include "nsError.h" // for NS_OK, etc +#include "nsQueryObject.h" // for do_QueryObject using namespace mozilla; using namespace mozilla::dom; diff --git a/editor/libeditor/PlaceholderTxn.cpp b/editor/libeditor/PlaceholderTxn.cpp index 80867fd37a7..811ba8e5330 100644 --- a/editor/libeditor/PlaceholderTxn.cpp +++ b/editor/libeditor/PlaceholderTxn.cpp @@ -8,6 +8,7 @@ #include "IMETextTxn.h" #include "nsGkAtoms.h" #include "mozilla/dom/Selection.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/editor/libeditor/nsEditorEventListener.cpp b/editor/libeditor/nsEditorEventListener.cpp index b5af2845873..9c5139a952b 100644 --- a/editor/libeditor/nsEditorEventListener.cpp +++ b/editor/libeditor/nsEditorEventListener.cpp @@ -53,6 +53,7 @@ #include "nsRange.h" #include "nsServiceManagerUtils.h" // for do_GetService #include "nsString.h" // for nsAutoString +#include "nsQueryObject.h" // for do_QueryObject #ifdef HANDLE_NATIVE_TEXT_DIRECTION_SWITCH #include "nsContentUtils.h" // for nsContentUtils, etc #include "nsIBidiKeyboard.h" // for nsIBidiKeyboard diff --git a/editor/libeditor/nsHTMLEditorEventListener.cpp b/editor/libeditor/nsHTMLEditorEventListener.cpp index 53477df6426..61b207b50c7 100644 --- a/editor/libeditor/nsHTMLEditorEventListener.cpp +++ b/editor/libeditor/nsHTMLEditorEventListener.cpp @@ -11,6 +11,7 @@ #include "nsDebug.h" #include "nsEditor.h" #include "nsError.h" +#include "nsQueryObject.h" #include "nsHTMLEditUtils.h" #include "nsHTMLEditor.h" #include "nsIDOMElement.h" diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 521372350e5..7f157b21c94 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -176,6 +176,7 @@ #include "nsIFrameInlines.h" #include "mozilla/gfx/2D.h" #include "nsSubDocumentFrame.h" +#include "nsQueryObject.h" #ifdef ANDROID #include "nsIDocShellTreeOwner.h" diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp index 687b071760b..84ac3c91909 100644 --- a/layout/inspector/inDOMUtils.cpp +++ b/layout/inspector/inDOMUtils.cpp @@ -45,6 +45,7 @@ #include "nsColor.h" #include "nsStyleSet.h" #include "nsStyleUtil.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::css; diff --git a/layout/style/CSSStyleSheet.cpp b/layout/style/CSSStyleSheet.cpp index d25e0d6e8b3..eaee3895767 100644 --- a/layout/style/CSSStyleSheet.cpp +++ b/layout/style/CSSStyleSheet.cpp @@ -43,6 +43,7 @@ #include "mozilla/Likely.h" #include "mozilla/dom/CSSStyleSheetBinding.h" #include "nsComponentManagerUtils.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/layout/style/nsDOMCSSDeclaration.cpp b/layout/style/nsDOMCSSDeclaration.cpp index 2365a71f6b1..7cfa1e2ca08 100644 --- a/layout/style/nsDOMCSSDeclaration.cpp +++ b/layout/style/nsDOMCSSDeclaration.cpp @@ -18,6 +18,7 @@ #include "nsIURI.h" #include "mozilla/dom/BindingUtils.h" #include "nsContentUtils.h" +#include "nsQueryObject.h" using namespace mozilla; diff --git a/layout/style/nsRuleWalker.h b/layout/style/nsRuleWalker.h index f77ee89161e..b2715bf6f2b 100644 --- a/layout/style/nsRuleWalker.h +++ b/layout/style/nsRuleWalker.h @@ -14,6 +14,7 @@ #include "nsRuleNode.h" #include "nsIStyleRule.h" #include "StyleRule.h" +#include "nsQueryObject.h" class nsRuleWalker { public: diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index bb9f219f577..8649c985945 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -38,6 +38,7 @@ #include "nsPrintfCString.h" #include "nsIFrame.h" #include "RestyleManager.h" +#include "nsQueryObject.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index dbc90cc305a..3e1d00ce76d 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -17,6 +17,7 @@ #include "nspr.h" #include "nss.h" #include "pk11pub.h" +#include "nsQueryObject.h" #include "nsNetCID.h" #include "nsIProperty.h" diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 03283013b49..ff56a16ecd3 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -31,7 +31,7 @@ #include "mozilla/ipc/BackgroundUtils.h" #include "nsIOService.h" #include "nsICachingChannel.h" - +#include "nsQueryObject.h" using namespace mozilla::dom; using namespace mozilla::ipc; diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 943e9781205..c1e1818a27c 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -71,6 +71,7 @@ #include "nsIHttpPushListener.h" #include "nsIX509Cert.h" #include "ScopedNSSTypes.h" +#include "nsQueryObject.h" namespace mozilla { namespace net { diff --git a/profile/dirserviceprovider/nsProfileLock.cpp b/profile/dirserviceprovider/nsProfileLock.cpp index 0344f1bd9bf..510ee29f3f2 100644 --- a/profile/dirserviceprovider/nsProfileLock.cpp +++ b/profile/dirserviceprovider/nsProfileLock.cpp @@ -6,6 +6,7 @@ #include "nsProfileStringTypes.h" #include "nsProfileLock.h" #include "nsCOMPtr.h" +#include "nsQueryObject.h" #if defined(XP_WIN) #include "mozilla/ProfileUnlockerWin.h" diff --git a/toolkit/components/places/nsNavHistoryResult.cpp b/toolkit/components/places/nsNavHistoryResult.cpp index 1d90b77ca1b..b5e5550a87a 100644 --- a/toolkit/components/places/nsNavHistoryResult.cpp +++ b/toolkit/components/places/nsNavHistoryResult.cpp @@ -18,6 +18,7 @@ #include "nsUnicharUtils.h" #include "prtime.h" #include "prprf.h" +#include "nsQueryObject.h" #include "nsCycleCollectionParticipant.h" diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index f7ce1262468..b3b4c2aa4f1 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -20,6 +20,7 @@ #include "nscore.h" #include "nsWeakPtr.h" #include "nsAutoPtr.h" +#include "nsQueryObject.h" #include "nsIDOMWindow.h" diff --git a/widget/cocoa/nsDeviceContextSpecX.mm b/widget/cocoa/nsDeviceContextSpecX.mm index 6b28c937942..4ed5e2aeb0c 100644 --- a/widget/cocoa/nsDeviceContextSpecX.mm +++ b/widget/cocoa/nsDeviceContextSpecX.mm @@ -9,6 +9,7 @@ #include #include "nsAutoPtr.h" +#include "nsQueryObject.h" #include "nsIServiceManager.h" #include "nsIPrintOptions.h" #include "nsPrintSettingsX.h" diff --git a/widget/cocoa/nsMenuUtilsX.mm b/widget/cocoa/nsMenuUtilsX.mm index e55a50756cd..d0865124a94 100644 --- a/widget/cocoa/nsMenuUtilsX.mm +++ b/widget/cocoa/nsMenuUtilsX.mm @@ -17,6 +17,7 @@ #include "nsIDOMDocument.h" #include "nsIDOMXULCommandEvent.h" #include "nsPIDOMWindow.h" +#include "nsQueryObject.h" using namespace mozilla; diff --git a/widget/cocoa/nsPrintDialogX.mm b/widget/cocoa/nsPrintDialogX.mm index 4320fe19edb..35b3d228795 100644 --- a/widget/cocoa/nsPrintDialogX.mm +++ b/widget/cocoa/nsPrintDialogX.mm @@ -9,6 +9,7 @@ #include "nsIPrintSettings.h" #include "nsPrintSettingsX.h" #include "nsCOMPtr.h" +#include "nsQueryObject.h" #include "nsServiceManagerUtils.h" #include "nsIWebProgressListener.h" #include "nsIStringBundle.h" diff --git a/widget/cocoa/nsPrintOptionsX.mm b/widget/cocoa/nsPrintOptionsX.mm index 2ebedf7bb2e..db72392dc3b 100644 --- a/widget/cocoa/nsPrintOptionsX.mm +++ b/widget/cocoa/nsPrintOptionsX.mm @@ -4,6 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsCOMPtr.h" +#include "nsQueryObject.h" #include "nsIServiceManager.h" #include "nsPrintOptionsX.h" #include "nsPrintSettingsX.h" diff --git a/widget/windows/LSPAnnotator.cpp b/widget/windows/LSPAnnotator.cpp index 98ac8b88f6b..0f001ef37c9 100644 --- a/widget/windows/LSPAnnotator.cpp +++ b/widget/windows/LSPAnnotator.cpp @@ -15,6 +15,7 @@ #include "nsISupportsImpl.h" #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" +#include "nsQueryObject.h" #include #include diff --git a/xpcom/base/moz.build b/xpcom/base/moz.build index e44b41d8c31..500e987593b 100644 --- a/xpcom/base/moz.build +++ b/xpcom/base/moz.build @@ -57,6 +57,7 @@ EXPORTS += [ 'nsISupportsBase.h', 'nsISupportsObsolete.h', 'nsObjCExceptions.h', + 'nsQueryObject.h', 'nsRefPtr.h', 'nsStackWalk.h', 'nsTraceRefcnt.h', diff --git a/xpcom/base/nsAutoPtr.h b/xpcom/base/nsAutoPtr.h index d5710ac82c1..9c3afb48f29 100644 --- a/xpcom/base/nsAutoPtr.h +++ b/xpcom/base/nsAutoPtr.h @@ -758,95 +758,4 @@ operator!=(NSCAP_Zero* aLhs, const nsAutoArrayPtr& aRhs) return reinterpret_cast(aLhs) != static_cast(aRhs.get()); } - -/*****************************************************************************/ - -template -class nsQueryObject : public nsCOMPtr_helper -{ -public: - explicit nsQueryObject(T* aRawPtr) - : mRawPtr(aRawPtr) - { - } - - virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, - void** aResult) const - { - nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) - : NS_ERROR_NULL_POINTER; - return status; - } -private: - T* mRawPtr; -}; - -template -class nsQueryObjectWithError : public nsCOMPtr_helper -{ -public: - nsQueryObjectWithError(T* aRawPtr, nsresult* aErrorPtr) - : mRawPtr(aRawPtr), mErrorPtr(aErrorPtr) - { - } - - virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, - void** aResult) const - { - nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) - : NS_ERROR_NULL_POINTER; - if (mErrorPtr) { - *mErrorPtr = status; - } - return status; - } -private: - T* mRawPtr; - nsresult* mErrorPtr; -}; - -template -inline nsQueryObject -do_QueryObject(T* aRawPtr) -{ - return nsQueryObject(aRawPtr); -} - -template -inline nsQueryObject -do_QueryObject(nsCOMPtr& aRawPtr) -{ - return nsQueryObject(aRawPtr); -} - -template -inline nsQueryObject -do_QueryObject(nsRefPtr& aRawPtr) -{ - return nsQueryObject(aRawPtr); -} - -template -inline nsQueryObjectWithError -do_QueryObject(T* aRawPtr, nsresult* aErrorPtr) -{ - return nsQueryObjectWithError(aRawPtr, aErrorPtr); -} - -template -inline nsQueryObjectWithError -do_QueryObject(nsCOMPtr& aRawPtr, nsresult* aErrorPtr) -{ - return nsQueryObjectWithError(aRawPtr, aErrorPtr); -} - -template -inline nsQueryObjectWithError -do_QueryObject(nsRefPtr& aRawPtr, nsresult* aErrorPtr) -{ - return nsQueryObjectWithError(aRawPtr, aErrorPtr); -} - -/*****************************************************************************/ - #endif // !defined(nsAutoPtr_h) diff --git a/xpcom/base/nsQueryObject.h b/xpcom/base/nsQueryObject.h new file mode 100644 index 00000000000..dceabeb69a9 --- /dev/null +++ b/xpcom/base/nsQueryObject.h @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#ifndef nsQueryObject_h +#define nsQueryObject_h + +#include "nsCOMPtr.h" +#include "nsRefPtr.h" + +/*****************************************************************************/ + +template +class nsQueryObject : public nsCOMPtr_helper +{ +public: + explicit nsQueryObject(T* aRawPtr) + : mRawPtr(aRawPtr) + { + } + + virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, + void** aResult) const + { + nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) + : NS_ERROR_NULL_POINTER; + return status; + } +private: + T* mRawPtr; +}; + +template +class nsQueryObjectWithError : public nsCOMPtr_helper +{ +public: + nsQueryObjectWithError(T* aRawPtr, nsresult* aErrorPtr) + : mRawPtr(aRawPtr), mErrorPtr(aErrorPtr) + { + } + + virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, + void** aResult) const + { + nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) + : NS_ERROR_NULL_POINTER; + if (mErrorPtr) { + *mErrorPtr = status; + } + return status; + } +private: + T* mRawPtr; + nsresult* mErrorPtr; +}; + +/*****************************************************************************/ + +/*****************************************************************************/ + +template +inline nsQueryObject +do_QueryObject(T* aRawPtr) +{ + return nsQueryObject(aRawPtr); +} + +template +inline nsQueryObject +do_QueryObject(nsCOMPtr& aRawPtr) +{ + return nsQueryObject(aRawPtr); +} + +template +inline nsQueryObject +do_QueryObject(nsRefPtr& aRawPtr) +{ + return nsQueryObject(aRawPtr); +} + +template +inline nsQueryObjectWithError +do_QueryObject(T* aRawPtr, nsresult* aErrorPtr) +{ + return nsQueryObjectWithError(aRawPtr, aErrorPtr); +} + +template +inline nsQueryObjectWithError +do_QueryObject(nsCOMPtr& aRawPtr, nsresult* aErrorPtr) +{ + return nsQueryObjectWithError(aRawPtr, aErrorPtr); +} + +template +inline nsQueryObjectWithError +do_QueryObject(nsRefPtr& aRawPtr, nsresult* aErrorPtr) +{ + return nsQueryObjectWithError(aRawPtr, aErrorPtr); +} + +/*****************************************************************************/ + +#endif // !defined(nsQueryObject_h) diff --git a/xpcom/tests/TestNsRefPtr.cpp b/xpcom/tests/TestNsRefPtr.cpp index 55a503a82c7..ecf941bf8a0 100644 --- a/xpcom/tests/TestNsRefPtr.cpp +++ b/xpcom/tests/TestNsRefPtr.cpp @@ -8,6 +8,7 @@ #include "nsCOMPtr.h" #include "nsAutoPtr.h" #include "nsISupports.h" +#include "nsQueryObject.h" #define NS_FOO_IID \ { 0x6f7652e0, 0xee43, 0x11d1, \ diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp index a8d8b1afe2c..fcebf2f44d6 100644 --- a/xpfe/appshell/nsXULWindow.cpp +++ b/xpfe/appshell/nsXULWindow.cpp @@ -50,6 +50,7 @@ #include "nsContentUtils.h" #include "nsWebShellWindow.h" // get rid of this one, too... #include "nsGlobalWindow.h" +#include "nsQueryObject.h" #include "prenv.h" #include "mozilla/AutoRestore.h"