Bug 1219910 - make gSocketThread a relaxed atomic variable; r=mcmanus

Many places that (re-)declared gSocketThread already included
nsSocketTransportService2.h; we can delete the declaration for those
places.  For all the other places, we need to include
nsSocketTransportService2.h.
This commit is contained in:
Nathan Froyd 2015-11-06 12:00:37 -05:00
parent ac15b0955e
commit 0d181baf2d
19 changed files with 11 additions and 63 deletions

View File

@ -19,8 +19,6 @@
#include <mmsystem.h>
#endif
extern PRThread *gSocketThread;
namespace mozilla {
namespace net {

View File

@ -20,8 +20,6 @@
#include "ScopedNSSTypes.h"
#include "ssl.h"
extern PRThread *gSocketThread;
namespace mozilla {
namespace net {

View File

@ -17,6 +17,7 @@
#include "nsIPrefBranch.h"
#include "nsServiceManagerUtils.h"
#include "nsIObserverService.h"
#include "mozilla/Atomics.h"
#include "mozilla/Services.h"
#include "mozilla/Likely.h"
#include "mozilla/PublicSSL.h"
@ -33,7 +34,7 @@ LazyLogModule gSocketTransportLog("nsSocketTransport");
LazyLogModule gUDPSocketLog("UDPSocket");
nsSocketTransportService *gSocketTransportService = nullptr;
PRThread *gSocketThread = nullptr;
Atomic<PRThread*, Relaxed> gSocketThread;
#define SEND_BUFFER_PREF "network.tcp.sendbuffer"
#define KEEPALIVE_ENABLED_PREF "network.tcp.keepalive.enabled"

View File

@ -262,6 +262,6 @@ private:
};
extern nsSocketTransportService *gSocketTransportService;
extern PRThread *gSocketThread;
extern mozilla::Atomic<PRThread*, mozilla::Relaxed> gSocketThread;
#endif // !nsSocketTransportService_h__

View File

@ -15,8 +15,7 @@
#include "nsIConsoleService.h"
#include "nsHttpRequestHead.h"
#include "nsServiceManagerUtils.h"
extern PRThread *gSocketThread;
#include "nsSocketTransportService2.h"
namespace mozilla {
namespace net {

View File

@ -18,8 +18,6 @@
#include "Http2HuffmanOutgoing.h"
#include "mozilla/StaticPtr.h"
extern PRThread *gSocketThread;
namespace mozilla {
namespace net {

View File

@ -35,11 +35,7 @@
#include "prnetdb.h"
#include "sslt.h"
#include "mozilla/Snprintf.h"
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
#include "nsSocketTransportService2.h"
namespace mozilla {
namespace net {

View File

@ -32,11 +32,6 @@
#include "nsStandardURL.h"
#include "prnetdb.h"
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {
namespace net {

View File

@ -26,14 +26,10 @@
#include "SpdySession31.h"
#include "SpdyStream31.h"
#include "SpdyZlibReporter.h"
#include "nsSocketTransportService2.h"
#include <algorithm>
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {
namespace net {

View File

@ -28,11 +28,6 @@
#include <algorithm>
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {
namespace net {

View File

@ -24,11 +24,6 @@
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {
namespace net {

View File

@ -33,11 +33,6 @@
#include "sslt.h"
#include "TunnelUtils.h"
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {
namespace net {

View File

@ -37,9 +37,6 @@
#include "mozilla/Telemetry.h"
// defined by the socket transport service while active
extern PRThread *gSocketThread;
namespace mozilla {
namespace net {

View File

@ -51,6 +51,7 @@
#include "nsHttpChannelAuthProvider.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "nsSocketTransportService2.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/ipc/URIUtils.h"
@ -73,11 +74,6 @@
#include "mozilla/net/HttpChannelChild.h"
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
#define UA_PREF_PREFIX "general.useragent."
#ifdef XP_WIN
#define UA_SPARE_PLATFORM

View File

@ -12,12 +12,11 @@
#include "nsISocketTransport.h"
#include "nsIPipe.h"
#include "nsCOMPtr.h"
#include "nsSocketTransportService2.h"
#include <algorithm>
#ifdef DEBUG
#include "prthread.h"
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
namespace mozilla {

View File

@ -44,13 +44,6 @@
//-----------------------------------------------------------------------------
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
#endif
//-----------------------------------------------------------------------------
static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID);
// Place a limit on how much non-compliant HTTP can be skipped while

View File

@ -55,6 +55,7 @@
#include "mozilla/StaticMutex.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "nsSocketTransportService2.h"
#include "plbase64.h"
#include "prmem.h"
@ -70,8 +71,6 @@
// dupe one constant we need from it
#define CLOSE_GOING_AWAY 1001
extern PRThread *gSocketThread;
using namespace mozilla;
using namespace mozilla::net;

View File

@ -12,8 +12,7 @@
#include "mozilla/StaticPtr.h"
#include "nsISupportsPrimitives.h"
#include "nsXULAppAPI.h"
extern PRThread *gSocketThread;
#include "nsSocketTransportService2.h"
namespace mozilla {
namespace net {

View File

@ -7,8 +7,7 @@
#include "WebSocketFrame.h"
#include "WebSocketChannel.h"
extern PRThread *gSocketThread;
#include "nsSocketTransportService2.h"
namespace mozilla {
namespace net {