mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1251493 - Remove remaining references to MOZILLA_XPCOMRT_API from netwerk. r=mcmanus
This commit is contained in:
parent
957caebc8c
commit
217f7e1cbf
@ -4,12 +4,10 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsSocketTransportService2.h"
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
#include "nsSocketTransport2.h"
|
||||
#include "NetworkActivityMonitor.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIOService.h"
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
#include "nsASocketHandler.h"
|
||||
#include "nsError.h"
|
||||
#include "prnetdb.h"
|
||||
@ -610,9 +608,7 @@ nsSocketTransportService::Shutdown()
|
||||
obsSvc->RemoveObserver(this, "last-pb-context-exited");
|
||||
}
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
mozilla::net::NetworkActivityMonitor::Shutdown();
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
mInitialized = false;
|
||||
mShuttingDown = false;
|
||||
@ -700,10 +696,6 @@ nsSocketTransportService::CreateRoutedTransport(const char **types,
|
||||
nsIProxyInfo *proxyInfo,
|
||||
nsISocketTransport **result)
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("nsSocketTransportService::CreateTransport not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||
NS_ENSURE_TRUE(port >= 0 && port <= 0xFFFF, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
@ -715,17 +707,12 @@ nsSocketTransportService::CreateRoutedTransport(const char **types,
|
||||
|
||||
trans.forget(result);
|
||||
return NS_OK;
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransportService::CreateUnixDomainTransport(nsIFile *aPath,
|
||||
nsISocketTransport **result)
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("nsSocketTransportService::CreateUnixDomainTransport not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsresult rv;
|
||||
|
||||
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||
@ -743,7 +730,6 @@ nsSocketTransportService::CreateUnixDomainTransport(nsIFile *aPath,
|
||||
|
||||
trans.forget(result);
|
||||
return NS_OK;
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -806,9 +792,7 @@ nsSocketTransportService::Run()
|
||||
|
||||
SOCKET_LOG(("STS thread init\n"));
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
psm::InitializeSSLServerCertVerificationThreads();
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
gSocketThread = PR_GetCurrentThread();
|
||||
|
||||
@ -971,9 +955,7 @@ nsSocketTransportService::Run()
|
||||
|
||||
gSocketThread = nullptr;
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
psm::StopSSLServerCertVerificationThreads();
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
SOCKET_LOG(("STS thread exit\n"));
|
||||
return NS_OK;
|
||||
@ -1069,15 +1051,11 @@ nsSocketTransportService::DoPollIteration(bool wait, TimeDuration *pollDuration)
|
||||
// Measures seconds spent while blocked on PR_Poll
|
||||
uint32_t pollInterval = 0;
|
||||
int32_t n = 0;
|
||||
*pollDuration = 0;
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
*pollDuration = 0;
|
||||
if (!gIOService->IsNetTearingDown()) {
|
||||
// Let's not do polling during shutdown.
|
||||
n = Poll(wait, &pollInterval, pollDuration);
|
||||
}
|
||||
#else
|
||||
n = Poll(wait, &pollInterval, pollDuration);
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
if (n < 0) {
|
||||
SOCKET_LOG((" PR_Poll error [%d] os error [%d]\n", PR_GetError(),
|
||||
@ -1166,12 +1144,8 @@ nsSocketTransportService::DoPollIteration(bool wait, TimeDuration *pollDuration)
|
||||
nsresult
|
||||
nsSocketTransportService::UpdatePrefs()
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("nsSocketTransportService::UpdatePrefs not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
mSendBufferSize = 0;
|
||||
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> tmpPrefService = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (tmpPrefService) {
|
||||
int32_t bufferSize;
|
||||
@ -1229,9 +1203,8 @@ nsSocketTransportService::UpdatePrefs()
|
||||
mMaxTimeForPrClosePref = PR_MillisecondsToInterval(maxTimeForPrClosePref);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
void
|
||||
@ -1276,7 +1249,6 @@ nsSocketTransportService::Observe(nsISupports *subject,
|
||||
const char *topic,
|
||||
const char16_t *data)
|
||||
{
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
if (!strcmp(topic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
|
||||
UpdatePrefs();
|
||||
return NS_OK;
|
||||
@ -1290,7 +1262,6 @@ nsSocketTransportService::Observe(nsISupports *subject,
|
||||
|
||||
return net::NetworkActivityMonitor::Init(blipInterval);
|
||||
}
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
if (!strcmp(topic, "last-pb-context-exited")) {
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
@ -1324,9 +1295,7 @@ nsSocketTransportService::ClosePrivateConnections()
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
mozilla::ClearPrivateSSLState();
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -55,10 +55,8 @@ InitGlobals()
|
||||
}
|
||||
|
||||
gInitialized = true;
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
Preferences::AddIntVarCache(&gMaxLength,
|
||||
"network.standard-url.max-length", 1048576);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -111,10 +109,6 @@ net_GetStdURLParser()
|
||||
nsresult
|
||||
net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result)
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("net_GetURLSpecFromDir not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsAutoCString escPath;
|
||||
nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath);
|
||||
if (NS_FAILED(rv))
|
||||
@ -123,19 +117,14 @@ net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result)
|
||||
if (escPath.Last() != '/') {
|
||||
escPath += '/';
|
||||
}
|
||||
|
||||
|
||||
result = escPath;
|
||||
return NS_OK;
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
nsresult
|
||||
net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("net_GetURLSpecFromFile not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsAutoCString escPath;
|
||||
nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath);
|
||||
if (NS_FAILED(rv))
|
||||
@ -152,10 +141,9 @@ net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result)
|
||||
if (NS_SUCCEEDED(rv) && dir)
|
||||
escPath += '/';
|
||||
}
|
||||
|
||||
|
||||
result = escPath;
|
||||
return NS_OK;
|
||||
#endif // defined(MOZILLA_XPCOMRT_API)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@ -468,7 +456,6 @@ net_ResolveRelativePath(const nsACString &relativePath,
|
||||
// scheme fu
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
static bool isAsciiAlpha(char c) {
|
||||
return nsCRT::IsAsciiAlpha(c);
|
||||
}
|
||||
@ -482,17 +469,12 @@ net_IsValidSchemeChar(const char aChar)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Extract URI-Scheme if possible */
|
||||
nsresult
|
||||
net_ExtractURLScheme(const nsACString &inURI,
|
||||
nsACString& scheme)
|
||||
{
|
||||
#if defined(MOZILLA_XPCOMRT_API)
|
||||
NS_WARNING("net_ExtractURLScheme not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
Tokenizer p(inURI, "\r\n\t");
|
||||
|
||||
while (p.CheckWhite() || p.CheckChar(' ')) {
|
||||
@ -516,7 +498,6 @@ net_ExtractURLScheme(const nsACString &inURI,
|
||||
p.Claim(scheme);
|
||||
scheme.StripChars("\r\n\t");
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
@ -542,7 +523,6 @@ net_IsValidScheme(const char *scheme, uint32_t schemeLen)
|
||||
bool
|
||||
net_IsAbsoluteURL(const nsACString& uri)
|
||||
{
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
Tokenizer p(uri, "\r\n\t");
|
||||
|
||||
while (p.CheckWhite() || p.CheckChar(' ')) {
|
||||
@ -571,7 +551,6 @@ net_IsAbsoluteURL(const nsACString& uri)
|
||||
// aSpec is really absolute. Ignore aBaseURI in this case
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/net/NeckoCommon.h"
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
#include "mozilla/net/ChildDNSService.h"
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
#include "mozilla/net/DNSListenerProxy.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
@ -504,11 +502,9 @@ static nsDNSService *gDNSService;
|
||||
nsIDNSService*
|
||||
nsDNSService::GetXPCOMSingleton()
|
||||
{
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
if (IsNeckoChild()) {
|
||||
return ChildDNSService::GetSingleton();
|
||||
}
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
return GetSingleton();
|
||||
}
|
||||
@ -642,9 +638,7 @@ nsDNSService::Init()
|
||||
mNotifyResolution = notifyResolution;
|
||||
}
|
||||
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
RegisterWeakMemoryReporter(this);
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -652,9 +646,7 @@ nsDNSService::Init()
|
||||
NS_IMETHODIMP
|
||||
nsDNSService::Shutdown()
|
||||
{
|
||||
#if !defined(MOZILLA_XPCOMRT_API)
|
||||
UnregisterWeakMemoryReporter(this);
|
||||
#endif // !defined(MOZILLA_XPCOMRT_API)
|
||||
|
||||
RefPtr<nsHostResolver> res;
|
||||
{
|
||||
|
@ -45,7 +45,6 @@ LOCAL_INCLUDES = [
|
||||
|
||||
DEFINES['IDNA2008'] = False
|
||||
DEFINES['MOZILLA_INTERNAL_API'] = True
|
||||
DEFINES['MOZILLA_XPCOMRT_API'] = True
|
||||
DEFINES['MOZILLA_EXTERNAL_LINKAGE'] = True
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
Loading…
Reference in New Issue
Block a user