mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Merge inbound to mozilla-central r=merge a=merge
This commit is contained in:
commit
17786852ca
39 files changed
+334
-198
No files matched your search
@@ -72,6 +72,8 @@ add_task(async function clearURLBarAfterManuallyLoadingAboutHome() {
|
||||
* default content principal are different).
|
||||
*/
|
||||
add_task(async function dontTemporarilyShowAboutHome() {
|
||||
requestLongerTimeout(2);
|
||||
|
||||
await SpecialPowers.pushPrefEnv({set: [["browser.startup.page", 1]]});
|
||||
let windowOpenedPromise = BrowserTestUtils.waitForNewWindow();
|
||||
let win = OpenBrowserWindow();
|
||||
@@ -79,6 +81,7 @@ add_task(async function dontTemporarilyShowAboutHome() {
|
||||
let promiseTabSwitch = BrowserTestUtils.switchTab(win.gBrowser, () => {});
|
||||
win.BrowserOpenTab();
|
||||
await promiseTabSwitch;
|
||||
is(win.gBrowser.visibleTabs.length, 2, "2 tabs opened");
|
||||
await TabStateFlusher.flush(win.gBrowser.selectedBrowser);
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
ok(SessionStore.getClosedWindowCount(), "Should have a closed window");
|
||||
@@ -94,6 +97,10 @@ add_task(async function dontTemporarilyShowAboutHome() {
|
||||
},
|
||||
};
|
||||
win.gBrowser.addProgressListener(wpl);
|
||||
|
||||
if (win.gBrowser.visibleTabs.length < 2) {
|
||||
await BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
|
||||
}
|
||||
let otherTab = win.gBrowser.selectedTab.previousSibling;
|
||||
let tabLoaded = BrowserTestUtils.browserLoaded(otherTab.linkedBrowser, false, "about:home");
|
||||
await BrowserTestUtils.switchTab(win.gBrowser, otherTab);
|
||||
|
||||
@@ -1745,7 +1745,7 @@ BrowserGlue.prototype = {
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
_migrateUI: function BG__migrateUI() {
|
||||
const UI_VERSION = 57;
|
||||
const UI_VERSION = 58;
|
||||
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
|
||||
|
||||
let currentUIVersion;
|
||||
@@ -2170,6 +2170,13 @@ BrowserGlue.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
if (currentUIVersion < 58) {
|
||||
// With Firefox 57, we are doing a one time reset of the geo prefs due to bug 1413652
|
||||
Services.prefs.clearUserPref("browser.search.countryCode");
|
||||
Services.prefs.clearUserPref("browser.search.region");
|
||||
Services.prefs.clearUserPref("browser.search.isUS");
|
||||
}
|
||||
|
||||
// Update the migration version.
|
||||
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
||||
},
|
||||
|
||||
@@ -199,8 +199,8 @@ set_config('XCODE_PATH', xcode_path)
|
||||
option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
|
||||
help='Enable compiling with wrappers such as distcc and ccache')
|
||||
|
||||
js_option('--with-ccache', env='CCACHE', nargs='?',
|
||||
help='Enable compiling with ccache')
|
||||
option('--with-ccache', env='CCACHE', nargs='?',
|
||||
help='Enable compiling with ccache')
|
||||
|
||||
|
||||
@depends_if('--with-ccache')
|
||||
@@ -1224,19 +1224,6 @@ set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
|
||||
set_config('VISIBILITY_FLAGS', visibility_flags)
|
||||
|
||||
|
||||
@depends(c_compiler, using_sccache)
|
||||
def depend_cflags(info, using_sccache):
|
||||
if info.type not in ('clang-cl', 'msvc'):
|
||||
return '-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
|
||||
elif using_sccache:
|
||||
# sccache supports a special flag to create depfiles
|
||||
# by parsing MSVC's -showIncludes output.
|
||||
return '-deps$(MDDEPDIR)/$(@F).pp'
|
||||
|
||||
|
||||
set_config('_DEPEND_CFLAGS', depend_cflags)
|
||||
|
||||
|
||||
@depends(c_compiler)
|
||||
@imports('multiprocessing')
|
||||
@imports(_from='__builtin__', _import='min')
|
||||
|
||||
@@ -447,28 +447,3 @@ def alter_path(sdk_bin_path):
|
||||
set_config('PATH', alter_path)
|
||||
|
||||
check_prog('MAKECAB', ('makecab.exe',))
|
||||
|
||||
|
||||
@depends(c_compiler, using_sccache)
|
||||
def need_showincludes_prefix(info, using_sccache):
|
||||
# sccache does its own -showIncludes prefix checking.
|
||||
if info.type in ('clang-cl', 'msvc') and not using_sccache:
|
||||
return True
|
||||
|
||||
|
||||
@depends(c_compiler, when=need_showincludes_prefix)
|
||||
@imports(_from='re', _import='compile', _as='re_compile')
|
||||
def msvc_showincludes_prefix(c_compiler):
|
||||
pattern = re_compile(br'^([^:]*:.*[ :] )(.*\\stdio.h)$')
|
||||
output = try_invoke_compiler([c_compiler.compiler], 'C', '#include <stdio.h>\n',
|
||||
['-nologo', '-c', '-Fonul', '-showIncludes'])
|
||||
for line in output.splitlines():
|
||||
if line.endswith(b'\\stdio.h'):
|
||||
m = pattern.match(line)
|
||||
if m:
|
||||
return m.group(1)
|
||||
# We should have found the prefix and returned earlier
|
||||
die('Cannot find cl -showIncludes prefix.')
|
||||
|
||||
|
||||
set_config('CL_INCLUDES_PREFIX', msvc_showincludes_prefix)
|
||||
@@ -124,6 +124,12 @@ else
|
||||
mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"
|
||||
case "$platform" in
|
||||
win*)
|
||||
# sccache supports a special flag to create depfiles.
|
||||
#TODO: bug 1318370 - move this all into toolchain.configure
|
||||
export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
|
||||
# Windows builds have a default wrapper that needs to be overridden
|
||||
mk_add_options "export CC_WRAPPER="
|
||||
mk_add_options "export CXX_WRAPPER="
|
||||
# For now, sccache doesn't support separate PDBs so force debug info to be
|
||||
# in object files.
|
||||
mk_add_options "export COMPILE_PDB_FLAG="
|
||||
|
||||
@@ -120,10 +120,8 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
|
||||
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
|
||||
|
||||
ifdef _MSC_VER
|
||||
ifndef MOZ_USING_SCCACHE
|
||||
CC_WRAPPER ?= $(call py_action,cl)
|
||||
CXX_WRAPPER ?= $(call py_action,cl)
|
||||
endif
|
||||
endif # _MSC_VER
|
||||
|
||||
CC := $(CC_WRAPPER) $(CC)
|
||||
|
||||
@@ -23,7 +23,7 @@ function test() {
|
||||
"There should be one error logged when parsing.");
|
||||
is(parser.errors[0].name, "SyntaxError",
|
||||
"The correct exception was caught.");
|
||||
is(parser.errors[0].message, "missing ; before statement",
|
||||
is(parser.errors[0].message, "unexpected token: \'+\'",
|
||||
"The correct exception was caught.");
|
||||
|
||||
finish();
|
||||
|
||||
@@ -36,12 +36,12 @@ function test() {
|
||||
|
||||
is(parser.errors[0].name, "SyntaxError",
|
||||
"The correct first exception was caught.");
|
||||
is(parser.errors[0].message, "missing ; before statement",
|
||||
is(parser.errors[0].message, "unexpected token: \'+\'",
|
||||
"The correct first exception was caught.");
|
||||
|
||||
is(parser.errors[1].name, "SyntaxError",
|
||||
"The correct second exception was caught.");
|
||||
is(parser.errors[1].message, "missing ; before statement",
|
||||
is(parser.errors[1].message, "unexpected token: \'+\'",
|
||||
"The correct second exception was caught.");
|
||||
|
||||
is(parsed.scriptCount, 1,
|
||||
|
||||
@@ -39,7 +39,7 @@ const ErrorDocs = {
|
||||
JSMSG_NO_PROPERTIES: "No_properties",
|
||||
JSMSG_ALREADY_HAS_PRAGMA: "Already_has_pragma",
|
||||
JSMSG_BAD_RETURN_OR_YIELD: "Bad_return_or_yield",
|
||||
JSMSG_SEMI_BEFORE_STMNT: "Missing_semicolon_before_statement",
|
||||
JSMSG_UNEXPECTED_TOKEN_NO_EXPECT: "Missing_semicolon_before_statement",
|
||||
JSMSG_OVER_RECURSED: "Too_much_recursion",
|
||||
JSMSG_BRACKET_AFTER_LIST: "Missing_bracket_after_list",
|
||||
JSMSG_PAREN_AFTER_ARGS: "Missing_parenthesis_after_argument_list",
|
||||
|
||||
@@ -115,7 +115,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsJSScriptTimeoutHandler)
|
||||
nsAutoCString name("nsJSScriptTimeoutHandler");
|
||||
if (tmp->mFunction) {
|
||||
JSObject* obj = tmp->mFunction->CallablePreserveColor();
|
||||
JSFunction* fun = JS_GetObjectFunction(js::UncheckedUnwrap(obj));
|
||||
JSFunction* fun = JS_GetObjectFunction(js::UncheckedUnwrapWithoutExpose(obj));
|
||||
if (fun && JS_GetFunctionId(fun)) {
|
||||
JSFlatString *funId = JS_ASSERT_STRING_IS_FLAT(JS_GetFunctionId(fun));
|
||||
size_t size = 1 + JS_PutEscapedFlatString(nullptr, 0, funId, 0);
|
||||
|
||||
@@ -650,6 +650,18 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
}
|
||||
}
|
||||
|
||||
if (aDeep && !aClone && aNode->IsElement()) {
|
||||
if (ShadowRoot* shadowRoot = aNode->AsElement()->GetShadowRoot()) {
|
||||
nsCOMPtr<nsINode> child =
|
||||
CloneAndAdopt(shadowRoot, aClone, aDeep, nodeInfoManager,
|
||||
aReparentScope, aNodesWithProperties, clone,
|
||||
aError);
|
||||
if (NS_WARN_IF(aError.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cloning template element.
|
||||
if (aDeep && aClone && IsTemplateElement(aNode)) {
|
||||
DocumentFragment* origContent =
|
||||
|
||||
@@ -114,7 +114,7 @@ void
|
||||
nsWrapperCache::CheckCCWrapperTraversal(void* aScriptObjectHolder,
|
||||
nsScriptObjectTracer* aTracer)
|
||||
{
|
||||
JSObject* wrapper = GetWrapper();
|
||||
JSObject* wrapper = GetWrapperPreserveColor();
|
||||
if (!wrapper) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,6 +312,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
GetWrapper(); // Read barrier for incremental GC.
|
||||
HoldJSObjects(aScriptObjectHolder, aTracer);
|
||||
SetPreservingWrapper(true);
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "mozilla/PeerIdentity.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/MediaStreamBinding.h"
|
||||
#include "mozilla/dom/MediaStreamTrackBinding.h"
|
||||
@@ -2130,6 +2131,35 @@ nsresult MediaManager::GenerateUUID(nsAString& aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static bool IsFullyActive(nsPIDOMWindowInner* aWindow)
|
||||
{
|
||||
while (true) {
|
||||
if (!aWindow) {
|
||||
return false;
|
||||
}
|
||||
nsIDocument* document = aWindow->GetExtantDoc();
|
||||
if (!document) {
|
||||
return false;
|
||||
}
|
||||
if (!document->IsCurrentActiveDocument()) {
|
||||
return false;
|
||||
}
|
||||
nsPIDOMWindowOuter* context = aWindow->GetOuterWindow();
|
||||
if (!context) {
|
||||
return false;
|
||||
}
|
||||
if (context->IsTopLevelWindow()) {
|
||||
return true;
|
||||
}
|
||||
nsCOMPtr<Element> frameElement =
|
||||
nsGlobalWindow::Cast(context)->GetRealFrameElementOuter();
|
||||
if (!frameElement) {
|
||||
return false;
|
||||
}
|
||||
aWindow = frameElement->OwnerDoc()->GetInnerWindow();
|
||||
}
|
||||
}
|
||||
|
||||
enum class GetUserMediaSecurityState {
|
||||
Other = 0,
|
||||
HTTPS = 1,
|
||||
@@ -2173,6 +2203,14 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
||||
onFailure->OnError(error);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!IsFullyActive(aWindow)) {
|
||||
RefPtr<MediaStreamError> error =
|
||||
new MediaStreamError(aWindow, NS_LITERAL_STRING("InvalidStateError"));
|
||||
onFailure->OnError(error);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (sInShutdown) {
|
||||
RefPtr<MediaStreamError> error =
|
||||
new MediaStreamError(aWindow,
|
||||
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
bool IsDecoded() const { return !IsPlaceholder() && mProvider->IsFinished(); }
|
||||
|
||||
ImageKey GetImageKey() const { return mProvider->GetImageKey(); }
|
||||
SurfaceKey GetSurfaceKey() const { return mProvider->GetSurfaceKey(); }
|
||||
const SurfaceKey& GetSurfaceKey() const { return mProvider->GetSurfaceKey(); }
|
||||
nsExpirationState* GetExpirationState() { return &mExpirationState; }
|
||||
|
||||
CostEntry GetCostEntry()
|
||||
|
||||
@@ -515,12 +515,12 @@ imgRequestProxy::CancelAndForgetObserver(nsresult aStatus)
|
||||
LOG_SCOPE(gImgLog, "imgRequestProxy::CancelAndForgetObserver");
|
||||
|
||||
mCanceled = true;
|
||||
mForceDispatchLoadGroup = true;
|
||||
|
||||
if (GetOwner()) {
|
||||
GetOwner()->RemoveProxy(this, aStatus);
|
||||
}
|
||||
|
||||
mForceDispatchLoadGroup = true;
|
||||
RemoveFromLoadGroup();
|
||||
mForceDispatchLoadGroup = false;
|
||||
|
||||
|
||||
+1
-21
@@ -35,27 +35,7 @@ const DEFAULT_HEAPSIZE: u32 = 32_u32 * 1024_u32 * 1024_u32;
|
||||
const STACK_QUOTA: usize = 128 * 8 * 1024;
|
||||
|
||||
// From Gecko:
|
||||
// The JS engine permits us to set different stack limits for system code,
|
||||
// trusted script, and untrusted script. We have tests that ensure that
|
||||
// we can always execute 10 "heavy" (eval+with) stack frames deeper in
|
||||
// privileged code. Our stack sizes vary greatly in different configurations,
|
||||
// so satisfying those tests requires some care. Manual measurements of the
|
||||
// number of heavy stack frames achievable gives us the following rough data,
|
||||
// ordered by the effective categories in which they are grouped in the
|
||||
// JS_SetNativeStackQuota call (which predates this analysis).
|
||||
//
|
||||
// (NB: These numbers may have drifted recently - see bug 938429)
|
||||
// OSX 64-bit Debug: 7MB stack, 636 stack frames => ~11.3k per stack frame
|
||||
// OSX64 Opt: 7MB stack, 2440 stack frames => ~3k per stack frame
|
||||
//
|
||||
// Linux 32-bit Debug: 2MB stack, 426 stack frames => ~4.8k per stack frame
|
||||
// Linux 64-bit Debug: 4MB stack, 455 stack frames => ~9.0k per stack frame
|
||||
//
|
||||
// Windows (Opt+Debug): 900K stack, 235 stack frames => ~3.4k per stack frame
|
||||
//
|
||||
// Linux 32-bit Opt: 1MB stack, 272 stack frames => ~3.8k per stack frame
|
||||
// Linux 64-bit Opt: 2MB stack, 316 stack frames => ~6.5k per stack frame
|
||||
//
|
||||
// (See js/xpconnect/src/XPCJSContext.cpp)
|
||||
// We tune the trusted/untrusted quotas for each configuration to achieve our
|
||||
// invariants while attempting to minimize overhead. In contrast, our buffer
|
||||
// between system code and trusted script is a very unscientific 10k.
|
||||
|
||||
@@ -178,7 +178,7 @@ js::ExecuteRegExpLegacy(JSContext* cx, RegExpStatics* res, Handle<RegExpObject*>
|
||||
static bool
|
||||
CheckPatternSyntax(JSContext* cx, HandleAtom pattern, RegExpFlag flags)
|
||||
{
|
||||
CompileOptions options(cx);
|
||||
CompileOptions options(cx, JSVERSION_DEFAULT);
|
||||
frontend::TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
|
||||
return irregexp::ParsePatternSyntax(dummyTokenStream, cx->tempLifoAlloc(), pattern,
|
||||
flags & UnicodeFlag);
|
||||
|
||||
@@ -2872,7 +2872,7 @@ Parser<ParseHandler, CharT>::matchOrInsertSemicolon()
|
||||
* tried to insert semicolon here
|
||||
*
|
||||
* Detect this situation and throw an understandable error. Otherwise
|
||||
* we'd throw a confusing "missing ; before statement" error.
|
||||
* we'd throw a confusing "unexpected token: (unexpected token)" error.
|
||||
*/
|
||||
if (!pc->isAsync() && tokenStream.currentToken().type == TOK_AWAIT) {
|
||||
error(JSMSG_AWAIT_OUTSIDE_ASYNC);
|
||||
@@ -2885,7 +2885,7 @@ Parser<ParseHandler, CharT>::matchOrInsertSemicolon()
|
||||
|
||||
/* Advance the scanner for proper error location reporting. */
|
||||
tokenStream.consumeKnownToken(tt, TokenStream::Operand);
|
||||
error(JSMSG_SEMI_BEFORE_STMNT);
|
||||
error(JSMSG_UNEXPECTED_TOKEN_NO_EXPECT, TokenKindToDesc(tt));
|
||||
return false;
|
||||
}
|
||||
bool matched;
|
||||
@@ -9004,7 +9004,7 @@ Parser<ParseHandler, CharT>::checkLabelOrIdentifierReference(PropertyName* ident
|
||||
return true;
|
||||
if (TokenKindIsContextualKeyword(tt)) {
|
||||
if (tt == TOK_YIELD) {
|
||||
if (yieldHandling == YieldIsKeyword || versionNumber() >= JSVERSION_1_7) {
|
||||
if (yieldHandling == YieldIsKeyword) {
|
||||
errorAt(offset, JSMSG_RESERVED_ID, "yield");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,10 +42,8 @@ reserved.forEach(ident => {
|
||||
});
|
||||
|
||||
var strictIdentifiers = [
|
||||
// XXX: see bug 1032150. Once fixed, please uncomment these values and
|
||||
// remove the assertions below
|
||||
//'yield',
|
||||
//'let',
|
||||
'yield',
|
||||
'let',
|
||||
'eval',
|
||||
'arguments',
|
||||
'implements',
|
||||
@@ -56,8 +54,6 @@ var strictIdentifiers = [
|
||||
'public',
|
||||
'static'
|
||||
];
|
||||
assertThrowsInstanceOf(() => new Function('[...yield] = []'), SyntaxError);
|
||||
assertThrowsInstanceOf(() => new Function('"use strict"; [...let] = []'), SyntaxError);
|
||||
|
||||
strictIdentifiers.forEach(ident =>
|
||||
assertThrowsInstanceOf(() =>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// |jit-test| error:SyntaxError
|
||||
// |jit-test| error:ReferenceError
|
||||
try {
|
||||
eval("}");
|
||||
} catch (exc) {}
|
||||
|
||||
@@ -2,30 +2,19 @@
|
||||
|
||||
load(libdir + "asserts.js");
|
||||
|
||||
// ES6 treating yield as an identifier except in ES6 generators introduces a
|
||||
// syntax conflict with permissible JS >= 1.7 legacy generator syntax. Is
|
||||
// |yield /a/g| inside a function an attempt to convert the function into a
|
||||
// legacy generator, yielding a RegExp instance? Or does it instead read as
|
||||
// |(yield / a) / g|? Similar ambiguities exist for different textual content
|
||||
// in place of |a| -- |yield /x+17/g| or |(yield / x) + 17 / g|, and so on.
|
||||
// (And, much less importantly, is |yield /a/g| a syntax error in global code
|
||||
// as in JS >= 1.7, or is it |(yield / a) / g|.)
|
||||
//
|
||||
// For now, in JS >= 1.7, we preserve the old behavior. In all other JS we
|
||||
// conform to ES6: |yield /a/g| is a YieldExpression inside an ES6 generator,
|
||||
// and it's an IdentifierReference divided twice when not in an ES6 generator.
|
||||
// This test will need changes if we change our JS >= 1.7 parsing to be
|
||||
// ES6-compatible.
|
||||
// Parses as IDENT(yield) DIV IDENT(abc) DIV IDENT(g).
|
||||
eval(`function f1() { yield /abc/g; }`);
|
||||
|
||||
// TODO: fix yield in non-generator functions.
|
||||
// Throws a ReferenceError because no global "yield" variable is defined.
|
||||
var ex;
|
||||
try {
|
||||
eval(`function f1() { yield /abc/g; }`);
|
||||
f1();
|
||||
} catch(e) {
|
||||
ex = e;
|
||||
}
|
||||
assertEq(ex.message.includes("reserved identifier"), true);
|
||||
assertEq(ex instanceof ReferenceError, true);
|
||||
|
||||
// Parses as YIELD REGEXP(/abc/g).
|
||||
function* f2() {
|
||||
yield /abc/g;
|
||||
}
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
// |jit-test| error: SyntaxError
|
||||
function d([{ [yield]: {} } ]) f
|
||||
+1
-1
@@ -320,7 +320,6 @@ MSG_DEF(JSMSG_SELFHOSTED_METHOD_CALL, 0, JSEXN_SYNTAXERR, "self-hosted code may
|
||||
MSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME, 0, JSEXN_TYPEERR, "self-hosted code may not contain unbound name lookups")
|
||||
MSG_DEF(JSMSG_SEMI_AFTER_FOR_COND, 0, JSEXN_SYNTAXERR, "missing ; after for-loop condition")
|
||||
MSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT, 0, JSEXN_SYNTAXERR, "missing ; after for-loop initializer")
|
||||
MSG_DEF(JSMSG_SEMI_BEFORE_STMNT, 0, JSEXN_SYNTAXERR, "missing ; before statement")
|
||||
MSG_DEF(JSMSG_SOURCE_TOO_LONG, 0, JSEXN_RANGEERR, "source is too long")
|
||||
MSG_DEF(JSMSG_STMT_AFTER_RETURN, 0, JSEXN_WARN, "unreachable code after return statement")
|
||||
MSG_DEF(JSMSG_STRICT_CODE_WITH, 0, JSEXN_SYNTAXERR, "strict mode code may not contain 'with' statements")
|
||||
@@ -336,6 +335,7 @@ MSG_DEF(JSMSG_TOO_MANY_LOCALS, 0, JSEXN_SYNTAXERR, "too many local varia
|
||||
MSG_DEF(JSMSG_TOO_MANY_YIELDS, 0, JSEXN_SYNTAXERR, "too many yield expressions")
|
||||
MSG_DEF(JSMSG_TOUGH_BREAK, 0, JSEXN_SYNTAXERR, "unlabeled break must be inside loop or switch")
|
||||
MSG_DEF(JSMSG_UNEXPECTED_TOKEN, 2, JSEXN_SYNTAXERR, "expected {0}, got {1}")
|
||||
MSG_DEF(JSMSG_UNEXPECTED_TOKEN_NO_EXPECT, 1, JSEXN_SYNTAXERR, "unexpected token: {0}")
|
||||
MSG_DEF(JSMSG_UNEXPECTED_PARAMLIST_END,0, JSEXN_SYNTAXERR, "unexpected end of function parameter list")
|
||||
MSG_DEF(JSMSG_UNNAMED_CLASS_STMT, 0, JSEXN_SYNTAXERR, "class statement requires a name")
|
||||
MSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT, 0, JSEXN_SYNTAXERR, "function statement requires a name")
|
||||
|
||||
@@ -1836,6 +1836,46 @@ AC_LANG_C
|
||||
|
||||
MOZ_EXPAND_LIBS
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
dnl = Build depencency options
|
||||
dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Build dependencies)
|
||||
|
||||
if test "$GNU_CC" -a "$GNU_CXX"; then
|
||||
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
|
||||
else
|
||||
dnl Don't override this for MSVC
|
||||
if test -z "$_WIN32_MSVC"; then
|
||||
_USE_CPP_INCLUDE_FLAG=
|
||||
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
|
||||
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
|
||||
else
|
||||
echo '#include <stdio.h>' > dummy-hello.c
|
||||
changequote(,)
|
||||
dnl This output is localized, split at the first double space or colon and space.
|
||||
_CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*\\\stdio.h\)$"
|
||||
CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'`
|
||||
_CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'`
|
||||
changequote([,])
|
||||
if ! test -e "$_CL_STDIO_PATH"; then
|
||||
AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.])
|
||||
fi
|
||||
if test -z "$CL_INCLUDES_PREFIX"; then
|
||||
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
|
||||
fi
|
||||
AC_SUBST(CL_INCLUDES_PREFIX)
|
||||
rm -f dummy-hello.c
|
||||
|
||||
dnl Make sure that the build system can handle non-ASCII characters
|
||||
dnl in environment variables to prevent it from breaking silently on
|
||||
dnl non-English systems.
|
||||
NONASCII=$'\241\241'
|
||||
AC_SUBST(NONASCII)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Link js shell to system readline
|
||||
dnl ========================================================
|
||||
@@ -1970,6 +2010,7 @@ HOST_CFLAGS=`echo \
|
||||
HOST_CXXFLAGS=`echo \
|
||||
$HOST_CXXFLAGS`
|
||||
|
||||
AC_SUBST(_DEPEND_CFLAGS)
|
||||
AC_SUBST(MOZ_SYSTEM_NSPR)
|
||||
|
||||
OS_CFLAGS="$CFLAGS"
|
||||
|
||||
@@ -91,7 +91,7 @@ function test()
|
||||
var x = 1;
|
||||
var y = 1;
|
||||
code = '(x\n)-- y';
|
||||
expect = 'SyntaxError: missing ; before statement';
|
||||
expect = 'SyntaxError: unexpected token: identifier';
|
||||
|
||||
try
|
||||
{
|
||||
@@ -105,7 +105,7 @@ function test()
|
||||
reportCompare(expect, actual, summary + ': ' + code);
|
||||
|
||||
code = '(x)-- y';
|
||||
expect = 'SyntaxError: missing ; before statement';
|
||||
expect = 'SyntaxError: unexpected token: identifier';
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ function test()
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'SyntaxError: missing ; before statement';
|
||||
expect = 'SyntaxError: unexpected token: identifier';
|
||||
|
||||
var s = 'var x = function f() { \n return 42; } print(x);';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ test();
|
||||
|
||||
try
|
||||
{
|
||||
expect = "SyntaxError";
|
||||
expect = "No Error";
|
||||
eval('yield = 1;');
|
||||
actual = 'No Error';
|
||||
}
|
||||
@@ -28,7 +28,7 @@ reportCompare(expect, actual, summary + ': global: yield = 1');
|
||||
|
||||
try
|
||||
{
|
||||
expect = "SyntaxError";
|
||||
expect = "No Error";
|
||||
eval('(function(){yield = 1;})');
|
||||
actual = 'No Error';
|
||||
}
|
||||
@@ -57,7 +57,7 @@ function test()
|
||||
|
||||
try
|
||||
{
|
||||
expect = "SyntaxError";
|
||||
expect = "No Error";
|
||||
eval('function f(yield, let) { return yield+let; }');
|
||||
actual = 'No Error';
|
||||
}
|
||||
@@ -70,7 +70,7 @@ function test()
|
||||
|
||||
try
|
||||
{
|
||||
expect = "SyntaxError";
|
||||
expect = "No Error";
|
||||
eval('var yield = 1;');
|
||||
actual = 'No Error';
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ function test()
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'SyntaxError: missing ; before statement';
|
||||
expect = 'SyntaxError: unexpected token: identifier';
|
||||
try
|
||||
{
|
||||
eval('(function() { if(t) function x() foo() bar(); })');
|
||||
|
||||
@@ -1034,7 +1034,7 @@ LexicalEnvironmentObject::clone(JSContext* cx, Handle<LexicalEnvironmentObject*>
|
||||
{
|
||||
Rooted<LexicalScope*> scope(cx, &env->scope());
|
||||
RootedObject enclosing(cx, &env->enclosingEnvironment());
|
||||
Rooted<LexicalEnvironmentObject*> copy(cx, create(cx, scope, enclosing, gc::TenuredHeap));
|
||||
Rooted<LexicalEnvironmentObject*> copy(cx, create(cx, scope, enclosing, gc::DefaultHeap));
|
||||
if (!copy)
|
||||
return nullptr;
|
||||
|
||||
@@ -1052,7 +1052,7 @@ LexicalEnvironmentObject::recreate(JSContext* cx, Handle<LexicalEnvironmentObjec
|
||||
{
|
||||
Rooted<LexicalScope*> scope(cx, &env->scope());
|
||||
RootedObject enclosing(cx, &env->enclosingEnvironment());
|
||||
return create(cx, scope, enclosing, gc::TenuredHeap);
|
||||
return create(cx, scope, enclosing, gc::DefaultHeap);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -242,7 +242,7 @@ RegExpObject::create(JSContext* cx, HandleAtom source, RegExpFlag flags,
|
||||
{
|
||||
Maybe<CompileOptions> dummyOptions;
|
||||
if (!tokenStream && !options) {
|
||||
dummyOptions.emplace(cx);
|
||||
dummyOptions.emplace(cx, JSVERSION_DEFAULT);
|
||||
options = dummyOptions.ptr();
|
||||
}
|
||||
Maybe<TokenStream> dummyTokenStream;
|
||||
@@ -987,7 +987,7 @@ RegExpShared::compile(JSContext* cx, MutableHandleRegExpShared re, HandleAtom pa
|
||||
if (!re->ignoreCase() && !StringHasRegExpMetaChars(pattern))
|
||||
re->canStringMatch = true;
|
||||
|
||||
CompileOptions options(cx);
|
||||
CompileOptions options(cx, JSVERSION_DEFAULT);
|
||||
frontend::TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
|
||||
|
||||
LifoAllocScope scope(&cx->tempLifoAlloc());
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
#include "ExpandedPrincipal.h"
|
||||
#include "SystemPrincipal.h"
|
||||
|
||||
#if defined(XP_LINUX) && !defined(ANDROID)
|
||||
// For getrlimit and min/max.
|
||||
#include <algorithm>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@@ -1018,17 +1024,26 @@ XPCJSContext::Initialize(XPCJSContext* aPrimaryContext)
|
||||
// ordered by the effective categories in which they are grouped in the
|
||||
// JS_SetNativeStackQuota call (which predates this analysis).
|
||||
//
|
||||
// (NB: These numbers may have drifted recently - see bug 938429)
|
||||
// OSX 64-bit Debug: 7MB stack, 636 stack frames => ~11.3k per stack frame
|
||||
// OSX64 Opt: 7MB stack, 2440 stack frames => ~3k per stack frame
|
||||
// The following "Stack Frames" numbers come from `chromeLimit` in
|
||||
// js/xpconnect/tests/chrome/test_bug732665.xul
|
||||
//
|
||||
// Linux 32-bit Debug: 2MB stack, 426 stack frames => ~4.8k per stack frame
|
||||
// Linux 64-bit Debug: 4MB stack, 455 stack frames => ~9.0k per stack frame
|
||||
//
|
||||
// Windows (Opt+Debug): 900K stack, 235 stack frames => ~3.4k per stack frame
|
||||
//
|
||||
// Linux 32-bit Opt: 1MB stack, 272 stack frames => ~3.8k per stack frame
|
||||
// Linux 64-bit Opt: 2MB stack, 316 stack frames => ~6.5k per stack frame
|
||||
// Platform | Build | Stack Quota | Stack Frames | Stack Frame Size
|
||||
// ------------+-------+-------------+--------------+------------------
|
||||
// OSX 64 | Opt | 7MB | 1331 | ~5.4k
|
||||
// OSX 64 | Debug | 7MB | 1202 | ~6.0k
|
||||
// ------------+-------+-------------+--------------+------------------
|
||||
// Linux 32 | Opt | 7.875MB | 2513 | ~3.2k
|
||||
// Linux 32 | Debug | 7.875MB | 2146 | ~3.8k
|
||||
// ------------+-------+-------------+--------------+------------------
|
||||
// Linux 64 | Opt | 7.875MB | 1360 | ~5.9k
|
||||
// Linux 64 | Debug | 7.875MB | 1180 | ~6.8k
|
||||
// Linux 64 | ASan | 7.875MB | 473 | ~17.0k
|
||||
// ------------+-------+-------------+--------------+------------------
|
||||
// Windows 32 | Opt | 984k | 188 | ~5.2k
|
||||
// Windows 32 | Debug | 984k | 208 | ~4.7k
|
||||
// ------------+-------+-------------+--------------+------------------
|
||||
// Windows 64 | Opt | 1.922MB | 189 | ~10.4k
|
||||
// Windows 64 | Debug | 1.922MB | 175 | ~11.2k
|
||||
//
|
||||
// We tune the trusted/untrusted quotas for each configuration to achieve our
|
||||
// invariants while attempting to minimize overhead. In contrast, our buffer
|
||||
@@ -1049,6 +1064,35 @@ XPCJSContext::Initialize(XPCJSContext* aPrimaryContext)
|
||||
// and give trusted script 180k extra. The stack is huge on mac anyway.
|
||||
const size_t kStackQuota = 7 * 1024 * 1024;
|
||||
const size_t kTrustedScriptBuffer = 180 * 1024;
|
||||
#elif defined(XP_LINUX) && !defined(ANDROID)
|
||||
// Most Linux distributions set default stack size to 8MB. Use it as the
|
||||
// maximum value.
|
||||
const size_t kStackQuotaMax = 8 * 1024 * 1024;
|
||||
# if defined(MOZ_ASAN) || defined(DEBUG)
|
||||
// Bug 803182: account for the 4x difference in the size of js::Interpret
|
||||
// between optimized and debug builds. We use 2x since the JIT part
|
||||
// doesn't increase much.
|
||||
// See the standalone MOZ_ASAN branch below for the ASan case.
|
||||
const size_t kStackQuotaMin = 2 * kDefaultStackQuota;
|
||||
# else
|
||||
const size_t kStackQuotaMin = kDefaultStackQuota;
|
||||
# endif
|
||||
// Allocate 128kB margin for the safe space.
|
||||
const size_t kStackSafeMargin = 128 * 1024;
|
||||
|
||||
struct rlimit rlim;
|
||||
const size_t kStackQuota =
|
||||
getrlimit(RLIMIT_STACK, &rlim) == 0
|
||||
? std::max(std::min(size_t(rlim.rlim_cur - kStackSafeMargin),
|
||||
kStackQuotaMax - kStackSafeMargin),
|
||||
kStackQuotaMin)
|
||||
: kStackQuotaMin;
|
||||
# if defined(MOZ_ASAN)
|
||||
// See the standalone MOZ_ASAN branch below for the ASan case.
|
||||
const size_t kTrustedScriptBuffer = 450 * 1024;
|
||||
# else
|
||||
const size_t kTrustedScriptBuffer = 180 * 1024;
|
||||
# endif
|
||||
#elif defined(MOZ_ASAN)
|
||||
// ASan requires more stack space due to red-zones, so give it double the
|
||||
// default (1MB on 32-bit, 2MB on 64-bit). ASAN stack frame measurements
|
||||
@@ -1056,30 +1100,33 @@ XPCJSContext::Initialize(XPCJSContext* aPrimaryContext)
|
||||
// ASAN builds have roughly thrice the stack overhead as normal builds.
|
||||
// On normal builds, the largest stack frame size we might encounter is
|
||||
// 9.0k (see above), so let's use a buffer of 9.0 * 5 * 10 = 450k.
|
||||
//
|
||||
// FIXME: Does this branch make sense for Windows and Android?
|
||||
// (See bug 1415195)
|
||||
const size_t kStackQuota = 2 * kDefaultStackQuota;
|
||||
const size_t kTrustedScriptBuffer = 450 * 1024;
|
||||
#elif defined(XP_WIN)
|
||||
// 1MB is the default stack size on Windows. We use the /STACK linker flag
|
||||
// to request a larger stack, so we determine the stack size at runtime.
|
||||
// 1MB is the default stack size on Windows. We use the -STACK linker flag
|
||||
// (see WIN32_EXE_LDFLAGS in config/config.mk) to request a larger stack,
|
||||
// so we determine the stack size at runtime.
|
||||
const size_t kStackQuota = GetWindowsStackSize();
|
||||
const size_t kTrustedScriptBuffer = (sizeof(size_t) == 8) ? 180 * 1024 //win64
|
||||
: 120 * 1024; //win32
|
||||
// The following two configurations are linux-only. Given the numbers above,
|
||||
// we use 50k and 100k trusted buffers on 32-bit and 64-bit respectively.
|
||||
#elif defined(ANDROID)
|
||||
// Android appears to have 1MB stacks. Allow the use of 3/4 of that size
|
||||
// (768KB on 32-bit), since otherwise we can crash with a stack overflow
|
||||
// when nearing the 1MB limit.
|
||||
const size_t kStackQuota = kDefaultStackQuota + kDefaultStackQuota / 2;
|
||||
const size_t kTrustedScriptBuffer = sizeof(size_t) * 12800;
|
||||
#elif defined(DEBUG)
|
||||
// Bug 803182: account for the 4x difference in the size of js::Interpret
|
||||
// between optimized and debug builds.
|
||||
// XXXbholley - Then why do we only account for 2x of difference?
|
||||
const size_t kStackQuota = 2 * kDefaultStackQuota;
|
||||
const size_t kTrustedScriptBuffer = sizeof(size_t) * 12800;
|
||||
#else
|
||||
// Catch-all configuration for other environments.
|
||||
# if defined(DEBUG)
|
||||
const size_t kStackQuota = 2 * kDefaultStackQuota;
|
||||
# else
|
||||
const size_t kStackQuota = kDefaultStackQuota;
|
||||
# endif
|
||||
// Given the numbers above, we use 50k and 100k trusted buffers on 32-bit
|
||||
// and 64-bit respectively.
|
||||
const size_t kTrustedScriptBuffer = sizeof(size_t) * 12800;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, uint32_t versio
|
||||
, mAttemptingEarlyData(attemptingEarlyData)
|
||||
, mOriginFrameActivated(false)
|
||||
, mTlsHandshakeFinished(false)
|
||||
, mFlushOKAddStream(false)
|
||||
, mFlushOKReadSegments(false)
|
||||
{
|
||||
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
|
||||
|
||||
@@ -384,6 +386,13 @@ Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction,
|
||||
{
|
||||
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mFlushOKAddStream);
|
||||
mFlushOKAddStream = true;
|
||||
auto cleanup = MakeScopeExit([&] () {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mFlushOKAddStream);
|
||||
mFlushOKAddStream = false;
|
||||
});
|
||||
|
||||
// integrity check
|
||||
if (mStreamTransactionHash.Get(aHttpTransaction)) {
|
||||
LOG3((" New transaction already present\n"));
|
||||
@@ -542,6 +551,24 @@ Http2Session::RealignOutputQueue()
|
||||
mOutputQueueSent = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Http2Session::MaybeFlushOutputQueue()
|
||||
{
|
||||
// Only try to flush the output queue if we know any mSegmentReader that's set
|
||||
// is properly set through the right channels. Otherwise, just set our write
|
||||
// callbacks so the connection can call in with a proper segment reader that
|
||||
// we'll be sure we can write to.
|
||||
// See bug 1402014 comment 6
|
||||
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
|
||||
LOG3(("Http2Session::MaybeFlushOutputQueue mFlushOKAddStream=%d, "
|
||||
"mFlushOKReadSegments=%d", mFlushOKAddStream, mFlushOKReadSegments));
|
||||
if (mFlushOKAddStream || mFlushOKReadSegments) {
|
||||
FlushOutputQueue();
|
||||
} else {
|
||||
SetWriteCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Http2Session::FlushOutputQueue()
|
||||
{
|
||||
@@ -794,7 +821,7 @@ Http2Session::GeneratePing(bool isAck)
|
||||
}
|
||||
|
||||
LogIO(this, nullptr, "Generate Ping", packet, kFrameHeaderBytes + 8);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -808,7 +835,7 @@ Http2Session::GenerateSettingsAck()
|
||||
mOutputQueueUsed += kFrameHeaderBytes;
|
||||
CreateFrameHeader(packet, 0, FRAME_TYPE_SETTINGS, kFlag_ACK, 0);
|
||||
LogIO(this, nullptr, "Generate Settings ACK", packet, kFrameHeaderBytes);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -821,7 +848,7 @@ Http2Session::GeneratePriority(uint32_t aID, uint8_t aPriorityWeight)
|
||||
char *packet = CreatePriorityFrame(aID, 0, aPriorityWeight);
|
||||
|
||||
LogIO(this, nullptr, "Generate Priority", packet, kFrameHeaderBytes + 5);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -848,7 +875,7 @@ Http2Session::GenerateRstStream(uint32_t aStatusCode, uint32_t aID)
|
||||
NetworkEndian::writeUint32(packet + kFrameHeaderBytes, aStatusCode);
|
||||
|
||||
LogIO(this, nullptr, "Generate Reset", packet, frameSize);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -871,7 +898,7 @@ Http2Session::GenerateGoAway(uint32_t aStatusCode)
|
||||
NetworkEndian::writeUint32(packet + frameSize - 4, aStatusCode);
|
||||
|
||||
LogIO(this, nullptr, "Generate GoAway", packet, frameSize);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
// The Hello is comprised of
|
||||
@@ -993,7 +1020,7 @@ Http2Session::SendHello()
|
||||
// Http2Session::OnTransportStatus. Yeah, that's right. YOU!
|
||||
}
|
||||
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1008,7 +1035,7 @@ Http2Session::SendPriorityFrame(uint32_t streamID,
|
||||
char *packet = CreatePriorityFrame(streamID, dependsOn, weight);
|
||||
|
||||
LogIO(this, nullptr, "SendPriorityFrame", packet, kFrameHeaderBytes + 5);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -2745,6 +2772,13 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||
MOZ_ASSERT(!mSegmentReader || !reader || (mSegmentReader == reader),
|
||||
"Inconsistent Write Function Callback");
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mFlushOKReadSegments);
|
||||
mFlushOKReadSegments = true;
|
||||
auto cleanup = MakeScopeExit([&] () {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mFlushOKReadSegments);
|
||||
mFlushOKReadSegments = false;
|
||||
});
|
||||
|
||||
nsresult rv = ConfirmTLSProfile();
|
||||
if (NS_FAILED(rv)) {
|
||||
if (mGoAwayReason == INADEQUATE_SECURITY) {
|
||||
@@ -2755,8 +2789,9 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (reader)
|
||||
mSegmentReader = reader;
|
||||
if (reader) {
|
||||
SetSegmentReader(reader);
|
||||
}
|
||||
|
||||
*countRead = 0;
|
||||
|
||||
@@ -2767,7 +2802,7 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||
LOG3(("Http2Session %p could not identify a stream to write; suspending.",
|
||||
this));
|
||||
uint32_t availBeforeFlush = mOutputQueueUsed - mOutputQueueSent;
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
uint32_t availAfterFlush = mOutputQueueUsed - mOutputQueueSent;
|
||||
if (availBeforeFlush != availAfterFlush) {
|
||||
LOG3(("Http2Session %p ResumeRecv After early flush in ReadSegments", this));
|
||||
@@ -2786,7 +2821,7 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||
if (!stream->Do0RTT()) {
|
||||
LOG3(("Http2Session %p will not get early data from Http2Stream %p 0x%X",
|
||||
this, stream, stream->StreamID()));
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
SetWriteCallbacks();
|
||||
if (!mCannotDo0RTTStreams.Contains(stream)) {
|
||||
mCannotDo0RTTStreams.AppendElement(stream);
|
||||
@@ -2828,7 +2863,7 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
|
||||
// tries to flush the output queue) - SENDING_FIN_STREAM can be an example
|
||||
// of that. But we might still have old data buffered that would be good
|
||||
// to flush.
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
|
||||
// Allow new server reads - that might be data or control information
|
||||
// (e.g. window updates or http replies) that are responses to these writes
|
||||
@@ -3632,7 +3667,7 @@ Http2Session::UpdateLocalRwin(Http2Stream *stream, uint32_t bytes)
|
||||
|
||||
UpdateLocalStreamWindow(stream, bytes);
|
||||
UpdateLocalSessionWindow(bytes);
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3721,7 +3756,7 @@ Http2Session::OnReadSegment(const char *buf,
|
||||
// If we can release old queued data then we can try and write the new
|
||||
// data directly to the network without using the output queue at all
|
||||
if (mOutputQueueUsed)
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
|
||||
if (!mOutputQueueUsed && mSegmentReader) {
|
||||
// try and write directly without output queue
|
||||
@@ -3763,7 +3798,7 @@ Http2Session::OnReadSegment(const char *buf,
|
||||
mOutputQueueUsed += count;
|
||||
*countRead = count;
|
||||
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -3772,7 +3807,7 @@ nsresult
|
||||
Http2Session::CommitToSegmentSize(uint32_t count, bool forceCommitment)
|
||||
{
|
||||
if (mOutputQueueUsed && !mAttemptingEarlyData)
|
||||
FlushOutputQueue();
|
||||
MaybeFlushOutputQueue();
|
||||
|
||||
// would there be enough room to buffer this if needed?
|
||||
if ((mOutputQueueUsed + count) <= (mOutputQueueSize - kQueueReserved))
|
||||
@@ -4549,5 +4584,18 @@ Http2Session::TopLevelOuterContentWindowIdChanged(uint64_t windowId)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Http2Session::SetSegmentReader(nsAHttpSegmentReader *reader)
|
||||
{
|
||||
LOG3(("Http2Session::SetSegmentReader this=%p mClosed=%d mSegmentReader=%p reader=%p",
|
||||
this, mClosed, mSegmentReader, reader));
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mSegmentReader || reader == mSegmentReader);
|
||||
if (mClosed) {
|
||||
mSegmentReader = nullptr;
|
||||
} else {
|
||||
mSegmentReader = reader;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
virtual MOZ_MUST_USE nsresult CommitToSegmentSize(uint32_t size,
|
||||
bool forceCommitment) override;
|
||||
MOZ_MUST_USE nsresult BufferOutput(const char *, uint32_t, uint32_t *);
|
||||
void FlushOutputQueue();
|
||||
void MaybeFlushOutputQueue();
|
||||
uint32_t AmountOfOutputBuffered() { return mOutputQueueUsed - mOutputQueueSent; }
|
||||
|
||||
uint32_t GetServerInitialStreamWindow() { return mServerInitialStreamWindow; }
|
||||
@@ -563,6 +563,12 @@ private:
|
||||
// We should propagate this events to the first nsHttpTransaction.
|
||||
RefPtr<nsHttpTransaction> mFirstHttpTransaction;
|
||||
bool mTlsHandshakeFinished;
|
||||
|
||||
void SetSegmentReader(nsAHttpSegmentReader *);
|
||||
void FlushOutputQueue();
|
||||
bool mFlushOKAddStream;
|
||||
bool mFlushOKReadSegments;
|
||||
|
||||
private:
|
||||
/// connect tunnels
|
||||
void DispatchOnTunnel(nsAHttpTransaction *, nsIInterfaceRequestor *);
|
||||
|
||||
@@ -958,7 +958,7 @@ Http2Stream::TransmitFrame(const char *buf,
|
||||
}
|
||||
|
||||
if (!mAttempting0RTT) {
|
||||
mSession->FlushOutputQueue();
|
||||
mSession->MaybeFlushOutputQueue();
|
||||
}
|
||||
|
||||
// calling this will trigger waiting_for if mRequestBodyLenRemaining is 0
|
||||
|
||||
@@ -4124,6 +4124,48 @@ if test "$COMPILE_ENVIRONMENT"; then
|
||||
MOZ_EXPAND_LIBS
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
dnl = Build depencency options
|
||||
dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Build dependencies)
|
||||
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
if test "$GNU_CC" -a "$GNU_CXX"; then
|
||||
_DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
|
||||
else
|
||||
dnl Don't override this for MSVC
|
||||
if test -z "$_WIN32_MSVC"; then
|
||||
_USE_CPP_INCLUDE_FLAG=
|
||||
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
|
||||
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
|
||||
else
|
||||
echo '#include <stdio.h>' > dummy-hello.c
|
||||
changequote(,)
|
||||
dnl This output is localized, split at the first double space or colon and space.
|
||||
_CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*\\\stdio.h\)$"
|
||||
CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'`
|
||||
_CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'`
|
||||
changequote([,])
|
||||
if ! test -e "$_CL_STDIO_PATH"; then
|
||||
AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.])
|
||||
fi
|
||||
if test -z "$CL_INCLUDES_PREFIX"; then
|
||||
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
|
||||
fi
|
||||
AC_SUBST(CL_INCLUDES_PREFIX)
|
||||
rm -f dummy-hello.c
|
||||
|
||||
dnl Make sure that the build system can handle non-ASCII characters
|
||||
dnl in environment variables to prevent it from breaking silently on
|
||||
dnl non-English systems.
|
||||
NONASCII=$'\241\241'
|
||||
AC_SUBST(NONASCII)
|
||||
fi
|
||||
fi
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
dnl = Static Build Options
|
||||
@@ -4733,6 +4775,7 @@ HOST_CFLAGS=`echo \
|
||||
HOST_CXXFLAGS=`echo \
|
||||
$HOST_CXXFLAGS`
|
||||
|
||||
AC_SUBST(_DEPEND_CFLAGS)
|
||||
AC_SUBST(MOZ_SYSTEM_JPEG)
|
||||
AC_SUBST(MOZ_SYSTEM_PNG)
|
||||
AC_SUBST(MOZ_SYSTEM_BZ2)
|
||||
|
||||
@@ -135,6 +135,7 @@ DEFAULTS = dict(
|
||||
'privacy.trackingprotection.pbmode.enabled': False,
|
||||
'browser.search.isUS': True,
|
||||
'browser.search.countryCode': 'US',
|
||||
'browser.search.geoip.url': '',
|
||||
'browser.urlbar.userMadeSearchSuggestionsChoice': True,
|
||||
'extensions.update.url':
|
||||
'http://127.0.0.1/extensions-dummy/updateURL',
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
[adopted-callback.html]
|
||||
type: testharness
|
||||
prefs: [dom.webcomponents.enabled:true]
|
||||
[Inserting the shadow host of a custom element into the document of the template elements must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into the document of the template elements must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into a new document must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into a new document must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into a cloned document must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into a cloned document must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into a document created by createHTMLDocument must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into a document created by createHTMLDocument must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into an HTML document created by createDocument must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into an HTML document created by createDocument must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into the document of an iframe must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into the document of an iframe must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Inserting the shadow host of a custom element into an HTML document fetched by XHR must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the shadow host of a custom element from the owner document into an HTML document fetched by XHR must enqueue and invoke adoptedCallback]
|
||||
expected: FAIL
|
||||
|
||||
@@ -577,7 +577,7 @@ add_task(function* format_errors() {
|
||||
eval("javascript syntax error");
|
||||
} catch (e) {
|
||||
str = pFormat.format(e);
|
||||
do_check_true(str.includes("SyntaxError: missing ;"));
|
||||
do_check_true(str.includes("SyntaxError: unexpected token"));
|
||||
// Make sure we identified it as an Error and formatted the error location as
|
||||
// lineNumber:columnNumber.
|
||||
do_check_true(str.includes(":1:11)"));
|
||||
|
||||
Reference in new issue
Block a user