This commit is contained in:
Ryan VanderMeulen 2017-01-07 15:32:04 -05:00
Родитель 542343e117 00f044376d
Коммит da6a7dfab8
22 изменённых файлов: 306 добавлений и 226 удалений

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

@ -35264,8 +35264,10 @@ var Debugger =
var sourceTree = _state.sourceTree;
var parentMap = _state.parentMap;
const isEmpty = sourceTree.contents.length === 0;
var tree = ManagedTree({
key: isEmpty ? "empty" : "full",
getParent: item => {
return parentMap.get(item);
},
@ -37355,8 +37357,10 @@ var Debugger =
displayName: "ManagedTree",
getInitialState() {
return { expanded: new Set(),
focusedItem: null };
return {
expanded: new Set(),
focusedItem: null
};
},
setExpanded(item, isExpanded) {
@ -58328,4 +58332,4 @@ var Debugger =
/***/ }
/******/ ]);
//# sourceMappingURL=bundle.js.map
//# sourceMappingURL=bundle.js.map

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

@ -89,7 +89,8 @@ var Debugger =
var _map$generatedPositio = map.generatedPositionFor({
source: originalSource.url,
line: location.line,
column: location.column == null ? 0 : location.column
column: location.column == null ? 0 : location.column,
bias: SourceMapConsumer.LEAST_UPPER_BOUND
});
var line = _map$generatedPositio.line;
@ -5827,4 +5828,4 @@ var Debugger =
/***/ }
/******/ });
//# sourceMappingURL=source-map-worker.js.map
//# sourceMappingURL=source-map-worker.js.map

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

@ -18,6 +18,9 @@ responsive.editDeviceList=Edit list…
# LOCALIZATION NOTE (responsive.exit): tooltip text of the exit button.
responsive.exit=Close Responsive Design Mode
# LOCALIZATION NOTE (responsive.rotate): tooltip text of the rotate button.
responsive.rotate=Rotate viewport
# LOCALIZATION NOTE (responsive.deviceListLoading): placeholder text for
# device selector when it's still fetching devices
responsive.deviceListLoading=Loading…

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

@ -7,6 +7,7 @@
const { DOM: dom, createClass, createFactory, PropTypes, addons } =
require("devtools/client/shared/vendor/react");
const { getStr } = require("../utils/l10n");
const Types = require("../types");
const DeviceSelector = createFactory(require("./device-selector"));
@ -48,6 +49,7 @@ module.exports = createClass({
dom.button({
className: "viewport-rotate-button toolbar-button devtools-button",
onClick: onRotateViewport,
title: getStr("responsive.rotate"),
})
);
},

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

@ -55,8 +55,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=884693
}
SimpleTest.waitForExplicitFinish();
runTest(204, "No content", "", "", []).
then(() => { return runTest(204, "No content", INVALID_XML, "", []); }).
runTest(201, "Created", "", "", []).
then(() => { return runTest(201, "Created", INVALID_XML, INVALID_XML, []); }).
then(() => { return runTest(202, "Accepted", "", "", []); }).
then(() => { return runTest(202, "Accepted", INVALID_XML, INVALID_XML, []); }).
then(() => { return runTest(204, "No Content", "", "", []); }).
then(() => { return runTest(204, "No Content", INVALID_XML, "", []); }).
then(() => { return runTest(205, "Reset Content", "", "", []); }).
then(() => { return runTest(205, "Reset Content", INVALID_XML, "", []); }).
then(() => { return runTest(304, "Not modified", "", "", []); }).
then(() => { return runTest(304, "Not modified", INVALID_XML, "", []); }).
then(() => { return runTest(200, "OK", "", "", ["no root element found"]); }).

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

@ -2012,6 +2012,16 @@ XMLHttpRequestMainThread::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
mResponseXML->SetChromeXHRDocURI(chromeXHRDocURI);
mResponseXML->SetChromeXHRDocBaseURI(chromeXHRDocBaseURI);
// suppress parsing failure messages to console for statuses which
// can have empty bodies (see bug 884693).
uint32_t responseStatus;
if (NS_SUCCEEDED(GetStatus(&responseStatus)) &&
(responseStatus == 201 || responseStatus == 202 ||
responseStatus == 204 || responseStatus == 205 ||
responseStatus == 304)) {
mResponseXML->SetSuppressParserErrorConsoleMessages(true);
}
if (nsContentUtils::IsSystemPrincipal(mPrincipal)) {
mResponseXML->ForceEnableXULXBL();
}
@ -2077,15 +2087,6 @@ XMLHttpRequestMainThread::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
mRequestObserver->OnStopRequest(request, ctxt, status);
}
// suppress parsing failure messages to console for status 204/304 (see bug 884693).
if (mResponseXML) {
uint32_t responseStatus;
if (NS_SUCCEEDED(GetStatus(&responseStatus)) &&
(responseStatus == 204 || responseStatus == 304)) {
mResponseXML->SetSuppressParserErrorConsoleMessages(true);
}
}
// make sure to notify the listener if we were aborted
// XXX in fact, why don't we do the cleanup below in this case??
// State::unsent is for abort calls. See OnStartRequest above.

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

@ -2007,43 +2007,6 @@ function InitializeNumberFormat(numberFormat, locales, options) {
}
/**
* Mapping from currency codes to the number of decimal digits used for them.
* Default is 2 digits.
*
* Spec: ISO 4217 Currency and Funds Code List.
* http://www.currency-iso.org/en/home/tables/table-a1.html
*/
var currencyDigits = {
BHD: 3,
BIF: 0,
BYR: 0,
CLF: 4,
CLP: 0,
DJF: 0,
GNF: 0,
IQD: 3,
ISK: 0,
JOD: 3,
JPY: 0,
KMF: 0,
KRW: 0,
KWD: 3,
LYD: 3,
OMR: 3,
PYG: 0,
RWF: 0,
TND: 3,
UGX: 0,
UYI: 0,
VND: 0,
VUV: 0,
XAF: 0,
XOF: 0,
XPF: 0
};
/**
* Returns the number of decimal digits to be used for the given currency.
*

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

@ -0,0 +1,76 @@
// Generated by make_intl_data.py. DO NOT EDIT.
// Version: 2017-01-01
/**
* Mapping from currency codes to the number of decimal digits used for them.
* Default is 2 digits.
*
* Spec: ISO 4217 Currency and Funds Code List.
* http://www.currency-iso.org/en/home/tables/table-a1.html
*/
var currencyDigits = {
// Bahraini Dinar (BAHRAIN)
BHD: 3,
// Burundi Franc (BURUNDI)
BIF: 0,
// Unidad de Fomento (CHILE)
CLF: 4,
// Chilean Peso (CHILE)
CLP: 0,
// Djibouti Franc (DJIBOUTI)
DJF: 0,
// Guinea Franc (GUINEA)
GNF: 0,
// Iraqi Dinar (IRAQ)
IQD: 3,
// Iceland Krona (ICELAND)
ISK: 0,
// Jordanian Dinar (JORDAN)
JOD: 3,
// Yen (JAPAN)
JPY: 0,
// Comoro Franc (COMOROS (THE))
KMF: 0,
// Won (KOREA (THE REPUBLIC OF))
KRW: 0,
// Kuwaiti Dinar (KUWAIT)
KWD: 3,
// Libyan Dinar (LIBYA)
LYD: 3,
// Rial Omani (OMAN)
OMR: 3,
// Guarani (PARAGUAY)
PYG: 0,
// Rwanda Franc (RWANDA)
RWF: 0,
// Tunisian Dinar (TUNISIA)
TND: 3,
// Uganda Shilling (UGANDA)
UGX: 0,
// Uruguay Peso en Unidades Indexadas (URUIURUI) (URUGUAY)
UYI: 0,
// Dong (VIET NAM)
VND: 0,
// Vatu (VANUATU)
VUV: 0,
// CFA Franc BEAC (CAMEROON)
// CFA Franc BEAC (CENTRAL AFRICAN REPUBLIC (THE))
// CFA Franc BEAC (CHAD)
// CFA Franc BEAC (CONGO (THE))
// CFA Franc BEAC (EQUATORIAL GUINEA)
// CFA Franc BEAC (GABON)
XAF: 0,
// CFA Franc BCEAO (BENIN)
// CFA Franc BCEAO (BURKINA FASO)
// CFA Franc BCEAO (CÔTE D'IVOIRE)
// CFA Franc BCEAO (GUINEA-BISSAU)
// CFA Franc BCEAO (MALI)
// CFA Franc BCEAO (NIGER (THE))
// CFA Franc BCEAO (SENEGAL)
// CFA Franc BCEAO (TOGO)
XOF: 0,
// CFP Franc (FRENCH POLYNESIA)
// CFP Franc (NEW CALEDONIA)
// CFP Franc (WALLIS AND FUTUNA)
XPF: 0,
};

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

@ -8,6 +8,7 @@
""" Usage:
make_intl_data.py langtags [language-subtag-registry.txt]
make_intl_data.py tzdata
make_intl_data.py currency
Target "langtags":
This script extracts information about mappings between deprecated and
@ -25,6 +26,10 @@
This script computes which time zone informations are not up-to-date in ICU
and provides the necessary mappings to workaround this problem.
https://ssl.icu-project.org/trac/ticket/12044
Target "currency":
Generates the mapping from currency codes to decimal digits used for them.
"""
from __future__ import print_function
@ -39,7 +44,7 @@ import urllib2
import urlparse
from contextlib import closing
from functools import partial
from itertools import chain, ifilter, ifilterfalse, imap, tee
from itertools import chain, groupby, ifilter, ifilterfalse, imap, tee
from operator import attrgetter, itemgetter
def readRegistryRecord(registry):
@ -863,16 +868,9 @@ def generateTzDataTests(tzdataDir, version, ignoreBackzone, testDir):
generateTzDataTestBackzone(tzdataDir, version, ignoreBackzone, testDir)
generateTzDataTestBackzoneLinks(tzdataDir, version, ignoreBackzone, testDir)
def updateTzdata(args):
def updateTzdata(topsrcdir, args):
""" Update the time zone cpp file. """
# This script must reside in js/src/builtin to work correctly.
(thisDir, thisFile) = os.path.split(os.path.abspath(sys.argv[0]))
thisDir = os.path.normpath(thisDir)
if "/".join(thisDir.split(os.sep)[-3:]) != "js/src/builtin":
raise RuntimeError("%s must reside in js/src/builtin" % sys.argv[0])
topsrcdir = "/".join(thisDir.split(os.sep)[:-3])
icuDir = os.path.join(topsrcdir, "intl/icu/source")
if not os.path.isdir(icuDir):
raise RuntimeError("not a directory: %s" % icuDir)
@ -929,9 +927,99 @@ def updateTzdata(args):
else:
updateFrom(tzDir)
def readCurrencyFile(tree):
reCurrency = re.compile(r"^[A-Z]{3}$")
reIntMinorUnits = re.compile(r"^\d+$")
for country in tree.iterfind(".//CcyNtry"):
# Skip entry if no currency information is available.
currency = country.findtext("Ccy")
if currency is None:
continue
assert reCurrency.match(currency)
minorUnits = country.findtext("CcyMnrUnts")
assert minorUnits is not None
# Skip all entries without minorUnits or which use the default minorUnits.
if reIntMinorUnits.match(minorUnits) and int(minorUnits) != 2:
currencyName = country.findtext("CcyNm")
countryName = country.findtext("CtryNm")
yield (currency, int(minorUnits), currencyName, countryName)
def writeCurrencyFile(published, currencies, out):
with io.open(out, mode="w", encoding="utf-8", newline="") as f:
println = partial(print, file=f)
println(generatedFileWarning)
println(u"// Version: {}".format(published))
println(u"""
/**
* Mapping from currency codes to the number of decimal digits used for them.
* Default is 2 digits.
*
* Spec: ISO 4217 Currency and Funds Code List.
* http://www.currency-iso.org/en/home/tables/table-a1.html
*/""")
println(u"var currencyDigits = {")
for (currency, entries) in groupby(sorted(currencies, key=itemgetter(0)), itemgetter(0)):
for (_, minorUnits, currencyName, countryName) in entries:
println(u" // {} ({})".format(currencyName, countryName))
println(u" {}: {},".format(currency, minorUnits))
println(u"};")
def updateCurrency(topsrcdir, args):
""" Update the IntlCurrency.js file. """
import xml.etree.ElementTree as ET
from random import randint
url = args.url
out = args.out
filename = args.file
print("Arguments:")
print("\tDownload url: %s" % url)
print("\tLocal currency file: %s" % filename)
print("\tOutput file: %s" % out)
print("")
def updateFrom(currencyFile):
print("Processing currency code list file...")
tree = ET.parse(currencyFile)
published = tree.getroot().attrib["Pblshd"]
currencies = readCurrencyFile(tree)
print("Writing IntlCurrency file...")
writeCurrencyFile(published, currencies, out)
if filename is not None:
print("Always make sure you have the newest currency code list file!")
updateFrom(filename)
else:
print("Downloading currency & funds code list...")
request = urllib2.Request(url)
# Fake a random user agent string to circumvent the bot detection from
# currency-iso.org...
request.add_header("User-agent", "Mozilla/5.0 (Mobile; rv:{0}.0) Gecko/{0}.0 Firefox/{0}.0".format(randint(1, 999)))
with closing(urllib2.urlopen(request)) as currencyFile:
fname = urlparse.urlsplit(currencyFile.geturl()).path.split("/")[-1]
with tempfile.NamedTemporaryFile(suffix=fname) as currencyTmpFile:
print("File stored in %s" % currencyTmpFile.name)
currencyTmpFile.write(currencyFile.read())
currencyTmpFile.flush()
updateFrom(currencyTmpFile.name)
if __name__ == "__main__":
import argparse
# This script must reside in js/src/builtin to work correctly.
(thisDir, thisFile) = os.path.split(os.path.abspath(sys.argv[0]))
dirPaths = os.path.normpath(thisDir).split(os.sep)
if "/".join(dirPaths[-3:]) != "js/src/builtin":
raise RuntimeError("%s must reside in js/src/builtin" % sys.argv[0])
topsrcdir = "/".join(dirPaths[:-3])
def EnsureHttps(v):
if not v.startswith("https:"):
raise argparse.ArgumentTypeError("URL protocol must be https: " % v)
@ -971,7 +1059,23 @@ if __name__ == "__main__":
parser_tz.add_argument("--out",
default="IntlTimeZoneData.h",
help="Output file (default: %(default)s)")
parser_tz.set_defaults(func=updateTzdata)
parser_tz.set_defaults(func=partial(updateTzdata, topsrcdir))
parser_currency = subparsers.add_parser("currency", help="Update currency digits mapping")
parser_currency.add_argument("--url",
metavar="URL",
default="https://www.currency-iso.org/dam/downloads/lists/list_one.xml",
type=EnsureHttps,
help="Download url for the currency & funds code list (default: "
"%(default)s)")
parser_currency.add_argument("--out",
default="IntlCurrency.js",
help="Output file (default: %(default)s)")
parser_currency.add_argument("file",
nargs="?",
help="Local currency code list file, if omitted uses <URL>")
parser_currency.set_defaults(func=partial(updateCurrency, topsrcdir))
args = parser.parse_args()
args.func(args)

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

@ -762,6 +762,7 @@ selfhosted.inputs = [
'builtin/Function.js',
'builtin/Generator.js',
'builtin/Intl.js',
'builtin/IntlCurrency.js',
'builtin/IntlData.js',
'builtin/Iterator.js',
'builtin/Map.js',

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

@ -1359,15 +1359,6 @@ if test "$ac_cv_thread_keyword" = yes; then
esac
fi
dnl See if compiler supports some gcc-style attributes
AC_CACHE_CHECK(for __attribute__((always_inline)),
ac_cv_attribute_always_inline,
[AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
[],
ac_cv_attribute_always_inline=yes,
ac_cv_attribute_always_inline=no)])
dnl End of C++ language/feature checks
AC_LANG_C

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

@ -33,7 +33,6 @@ var currencyDigits = {
BSD: 2,
BTN: 2,
BWP: 2,
BYR: 0,
BZD: 2,
CAD: 2,
CDF: 2,

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

@ -153,8 +153,6 @@
'sources': [
'sndio/audio_device_sndio.cc',
'sndio/audio_device_sndio.h',
'sndio/audio_device_utility_sndio.cc',
'sndio/audio_device_utility_sndio.h',
],
}],
['include_alsa_audio==1', {

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

@ -33,7 +33,6 @@
#include "webrtc/modules/audio_device/android/audio_track_jni.h"
#include "webrtc/modules/audio_device/android/opensles_player.h"
#elif defined(WEBRTC_AUDIO_SNDIO)
#include "audio_device_utility_sndio.h"
#include "audio_device_sndio.h"
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
#if defined(LINUX_ALSA)
@ -297,8 +296,6 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
{
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "attempting to use the Sndio audio API...");
_platformAudioLayer = kSndioAudio;
// Create the sndio implementation of the Device Utility.
ptrAudioDeviceUtility = new AudioDeviceUtilitySndio(Id());
}
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
// Create the *Linux* implementation of the Audio Device

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

@ -12,7 +12,6 @@
#include <string.h>
#include "webrtc/modules/audio_device/audio_device_config.h"
#include "webrtc/modules/audio_device/audio_device_utility.h"
#include "webrtc/modules/audio_device/sndio/audio_device_sndio.h"
#include "webrtc/system_wrappers/include/event_wrapper.h"
@ -699,9 +698,9 @@ int32_t AudioDeviceSndio::StartRecording()
return 0;
}
_ptrThreadRec = new rtc::PlatformThread(RecThreadFunc,
this,
threadName);
_ptrThreadRec.reset(new rtc::PlatformThread(
RecThreadFunc, this, "webrtc_audio_module_capture_thread"));
if (_ptrThreadRec == NULL)
{
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
@ -724,17 +723,7 @@ int32_t AudioDeviceSndio::StartRecording()
return -1;
}
if (!_ptrThreadRec->Start())
{
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
" failed to start the rec audio thread");
_recording = false;
sio_stop(_recHandle);
_ptrThreadRec.reset();
delete [] _recordingBuffer;
_recordingBuffer = NULL;
return -1;
}
_ptrThreadRec->Start();
_recording = true;
return 0;
}
@ -796,9 +785,9 @@ int32_t AudioDeviceSndio::StartPlayout()
return 0;
}
_ptrThreadPlay = new rtc::PlatformThread(PlayThreadFunc,
this,
threadName);
_ptrThreadPlay.reset(new rtc::PlatformThread(
PlayThreadFunc, this, "webrtc_audio_module_play_thread"));
if (_ptrThreadPlay == NULL)
{
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
@ -818,17 +807,7 @@ int32_t AudioDeviceSndio::StartPlayout()
return -1;
}
if (!_ptrThreadPlay->Start())
{
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
" failed to start the play audio thread");
sio_stop(_playHandle);
_ptrThreadPlay.reset();
_ptrThreadPlay = NULL;
delete [] _playoutBuffer;
_playoutBuffer = NULL;
return -1;
}
_ptrThreadPlay->Start();
_playing = true;
return 0;
}

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

@ -1,53 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/trace.h"
namespace webrtc
{
AudioDeviceUtilitySndio::AudioDeviceUtilitySndio(const int32_t id) :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id)
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id,
"%s created", __FUNCTION__);
}
AudioDeviceUtilitySndio::~AudioDeviceUtilitySndio()
{
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id,
"%s destroyed", __FUNCTION__);
{
CriticalSectionScoped lock(&_critSect);
// XXX free stuff here...
}
delete &_critSect;
}
// ============================================================================
// API
// ============================================================================
int32_t AudioDeviceUtilitySndio::Init()
{
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
" OS info: %s", "POSIX using sndio");
return 0;
}
} // namespace webrtc

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

@ -1,36 +0,0 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H
#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H
#include "webrtc/modules/audio_device/audio_device_utility.h"
#include "webrtc/modules/audio_device/include/audio_device.h"
namespace webrtc
{
class CriticalSectionWrapper;
class AudioDeviceUtilitySndio: public AudioDeviceUtility
{
public:
AudioDeviceUtilitySndio(const int32_t id);
virtual ~AudioDeviceUtilitySndio();
virtual int32_t Init() override;
private:
CriticalSectionWrapper& _critSect;
int32_t _id;
};
} // namespace webrtc
#endif

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

@ -1321,15 +1321,16 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer,
{
ENSURE_CALLED_BEFORE_CONNECT();
mReferrerPolicy = referrerPolicy;
// clear existing referrer, if any
mReferrer = nullptr;
nsresult rv = mRequestHead.ClearHeader(nsHttp::Referer);
if(NS_FAILED(rv)) {
return rv;
}
mReferrerPolicy = referrerPolicy;
if (referrerPolicy == REFERRER_POLICY_UNSET) {
if (mReferrerPolicy == REFERRER_POLICY_UNSET) {
mReferrerPolicy = NS_GetDefaultReferrerPolicy();
}
@ -1338,7 +1339,7 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer,
}
// Don't send referrer at all when the meta referrer setting is "no-referrer"
if (referrerPolicy == REFERRER_POLICY_NO_REFERRER) {
if (mReferrerPolicy == REFERRER_POLICY_NO_REFERRER) {
return NS_OK;
}
@ -1444,9 +1445,9 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer,
// It's ok to send referrer for https-to-http scenarios if the referrer
// policy is "unsafe-url", "origin", or "origin-when-cross-origin".
if (referrerPolicy != REFERRER_POLICY_UNSAFE_URL &&
referrerPolicy != REFERRER_POLICY_ORIGIN_WHEN_XORIGIN &&
referrerPolicy != REFERRER_POLICY_ORIGIN) {
if (mReferrerPolicy != REFERRER_POLICY_UNSAFE_URL &&
mReferrerPolicy != REFERRER_POLICY_ORIGIN_WHEN_XORIGIN &&
mReferrerPolicy != REFERRER_POLICY_ORIGIN) {
// in other referrer policies, https->http is not allowed...
if (!match) return NS_OK;
@ -1479,8 +1480,7 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer,
}
// Don't send referrer when the request is cross-origin and policy is "same-origin".
if (isCrossOrigin && referrerPolicy == REFERRER_POLICY_SAME_ORIGIN) {
mReferrerPolicy = REFERRER_POLICY_SAME_ORIGIN;
if (isCrossOrigin && mReferrerPolicy == REFERRER_POLICY_SAME_ORIGIN) {
return NS_OK;
}
@ -1560,10 +1560,10 @@ HttpBaseChannel::SetReferrerWithPolicy(nsIURI *referrer,
// "Strict" request from https->http case was bailed out, so here:
// "strict-origin" behaves the same as "origin".
// "strict-origin-when-cross-origin" behaves the same as "origin-when-cross-origin"
if (referrerPolicy == REFERRER_POLICY_ORIGIN ||
referrerPolicy == REFERRER_POLICY_STRICT_ORIGIN ||
(isCrossOrigin && (referrerPolicy == REFERRER_POLICY_ORIGIN_WHEN_XORIGIN ||
referrerPolicy == REFERRER_POLICY_STRICT_ORIGIN_WHEN_XORIGIN))) {
if (mReferrerPolicy == REFERRER_POLICY_ORIGIN ||
mReferrerPolicy == REFERRER_POLICY_STRICT_ORIGIN ||
(isCrossOrigin && (mReferrerPolicy == REFERRER_POLICY_ORIGIN_WHEN_XORIGIN ||
mReferrerPolicy == REFERRER_POLICY_STRICT_ORIGIN_WHEN_XORIGIN))) {
// We can override the user trimming preference because "origin"
// (network.http.referer.trimmingPolicy = 2) is the strictest
// trimming policy that users can specify.

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

@ -3,6 +3,15 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
function test_policy(test) {
do_print("Running test: " + test.toSource());
var prefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (test.defaultReferrerPolicyPref !== undefined) {
prefs.setIntPref("network.http.referer.userControlPolicy",
test.defaultReferrerPolicyPref);
} else {
prefs.setIntPref("network.http.referer.userControlPolicy", 3);
}
var uri = NetUtil.newURI(test.url, "", null)
var chan = NetUtil.newChannel({
uri: uri,
@ -27,21 +36,53 @@ function test_policy(test) {
}
const nsIHttpChannel = Ci.nsIHttpChannel;
// Assuming cross origin because we have no triggering principal available
var gTests = [
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 0,
url: "https://test.example/foo",
referrer: "https://test.example/referrer",
expectedReferrerSpec: undefined
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 1,
url: "http://test.example/foo",
referrer: "http://test1.example/referrer",
expectedReferrerSpec: undefined
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 2,
url: "https://sub1.\xe4lt.example/foo",
referrer: "https://sub1.\xe4lt.example/referrer",
expectedReferrerSpec: "https://sub1.xn--lt-uia.example/"
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 2,
url: "https://test.example/foo",
referrer: "https://test1.example/referrer",
expectedReferrerSpec: "https://test1.example/"
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 3,
url: "https://test.example/foo",
referrer: "https://test.example/referrer",
expectedReferrerSpec: "https://test.example/referrer"
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 3,
url: "https://sub1.\xe4lt.example/foo",
referrer: "https://sub1.\xe4lt.example/referrer",
expectedReferrerSpec: "https://sub1.xn--lt-uia.example/referrer"
},
{
policy: nsIHttpChannel.REFERRER_POLICY_UNSET,
defaultReferrerPolicyPref: 3,
url: "http://test.example/foo",
referrer: "https://test.example/referrer",
expectedReferrerSpec: undefined

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

@ -1923,15 +1923,6 @@ if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then
fi
fi
dnl See if compiler supports some gcc-style attributes
AC_CACHE_CHECK(for __attribute__((always_inline)),
ac_cv_attribute_always_inline,
[AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
[],
ac_cv_attribute_always_inline=yes,
ac_cv_attribute_always_inline=no)])
dnl End of C++ language/feature checks
AC_LANG_C

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

@ -307,23 +307,34 @@ nsNSSSocketInfo::GetNegotiatedNPN(nsACString& aNegotiatedNPN)
NS_IMETHODIMP
nsNSSSocketInfo::GetAlpnEarlySelection(nsACString& aAlpnSelected)
{
aAlpnSelected.Truncate();
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown() || isPK11LoggedOut()) {
return NS_ERROR_NOT_AVAILABLE;
}
SSLNextProtoState alpnState;
unsigned char chosenAlpn[MAX_ALPN_LENGTH];
unsigned int chosenAlpnLen;
SECStatus rv = SSL_GetNextProto(mFd, &alpnState, chosenAlpn, &chosenAlpnLen,
AssertedCast<unsigned int>(ArrayLength(chosenAlpn)));
if (rv != SECSuccess || alpnState != SSL_NEXT_PROTO_EARLY_VALUE ||
chosenAlpnLen == 0) {
SSLPreliminaryChannelInfo info;
SECStatus rv = SSL_GetPreliminaryChannelInfo(mFd, &info, sizeof(info));
if (rv != SECSuccess || !info.canSendEarlyData) {
return NS_ERROR_NOT_AVAILABLE;
}
aAlpnSelected.Assign(BitwiseCast<char*, unsigned char*>(chosenAlpn),
chosenAlpnLen);
SSLNextProtoState alpnState;
unsigned char chosenAlpn[MAX_ALPN_LENGTH];
unsigned int chosenAlpnLen;
rv = SSL_GetNextProto(mFd, &alpnState, chosenAlpn, &chosenAlpnLen,
AssertedCast<unsigned int>(ArrayLength(chosenAlpn)));
if (rv != SECSuccess) {
return NS_ERROR_NOT_AVAILABLE;
}
if (alpnState == SSL_NEXT_PROTO_EARLY_VALUE) {
aAlpnSelected.Assign(BitwiseCast<char*, unsigned char*>(chosenAlpn),
chosenAlpnLen);
}
return NS_OK;
}

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

@ -668,6 +668,7 @@ SSL_GetClientAuthDataHook
SSL_GetImplementedCiphers
SSL_GetNextProto
SSL_GetNumImplementedCiphers
SSL_GetPreliminaryChannelInfo
SSL_GetSRTPCipher
SSL_GetStatistics
SSL_HandshakeCallback