зеркало из https://github.com/mozilla/pjs.git
backing out changes to 104172. r=ccarlen@netscape.com
This commit is contained in:
Родитель
98d5d5626a
Коммит
220f65a002
|
@ -39,7 +39,7 @@
|
|||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
nsresult NS_EXPORT
|
||||
nsresult
|
||||
nsGetInterface::operator()( const nsIID& aIID, void** aInstancePtr ) const
|
||||
{
|
||||
nsresult status;
|
||||
|
@ -62,4 +62,3 @@ nsGetInterface::operator()( const nsIID& aIID, void** aInstancePtr ) const
|
|||
*mErrorPtr = status;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is the Mozilla browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications, Inc. Portions created by Netscape are
|
||||
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#ifndef __nsInterfaceRequestorUtils_h
|
||||
#define __nsInterfaceRequestorUtils_h
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
// a type-safe shortcut for calling the |GetInterface()| member function
|
||||
// T must inherit from nsIInterfaceRequestor, but the cast may be ambiguous.
|
||||
template <class T, class DestinationType>
|
||||
inline
|
||||
nsresult
|
||||
CallGetInterface( T* aSource, DestinationType** aDestination )
|
||||
{
|
||||
NS_PRECONDITION(aSource, "null parameter");
|
||||
NS_PRECONDITION(aDestination, "null parameter");
|
||||
|
||||
return aSource->GetInterface(NS_GET_IID(DestinationType),
|
||||
NS_REINTERPRET_CAST(void**, aDestination));
|
||||
}
|
||||
|
||||
class nsGetInterface : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
inline
|
||||
nsGetInterface( nsISupports* aSource, nsresult* error )
|
||||
: mSource(aSource),
|
||||
mErrorPtr(error)
|
||||
{
|
||||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual NS_EXPORT nsresult operator()( const nsIID&, void** ) const;
|
||||
virtual ~nsGetInterface() {};
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsISupports> mSource;
|
||||
nsresult* mErrorPtr;
|
||||
};
|
||||
|
||||
inline
|
||||
const nsGetInterface
|
||||
do_GetInterface( nsISupports* aSource, nsresult* error = 0 )
|
||||
{
|
||||
return nsGetInterface(aSource, error);
|
||||
}
|
||||
|
||||
#endif // __nsInterfaceRequestorUtils_h
|
||||
|
|
@ -106,10 +106,9 @@ CallQueryReferent( T* aSource, DestinationType** aDestination )
|
|||
}
|
||||
|
||||
|
||||
class nsQueryReferent : public nsCOMPtr_helper
|
||||
class NS_EXPORT nsQueryReferent : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
inline
|
||||
nsQueryReferent( nsIWeakReference* aWeakPtr, nsresult* error )
|
||||
: mWeakPtr(aWeakPtr),
|
||||
mErrorPtr(error)
|
||||
|
@ -117,7 +116,7 @@ class nsQueryReferent : public nsCOMPtr_helper
|
|||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual nsresult NS_EXPORT operator()( const nsIID& aIID, void** ) const;
|
||||
virtual nsresult operator()( const nsIID& aIID, void** ) const;
|
||||
|
||||
private:
|
||||
nsIWeakReference* mWeakPtr;
|
||||
|
@ -133,10 +132,9 @@ do_QueryReferent( nsIWeakReference* aRawPtr, nsresult* error = 0 )
|
|||
|
||||
|
||||
|
||||
class nsGetWeakReference : public nsCOMPtr_helper
|
||||
class NS_COM nsGetWeakReference : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
inline
|
||||
nsGetWeakReference( nsISupports* aRawPtr, nsresult* error )
|
||||
: mRawPtr(aRawPtr),
|
||||
mErrorPtr(error)
|
||||
|
@ -144,7 +142,7 @@ class nsGetWeakReference : public nsCOMPtr_helper
|
|||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual nsresult NS_COM operator()( const nsIID&, void** ) const;
|
||||
virtual nsresult operator()( const nsIID&, void** ) const;
|
||||
|
||||
private:
|
||||
nsISupports* mRawPtr;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "nsWeakReference.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsresult NS_EXPORT
|
||||
nsresult
|
||||
nsQueryReferent::operator()( const nsIID& aIID, void** answer ) const
|
||||
{
|
||||
nsresult status;
|
||||
|
|
|
@ -63,10 +63,9 @@ interface nsICollection : nsISerializable
|
|||
#include "nsCOMPtr.h"
|
||||
#endif
|
||||
|
||||
class nsQueryElementAt : public nsCOMPtr_helper
|
||||
class NS_EXPORT nsQueryElementAt : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
inline
|
||||
nsQueryElementAt( nsICollection* aCollection, PRUint32 aIndex, nsresult* aErrorPtr )
|
||||
: mCollection(aCollection),
|
||||
mIndex(aIndex),
|
||||
|
@ -75,7 +74,7 @@ class nsQueryElementAt : public nsCOMPtr_helper
|
|||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual nsresult NS_EXPORT operator()( const nsIID& aIID, void** ) const;
|
||||
virtual nsresult operator()( const nsIID& aIID, void** ) const;
|
||||
|
||||
private:
|
||||
nsICollection* mCollection;
|
||||
|
|
|
@ -111,7 +111,7 @@ SupportsStats::~SupportsStats()
|
|||
SupportsStats gSupportsStats;
|
||||
#endif
|
||||
|
||||
nsresult NS_EXPORT
|
||||
nsresult
|
||||
nsQueryElementAt::operator()( const nsIID& aIID, void** aResult ) const
|
||||
{
|
||||
nsresult status = mCollection
|
||||
|
|
|
@ -396,7 +396,6 @@ class nsCOMPtr_base
|
|||
{
|
||||
public:
|
||||
|
||||
inline
|
||||
nsCOMPtr_base( nsISupports* rawPtr = 0 )
|
||||
: mRawPtr(rawPtr)
|
||||
{
|
||||
|
@ -404,11 +403,11 @@ class nsCOMPtr_base
|
|||
}
|
||||
|
||||
#ifdef NSCAP_FEATURE_FACTOR_DESTRUCTOR
|
||||
// Allow debug builds to link with optimized versions of nsCOMPtr-using
|
||||
// plugins (e.g., JVMs).
|
||||
NS_EXPORT ~nsCOMPtr_base();
|
||||
#else
|
||||
~nsCOMPtr_base() { }
|
||||
// Allow debug builds to link with optimized versions of nsCOMPtr-using
|
||||
// plugins (e.g., JVMs).
|
||||
NS_EXPORT ~nsCOMPtr_base() { }
|
||||
#endif
|
||||
|
||||
NS_EXPORT void assign_with_AddRef( nsISupports* );
|
||||
|
@ -418,7 +417,7 @@ class nsCOMPtr_base
|
|||
protected:
|
||||
nsISupports* mRawPtr;
|
||||
|
||||
inline void
|
||||
void
|
||||
assign_assuming_AddRef( nsISupports* newPtr )
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -38,10 +38,9 @@ CallGetInterface( T* aSource, DestinationType** aDestination )
|
|||
NS_REINTERPRET_CAST(void**, aDestination));
|
||||
}
|
||||
|
||||
class nsGetInterface : public nsCOMPtr_helper
|
||||
class NS_EXPORT nsGetInterface : public nsCOMPtr_helper
|
||||
{
|
||||
public:
|
||||
inline
|
||||
nsGetInterface( nsISupports* aSource, nsresult* error )
|
||||
: mSource(aSource),
|
||||
mErrorPtr(error)
|
||||
|
@ -49,7 +48,7 @@ class nsGetInterface : public nsCOMPtr_helper
|
|||
// nothing else to do here
|
||||
}
|
||||
|
||||
virtual NS_EXPORT nsresult operator()( const nsIID&, void** ) const;
|
||||
virtual nsresult operator()( const nsIID&, void** ) const;
|
||||
virtual ~nsGetInterface() {};
|
||||
|
||||
private:
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "nsWeakReference.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsresult NS_EXPORT
|
||||
nsresult
|
||||
nsQueryReferent::operator()( const nsIID& aIID, void** answer ) const
|
||||
{
|
||||
nsresult status;
|
||||
|
|
|
@ -131,10 +131,10 @@ private:
|
|||
};
|
||||
|
||||
|
||||
class nsProxyObjectCallInfo
|
||||
class NS_EXPORT nsProxyObjectCallInfo
|
||||
{
|
||||
public:
|
||||
NS_EXPORT
|
||||
|
||||
nsProxyObjectCallInfo(nsProxyObject* owner,
|
||||
nsXPTMethodInfo *methodInfo,
|
||||
PRUint32 methodIndex,
|
||||
|
@ -142,23 +142,23 @@ public:
|
|||
PRUint32 parameterCount,
|
||||
PLEvent *event);
|
||||
|
||||
NS_EXPORT virtual ~nsProxyObjectCallInfo();
|
||||
virtual ~nsProxyObjectCallInfo();
|
||||
|
||||
inline PRUint32 GetMethodIndex() const { return mMethodIndex; }
|
||||
inline nsXPTCVariant* GetParameterList() const { return mParameterList; }
|
||||
inline PRUint32 GetParameterCount() const { return mParameterCount; }
|
||||
inline PLEvent* GetPLEvent() const { return mEvent; }
|
||||
inline nsresult GetResult() const { return mResult; }
|
||||
inline nsProxyObject* GetProxyObject() const { return mOwner; }
|
||||
PRUint32 GetMethodIndex() const { return mMethodIndex; }
|
||||
nsXPTCVariant* GetParameterList() const { return mParameterList; }
|
||||
PRUint32 GetParameterCount() const { return mParameterCount; }
|
||||
PLEvent* GetPLEvent() const { return mEvent; }
|
||||
nsresult GetResult() const { return mResult; }
|
||||
nsProxyObject* GetProxyObject() const { return mOwner; }
|
||||
|
||||
NS_EXPORT PRBool GetCompleted();
|
||||
NS_EXPORT void SetCompleted();
|
||||
NS_EXPORT void PostCompleted();
|
||||
PRBool GetCompleted();
|
||||
void SetCompleted();
|
||||
void PostCompleted();
|
||||
|
||||
inline void SetResult(nsresult rv) {mResult = rv; }
|
||||
void SetResult(nsresult rv) {mResult = rv; }
|
||||
|
||||
NS_EXPORT nsIEventQueue* GetCallersQueue();
|
||||
NS_EXPORT void SetCallersQueue(nsIEventQueue* queue);
|
||||
nsIEventQueue* GetCallersQueue();
|
||||
void SetCallersQueue(nsIEventQueue* queue);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ static void PR_CALLBACK CompletedDestroyHandler(PLEvent *self) ;
|
|||
static void* PR_CALLBACK ProxyDestructorEventHandler(PLEvent *self);
|
||||
static void PR_CALLBACK ProxyDestructorDestroyHandler(PLEvent *self) ;
|
||||
|
||||
NS_EXPORT nsProxyObjectCallInfo::nsProxyObjectCallInfo( nsProxyObject* owner,
|
||||
nsProxyObjectCallInfo::nsProxyObjectCallInfo( nsProxyObject* owner,
|
||||
nsXPTMethodInfo *methodInfo,
|
||||
PRUint32 methodIndex,
|
||||
nsXPTCVariant* parameterList,
|
||||
|
@ -84,7 +84,7 @@ NS_EXPORT nsProxyObjectCallInfo::nsProxyObjectCallInfo( nsProxyObject* owner,
|
|||
}
|
||||
|
||||
|
||||
NS_EXPORT nsProxyObjectCallInfo::~nsProxyObjectCallInfo()
|
||||
nsProxyObjectCallInfo::~nsProxyObjectCallInfo()
|
||||
{
|
||||
RefCountInInterfacePointers(PR_FALSE);
|
||||
if (mOwner->GetProxyType() & PROXY_ASYNC)
|
||||
|
@ -167,19 +167,19 @@ nsProxyObjectCallInfo::CopyStrings(PRBool copy)
|
|||
}
|
||||
}
|
||||
|
||||
NS_EXPORT PRBool
|
||||
PRBool
|
||||
nsProxyObjectCallInfo::GetCompleted()
|
||||
{
|
||||
return (PRBool)mCompleted;
|
||||
}
|
||||
|
||||
NS_EXPORT void
|
||||
void
|
||||
nsProxyObjectCallInfo::SetCompleted()
|
||||
{
|
||||
PR_AtomicSet(&mCompleted, 1);
|
||||
}
|
||||
|
||||
NS_EXPORT void
|
||||
void
|
||||
nsProxyObjectCallInfo::PostCompleted()
|
||||
{
|
||||
if (mCallersEventQ)
|
||||
|
@ -201,12 +201,12 @@ nsProxyObjectCallInfo::PostCompleted()
|
|||
}
|
||||
}
|
||||
|
||||
NS_EXPORT nsIEventQueue*
|
||||
nsIEventQueue*
|
||||
nsProxyObjectCallInfo::GetCallersQueue()
|
||||
{
|
||||
return mCallersEventQ;
|
||||
}
|
||||
NS_EXPORT void
|
||||
void
|
||||
nsProxyObjectCallInfo::SetCallersQueue(nsIEventQueue* queue)
|
||||
{
|
||||
mCallersEventQ = queue;
|
||||
|
|
Загрузка…
Ссылка в новой задаче