зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1295053 (part 1) - Don't use NS_METHOD for xpcom thread utility functions. r=froydnj.
These don't need __stdcall on Win32. --HG-- extra : rebase_source : 9af47c64571a2c7459f95c46e737c5ef50d47909
This commit is contained in:
Родитель
0b67a32f2e
Коммит
060123c88a
|
@ -17,7 +17,7 @@ class nsIThread;
|
|||
* @param aResult
|
||||
* The resulting nsIThread object.
|
||||
*/
|
||||
extern NS_METHOD NS_GetMainThread(nsIThread** aResult);
|
||||
extern nsresult NS_GetMainThread(nsIThread** aResult);
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// Fast access to the current thread. Do not release the returned pointer! If
|
||||
|
|
|
@ -55,7 +55,7 @@ CancelableRunnable::Cancel()
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_NewThread(nsIThread** aResult, nsIRunnable* aEvent, uint32_t aStackSize)
|
||||
{
|
||||
nsCOMPtr<nsIThread> thread;
|
||||
|
@ -89,7 +89,7 @@ NS_NewThread(nsIThread** aResult, nsIRunnable* aEvent, uint32_t aStackSize)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_GetCurrentThread(nsIThread** aResult)
|
||||
{
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
|
@ -105,7 +105,7 @@ NS_GetCurrentThread(nsIThread** aResult)
|
|||
#endif
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_GetMainThread(nsIThread** aResult)
|
||||
{
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
|
@ -135,7 +135,7 @@ NS_IsMainThread()
|
|||
}
|
||||
#endif
|
||||
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_DispatchToCurrentThread(already_AddRefed<nsIRunnable>&& aEvent)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -168,14 +168,14 @@ NS_DispatchToCurrentThread(already_AddRefed<nsIRunnable>&& aEvent)
|
|||
// It is common to call NS_DispatchToCurrentThread with a newly
|
||||
// allocated runnable with a refcount of zero. To keep us from leaking
|
||||
// the runnable if the dispatch method fails, we take a death grip.
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_DispatchToCurrentThread(nsIRunnable* aEvent)
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> event(aEvent);
|
||||
return NS_DispatchToCurrentThread(event.forget());
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_DispatchToMainThread(already_AddRefed<nsIRunnable>&& aEvent, uint32_t aDispatchFlags)
|
||||
{
|
||||
LeakRefPtr<nsIRunnable> event(Move(aEvent));
|
||||
|
@ -195,7 +195,7 @@ NS_DispatchToMainThread(already_AddRefed<nsIRunnable>&& aEvent, uint32_t aDispat
|
|||
// likely that the runnable is being dispatched to the main thread
|
||||
// because it owns main thread only objects, so it is not safe to
|
||||
// release them here.
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_DispatchToMainThread(nsIRunnable* aEvent, uint32_t aDispatchFlags)
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> event(aEvent);
|
||||
|
@ -203,7 +203,7 @@ NS_DispatchToMainThread(nsIRunnable* aEvent, uint32_t aDispatchFlags)
|
|||
}
|
||||
|
||||
#ifndef XPCOM_GLUE_AVOID_NSPR
|
||||
NS_METHOD
|
||||
nsresult
|
||||
NS_ProcessPendingEvents(nsIThread* aThread, PRIntervalTime aTimeout)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
|
|
@ -59,7 +59,7 @@ NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN])
|
|||
* @returns NS_ERROR_INVALID_ARG
|
||||
* Indicates that the given name is not unique.
|
||||
*/
|
||||
extern NS_METHOD
|
||||
extern nsresult
|
||||
NS_NewThread(nsIThread** aResult,
|
||||
nsIRunnable* aInitialEvent = nullptr,
|
||||
uint32_t aStackSize = nsIThreadManager::DEFAULT_STACK_SIZE);
|
||||
|
@ -68,7 +68,7 @@ NS_NewThread(nsIThread** aResult,
|
|||
* Creates a named thread, otherwise the same as NS_NewThread
|
||||
*/
|
||||
template<size_t LEN>
|
||||
inline NS_METHOD
|
||||
inline nsresult
|
||||
NS_NewNamedThread(const char (&aName)[LEN],
|
||||
nsIThread** aResult,
|
||||
nsIRunnable* aInitialEvent = nullptr,
|
||||
|
@ -97,7 +97,7 @@ NS_NewNamedThread(const char (&aName)[LEN],
|
|||
* @param aResult
|
||||
* The resulting nsIThread object.
|
||||
*/
|
||||
extern NS_METHOD NS_GetCurrentThread(nsIThread** aResult);
|
||||
extern nsresult NS_GetCurrentThread(nsIThread** aResult);
|
||||
|
||||
/**
|
||||
* Dispatch the given event to the current thread.
|
||||
|
@ -108,8 +108,8 @@ extern NS_METHOD NS_GetCurrentThread(nsIThread** aResult);
|
|||
* @returns NS_ERROR_INVALID_ARG
|
||||
* If event is null.
|
||||
*/
|
||||
extern NS_METHOD NS_DispatchToCurrentThread(nsIRunnable* aEvent);
|
||||
extern NS_METHOD
|
||||
extern nsresult NS_DispatchToCurrentThread(nsIRunnable* aEvent);
|
||||
extern nsresult
|
||||
NS_DispatchToCurrentThread(already_AddRefed<nsIRunnable>&& aEvent);
|
||||
|
||||
/**
|
||||
|
@ -123,10 +123,10 @@ NS_DispatchToCurrentThread(already_AddRefed<nsIRunnable>&& aEvent);
|
|||
* @returns NS_ERROR_INVALID_ARG
|
||||
* If event is null.
|
||||
*/
|
||||
extern NS_METHOD
|
||||
extern nsresult
|
||||
NS_DispatchToMainThread(nsIRunnable* aEvent,
|
||||
uint32_t aDispatchFlags = NS_DISPATCH_NORMAL);
|
||||
extern NS_METHOD
|
||||
extern nsresult
|
||||
NS_DispatchToMainThread(already_AddRefed<nsIRunnable>&& aEvent,
|
||||
uint32_t aDispatchFlags = NS_DISPATCH_NORMAL);
|
||||
|
||||
|
@ -146,7 +146,7 @@ NS_DispatchToMainThread(already_AddRefed<nsIRunnable>&& aEvent,
|
|||
* value is simply used to determine whether or not to process another event.
|
||||
* Pass PR_INTERVAL_NO_TIMEOUT to specify no timeout.
|
||||
*/
|
||||
extern NS_METHOD
|
||||
extern nsresult
|
||||
NS_ProcessPendingEvents(nsIThread* aThread,
|
||||
PRIntervalTime aTimeout = PR_INTERVAL_NO_TIMEOUT);
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче