mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 913847 - stop needlessly including nsThreadUtils.h - r=ehsan
This commit is contained in:
parent
31eb1565d0
commit
ef57b5655b
@ -35,6 +35,7 @@
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "mozilla/dom/FileListBinding.h"
|
||||
using namespace mozilla;
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "pldhash.h"
|
||||
#include "nsAttrAndChildArray.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "MediaDecoderOwner.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsILoadGroup.h"
|
||||
@ -45,6 +44,7 @@ class MediaDecoder;
|
||||
|
||||
class nsITimer;
|
||||
class nsRange;
|
||||
class nsIRunnable;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "MediaDecoder.h"
|
||||
#include "DASHReader.h"
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#define NAN std::numeric_limits<double>::quiet_NaN()
|
||||
#endif
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIDOMCameraManager.h"
|
||||
#include "prlog.h"
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "FileRequest.h"
|
||||
#include "FileService.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
USING_FILE_NAMESPACE
|
||||
|
||||
@ -209,3 +210,17 @@ FileHelper::Finish()
|
||||
mRequest), "Subclass didn't call FileHelper::ReleaseObjects!");
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
FileHelper::OnStreamClose()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
Finish();
|
||||
}
|
||||
|
||||
void
|
||||
FileHelper::OnStreamDestroy()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
Finish();
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "FileCommon.h"
|
||||
|
||||
#include "nsIRequestObserver.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
class nsIFileStorage;
|
||||
|
||||
@ -58,18 +57,10 @@ public:
|
||||
OnStreamProgress(uint64_t aProgress, uint64_t aProgressMax);
|
||||
|
||||
void
|
||||
OnStreamClose()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
Finish();
|
||||
}
|
||||
OnStreamClose();
|
||||
|
||||
void
|
||||
OnStreamDestroy()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
Finish();
|
||||
}
|
||||
OnStreamDestroy();
|
||||
|
||||
static LockedFile*
|
||||
GetCurrentLockedFile();
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "FileInfo.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/dom/quota/QuotaManager.h"
|
||||
|
||||
USING_INDEXEDDB_NAMESPACE
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
#include "IndexedDatabase.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "FileManager.h"
|
||||
#include "IndexedDatabaseManager.h"
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "nsIWindowMediator.h"
|
||||
#include "nsIWinTaskbar.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "WidgetUtils.h"
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prlog.h"
|
||||
#include "nsHashKeys.h"
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "ArrayCluster.h"
|
||||
#include "Client.h"
|
||||
@ -33,6 +32,7 @@ class nsIThread;
|
||||
class nsITimer;
|
||||
class nsIURI;
|
||||
class nsPIDOMWindow;
|
||||
class nsIRunnable;
|
||||
|
||||
BEGIN_QUOTA_NAMESPACE
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "nsDOMEventTargetHelper.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsRect.h" // for nsIntRect
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
#include "nsThreadUtils.h" // for NS_IsMainThread
|
||||
#include "mozilla/Atomics.h"
|
||||
|
||||
class nsMainThreadSurfaceRef;
|
||||
@ -817,7 +816,6 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxASurface> GetAsSurface()
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Must be main thread");
|
||||
nsRefPtr<gfxASurface> surface = mSurface.get();
|
||||
return surface.forget();
|
||||
}
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
#include "nsITimer.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "transportlayer.h"
|
||||
#include "m_cpp_utils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
// A stack of transport layers acts as a flow.
|
||||
// Generally, one reads and writes to the top layer.
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "logging.h"
|
||||
#include "transportflow.h"
|
||||
#include "transportlayer.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
// Logging context
|
||||
namespace mozilla {
|
||||
@ -46,4 +47,19 @@ void TransportLayer::SetState(State state) {
|
||||
}
|
||||
}
|
||||
|
||||
nsresult TransportLayer::RunOnThread(nsIRunnable *event) {
|
||||
if (target_) {
|
||||
nsIThread *thr;
|
||||
|
||||
DebugOnly<nsresult> rv = NS_GetCurrentThread(&thr);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
|
||||
if (target_ != thr) {
|
||||
return target_->Dispatch(event, NS_DISPATCH_SYNC);
|
||||
}
|
||||
}
|
||||
|
||||
return event->Run();
|
||||
}
|
||||
|
||||
} // close namespace
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIEventTarget.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "m_cpp_utils.h"
|
||||
|
||||
@ -62,20 +61,7 @@ class TransportLayer : public sigslot::has_slots<> {
|
||||
|
||||
// Dispatch a call onto our thread (or run on the same thread if
|
||||
// thread is not set). This is always synchronous.
|
||||
nsresult RunOnThread(nsIRunnable *event) {
|
||||
if (target_) {
|
||||
nsIThread *thr;
|
||||
|
||||
DebugOnly<nsresult> rv = NS_GetCurrentThread(&thr);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
|
||||
if (target_ != thr) {
|
||||
return target_->Dispatch(event, NS_DISPATCH_SYNC);
|
||||
}
|
||||
}
|
||||
|
||||
return event->Run();
|
||||
}
|
||||
nsresult RunOnThread(nsIRunnable *event);
|
||||
|
||||
// Get the state
|
||||
State state() const { return state_; }
|
||||
|
@ -2,6 +2,7 @@
|
||||
* 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 "nsThreadUtils.h"
|
||||
#include "nsAndroidHistory.h"
|
||||
#include "AndroidBridge.h"
|
||||
#include "Link.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "IHistory.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsTPriorityQueue.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIRunnable.h"
|
||||
|
||||
#define NS_ANDROIDHISTORY_CID \
|
||||
{0xCCAA4880, 0x44DD, 0x40A7, {0xA1, 0x3F, 0x61, 0x56, 0xFC, 0x88, 0x2C, 0x0B}}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "nsIDNSService.h"
|
||||
#include "nsIThread.h"
|
||||
#include "nsSocketTransport2.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
using mozilla::AutoSafeJSContext;
|
||||
namespace mozilla {
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsSocketTransportService2.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "prnetdb.h"
|
||||
#include "Tickler.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#ifdef MOZ_USE_WIFI_TICKLER
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsIThread.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "prerr.h"
|
||||
#include "NetworkActivityMonitor.h"
|
||||
#include "mozilla/VisualEventTracer.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsISocketProviderService.h"
|
||||
#include "nsISocketProvider.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/PublicSSL.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::net;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "nsPISocketTransportService.h"
|
||||
#include "nsIThreadInternal.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsEventQueue.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "pldhash.h"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "nsSocketTransportService2.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "mozilla/net/ChannelEventQueue.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
@ -41,6 +42,21 @@ ChannelEventQueue::FlushQueue()
|
||||
mFlushing = false;
|
||||
}
|
||||
|
||||
void
|
||||
ChannelEventQueue::Resume()
|
||||
{
|
||||
// Resuming w/o suspend: error in debug mode, ignore in build
|
||||
MOZ_ASSERT(mSuspendCount > 0);
|
||||
if (mSuspendCount <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!--mSuspendCount) {
|
||||
nsRefPtr<nsRunnableMethod<ChannelEventQueue> > event =
|
||||
NS_NewRunnableMethod(this, &ChannelEventQueue::CompleteResume);
|
||||
NS_DispatchToCurrentThread(event);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <nsTArray.h>
|
||||
#include <nsAutoPtr.h>
|
||||
#include <nsThreadUtils.h>
|
||||
|
||||
class nsISupports;
|
||||
|
||||
@ -70,7 +69,7 @@ class ChannelEventQueue
|
||||
inline void Suspend();
|
||||
// Resume flushes the queue asynchronously, i.e. items in queue will be
|
||||
// dispatched in a new event on the current thread.
|
||||
inline void Resume();
|
||||
void Resume();
|
||||
|
||||
private:
|
||||
inline void MaybeFlushQueue();
|
||||
@ -140,22 +139,6 @@ ChannelEventQueue::CompleteResume()
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
ChannelEventQueue::Resume()
|
||||
{
|
||||
// Resuming w/o suspend: error in debug mode, ignore in build
|
||||
MOZ_ASSERT(mSuspendCount > 0);
|
||||
if (mSuspendCount <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!--mSuspendCount) {
|
||||
nsRefPtr<nsRunnableMethod<ChannelEventQueue> > event =
|
||||
NS_NewRunnableMethod(this, &ChannelEventQueue::CompleteResume);
|
||||
NS_DispatchToCurrentThread(event);
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
ChannelEventQueue::MaybeFlushQueue()
|
||||
{
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include "nsHttpTransaction.h"
|
||||
#include "nsInputStreamPump.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#include "nsIHttpEventSink.h"
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsIURL.h"
|
||||
#include "nsParserCIID.h"
|
||||
#include "nsITokenizer.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIContentSink.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsIChannel.h"
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "nscore.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIRunnable.h"
|
||||
|
||||
#include "SQLiteMutex.h"
|
||||
#include "mozIStoragePendingStatement.h"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "nsCategoryCache.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsToolkitCompsCID.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsURIHashKey.h"
|
||||
#include "nsTHashtable.h"
|
||||
|
||||
|
@ -13,9 +13,6 @@
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "AndroidJavaWrappers.h"
|
||||
|
||||
@ -38,6 +35,7 @@
|
||||
|
||||
class nsWindow;
|
||||
class nsIDOMMozSmsMessage;
|
||||
class nsIObserver;
|
||||
|
||||
/* See the comment in AndroidBridge about this function before using it */
|
||||
extern "C" JNIEnv * GetJNIForThread();
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsIJumpListItem.h"
|
||||
#include "JumpListItem.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "imgIEncoder.h"
|
||||
#include "nsIThread.h"
|
||||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
#include <textstor.h>
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsRegion.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsICryptoHash.h"
|
||||
#ifdef MOZ_PLACES
|
||||
#include "nsIFaviconService.h"
|
||||
@ -30,6 +30,7 @@ class nsWindow;
|
||||
class nsWindowBase;
|
||||
struct KeyPair;
|
||||
struct nsIntRect;
|
||||
class nsIThread;
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* gWin32SoundLog = nullptr;
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include "nsISound.h"
|
||||
#include "nsIStreamLoader.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsIThread;
|
||||
|
||||
class nsSound : public nsISound,
|
||||
public nsIStreamLoaderObserver
|
||||
|
Loading…
Reference in New Issue
Block a user