Merge inbound to mozilla-central. a=merge

This commit is contained in:
Bogdan Tara 2019-02-19 19:34:25 +02:00
commit aedbe0b772
51 changed files with 90 additions and 637 deletions

View File

@ -119,6 +119,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -74,6 +74,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -66,6 +66,3 @@ FINAL_LIBRARY = 'xul'
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -82,6 +82,3 @@ LIBRARY_DEFINES['UNICODE'] = True
LIBRARY_DEFINES['_UNICODE'] = True
LIBRARY_DEFINES['MOZ_NO_MOZALLOC'] = True
DisableStlWrapping()
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -83,6 +83,3 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -22,6 +22,3 @@ LOCAL_INCLUDES += [
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -68,6 +68,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -33,6 +33,3 @@ if CONFIG['MOZ_LAUNCHER_PROCESS']:
DEFINES[var] = '"%s"' % CONFIG[var]
DisableStlWrapping()
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -32,6 +32,3 @@ if CONFIG['LLVM_SYMBOLIZER'] and CONFIG['WIN_DIA_SDK_BIN_DIR']:
FINAL_TARGET_FILES += [
'%%%s/msdia140.dll' % CONFIG['WIN_DIA_SDK_BIN_DIR']
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -89,7 +89,7 @@ class Timeout final : public LinkedListElement<RefPtr<Timeout>> {
// when sync loops trigger nested firing.
uint32_t mFiringId;
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
int64_t mFiringIndex;
#endif

View File

@ -454,7 +454,7 @@ TimeoutManager::TimeoutManager(nsGlobalWindowInner& aWindow,
mTimeouts(*this),
mTimeoutIdCounter(1),
mNextFiringId(InvalidFiringId + 1),
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
mFiringIndex(0),
mLastFiringIndex(-1),
#endif
@ -563,7 +563,7 @@ nsresult TimeoutManager::SetTimeout(nsITimeoutHandler* aHandler,
}
RefPtr<Timeout> timeout = new Timeout();
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
timeout->mFiringIndex = -1;
#endif
timeout->mWindow = &mWindow;
@ -899,7 +899,7 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
// ("Wait until any invocations of this algorithm that had the same
// method context, that started before this one, and whose timeout is
// equal to or less than this one's, have completed.").
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
if (timeout->mFiringIndex == -1) {
timeout->mFiringIndex = mFiringIndex++;
}
@ -939,8 +939,8 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
continue;
}
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
MOZ_DIAGNOSTIC_ASSERT(timeout->mFiringIndex > mLastFiringIndex);
#ifdef DEBUG
MOZ_ASSERT(timeout->mFiringIndex > mLastFiringIndex);
mLastFiringIndex = timeout->mFiringIndex;
#endif
// This timeout is good to run
@ -1068,7 +1068,7 @@ bool TimeoutManager::RescheduleTimeout(Timeout* aTimeout,
TimeStamp firingTime = aLastCallbackTime + nextInterval;
TimeDuration delay = firingTime - aCurrentNow;
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
aTimeout->mFiringIndex = -1;
#endif
// And make sure delay is nonnegative; that might happen if the timer

View File

@ -203,7 +203,7 @@ class TimeoutManager final {
Timeouts mTimeouts;
uint32_t mTimeoutIdCounter;
uint32_t mNextFiringId;
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
#ifdef DEBUG
int64_t mFiringIndex;
int64_t mLastFiringIndex;
#endif

View File

@ -51,7 +51,3 @@ MOCHITEST_MANIFESTS += [
]
MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
if (not CONFIG['HAVE_64BIT_BUILD'] and
CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -114,7 +114,3 @@ XPIDL_SOURCES += [
]
XPIDL_MODULE = 'dom_indexeddb'
if (not CONFIG['HAVE_64BIT_BUILD'] and
CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -30,6 +30,3 @@ NoVisibilityFlags()
# Don't use STL wrappers; this isn't Gecko code
DisableStlWrapping()
NO_PGO = True
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -149,6 +149,3 @@ LOCAL_INCLUDES += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -25,7 +25,3 @@ RCINCLUDE = 'HangUIDlg.rc'
OS_LIBS += [
'comctl32',
]
if (not CONFIG['HAVE_64BIT_BUILD'] and CONFIG['ENABLE_CLANG_PLUGIN']
and CONFIG['CC_TYPE'] == 'clang-cl'):
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -155,6 +155,3 @@ if CONFIG['CC_TYPE'] == 'clang-cl':
# 'type cast': conversion from 'unsigned int' to 'HIMC' of greater size
CXXFLAGS += ['-wd4312']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -68,6 +68,3 @@ else:
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -55,6 +55,3 @@ LOCAL_INCLUDES += [
if CONFIG['ENABLE_TESTS']:
DEFINES['DOM_STORAGE_TESTS'] = True
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -84,6 +84,3 @@ CFLAGS += CONFIG['TK_CFLAGS']
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -101,6 +101,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -73,6 +73,3 @@ elif CONFIG['CC_TYPE'] == 'clang-cl':
CFLAGS += [
'-FI', 'stdio.h', # for sprintf() prototype
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -61,6 +61,3 @@ SOURCES += [
]
FINAL_LIBRARY = 'xul'
if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -319,7 +319,7 @@ CaptureInputPin::Receive(IN IMediaSample* pIMediaSample) {
reinterpret_cast<CaptureSinkFilter*>(mFilter)->LockReceive();
hr = BaseInputPin::Receive(pIMediaSample);
if (SUCCEEDED(hr)) {
if (hr == S_OK) {
const int32_t length = pIMediaSample->GetActualDataLength();
unsigned char* pBuffer = NULL;

View File

@ -21,6 +21,3 @@ if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CC_TYPE'] in ('gcc', 'clang'):
LDFLAGS += [
'-municode',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -217,7 +217,6 @@ UNIFIED_SOURCES += [
'nsProxyInfo.cpp',
'nsRedirectHistoryEntry.cpp',
'nsRequestObserverProxy.cpp',
'nsSecCheckWrapChannel.cpp',
'nsSerializationHelper.cpp',
'nsServerSocket.cpp',
'nsSimpleNestedURI.cpp',
@ -301,6 +300,3 @@ LOCAL_INCLUDES += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -23,7 +23,6 @@
#include "nsNetUtil.h"
#include "nsNetCID.h"
#include "nsCRT.h"
#include "nsSecCheckWrapChannel.h"
#include "nsSimpleNestedURI.h"
#include "nsTArray.h"
#include "nsIConsoleService.h"
@ -935,39 +934,10 @@ nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
if (pph) {
rv = pph->NewProxiedChannel2(aURI, nullptr, aProxyFlags, aProxyURI,
aLoadInfo, getter_AddRefs(channel));
// if calling NewProxiedChannel2() fails we try to fall back to
// creating a new proxied channel by calling NewProxiedChannel().
if (NS_FAILED(rv)) {
rv = pph->NewProxiedChannel(aURI, nullptr, aProxyFlags, aProxyURI,
getter_AddRefs(channel));
NS_ENSURE_SUCCESS(rv, rv);
// The protocol handler does not implement NewProxiedChannel2, so
// maybe we need to wrap the channel (see comment in MaybeWrap
// function).
channel = nsSecCheckWrapChannel::MaybeWrap(channel, aLoadInfo);
}
} else {
rv = handler->NewChannel2(aURI, aLoadInfo, getter_AddRefs(channel));
// if an implementation of NewChannel2() is missing we try to fall back to
// creating a new channel by calling NewChannel().
if (rv == NS_ERROR_NOT_IMPLEMENTED ||
rv == NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED) {
LOG(("NewChannel2 not implemented rv=%" PRIx32
". Falling back to NewChannel\n",
static_cast<uint32_t>(rv)));
rv = handler->NewChannel(aURI, getter_AddRefs(channel));
if (NS_FAILED(rv)) {
return rv;
}
// The protocol handler does not implement NewChannel2, so
// maybe we need to wrap the channel (see comment in MaybeWrap
// function).
channel = nsSecCheckWrapChannel::MaybeWrap(channel, aLoadInfo);
} else if (NS_FAILED(rv)) {
return rv;
}
}
NS_ENSURE_SUCCESS(rv, rv);
// Make sure that all the individual protocolhandlers attach a loadInfo.
if (aLoadInfo) {

View File

@ -1,178 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsContentSecurityManager.h"
#include "nsSecCheckWrapChannel.h"
#include "nsIForcePendingChannel.h"
#include "nsIStreamListener.h"
#include "mozilla/Logging.h"
#include "nsCOMPtr.h"
namespace mozilla {
namespace net {
static LazyLogModule gChannelWrapperLog("ChannelWrapper");
#define CHANNELWRAPPERLOG(args) \
MOZ_LOG(gChannelWrapperLog, LogLevel::Debug, args)
NS_IMPL_ADDREF(nsSecCheckWrapChannelBase)
NS_IMPL_RELEASE(nsSecCheckWrapChannelBase)
NS_INTERFACE_MAP_BEGIN(nsSecCheckWrapChannelBase)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIHttpChannel, mHttpChannel)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIHttpChannelInternal,
mHttpChannelInternal)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIHttpChannel)
NS_INTERFACE_MAP_ENTRY(nsIRequest)
NS_INTERFACE_MAP_ENTRY(nsIChannel)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIUploadChannel, mUploadChannel)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIUploadChannel2, mUploadChannel2)
NS_INTERFACE_MAP_ENTRY(nsISecCheckWrapChannel)
NS_INTERFACE_MAP_END
//---------------------------------------------------------
// nsSecCheckWrapChannelBase implementation
//---------------------------------------------------------
nsSecCheckWrapChannelBase::nsSecCheckWrapChannelBase(nsIChannel *aChannel)
: mChannel(aChannel),
mHttpChannel(do_QueryInterface(aChannel)),
mHttpChannelInternal(do_QueryInterface(aChannel)),
mRequest(aChannel),
mUploadChannel(do_QueryInterface(aChannel)),
mUploadChannel2(do_QueryInterface(aChannel)) {
MOZ_ASSERT(mChannel, "can not create a channel wrapper without a channel");
}
//---------------------------------------------------------
// nsISecCheckWrapChannel implementation
//---------------------------------------------------------
NS_IMETHODIMP
nsSecCheckWrapChannelBase::GetInnerChannel(nsIChannel **aInnerChannel) {
NS_IF_ADDREF(*aInnerChannel = mChannel);
return NS_OK;
}
//---------------------------------------------------------
// nsSecCheckWrapChannel implementation
//---------------------------------------------------------
nsSecCheckWrapChannel::nsSecCheckWrapChannel(nsIChannel *aChannel,
nsILoadInfo *aLoadInfo)
: nsSecCheckWrapChannelBase(aChannel), mLoadInfo(aLoadInfo) {
{
nsCOMPtr<nsIURI> uri;
mChannel->GetURI(getter_AddRefs(uri));
CHANNELWRAPPERLOG(("nsSecCheckWrapChannel::nsSecCheckWrapChannel [%p] (%s)",
this, uri ? uri->GetSpecOrDefault().get() : ""));
}
}
// static
already_AddRefed<nsIChannel> nsSecCheckWrapChannel::MaybeWrap(
nsIChannel *aChannel, nsILoadInfo *aLoadInfo) {
// Maybe a custom protocol handler actually returns a gecko
// http/ftpChannel - To check this we will check whether the channel
// implements a gecko non-scriptable interface e.g. nsIForcePendingChannel.
nsCOMPtr<nsIForcePendingChannel> isGeckoChannel = do_QueryInterface(aChannel);
nsCOMPtr<nsIChannel> channel;
if (isGeckoChannel) {
// If it is a gecko channel (ftp or http) we do not need to wrap it.
channel = aChannel;
channel->SetLoadInfo(aLoadInfo);
} else {
channel = new nsSecCheckWrapChannel(aChannel, aLoadInfo);
}
return channel.forget();
}
//---------------------------------------------------------
// SecWrapChannelStreamListener helper
//---------------------------------------------------------
class SecWrapChannelStreamListener final : public nsIStreamListener {
public:
SecWrapChannelStreamListener(nsIRequest *aRequest,
nsIStreamListener *aStreamListener)
: mRequest(aRequest), mListener(aStreamListener) {}
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIREQUESTOBSERVER
private:
~SecWrapChannelStreamListener() = default;
nsCOMPtr<nsIRequest> mRequest;
nsCOMPtr<nsIStreamListener> mListener;
};
NS_IMPL_ISUPPORTS(SecWrapChannelStreamListener, nsIStreamListener,
nsIRequestObserver)
NS_IMETHODIMP
SecWrapChannelStreamListener::OnStartRequest(nsIRequest *aRequest,
nsISupports *aContext) {
return mListener->OnStartRequest(mRequest, aContext);
}
NS_IMETHODIMP
SecWrapChannelStreamListener::OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aStatus) {
return mListener->OnStopRequest(mRequest, aContext, aStatus);
}
NS_IMETHODIMP
SecWrapChannelStreamListener::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInStream,
uint64_t aOffset,
uint32_t aCount) {
return mListener->OnDataAvailable(mRequest, aContext, aInStream, aOffset,
aCount);
}
//---------------------------------------------------------
// nsIChannel implementation
//---------------------------------------------------------
NS_IMETHODIMP
nsSecCheckWrapChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {
CHANNELWRAPPERLOG(("nsSecCheckWrapChannel::GetLoadInfo() [%p]", this));
NS_IF_ADDREF(*aLoadInfo = mLoadInfo);
return NS_OK;
}
NS_IMETHODIMP
nsSecCheckWrapChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
CHANNELWRAPPERLOG(("nsSecCheckWrapChannel::SetLoadInfo() [%p]", this));
mLoadInfo = aLoadInfo;
return NS_OK;
}
NS_IMETHODIMP
nsSecCheckWrapChannel::AsyncOpen(nsIStreamListener *aListener) {
nsCOMPtr<nsIStreamListener> secWrapChannelListener =
new SecWrapChannelStreamListener(this, aListener);
nsresult rv = nsContentSecurityManager::doContentSecurityCheck(
this, secWrapChannelListener);
NS_ENSURE_SUCCESS(rv, rv);
return AsyncOpen(secWrapChannelListener);
}
NS_IMETHODIMP
nsSecCheckWrapChannel::Open(nsIInputStream **aStream) {
nsCOMPtr<nsIStreamListener> listener;
nsresult rv =
nsContentSecurityManager::doContentSecurityCheck(this, listener);
NS_ENSURE_SUCCESS(rv, rv);
return Open(aStream);
}
} // namespace net
} // namespace mozilla

View File

@ -1,104 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsSecCheckWrapChannel_h__
#define nsSecCheckWrapChannel_h__
#include "nsIHttpChannel.h"
#include "nsIHttpChannelInternal.h"
#include "nsIUploadChannel.h"
#include "nsIUploadChannel2.h"
#include "nsISecCheckWrapChannel.h"
#include "nsIWyciwygChannel.h"
#include "mozilla/LoadInfo.h"
namespace mozilla {
namespace net {
/*
* The nsSecCheckWrapChannelBase wraps channels that do *not*
* * provide a newChannel2() implementation
* * provide get/setLoadInfo functions
*
* In order to perform security checks for channels
* a) before opening the channel, and
* b) after redirects
* we are attaching a loadinfo object to every channel which
* provides information about the content-type of the channel,
* who initiated the load, etc.
*
* Addon created channels might *not* provide that loadInfo object for
* some transition time before we mark the NewChannel-API as deprecated.
* We do not want to break those addons hence we wrap such channels
* using the provided wrapper in this class.
*
* Please note that the wrapper only forwards calls for
* * nsIRequest
* * nsIChannel
* * nsIHttpChannel
* * nsIHttpChannelInternal
* * nsIUploadChannel
* * nsIUploadChannel2
*
* In case any addon needs to query the inner channel this class
* provides a readonly function to query the wrapped channel.
*
*/
class nsSecCheckWrapChannelBase : public nsIHttpChannel,
public nsIHttpChannelInternal,
public nsISecCheckWrapChannel,
public nsIUploadChannel,
public nsIUploadChannel2 {
public:
NS_FORWARD_NSIHTTPCHANNEL(mHttpChannel->)
NS_FORWARD_NSIHTTPCHANNELINTERNAL(mHttpChannelInternal->)
NS_FORWARD_NSICHANNEL(mChannel->)
NS_FORWARD_NSIREQUEST(mRequest->)
NS_FORWARD_NSIUPLOADCHANNEL(mUploadChannel->)
NS_FORWARD_NSIUPLOADCHANNEL2(mUploadChannel2->)
NS_DECL_NSISECCHECKWRAPCHANNEL
NS_DECL_ISUPPORTS
explicit nsSecCheckWrapChannelBase(nsIChannel* aChannel);
protected:
virtual ~nsSecCheckWrapChannelBase() = default;
nsCOMPtr<nsIChannel> mChannel;
// We do a QI in the constructor to set the following pointers.
nsCOMPtr<nsIHttpChannel> mHttpChannel;
nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal;
nsCOMPtr<nsIRequest> mRequest;
nsCOMPtr<nsIUploadChannel> mUploadChannel;
nsCOMPtr<nsIUploadChannel2> mUploadChannel2;
};
/* We define a separate class here to make it clear that we're overriding
* Get/SetLoadInfo as well as AsyncOpen() and Open(), rather that using
* the forwarded implementations provided by NS_FORWARD_NSICHANNEL"
*/
class nsSecCheckWrapChannel : public nsSecCheckWrapChannelBase {
public:
NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) override;
NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) override;
NS_IMETHOD AsyncOpen(nsIStreamListener* aListener) override;
NS_IMETHOD Open(nsIInputStream** aStream) override;
nsSecCheckWrapChannel(nsIChannel* aChannel, nsILoadInfo* aLoadInfo);
static already_AddRefed<nsIChannel> MaybeWrap(nsIChannel* aChannel,
nsILoadInfo* aLoadInfo);
protected:
virtual ~nsSecCheckWrapChannel() = default;
nsCOMPtr<nsILoadInfo> mLoadInfo;
};
} // namespace net
} // namespace mozilla
#endif // nsSecCheckWrapChannel_h__

View File

@ -156,6 +156,3 @@ if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES.update(
HAS_CONNECTX=True,
)
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -1,189 +0,0 @@
/*
* Tests for bug 1351443: NewChannel2 should only fallback to NewChannel if
* NewChannel2() is unimplemented.
*/
"use strict";
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var contentSecManager = Cc["@mozilla.org/contentsecuritymanager;1"]
.getService(Ci.nsIContentSecurityManager);
function ProtocolHandler() {
this.uri = Cc["@mozilla.org/network/simple-uri-mutator;1"]
.createInstance(Ci.nsIURIMutator)
.setSpec(this.scheme + ":dummy")
.finalize();
}
ProtocolHandler.prototype = {
/** nsIProtocolHandler */
get scheme() {
return "x-1351443";
},
get defaultPort() {
return -1;
},
get protocolFlags() {
return Ci.nsIProtocolHandler.URI_NORELATIVE |
Ci.nsIProtocolHandler.URI_NOAUTH |
Ci.nsIProtocolHandler.URI_IS_UI_RESOURCE |
Ci.nsIProtocolHandler.URI_IS_LOCAL_RESOURCE |
Ci.nsIProtocolHandler.URI_NON_PERSISTABLE |
Ci.nsIProtocolHandler.URI_SYNC_LOAD_IS_OK;
},
newURI: function(aSpec, aOriginCharset, aBaseURI) {
return this.uri;
},
newChannel2: function(aURI, aLoadInfo) {
this.loadInfo = aLoadInfo;
return this;
},
newChannel2_not_implemented: function(aURI, aLoadInfo) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
newChannel2_failure: function(aURI, aLoadInfo) {
throw Cr.NS_ERROR_FAILURE;
},
newChannel: function(aURI) {
return this;
},
allowPort: function(port, scheme) {
return port != -1;
},
/** nsIChannel */
get originalURI() {
return this.uri;
},
get URI() {
return this.uri;
},
owner: null,
notificationCallbacks: null,
get securityInfo() {
return null;
},
get contentType() {
return "text/css";
},
set contentType(val) {
},
contentCharset: "UTF-8",
get contentLength() {
return -1;
},
set contentLength(val) {
throw Components.Exception("Setting content length", NS_ERROR_NOT_IMPLEMENTED);
},
open: function() {
// throws an error if security checks fail
contentSecManager.performSecurityCheck(this, null);
var file = do_get_file("test_bug894586.js", false);
Assert.ok(file.exists());
var url = Services.io.newFileURI(file);
return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}).open();
},
asyncOpen: function(aListener, aContext) {
throw Components.Exception("Not implemented",
Cr.NS_ERROR_NOT_IMPLEMENTED);
},
asyncOpen: function(aListener, aContext) {
throw Components.Exception("Not implemented",
Cr.NS_ERROR_NOT_IMPLEMENTED);
},
contentDisposition: Ci.nsIChannel.DISPOSITION_INLINE,
get contentDispositionFilename() {
throw Components.Exception("No file name",
Cr.NS_ERROR_NOT_AVAILABLE);
},
get contentDispositionHeader() {
throw Components.Exception("No header",
Cr.NS_ERROR_NOT_AVAILABLE);
},
/** nsIRequest */
get name() {
return this.uri.spec;
},
isPending: () => false,
get status() {
return Cr.NS_OK;
},
cancel: function(status) {},
loadGroup: null,
loadFlags: Ci.nsIRequest.LOAD_NORMAL |
Ci.nsIRequest.INHIBIT_CACHING |
Ci.nsIRequest.LOAD_BYPASS_CACHE,
/** nsIFactory */
createInstance: function(aOuter, aIID) {
if (aOuter) {
throw Components.Exception("createInstance no aggregation",
Cr.NS_ERROR_NO_AGGREGATION);
}
return this.QueryInterface(aIID);
},
lockFactory: function() {},
/** nsISupports */
QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler,
Ci.nsIRequest,
Ci.nsIChannel,
Ci.nsIFactory]),
classID: Components.ID("{accbaf4a-2fd9-47e7-8aad-8c19fc5265b5}")
};
/**
* Attempt a sync load; we use the stylesheet service to do this for us,
* based on the knowledge that it forces a sync load under the hood.
*/
function run_test()
{
var handler = new ProtocolHandler();
var registrar = Components.manager.
QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(handler.classID, "",
"@mozilla.org/network/protocol;1?name=" + handler.scheme,
handler);
// The default implementation of NewChannel2 should work.
var channel = NetUtil.newChannel({
uri: handler.uri,
loadUsingSystemPrincipal: true
});
ok(channel, "channel exists");
channel = null;
// If the method throws NS_ERROR_NOT_IMPLEMENTED, it should fall back on newChannel()
handler.newChannel2 = handler.newChannel2_not_implemented;
channel = NetUtil.newChannel({
uri: handler.uri,
loadUsingSystemPrincipal: true
});
ok(channel, "channel exists");
channel = null;
// If the method is not defined (the error code will be
// NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED) it should fall back on newChannel()
handler.newChannel2 = undefined;
channel = NetUtil.newChannel({
uri: handler.uri,
loadUsingSystemPrincipal: true
});
ok(channel, "channel exists");
channel = null;
// If the method simply throws an error code, it should not fall back on newChannel()
// so we make sure it throws.
handler.newChannel2 = handler.newChannel2_failure;
Assert.throws(() => {
channel = NetUtil.newChannel({
uri: handler.uri,
loadUsingSystemPrincipal: true
});
}, /Failure/, "If the channel returns an error code, it should throw");
ok(!channel, "channel should not exist");
}

View File

@ -400,7 +400,6 @@ skip-if = appname == "thunderbird"
skip-if = (verify && !debug && (os == 'win'))
[test_channel_priority.js]
[test_bug1312774_http1.js]
[test_1351443-missing-NewChannel2.js]
[test_bug1312782_http1.js]
[test_bug1355539_http1.js]
[test_bug1378385_http1.js]

View File

@ -235,6 +235,3 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += [
'-Wno-unused-parameter',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -42,6 +42,3 @@ if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
LOCAL_INCLUDES += [
'/toolkit/crashreporter/google-breakpad/src',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -17,6 +17,3 @@ if CONFIG['ENABLE_TESTS'] and CONFIG['OS_ARCH'] == 'WINNT':
WIN32_EXE_LDFLAGS += ['-municode']
NO_PGO = True
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -0,0 +1,38 @@
[grow.reftypes-tentative.any.js]
[Grow with exported-function argument]
expected:
if release_or_beta: FAIL
[Grow with non-function argument]
expected:
if release_or_beta: FAIL
[Grow with JS-function argument]
expected:
if release_or_beta: FAIL
[grow.reftypes-tentative.any.html]
[Grow with exported-function argument]
expected:
if release_or_beta: FAIL
[Grow with non-function argument]
expected:
if release_or_beta: FAIL
[Grow with JS-function argument]
expected:
if release_or_beta: FAIL
[grow.reftypes-tentative.any.worker.html]
[Grow with exported-function argument]
expected:
if release_or_beta: FAIL
[Grow with non-function argument]
expected:
if release_or_beta: FAIL
[Grow with JS-function argument]
expected:
if release_or_beta: FAIL

View File

@ -0,0 +1,42 @@
// META: global=jsshell
// META: script=assertions.js
// META: script=/wasm/jsapi/wasm-constants.js
// META: script=/wasm/jsapi/wasm-module-builder.js
// Test cases for changes to the WebAssembly.Table.prototype.grow() API that
// come in with the reftypes proposal: the API takes a default argument, which
// for tables of anyfunc must be either an exported wasm function or null.
//
// See:
// https://github.com/WebAssembly/reference-types
// https://bugzilla.mozilla.org/show_bug.cgi?id=1507491
// https://github.com/WebAssembly/reference-types/issues/22
test(() => {
const builder = new WasmModuleBuilder();
builder
.addFunction("fn", kSig_v_v)
.addBody([kExprEnd])
.exportFunc();
const bin = builder.toBuffer()
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
const fn = new WebAssembly.Instance(new WebAssembly.Module(bin)).exports.fn;
const result = table.grow(2, fn);
assert_equals(result, 1);
assert_equals(table.get(0), null);
assert_equals(table.get(1), fn);
assert_equals(table.get(2), fn);
}, "Grow with exported-function argument");
test(() => {
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
assert_throws(new TypeError(), () => table.grow(2, {}));
}, "Grow with non-function argument");
test(() => {
const argument = { "element": "anyfunc", "initial": 1 };
const table = new WebAssembly.Table(argument);
assert_throws(new TypeError(), () => table.grow(2, () => true));
}, "Grow with JS-function argument");

View File

@ -24,6 +24,3 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../url-classifier',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -51,6 +51,3 @@ OS_LIBS += [
with Files('**'):
BUG_COMPONENT = ('Toolkit', 'Application Update')
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -33,7 +33,3 @@ FINAL_LIBRARY = 'xul'
with Files('**'):
BUG_COMPONENT = ('Toolkit', 'OS.File')
if (not CONFIG['HAVE_64BIT_BUILD'] and
CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -43,6 +43,3 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-shadow']
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -36,6 +36,3 @@ else:
# Don't use the STL wrappers; we don't link with -lmozalloc, and it really
# doesn't matter here anyway.
DisableStlWrapping()
if CONFIG['MOZ_DEBUG'] and CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -98,6 +98,3 @@ with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -36,6 +36,3 @@ if CONFIG['NIGHTLY_BUILD'] or CONFIG['MOZ_DEBUG']:
DEFINES['MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES'] = True
FINAL_LIBRARY = 'xul-gtest'
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -112,6 +112,3 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
if CONFIG['CC_TYPE'] == 'gcc':
CXXFLAGS += ['-Wno-format-truncation']
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -16,6 +16,3 @@ SOURCES += [
]
FINAL_LIBRARY = 'xul'
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -37,6 +37,3 @@ if CONFIG['MOZ_LAUNCHER_PROCESS']:
# Needed for TestLauncherRegistryInfo
for var in ('MOZ_APP_BASENAME', 'MOZ_APP_VENDOR'):
DEFINES[var] = '"%s"' % CONFIG[var]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -246,6 +246,3 @@ LOCAL_INCLUDES += [
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -19,6 +19,3 @@ xpcom_gluens_src_lcppsrcs = [
xpcom_gluens_src_cppsrcs = [
'/xpcom/glue/%s' % s for s in xpcom_gluens_src_lcppsrcs
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -120,6 +120,3 @@ LOCAL_INCLUDES += [
FINAL_LIBRARY = 'xul'
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497