Bug 1733356 - Fix non-unified build errors in netwerk/ r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D170852
This commit is contained in:
serge-sans-paille 2023-02-28 10:20:16 +00:00
parent 55bba8e918
commit 74f462c959
33 changed files with 61 additions and 24 deletions

View File

@ -6,6 +6,10 @@
#include "nsIClassInfoImpl.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsURLHelper.h"
#include "mozilla/ipc/URIParams.h"
namespace mozilla {
namespace net {

View File

@ -8,11 +8,13 @@
#define IOActivityMonitor_h___
#include "mozilla/dom/ChromeUtilsBinding.h"
#include "mozilla/Mutex.h"
#include "nsCOMPtr.h"
#include "nscore.h"
#include "nsClassHashtable.h"
#include "nsTHashMap.h"
#include "nsHashKeys.h"
#include "nsINamed.h"
#include "nsISupports.h"
#include "prinrval.h"
#include "prio.h"

View File

@ -7,14 +7,16 @@
#include "mozilla/net/SocketProcessParent.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "nsCOMPtr.h"
#include "nsIOService.h"
#include "nsICancelable.h"
#include "xpcpublic.h"
#include "nsSocketTransport2.h"
#include "nsIHttpChannelInternal.h"
#include "nsINetworkLinkService.h"
#include "mozilla/StaticPrefs_network.h"
static LazyLogModule gNCSLog("NetworkConnectivityService");
static mozilla::LazyLogModule gNCSLog("NetworkConnectivityService");
#undef LOG
#define LOG(args) MOZ_LOG(gNCSLog, mozilla::LogLevel::Debug, args)

View File

@ -6,10 +6,12 @@
#define NetworkConnectivityService_h_
#include "nsINetworkConnectivityService.h"
#include "nsCOMPtr.h"
#include "nsIObserver.h"
#include "nsIDNSListener.h"
#include "nsIStreamListener.h"
#include "mozilla/net/DNS.h"
#include "mozilla/Mutex.h"
namespace mozilla {
namespace net {

View File

@ -8,6 +8,8 @@
#define NetworkDataCountLayer_h__
#include "prerror.h"
#include "prio.h"
#include "ErrorList.h"
namespace mozilla {
namespace net {

View File

@ -9,6 +9,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Logging.h"
#include "mozilla/net/DNS.h"
#include "prerror.h"
#include "prio.h"
#include "private/pprio.h"

View File

@ -73,8 +73,6 @@ static const uint32_t ONE_WEEK = 7U * ONE_DAY;
static const uint32_t ONE_MONTH = 30U * ONE_DAY;
static const uint32_t ONE_YEAR = 365U * ONE_DAY;
static const uint32_t STARTUP_WINDOW = 5U * 60U; // 5min
// Version of metadata entries we expect
static const uint32_t METADATA_VERSION = 1;

View File

@ -14,7 +14,9 @@
*/
#include "prtypes.h"
#include "ErrorList.h"
#include "mozilla/LinkedList.h"
#include "nsISupportsImpl.h"
namespace mozilla {
namespace net {

View File

@ -8,6 +8,7 @@
#include "nsBaseChannel.h"
#include "nsIChannel.h"
#include "nsIChildChannel.h"
#include "nsICancelable.h"
#include "nsIInputStream.h"
#include "nsIRequest.h"
#include "nsISupportsImpl.h"

View File

@ -6,6 +6,7 @@
#ifndef mozilla_net_TLSServerSocket_h
#define mozilla_net_TLSServerSocket_h
#include "nsIInterfaceRequestor.h"
#include "nsITLSServerSocket.h"
#include "nsServerSocket.h"
#include "nsString.h"

View File

@ -11,6 +11,7 @@
#include "nsINamed.h"
#include "nsIThrottledInputChannel.h"
#include "nsITimer.h"
#include "nsTArray.h"
namespace mozilla {
namespace net {

View File

@ -334,5 +334,3 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
GeneratedFile(
"ascii_pac_utils.inc", script="makecppstring.py", inputs=["ascii_pac_utils.js"]
)
REQUIRES_UNIFIED_BUILD = True

View File

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsAsyncStreamCopier.h"
#include "nsComponentManagerUtils.h"
#include "nsIOService.h"
#include "nsIEventTarget.h"
#include "nsStreamUtils.h"

View File

@ -12,6 +12,7 @@
#include "nsUnknownDecoder.h"
#include "nsIScriptSecurityManager.h"
#include "nsMimeTypes.h"
#include "nsICancelable.h"
#include "nsIChannelEventSink.h"
#include "nsIStreamConverterService.h"
#include "nsChannelClassifier.h"

View File

@ -11,7 +11,6 @@
#include "mozilla/UniquePtr.h"
#include "mozilla/net/NeckoTargetHolder.h"
#include "mozilla/net/PrivateBrowsingChannel.h"
#include "nsCOMPtr.h"
#include "nsHashPropertyBag.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIChannel.h"
@ -28,6 +27,7 @@
#include "nsInputStreamPump.h"
#include "nsString.h"
#include "nsThreadUtils.h"
#include "nsCOMPtr.h"
class nsIInputStream;
class nsICancelable;

View File

@ -4,6 +4,7 @@
#include "nsDownloader.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsNetUtil.h"

View File

@ -28,6 +28,7 @@
#include "mozilla/ipc/RandomAccessStreamParams.h"
#include "mozilla/Unused.h"
#include "mozilla/FileUtils.h"
#include "mozilla/UniquePtr.h"
#include "nsNetCID.h"
#include "nsXULAppAPI.h"
@ -308,7 +309,7 @@ nsresult nsFileStreamBase::DoOpen() {
// Result doesn't need to be checked. If the file's parent path does not
// exist, make it. If it does exist, do nothing.
if (parent) {
Unused << parent->Create(nsIFile::DIRECTORY_TYPE, 0755);
mozilla::Unused << parent->Create(nsIFile::DIRECTORY_TYPE, 0755);
}
}
@ -481,7 +482,7 @@ nsFileInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) {
NS_IMETHODIMP
nsFileInputStream::ReadLine(nsACString& aLine, bool* aResult) {
if (!mLineBuffer) {
mLineBuffer = MakeUnique<nsLineBuffer<char>>();
mLineBuffer = mozilla::MakeUnique<nsLineBuffer<char>>();
}
return NS_ReadLine(this, mLineBuffer.get(), aLine, aResult);
}

View File

@ -29,6 +29,7 @@
#include <algorithm>
#include "nsIContentPolicy.h"
#include "nsContentUtils.h"
#include "mozilla/Logging.h"
#include "mozilla/UniquePtr.h"
// Default values used to initialize a nsIncrementalDownload object.
@ -43,6 +44,10 @@
using namespace mozilla;
using namespace mozilla::net;
static LazyLogModule gIDLog("IncrementalDownload");
#undef LOG
#define LOG(args) MOZ_LOG(gIDLog, mozilla::LogLevel::Debug, args)
//-----------------------------------------------------------------------------
static nsresult WriteToFile(nsIFile* lf, const char* data, uint32_t len,

View File

@ -17,11 +17,10 @@
#include "nsIStreamListener.h"
#include "nsILoadGroup.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsStreamUtils.h"
#include <algorithm>
static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID);
//
// MOZ_LOG=nsStreamPump:5
//
@ -86,7 +85,8 @@ nsresult nsInputStreamPump::PeekStream(PeekSegmentFun callback, void* closure) {
PeekData data(callback, closure);
return mAsyncStream->ReadSegments(
CallPeekFunc, &data, net::nsIOService::gDefaultSegmentSize, &dummy);
CallPeekFunc, &data, mozilla::net::nsIOService::gDefaultSegmentSize,
&dummy);
}
nsresult nsInputStreamPump::EnsureWaiting() {
@ -102,7 +102,7 @@ nsresult nsInputStreamPump::EnsureWaiting() {
nsCOMPtr<nsIEventTarget> mainThread =
mLabeledMainThreadTarget
? mLabeledMainThreadTarget
: do_AddRef(GetMainThreadSerialEventTarget());
: do_AddRef(mozilla::GetMainThreadSerialEventTarget());
if (mTargetThread != mainThread) {
mTargetThread = mainThread;
}
@ -651,8 +651,8 @@ uint32_t nsInputStreamPump::OnStateStop() {
// This method can be called on a different thread if nsInputStreamPump
// is used off the main-thread.
nsresult rv = mLabeledMainThreadTarget->Dispatch(
NewRunnableMethod("nsInputStreamPump::CallOnStateStop", this,
&nsInputStreamPump::CallOnStateStop));
mozilla::NewRunnableMethod("nsInputStreamPump::CallOnStateStop", this,
&nsInputStreamPump::CallOnStateStop));
NS_ENSURE_SUCCESS(rv, STATE_DEAD);
return STATE_DEAD;
}

View File

@ -25,6 +25,9 @@
#include "RequestContextService.h"
#include "mozilla/StoragePrincipalHelper.h"
#include "mozilla/Unused.h"
#include "mozilla/net/NeckoCommon.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/StaticPrefs_network.h"
namespace mozilla {
namespace net {

View File

@ -257,7 +257,7 @@ nsMIMEInputStream::AsyncWait(nsIInputStreamCallback* aCallback, uint32_t aFlags,
nsCOMPtr<nsIInputStreamCallback> callback = aCallback ? this : nullptr;
{
MutexAutoLock lock(mMutex);
mozilla::MutexAutoLock lock(mMutex);
if (NS_WARN_IF(mAsyncWaitCallback && aCallback &&
mAsyncWaitCallback != aCallback)) {
return NS_ERROR_FAILURE;
@ -277,7 +277,7 @@ nsMIMEInputStream::OnInputStreamReady(nsIAsyncInputStream* aStream) {
nsCOMPtr<nsIInputStreamCallback> callback;
{
MutexAutoLock lock(mMutex);
mozilla::MutexAutoLock lock(mMutex);
// We have been canceled in the meanwhile.
if (!mAsyncWaitCallback) {
@ -413,7 +413,7 @@ nsMIMEInputStream::AsyncLengthWait(nsIInputStreamLengthCallback* aCallback,
nsCOMPtr<nsIInputStreamLengthCallback> callback = aCallback ? this : nullptr;
{
MutexAutoLock lock(mMutex);
mozilla::MutexAutoLock lock(mMutex);
mAsyncInputStreamLengthCallback = aCallback;
}
@ -425,7 +425,7 @@ nsMIMEInputStream::OnInputStreamLengthReady(nsIAsyncInputStreamLength* aStream,
int64_t aLength) {
nsCOMPtr<nsIInputStreamLengthCallback> callback;
{
MutexAutoLock lock(mMutex);
mozilla::MutexAutoLock lock(mMutex);
// We have been canceled in the meanwhile.
if (!mAsyncInputStreamLengthCallback) {
return NS_OK;

View File

@ -11,6 +11,9 @@
#ifndef _nsMIMEInputStream_h_
#define _nsMIMEInputStream_h_
#include "ErrorList.h"
#include "nsID.h"
#define NS_MIMEINPUTSTREAM_CONTRACTID "@mozilla.org/network/mime-input-stream;1"
#define NS_MIMEINPUTSTREAM_CID \
{ /* 58a1c31c-1dd2-11b2-a3f6-d36949d48268 */ \

View File

@ -56,6 +56,7 @@ extern const char kProxyType_SOCKS[];
extern const char kProxyType_SOCKS4[];
extern const char kProxyType_SOCKS5[];
extern const char kProxyType_DIRECT[];
extern const char kProxyType_PROXY[];
#undef LOG
#define LOG(args) MOZ_LOG(gProxyLog, LogLevel::Debug, args)

View File

@ -23,6 +23,7 @@ extern const char kProxyType_SOCKS[];
extern const char kProxyType_SOCKS4[];
extern const char kProxyType_SOCKS5[];
extern const char kProxyType_DIRECT[];
extern const char kProxyType_PROXY[];
nsProxyInfo::nsProxyInfo(const nsACString& aType, const nsACString& aHost,
int32_t aPort, const nsACString& aUsername,

View File

@ -5,6 +5,8 @@
#ifndef nsRedirectHistoryEntry_h__
#define nsRedirectHistoryEntry_h__
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsIRedirectHistoryEntry.h"
class nsIURI;

View File

@ -8,6 +8,7 @@
#include "prio.h"
#include "nsASocketHandler.h"
#include "nsCOMPtr.h"
#include "nsIServerSocket.h"
#include "mozilla/Mutex.h"

View File

@ -7,6 +7,7 @@
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsIClassInfoImpl.h"
#include "nsSimpleNestedURI.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"

View File

@ -25,6 +25,7 @@
#include "nsIClassInfoImpl.h"
#include "nsIURIMutator.h"
#include "mozilla/net/MozURL.h"
#include "mozilla/StaticPrefs_network.h"
using namespace mozilla::ipc;

View File

@ -19,6 +19,7 @@
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tokenizer.h"
#include "nsASocketHandler.h"
#include "nsError.h"
#include "nsIFile.h"
@ -26,6 +27,7 @@
#include "nsIObserverService.h"
#include "nsIWidget.h"
#include "nsServiceManagerUtils.h"
#include "nsINetworkLinkService.h"
#include "nsSocketTransport2.h"
#include "nsThreadUtils.h"
#include "prerror.h"

View File

@ -16,6 +16,7 @@
#include "nsIIDNService.h"
#include "mozilla/Logging.h"
#include "nsIURLParser.h"
#include "nsPrintfCString.h"
#include "nsNetCID.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/ipc/URIUtils.h"
@ -35,7 +36,7 @@
//
// setenv MOZ_LOG nsStandardURL:5
//
static LazyLogModule gStandardURLLog("nsStandardURL");
static mozilla::LazyLogModule gStandardURLLog("nsStandardURL");
// The Chromium code defines its own LOG macro which we don't want
#undef LOG
@ -49,7 +50,6 @@ namespace mozilla {
namespace net {
static NS_DEFINE_CID(kThisImplCID, NS_THIS_STANDARDURL_IMPL_CID);
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
// This will always be initialized and destroyed on the main thread, but
// can be safely used on other threads.

View File

@ -4,6 +4,7 @@
#include "nsStreamListenerTee.h"
#include "nsProxyRelease.h"
#include "nsIRequest.h"
namespace mozilla {
namespace net {

View File

@ -58,8 +58,8 @@ class nsTransportStatusEvent : public Runnable {
~nsTransportStatusEvent() {
auto ReleaseTransport = [transport(std::move(mTransport))]() mutable {};
if (!OnSocketThread()) {
gSocketTransportService->Dispatch(NS_NewRunnableFunction(
if (!net::OnSocketThread()) {
net::gSocketTransportService->Dispatch(NS_NewRunnableFunction(
"nsHttpConnection::~nsHttpConnection", std::move(ReleaseTransport)));
}
}

View File

@ -49,5 +49,3 @@ if CONFIG["NECKO_WIFI_DBUS"]:
CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
FINAL_LIBRARY = "xul"
REQUIRES_UNIFIED_BUILD = True