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-24 10:41:25 +00:00
Родитель f1492ecbfe
Коммит aade476c1e
32 изменённых файлов: 60 добавлений и 21 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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"

Просмотреть файл

@ -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)

Просмотреть файл

@ -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 {

Просмотреть файл

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

Просмотреть файл

@ -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;

Просмотреть файл

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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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"

Просмотреть файл

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

Просмотреть файл

@ -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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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"

Просмотреть файл

@ -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;

Просмотреть файл

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

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -17,6 +17,7 @@
#include "nsIStreamListener.h"
#include "nsILoadGroup.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsStreamUtils.h"
#include <algorithm>
@ -86,7 +87,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 +104,7 @@ nsresult nsInputStreamPump::EnsureWaiting() {
nsCOMPtr<nsIEventTarget> mainThread =
mLabeledMainThreadTarget
? mLabeledMainThreadTarget
: do_AddRef(GetMainThreadSerialEventTarget());
: do_AddRef(mozilla::GetMainThreadSerialEventTarget());
if (mTargetThread != mainThread) {
mTargetThread = mainThread;
}
@ -651,8 +653,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;
}

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 */ \

Просмотреть файл

@ -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)

Просмотреть файл

@ -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,

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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

Просмотреть файл

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

Просмотреть файл

@ -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)));
}
}

Просмотреть файл

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