зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset bf25101e66cf (bug 1095098) for build bustage
This commit is contained in:
Родитель
0f94bddfc8
Коммит
126b4f108e
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "Role.h"
|
||||
#include "States.h"
|
||||
#include "XULTreeGridAccessible.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIAccessibleRelation.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "Relation.h"
|
||||
#include "Role.h"
|
||||
#include "States.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsIMutableArray.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "nsEscape.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsString.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "mozilla/CSSStyleSheet.h"
|
||||
#include "mozilla/dom/URL.h"
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "nsIDOMWindow.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsError.h"
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIWritablePropertyBag2.h"
|
||||
#include "nsIAppShell.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "nsFrame.h"
|
||||
#include "mozilla/layers/ShadowLayers.h"
|
||||
#include "ClientLayerManager.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsIScrollableFrame.h"
|
||||
|
||||
|
|
|
@ -224,7 +224,6 @@
|
|||
#include "nsLocation.h"
|
||||
#include "mozilla/dom/FontFaceSet.h"
|
||||
#include "mozilla/dom/BoxObject.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#ifdef MOZ_MEDIA_NAVIGATOR
|
||||
#include "mozilla/MediaManager.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "mozilla/dom/DOMStringList.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef ANDROID
|
||||
|
|
|
@ -119,7 +119,6 @@
|
|||
#include "nsIControllerContext.h"
|
||||
#include "nsGlobalWindowCommands.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsIDOMFileList.h"
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsSandboxFlags.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
// Concrete classes
|
||||
#include "nsFrameLoader.h"
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "nsUnicharInputStream.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsStyleUtil.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsIParserUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID.
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID.
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsIRunnable.h"
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "nsXULAppAPI.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "mozilla/dom/HTMLFieldSetElement.h"
|
||||
#include "mozilla/dom/HTMLFieldSetElementBinding.h"
|
||||
#include "nsContentList.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nsIMutableArray.h"
|
||||
#include "nsIFormAutofillContentService.h"
|
||||
#include "mozilla/BinarySearch.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
// form submission
|
||||
#include "nsIFormSubmitObserver.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "mozilla/dom/HTMLLabelElementBinding.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
// construction, destruction
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsIThreadInternal.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIXPConnect.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsAttrValueInlines.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "mozilla/css/StyleRule.h"
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsThreadUtils.h"
|
||||
#include "ProfilerHelpers.h"
|
||||
#include "ReportInternalError.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
// Include this last to avoid path problems on Windows.
|
||||
#include "ActorsChild.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "nsIEventTarget.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIStringEnumerator.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsTArray.h"
|
||||
#include "GetUserMediaRequest.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "mozilla/dom/SpeechRecognitionEvent.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "nsError.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSVGAttrTearoffTable.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include <algorithm>
|
||||
|
||||
// See the architecture comment in this file's header.
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "mozilla/dom/SVGElementBinding.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "RestyleManager.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsProxyRelease.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "RuntimeService.h"
|
||||
#include "ServiceWorker.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "nsIURL.h"
|
||||
#include "nsIWorkerDebugger.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "jsfriendapi.h"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -93,7 +93,6 @@
|
|||
#include "nsAttrValueInlines.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIController.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include <algorithm>
|
||||
|
||||
// The XUL doc interface
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#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;
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#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;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "IMETextTxn.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#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
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsDebug.h"
|
||||
#include "nsEditor.h"
|
||||
#include "nsError.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsHTMLEditUtils.h"
|
||||
#include "nsHTMLEditor.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
|
|
@ -176,7 +176,6 @@
|
|||
#include "nsIFrameInlines.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "nsColor.h"
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsStyleUtil.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::css;
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/dom/CSSStyleSheetBinding.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIURI.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsRuleNode.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "StyleRule.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
class nsRuleWalker {
|
||||
public:
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsPrintfCString.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "RestyleManager.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nspr.h"
|
||||
#include "nss.h"
|
||||
#include "pk11pub.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsNetCID.h"
|
||||
#include "nsIProperty.h"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
#include "nsIHttpPushListener.h"
|
||||
#include "nsIX509Cert.h"
|
||||
#include "ScopedNSSTypes.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
namespace mozilla { namespace net {
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "nsProfileStringTypes.h"
|
||||
#include "nsProfileLock.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#include "mozilla/ProfileUnlockerWin.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "prtime.h"
|
||||
#include "prprf.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "nscore.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#include "nsIDOMWindow.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIPrintOptions.h"
|
||||
#include "nsPrintSettingsX.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsIPrintSettings.h"
|
||||
#include "nsPrintSettingsX.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* 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"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "nsISupportsImpl.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include <windows.h>
|
||||
#include <ws2spi.h>
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ EXPORTS += [
|
|||
'nsISupportsBase.h',
|
||||
'nsISupportsObsolete.h',
|
||||
'nsObjCExceptions.h',
|
||||
'nsQueryObject.h',
|
||||
'nsRefPtr.h',
|
||||
'nsStackWalk.h',
|
||||
'nsTraceRefcnt.h',
|
||||
|
|
|
@ -758,4 +758,95 @@ operator!=(NSCAP_Zero* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
|||
return reinterpret_cast<const void*>(aLhs) != static_cast<const void*>(aRhs.get());
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
template<class T>
|
||||
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 T>
|
||||
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<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(T* aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(T* aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif // !defined(nsAutoPtr_h)
|
||||
|
|
|
@ -1,107 +0,0 @@
|
|||
/* -*- 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 T>
|
||||
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 T>
|
||||
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<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(T* aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(T* aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif // !defined(nsQueryObject_h)
|
|
@ -8,7 +8,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
#define NS_FOO_IID \
|
||||
{ 0x6f7652e0, 0xee43, 0x11d1, \
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче