Skip to content

Commit

Permalink
Bug 1274376 - more mozilla::net namespaces r=dragana
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 914d48f23a4a5db052a789b9e21c1ff922533d35
  • Loading branch information
mcmanus committed May 19, 2016
1 parent e013fac commit 2cd574f
Show file tree
Hide file tree
Showing 79 changed files with 516 additions and 240 deletions.
2 changes: 1 addition & 1 deletion chrome/nsChromeProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ nsChromeProtocolHandler::NewURI(const nsACString &aSpec,
// Chrome: URLs (currently) have no additional structure beyond that provided
// by standard URLs, so there is no "outer" given to CreateInstance

RefPtr<nsStandardURL> surl = new nsStandardURL();
RefPtr<mozilla::net::nsStandardURL> surl = new mozilla::net::nsStandardURL();

nsresult rv = surl->Init(nsIStandardURL::URLTYPE_STANDARD, -1, aSpec,
aCharset, aBaseURI);
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsHostObjectProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

using mozilla::dom::BlobImpl;
using mozilla::ErrorResult;
using mozilla::LoadInfo;
using mozilla::net::LoadInfo;

// -----------------------------------------------------------------------
// Hash table
Expand Down Expand Up @@ -720,7 +720,7 @@ nsFontTableProtocolHandler::NewURI(const nsACString& aSpec,
// fonttable: scheme.
// If aSpec is a relative URI -other- than a bare #ref,
// this will leave uri empty, and we'll return a failure code below.
uri = new nsSimpleURI();
uri = new mozilla::net::nsSimpleURI();
uri->SetSpec(aSpec);
}

Expand Down
22 changes: 11 additions & 11 deletions dom/base/nsHostObjectURI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ static NS_DEFINE_CID(kHOSTOBJECTURICID, NS_HOSTOBJECTURI_CID);
static NS_DEFINE_CID(kThisSimpleURIImplementationCID,
NS_THIS_SIMPLEURI_IMPLEMENTATION_CID);

NS_IMPL_ADDREF_INHERITED(nsHostObjectURI, nsSimpleURI)
NS_IMPL_RELEASE_INHERITED(nsHostObjectURI, nsSimpleURI)
NS_IMPL_ADDREF_INHERITED(nsHostObjectURI, mozilla::net::nsSimpleURI)
NS_IMPL_RELEASE_INHERITED(nsHostObjectURI, mozilla::net::nsSimpleURI)

NS_INTERFACE_MAP_BEGIN(nsHostObjectURI)
NS_INTERFACE_MAP_ENTRY(nsIURIWithPrincipal)
Expand All @@ -33,7 +33,7 @@ NS_INTERFACE_MAP_BEGIN(nsHostObjectURI)
return NS_NOINTERFACE;
}
else
NS_INTERFACE_MAP_END_INHERITING(nsSimpleURI)
NS_INTERFACE_MAP_END_INHERITING(mozilla::net::nsSimpleURI)

// nsIURIWithPrincipal methods:

Expand Down Expand Up @@ -63,7 +63,7 @@ nsHostObjectURI::GetPrincipalUri(nsIURI** aUri)
NS_IMETHODIMP
nsHostObjectURI::Read(nsIObjectInputStream* aStream)
{
nsresult rv = nsSimpleURI::Read(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Read(aStream);
NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<nsISupports> supports;
Expand All @@ -77,7 +77,7 @@ nsHostObjectURI::Read(nsIObjectInputStream* aStream)
NS_IMETHODIMP
nsHostObjectURI::Write(nsIObjectOutputStream* aStream)
{
nsresult rv = nsSimpleURI::Write(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Write(aStream);
NS_ENSURE_SUCCESS(rv, rv);

return NS_WriteOptionalCompoundObject(aStream, mPrincipal,
Expand All @@ -94,7 +94,7 @@ nsHostObjectURI::Serialize(mozilla::ipc::URIParams& aParams)
HostObjectURIParams hostParams;
URIParams simpleParams;

nsSimpleURI::Serialize(simpleParams);
mozilla::net::nsSimpleURI::Serialize(simpleParams);
hostParams.simpleParams() = simpleParams;

if (mPrincipal) {
Expand Down Expand Up @@ -124,7 +124,7 @@ nsHostObjectURI::Deserialize(const mozilla::ipc::URIParams& aParams)

const HostObjectURIParams& hostParams = aParams.get_HostObjectURIParams();

if (!nsSimpleURI::Deserialize(hostParams.simpleParams())) {
if (!mozilla::net::nsSimpleURI::Deserialize(hostParams.simpleParams())) {
return false;
}
if (hostParams.principal().type() == OptionalPrincipalInfo::Tvoid_t) {
Expand All @@ -146,12 +146,12 @@ nsHostObjectURI::SetScheme(const nsACString& aScheme)

// nsIURI methods:
nsresult
nsHostObjectURI::CloneInternal(nsSimpleURI::RefHandlingEnum aRefHandlingMode,
nsHostObjectURI::CloneInternal(mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
nsIURI** aClone)
{
nsCOMPtr<nsIURI> simpleClone;
nsresult rv =
nsSimpleURI::CloneInternal(aRefHandlingMode, getter_AddRefs(simpleClone));
mozilla::net::nsSimpleURI::CloneInternal(aRefHandlingMode, getter_AddRefs(simpleClone));
NS_ENSURE_SUCCESS(rv, rv);

#ifdef DEBUG
Expand All @@ -170,7 +170,7 @@ nsHostObjectURI::CloneInternal(nsSimpleURI::RefHandlingEnum aRefHandlingMode,

/* virtual */ nsresult
nsHostObjectURI::EqualsInternal(nsIURI* aOther,
nsSimpleURI::RefHandlingEnum aRefHandlingMode,
mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
bool* aResult)
{
if (!aOther) {
Expand All @@ -186,7 +186,7 @@ nsHostObjectURI::EqualsInternal(nsIURI* aOther,
}

// Compare the member data that our base class knows about.
if (!nsSimpleURI::EqualsInternal(otherUri, aRefHandlingMode)) {
if (!mozilla::net::nsSimpleURI::EqualsInternal(otherUri, aRefHandlingMode)) {
*aResult = false;
return NS_OK;
}
Expand Down
8 changes: 4 additions & 4 deletions dom/base/nsHostObjectURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
* MediaStreams, with scheme "mediastream", and MediaSources, with scheme
* "mediasource".
*/
class nsHostObjectURI : public nsSimpleURI,
class nsHostObjectURI : public mozilla::net::nsSimpleURI,
public nsIURIWithPrincipal
{
public:
explicit nsHostObjectURI(nsIPrincipal* aPrincipal) :
nsSimpleURI(), mPrincipal(aPrincipal)
mozilla::net::nsSimpleURI(), mPrincipal(aPrincipal)
{}

// For use only from deserialization
nsHostObjectURI() : nsSimpleURI() {}
nsHostObjectURI() : mozilla::net::nsSimpleURI() {}

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIURIWITHPRINCIPAL
Expand All @@ -48,7 +48,7 @@ class nsHostObjectURI : public nsSimpleURI,
bool* aResult) override;

// Override StartClone to hand back a nsHostObjectURI
virtual nsSimpleURI* StartClone(RefHandlingEnum /* unused */) override
virtual mozilla::net::nsSimpleURI* StartClone(RefHandlingEnum /* unused */) override
{ return new nsHostObjectURI(); }

nsCOMPtr<nsIPrincipal> mPrincipal;
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsObjectLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ static const char *kPrefBlockURIs = "browser.safebrowsing.blockedURIs.enabled";

using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::net;

static LogModule*
GetObjectLog()
Expand Down
22 changes: 11 additions & 11 deletions dom/jsurl/nsJSProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,8 @@ static NS_DEFINE_CID(kThisSimpleURIImplementationCID,
NS_THIS_SIMPLEURI_IMPLEMENTATION_CID);


NS_IMPL_ADDREF_INHERITED(nsJSURI, nsSimpleURI)
NS_IMPL_RELEASE_INHERITED(nsJSURI, nsSimpleURI)
NS_IMPL_ADDREF_INHERITED(nsJSURI, mozilla::net::nsSimpleURI)
NS_IMPL_RELEASE_INHERITED(nsJSURI, mozilla::net::nsSimpleURI)

NS_INTERFACE_MAP_BEGIN(nsJSURI)
if (aIID.Equals(kJSURICID))
Expand All @@ -1279,14 +1279,14 @@ NS_INTERFACE_MAP_BEGIN(nsJSURI)
return NS_NOINTERFACE;
}
else
NS_INTERFACE_MAP_END_INHERITING(nsSimpleURI)
NS_INTERFACE_MAP_END_INHERITING(mozilla::net::nsSimpleURI)

// nsISerializable methods:

NS_IMETHODIMP
nsJSURI::Read(nsIObjectInputStream* aStream)
{
nsresult rv = nsSimpleURI::Read(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Read(aStream);
if (NS_FAILED(rv)) return rv;

bool haveBase;
Expand All @@ -1306,7 +1306,7 @@ nsJSURI::Read(nsIObjectInputStream* aStream)
NS_IMETHODIMP
nsJSURI::Write(nsIObjectOutputStream* aStream)
{
nsresult rv = nsSimpleURI::Write(aStream);
nsresult rv = mozilla::net::nsSimpleURI::Write(aStream);
if (NS_FAILED(rv)) return rv;

rv = aStream->WriteBoolean(mBaseURI != nullptr);
Expand All @@ -1329,7 +1329,7 @@ nsJSURI::Serialize(mozilla::ipc::URIParams& aParams)
JSURIParams jsParams;
URIParams simpleParams;

nsSimpleURI::Serialize(simpleParams);
mozilla::net::nsSimpleURI::Serialize(simpleParams);

jsParams.simpleParams() = simpleParams;
if (mBaseURI) {
Expand All @@ -1352,7 +1352,7 @@ nsJSURI::Deserialize(const mozilla::ipc::URIParams& aParams)
}

const JSURIParams& jsParams = aParams.get_JSURIParams();
nsSimpleURI::Deserialize(jsParams.simpleParams());
mozilla::net::nsSimpleURI::Deserialize(jsParams.simpleParams());

if (jsParams.baseURI().type() != OptionalURIParams::Tvoid_t) {
mBaseURI = DeserializeURI(jsParams.baseURI().get_URIParams());
Expand All @@ -1363,8 +1363,8 @@ nsJSURI::Deserialize(const mozilla::ipc::URIParams& aParams)
}

// nsSimpleURI methods:
/* virtual */ nsSimpleURI*
nsJSURI::StartClone(nsSimpleURI::RefHandlingEnum /* ignored */)
/* virtual */ mozilla::net::nsSimpleURI*
nsJSURI::StartClone(mozilla::net::nsSimpleURI::RefHandlingEnum /* ignored */)
{
nsCOMPtr<nsIURI> baseClone;
if (mBaseURI) {
Expand All @@ -1380,7 +1380,7 @@ nsJSURI::StartClone(nsSimpleURI::RefHandlingEnum /* ignored */)

/* virtual */ nsresult
nsJSURI::EqualsInternal(nsIURI* aOther,
nsSimpleURI::RefHandlingEnum aRefHandlingMode,
mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
bool* aResult)
{
NS_ENSURE_ARG_POINTER(aOther);
Expand All @@ -1395,7 +1395,7 @@ nsJSURI::EqualsInternal(nsIURI* aOther,
}

// Compare the member data that our base class knows about.
if (!nsSimpleURI::EqualsInternal(otherJSURI, aRefHandlingMode)) {
if (!mozilla::net::nsSimpleURI::EqualsInternal(otherJSURI, aRefHandlingMode)) {
*aResult = false;
return NS_OK;
}
Expand Down
8 changes: 4 additions & 4 deletions dom/jsurl/nsJSProtocolHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class nsJSProtocolHandler : public nsIProtocolHandler
};


class nsJSURI : public nsSimpleURI
class nsJSURI : public mozilla::net::nsSimpleURI
{
public:
using nsSimpleURI::Read;
using nsSimpleURI::Write;
using mozilla::net::nsSimpleURI::Read;
using mozilla::net::nsSimpleURI::Write;

nsJSURI() {}

Expand All @@ -79,7 +79,7 @@ class nsJSURI : public nsSimpleURI
NS_DECL_ISUPPORTS_INHERITED

// nsIURI overrides
virtual nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode) override;
virtual mozilla::net::nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode) override;

// nsISerializable overrides
NS_IMETHOD Read(nsIObjectInputStream* aStream) override;
Expand Down
17 changes: 10 additions & 7 deletions dom/network/TCPSocketParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
#include "nsIScriptSecurityManager.h"
#include "nsNetUtil.h"

//
// set NSPR_LOG_MODULES=TCPSocket:5
//
extern mozilla::LazyLogModule gTCPSocketLog;
#define TCPSOCKET_LOG(args) MOZ_LOG(gTCPSocketLog, mozilla::LogLevel::Debug, args)
#define TCPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gTCPSocketLog, mozilla::LogLevel::Debug)

namespace IPC {

//Defined in TCPSocketChild.cpp
Expand All @@ -39,6 +32,16 @@ DeserializeArrayBuffer(JSContext* aCx,
} // namespace IPC

namespace mozilla {

namespace net {
//
// set NSPR_LOG_MODULES=TCPSocket:5
//
extern LazyLogModule gTCPSocketLog;
#define TCPSOCKET_LOG(args) MOZ_LOG(gTCPSocketLog, LogLevel::Debug, args)
#define TCPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gTCPSocketLog, LogLevel::Debug)
} // namespace net

namespace dom {

static void
Expand Down
9 changes: 6 additions & 3 deletions dom/network/UDPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ struct JSContext;
//
// set NSPR_LOG_MODULES=UDPSocket:5
//
extern mozilla::LazyLogModule gUDPSocketLog;
#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args)
#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug)

namespace mozilla {
namespace net {
extern LazyLogModule gUDPSocketLog;
#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, LogLevel::Debug, args)
#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, LogLevel::Debug)
} // namespace net

namespace dom {

struct UDPOptions;
Expand Down
7 changes: 0 additions & 7 deletions dom/network/UDPSocketChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@

using mozilla::net::gNeckoChild;

//
// set NSPR_LOG_MODULES=UDPSocket:5
//
extern mozilla::LazyLogModule gUDPSocketLog;
#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args)
#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug)

namespace mozilla {
namespace dom {

Expand Down
7 changes: 0 additions & 7 deletions dom/network/UDPSocketParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
#include "mozilla/ipc/PBackgroundParent.h"
#include "mtransport/runnable_utils.h"

//
// set NSPR_LOG_MODULES=UDPSocket:5
//
extern mozilla::LazyLogModule gUDPSocketLog;
#define UDPSOCKET_LOG(args) MOZ_LOG(gUDPSocketLog, mozilla::LogLevel::Debug, args)
#define UDPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gUDPSocketLog, mozilla::LogLevel::Debug)

namespace mozilla {
namespace dom {

Expand Down
2 changes: 1 addition & 1 deletion dom/security/nsCSPService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
uint32_t flags,
nsIAsyncVerifyRedirectCallback *callback)
{
nsAsyncRedirectAutoCallback autoCallback(callback);
net::nsAsyncRedirectAutoCallback autoCallback(callback);

nsCOMPtr<nsIURI> newUri;
nsresult rv = newChannel->GetURI(getter_AddRefs(newUri));
Expand Down
2 changes: 1 addition & 1 deletion dom/xslt/base/txURIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "nsIPrincipal.h"
#include "mozilla/LoadInfo.h"

using mozilla::LoadInfo;
using mozilla::net::LoadInfo;

/**
* URIUtils
Expand Down
2 changes: 2 additions & 0 deletions netwerk/base/LoadInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using namespace mozilla::dom;

namespace mozilla {
namespace net {

static void
InheritOriginAttributes(nsIPrincipal* aLoadingPrincipal, NeckoOriginAttributes& aAttrs)
Expand Down Expand Up @@ -725,4 +726,5 @@ LoadInfo::MaybeIncreaseTainting(uint32_t aTainting)
return NS_OK;
}

} // namespace net
} // namespace mozilla
3 changes: 3 additions & 0 deletions netwerk/base/LoadInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ LoadInfoArgsToLoadInfo(const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
nsILoadInfo** outLoadInfo);
} // namespace ipc

namespace net {

/**
* Class that provides an nsILoadInfo implementation.
*
Expand Down Expand Up @@ -135,6 +137,7 @@ class MOZ_EXPORT LoadInfo final : public nsILoadInfo
bool mIsPreflight;
};

} // namespace net
} // namespace mozilla

#endif // mozilla_LoadInfo_h
Expand Down
Loading

0 comments on commit 2cd574f

Please sign in to comment.