From 3d2c220651efc9c5d323506888373447dc4767e7 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Mon, 9 Jun 2014 19:09:51 +0100 Subject: [PATCH 01/23] Bug 1022002 - make cloneInto create functions that clone their arguments, r=bholley --- js/xpconnect/src/XPCComponents.cpp | 2 +- js/xpconnect/tests/chrome/test_cloneInto.xul | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index abb8888cecb..0f12641d1eb 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -3531,7 +3531,7 @@ CloneIntoReadStructuredClone(JSContext *cx, if (!JS_WrapObject(cx, &obj)) return nullptr; - if (!xpc::NewFunctionForwarder(cx, obj, false, &functionValue)) + if (!xpc::NewFunctionForwarder(cx, obj, true, &functionValue)) return nullptr; return &functionValue.toObject(); diff --git a/js/xpconnect/tests/chrome/test_cloneInto.xul b/js/xpconnect/tests/chrome/test_cloneInto.xul index bb2bed90805..7a59d8c2f5e 100644 --- a/js/xpconnect/tests/chrome/test_cloneInto.xul +++ b/js/xpconnect/tests/chrome/test_cloneInto.xul @@ -161,8 +161,14 @@ 'CloneInto should only work on less privileged target scopes.'); } - var test = { a: function() { return 42; } } + var test = { a: function() { return 42; } }; cloneAndTestWithFunctions(test); + + // Check that we're cloning input to functions: + test = { a: function(obj) { return obj; } }; + var clonedTest = Cu.cloneInto(test, sandbox, {cloneFunctions: true}); + var testInput = {}; + isnot(clonedTest.a(testInput), testInput, "Objects should not be identical"); ]]> From 8ea831468357f6eb1fde5a5905758d6c1af471b5 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Tue, 10 Jun 2014 16:02:45 +0800 Subject: [PATCH 02/23] Bug 999323: use an extra thread to free stack of a exit thread in Nuwa. r=cyu,r=khuey --- mozglue/build/Nuwa.cpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/mozglue/build/Nuwa.cpp b/mozglue/build/Nuwa.cpp index 2c605221497..35113b57d14 100644 --- a/mozglue/build/Nuwa.cpp +++ b/mozglue/build/Nuwa.cpp @@ -548,16 +548,45 @@ thread_info_cleanup(void *arg) { thread_info_t *tinfo = (thread_info_t *)arg; pthread_attr_destroy(&tinfo->threadAttr); + uintptr_t pageGuard = ceilToPage((uintptr_t)tinfo->stk); + mprotect((void*)pageGuard, getPageSize(), PROT_READ | PROT_WRITE); + free(tinfo->stk); + REAL(pthread_mutex_lock)(&sThreadCountLock); /* unlink tinfo from sAllThreads */ tinfo->remove(); + pthread_mutex_unlock(&sThreadCountLock); + // while sThreadCountLock is held, since delete calls wrapped functions + // which try to lock sThreadCountLock. This results in deadlock. And we + // need to delete |tinfo| before decreasing sThreadCount, so Nuwa won't + // get ready before tinfo is cleaned. + delete tinfo; + + REAL(pthread_mutex_lock)(&sThreadCountLock); sThreadCount--; pthread_cond_signal(&sThreadChangeCond); pthread_mutex_unlock(&sThreadCountLock); +} - free(tinfo->stk); - delete tinfo; +static void* +cleaner_thread(void *arg) { + thread_info_t *tinfo = (thread_info_t *)arg; + pthread_t *thread = sIsNuwaProcess ? &tinfo->origThreadID + : &tinfo->recreatedThreadID; + // Wait until target thread end. + while (!pthread_kill(*thread, 0)) { + sched_yield(); + } + thread_info_cleanup(tinfo); + return nullptr; +} + +static void +thread_cleanup(void *arg) { + pthread_t thread; + REAL(pthread_create)(&thread, nullptr, &cleaner_thread, arg); + pthread_detach(thread); } static void * @@ -573,7 +602,7 @@ _thread_create_startup(void *arg) { tinfo->origThreadID = REAL(pthread_self)(); tinfo->origNativeThreadID = gettid(); - pthread_cleanup_push(thread_info_cleanup, tinfo); + pthread_cleanup_push(thread_cleanup, tinfo); r = tinfo->startupFunc(tinfo->startupArg); From 63432aedaaf64ab7af15035b4cb37bade3cb198c Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 9 Jun 2014 11:12:06 -0400 Subject: [PATCH 03/23] Bug 1022684 - add -Wno-unused-local-typedefs to various bits of crashreporter building; r=mshal --- toolkit/crashreporter/client/moz.build | 2 ++ toolkit/crashreporter/crashreporter.mozbuild | 15 +++++++++++++++ .../src/client/linux/crash_generation/moz.build | 2 ++ .../src/client/linux/handler/moz.build | 1 + .../src/client/linux/minidump_writer/moz.build | 2 ++ .../google-breakpad/src/common/moz.build | 2 ++ .../google-breakpad/src/processor/moz.build | 1 + toolkit/crashreporter/moz.build | 10 +--------- toolkit/crashreporter/test/moz.build | 1 + 9 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 toolkit/crashreporter/crashreporter.mozbuild diff --git a/toolkit/crashreporter/client/moz.build b/toolkit/crashreporter/client/moz.build index e21a319ff1c..6728e2dba38 100644 --- a/toolkit/crashreporter/client/moz.build +++ b/toolkit/crashreporter/client/moz.build @@ -49,3 +49,5 @@ RCINCLUDE = 'crashreporter.rc' # Don't use the STL wrappers in the crashreporter clients; they don't # link with -lmozalloc, and it really doesn't matter here anyway. DISABLE_STL_WRAPPING = True + +include('/toolkit/crashreporter/crashreporter.mozbuild') diff --git a/toolkit/crashreporter/crashreporter.mozbuild b/toolkit/crashreporter/crashreporter.mozbuild new file mode 100644 index 00000000000..36609da245f --- /dev/null +++ b/toolkit/crashreporter/crashreporter.mozbuild @@ -0,0 +1,15 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +# Suppress warnings in third-party code. +if CONFIG['_MSC_VER']: + CXXFLAGS += [ + '-wd4005', # macro redefinition + ] +elif CONFIG['GNU_CXX']: + CXXFLAGS += [ + '-Wno-unused-local-typedefs', + ] diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build index 07f735408b1..7d74bacac4a 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build @@ -19,3 +19,5 @@ if CONFIG['OS_TARGET'] == 'Android': LOCAL_INCLUDES += [ '/toolkit/crashreporter/google-breakpad/src/common/android/include', ] + +include('/toolkit/crashreporter/crashreporter.mozbuild') diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build index c9c13b8f7e7..b7d6dfeb24e 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build @@ -26,3 +26,4 @@ LOCAL_INCLUDES += [ '/toolkit/crashreporter/google-breakpad/src', ] +include('/toolkit/crashreporter/crashreporter.mozbuild') diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build index a7e2bcb1bec..7a9dffdf9fb 100644 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build @@ -25,3 +25,5 @@ if CONFIG['OS_TARGET'] == 'Android': LOCAL_INCLUDES += [ '/toolkit/crashreporter/google-breakpad/src/common/android/include', ] + +include('/toolkit/crashreporter/crashreporter.mozbuild') diff --git a/toolkit/crashreporter/google-breakpad/src/common/moz.build b/toolkit/crashreporter/google-breakpad/src/common/moz.build index 518faf63841..17150b17fb3 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build @@ -88,6 +88,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': if CONFIG['OS_TARGET'] == 'Android': DEFINES['NO_STABS_SUPPORT'] = True +include('/toolkit/crashreporter/crashreporter.mozbuild') + LOCAL_INCLUDES += [ '..', ] diff --git a/toolkit/crashreporter/google-breakpad/src/processor/moz.build b/toolkit/crashreporter/google-breakpad/src/processor/moz.build index a31fbc9e59c..8aab9efbea8 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build +++ b/toolkit/crashreporter/google-breakpad/src/processor/moz.build @@ -28,3 +28,4 @@ LOCAL_INCLUDES += [ '../..', ] +include('/toolkit/crashreporter/crashreporter.mozbuild') diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build index 59296dd0375..5b45c71347c 100644 --- a/toolkit/crashreporter/moz.build +++ b/toolkit/crashreporter/moz.build @@ -103,14 +103,6 @@ LOCAL_INCLUDES += [ 'google-breakpad/src', ] -# Suppress warnings in third-party code. -if CONFIG['_MSC_VER']: - CXXFLAGS += [ - '-wd4005', # macro redefinition - ] -elif CONFIG['GNU_CXX']: - CXXFLAGS += [ - '-Wno-unused-local-typedefs', - ] +include('/toolkit/crashreporter/crashreporter.mozbuild') FAIL_ON_WARNINGS = True diff --git a/toolkit/crashreporter/test/moz.build b/toolkit/crashreporter/test/moz.build index 1034ea6ef55..16a6fca7b5a 100644 --- a/toolkit/crashreporter/test/moz.build +++ b/toolkit/crashreporter/test/moz.build @@ -37,3 +37,4 @@ LOCAL_INCLUDES += [ '../google-breakpad/src/', ] +include('/toolkit/crashreporter/crashreporter.mozbuild') From 57715b2af58faab682030a4d7566e5472f9cd321 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 10 Jun 2014 10:49:48 +0200 Subject: [PATCH 04/23] Bug 1022372. Listen for "load" instead of "DOMContentLoaded" in webapprt chrome tests. r=myk --- webapprt/test/chrome/head.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapprt/test/chrome/head.js b/webapprt/test/chrome/head.js index 48f0f9c771e..e91af6ba2fa 100644 --- a/webapprt/test/chrome/head.js +++ b/webapprt/test/chrome/head.js @@ -27,10 +27,10 @@ function loadWebapp(manifest, parameters, onLoad) { becomeWebapp(url.spec, parameters, function onBecome() { function onLoadApp() { - gAppBrowser.removeEventListener("DOMContentLoaded", onLoadApp, true); + gAppBrowser.removeEventListener("load", onLoadApp, true); onLoad(); } - gAppBrowser.addEventListener("DOMContentLoaded", onLoadApp, true); + gAppBrowser.addEventListener("load", onLoadApp, true); gAppBrowser.setAttribute("src", WebappRT.launchURI); }); From cd2fe75c305ab2d154bcb18b0d2ae15079703342 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Jun 2014 11:19:22 +0200 Subject: [PATCH 05/23] Bug 1021714 part 1 - Eliminate "goto syntax" in date_parseString. r=njn --HG-- extra : rebase_source : 7a5d30ad5346e8b06e04cad82f0637ad5ee7dfbf --- js/src/jsdate.cpp | 71 +++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 2eefd99b504..a1225065091 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -936,7 +936,8 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) s = str->chars(); limit = str->length(); if (limit == 0) - goto syntax; + return false; + while (i < limit) { c = s[i]; i++; @@ -985,20 +986,20 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) if (prevc == '+') /* plus means east of GMT */ n = -n; if (tzoffset != 0 && tzoffset != -1) - goto syntax; + return false; tzoffset = n; } else if (prevc == '/' && mon >= 0 && mday >= 0 && year < 0) { if (c <= ' ' || c == ',' || c == '/' || i >= limit) year = n; else - goto syntax; + return false; } else if (c == ':') { if (hour < 0) hour = /*byte*/ n; else if (min < 0) min = /*byte*/ n; else - goto syntax; + return false; } else if (c == '/') { /* until it is determined that mon is the actual month, keep it as 1-based rather than 0-based */ @@ -1007,9 +1008,9 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) else if (mday < 0) mday = /*byte*/ n; else - goto syntax; + return false; } else if (i < limit && c != ',' && c > ' ' && c != '-' && c != '(') { - goto syntax; + return false; } else if (seenplusminus && n < 60) { /* handle GMT-3:30 */ if (tzoffset < 0) tzoffset -= n; @@ -1026,7 +1027,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } else if (mon >= 0 && mday >= 0 && year < 0) { year = n; } else { - goto syntax; + return false; } prevc = 0; } else if (c == '/' || c == ':' || c == '+' || c == '-') { @@ -1041,8 +1042,8 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) i++; } if (i <= st + 1) - goto syntax; - for (k = ArrayLength(wtb); --k >= 0;) + return false; + for (k = ArrayLength(wtb); --k >= 0;) { if (date_regionMatches(wtb[k], 0, s, st, i-st, 1)) { int action = ttb[k]; if (action != 0) { @@ -1052,21 +1053,19 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) * 12:30, instead of blindly adding 12 if PM. */ JS_ASSERT(action == -1 || action == -2); - if (hour > 12 || hour < 0) { - goto syntax; - } else { - if (action == -1 && hour == 12) { /* am */ - hour = 0; - } else if (action == -2 && hour != 12) { /* pm */ - hour += 12; - } - } + if (hour > 12 || hour < 0) + return false; + + if (action == -1 && hour == 12) /* am */ + hour = 0; + else if (action == -2 && hour != 12) /* pm */ + hour += 12; } else if (action <= 13) { /* month! */ /* Adjust mon to be 1-based until the final values for mon, mday and year are adjusted below */ - if (seenmonthname) { - goto syntax; - } + if (seenmonthname) + return false; + seenmonthname = true; temp = /*byte*/ (action - 2) + 1; @@ -1079,7 +1078,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) year = mon; mon = temp; } else { - goto syntax; + return false; } } else { tzoffset = action - 10000; @@ -1087,13 +1086,16 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } break; } + } if (k < 0) - goto syntax; + return false; prevc = 0; } } + if (year < 0 || mon < 0 || mday < 0) - goto syntax; + return false; + /* Case 1. The input string contains an English month name. The form of the string can be month f l, or f month l, or @@ -1121,9 +1123,9 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) ii. If m >= 70, the date is invalid. */ if (seenmonthname) { - if ((mday >= 70 && year >= 70) || (mday < 70 && year < 70)) { - goto syntax; - } + if ((mday >= 70 && year >= 70) || (mday < 70 && year < 70)) + return false; + if (mday > year) { temp = year; year = mday; @@ -1143,7 +1145,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) mon = mday; mday = temp; } else { - goto syntax; + return false; } } else { /* (c) year/month/day */ if (mday < 70) { @@ -1152,9 +1154,10 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) mon = mday; mday = temp; } else { - goto syntax; + return false; } } + mon -= 1; /* convert month to 0-based */ if (sec < 0) sec = 0; @@ -1165,19 +1168,13 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) msec = date_msecFromDate(year, mon, mday, hour, min, sec, 0); - if (tzoffset == -1) { /* no time zone specified, have to use local */ + if (tzoffset == -1) /* no time zone specified, have to use local */ msec = UTC(msec, dtInfo); - } else { + else msec += tzoffset * msPerMinute; - } *result = msec; return true; - -syntax: - /* syntax error */ - *result = 0; - return false; } static bool From d27e9832728cb5ad4811e30f4bf2c020a8def9ec Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Jun 2014 11:19:27 +0200 Subject: [PATCH 06/23] Bug 1021714 part 2 - Move some variable declarations. r=njn --HG-- extra : rebase_source : 74dde3ee49f8397f6d6ef6b7bc0851d0bcea643f --- js/src/jsdate.cpp | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index a1225065091..226be3cc23f 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -911,35 +911,30 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) static bool date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) { - double msec; + if (date_parseISOString(str, result, dtInfo)) + return true; + + const jschar *s = str->chars(); + size_t limit = str->length(); + if (limit == 0) + return false; - const jschar *s; - size_t limit; - size_t i = 0; int year = -1; int mon = -1; int mday = -1; int hour = -1; int min = -1; int sec = -1; - int c = -1; - int n = -1; int tzoffset = -1; + int prevc = 0; + bool seenplusminus = false; - int temp; bool seenmonthname = false; - if (date_parseISOString(str, result, dtInfo)) - return true; - - s = str->chars(); - limit = str->length(); - if (limit == 0) - return false; - + size_t i = 0; while (i < limit) { - c = s[i]; + int c = s[i]; i++; if (c <= ' ' || c == ',' || c == '-') { if (c == '-' && '0' <= s[i] && s[i] <= '9') { @@ -960,7 +955,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) continue; } if ('0' <= c && c <= '9') { - n = c - '0'; + int n = c - '0'; while (i < limit && '0' <= (c = s[i]) && c <= '9') { n = n * 10 + c - '0'; i++; @@ -1067,7 +1062,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; seenmonthname = true; - temp = /*byte*/ (action - 2) + 1; + int temp = /*byte*/ (action - 2) + 1; if (mon < 0) { mon = temp; @@ -1127,7 +1122,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; if (mday > year) { - temp = year; + int temp = year; year = mday; mday = temp; } @@ -1140,7 +1135,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } } else if (mon < 100) { /* (b) year/month/day */ if (mday < 70) { - temp = year; + int temp = year; year = mon + 1900; mon = mday; mday = temp; @@ -1149,7 +1144,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } } else { /* (c) year/month/day */ if (mday < 70) { - temp = year; + int temp = year; year = mon; mon = mday; mday = temp; @@ -1166,7 +1161,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) if (hour < 0) hour = 0; - msec = date_msecFromDate(year, mon, mday, hour, min, sec, 0); + double msec = date_msecFromDate(year, mon, mday, hour, min, sec, 0); if (tzoffset == -1) /* no time zone specified, have to use local */ msec = UTC(msec, dtInfo); From d5ca51d7c53c943ae699d5f65d0bd31c69d89a7a Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Jun 2014 11:19:27 +0200 Subject: [PATCH 07/23] Bug 1021714 part 3 - More date_parseString cleanup. r=njn --HG-- extra : rebase_source : 18254fb8d0296c82ad7ca1fd79166fbbaeda1fc0 --- js/src/jsdate.cpp | 126 +++++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 57 deletions(-) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 226be3cc23f..336e7502d60 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -925,21 +925,20 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) int hour = -1; int min = -1; int sec = -1; - int tzoffset = -1; + int tzOffset = -1; int prevc = 0; - bool seenplusminus = false; - bool seenmonthname = false; + bool seenPlusMinus = false; + bool seenMonthName = false; size_t i = 0; while (i < limit) { int c = s[i]; i++; if (c <= ' ' || c == ',' || c == '-') { - if (c == '-' && '0' <= s[i] && s[i] <= '9') { - prevc = c; - } + if (c == '-' && '0' <= s[i] && s[i] <= '9') + prevc = c; continue; } if (c == '(') { /* comments) */ @@ -947,10 +946,12 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) while (i < limit) { c = s[i]; i++; - if (c == '(') depth++; - else if (c == ')') + if (c == '(') { + depth++; + } else if (c == ')') { if (--depth <= 0) break; + } } continue; } @@ -961,28 +962,31 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) i++; } - /* allow TZA before the year, so - * 'Wed Nov 05 21:49:11 GMT-0800 1997' - * works */ - - /* uses of seenplusminus allow : in TZA, so Java - * no-timezone style of GMT+4:30 works + /* + * Allow TZA before the year, so 'Wed Nov 05 21:49:11 GMT-0800 1997' + * works. + * + * Uses of seenPlusMinus allow ':' in TZA, so Java no-timezone style + * of GMT+4:30 works. */ if ((prevc == '+' || prevc == '-')/* && year>=0 */) { - /* make ':' case below change tzoffset */ - seenplusminus = true; + /* Make ':' case below change tzOffset. */ + seenPlusMinus = true; /* offset */ if (n < 24) n = n * 60; /* EG. "GMT-3" */ else n = n % 100 + n / 100 * 60; /* eg "GMT-0430" */ + if (prevc == '+') /* plus means east of GMT */ n = -n; - if (tzoffset != 0 && tzoffset != -1) + + if (tzOffset != 0 && tzOffset != -1) return false; - tzoffset = n; + + tzOffset = n; } else if (prevc == '/' && mon >= 0 && mday >= 0 && year < 0) { if (c <= ' ' || c == ',' || c == '/' || i >= limit) year = n; @@ -996,8 +1000,10 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) else return false; } else if (c == '/') { - /* until it is determined that mon is the actual - month, keep it as 1-based rather than 0-based */ + /* + * Until it is determined that mon is the actual month, keep + * it as 1-based rather than 0-based. + */ if (mon < 0) mon = /*byte*/ n; else if (mday < 0) @@ -1006,11 +1012,11 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; } else if (i < limit && c != ',' && c > ' ' && c != '-' && c != '(') { return false; - } else if (seenplusminus && n < 60) { /* handle GMT-3:30 */ - if (tzoffset < 0) - tzoffset -= n; + } else if (seenPlusMinus && n < 60) { /* handle GMT-3:30 */ + if (tzOffset < 0) + tzOffset -= n; else - tzoffset += n; + tzOffset += n; } else if (hour >= 0 && min < 0) { min = /*byte*/ n; } else if (prevc == ':' && min >= 0 && sec < 0) { @@ -1036,8 +1042,10 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) break; i++; } + if (i <= st + 1) return false; + for (k = ArrayLength(wtb); --k >= 0;) { if (date_regionMatches(wtb[k], 0, s, st, i-st, 1)) { int action = ttb[k]; @@ -1056,12 +1064,14 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) else if (action == -2 && hour != 12) /* pm */ hour += 12; } else if (action <= 13) { /* month! */ - /* Adjust mon to be 1-based until the final values - for mon, mday and year are adjusted below */ - if (seenmonthname) + /* + * Adjust mon to be 1-based until the final values + * for mon, mday and year are adjusted below. + */ + if (seenMonthName) return false; - seenmonthname = true; + seenMonthName = true; int temp = /*byte*/ (action - 2) + 1; if (mon < 0) { @@ -1076,14 +1086,16 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; } } else { - tzoffset = action - 10000; + tzOffset = action - 10000; } } break; } } + if (k < 0) return false; + prevc = 0; } } @@ -1092,32 +1104,32 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; /* - Case 1. The input string contains an English month name. - The form of the string can be month f l, or f month l, or - f l month which each evaluate to the same date. - If f and l are both greater than or equal to 70, or - both less than 70, the date is invalid. - The year is taken to be the greater of the values f, l. - If the year is greater than or equal to 70 and less than 100, - it is considered to be the number of years after 1900. - Case 2. The input string is of the form "f/m/l" where f, m and l are - integers, e.g. 7/16/45. - Adjust the mon, mday and year values to achieve 100% MSIE - compatibility. - a. If 0 <= f < 70, f/m/l is interpreted as month/day/year. - i. If year < 100, it is the number of years after 1900 - ii. If year >= 100, it is the number of years after 0. - b. If 70 <= f < 100 - i. If m < 70, f/m/l is interpreted as - year/month/day where year is the number of years after - 1900. - ii. If m >= 70, the date is invalid. - c. If f >= 100 - i. If m < 70, f/m/l is interpreted as - year/month/day where year is the number of years after 0. - ii. If m >= 70, the date is invalid. - */ - if (seenmonthname) { + * Case 1. The input string contains an English month name. + * The form of the string can be month f l, or f month l, or + * f l month which each evaluate to the same date. + * If f and l are both greater than or equal to 70, or + * both less than 70, the date is invalid. + * The year is taken to be the greater of the values f, l. + * If the year is greater than or equal to 70 and less than 100, + * it is considered to be the number of years after 1900. + * Case 2. The input string is of the form "f/m/l" where f, m and l are + * integers, e.g. 7/16/45. + * Adjust the mon, mday and year values to achieve 100% MSIE + * compatibility. + * a. If 0 <= f < 70, f/m/l is interpreted as month/day/year. + * i. If year < 100, it is the number of years after 1900 + * ii. If year >= 100, it is the number of years after 0. + * b. If 70 <= f < 100 + * i. If m < 70, f/m/l is interpreted as + * year/month/day where year is the number of years after + * 1900. + * ii. If m >= 70, the date is invalid. + * c. If f >= 100 + * i. If m < 70, f/m/l is interpreted as + * year/month/day where year is the number of years after 0. + * ii. If m >= 70, the date is invalid. + */ + if (seenMonthName) { if ((mday >= 70 && year >= 70) || (mday < 70 && year < 70)) return false; @@ -1163,10 +1175,10 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) double msec = date_msecFromDate(year, mon, mday, hour, min, sec, 0); - if (tzoffset == -1) /* no time zone specified, have to use local */ + if (tzOffset == -1) /* no time zone specified, have to use local */ msec = UTC(msec, dtInfo); else - msec += tzoffset * msPerMinute; + msec += tzOffset * msPerMinute; *result = msec; return true; From 6779ebc7474cf946a7007b72fa7094b06378ec8e Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Jun 2014 11:19:28 +0200 Subject: [PATCH 08/23] Bug 1021714 part 4 - Some date_parseISOString cleanup. r=njn --HG-- extra : rebase_source : 4ab27793d02767c461305d43aa4863c06fbf14c9 --- js/src/jsdate.cpp | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 336e7502d60..682d3cb7166 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -772,10 +772,6 @@ DaysInMonth(int year, int month) static bool date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) { - double msec; - - const jschar *s; - size_t limit; size_t i = 0; int tzMul = 1; int dateMul = 1; @@ -792,9 +788,9 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) #define PEEK(ch) (i < limit && s[i] == ch) -#define NEED(ch) \ - JS_BEGIN_MACRO \ - if (i >= limit || s[i] != ch) { goto syntax; } else { ++i; } \ +#define NEED(ch) \ + JS_BEGIN_MACRO \ + if (i >= limit || s[i] != ch) { return false; } else { ++i; } \ JS_END_MACRO #define DONE_DATE_UNLESS(ch) \ @@ -809,11 +805,11 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) #define NEED_NDIGITS(n, field) \ JS_BEGIN_MACRO \ - if (!ndigits(n, &field, s, &i, limit)) { goto syntax; } \ + if (!ndigits(n, &field, s, &i, limit)) { return false; } \ JS_END_MACRO - s = str->chars(); - limit = str->length(); + const jschar *s = str->chars(); + size_t limit = str->length(); if (PEEK('+') || PEEK('-')) { if (PEEK('-')) @@ -840,7 +836,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) if (PEEK('.')) { ++i; if (!fractional(&frac, s, &i, limit)) - goto syntax; + return false; } } @@ -856,7 +852,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) * allow "-0700" as a time zone offset, not just "-07:00". */ if (PEEK(':')) - ++i; + ++i; NEED_NDIGITS(2, tzMin); } else { isLocalTime = true; @@ -872,36 +868,29 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) || sec > 59 || tzHour > 23 || tzMin > 59) - goto syntax; + { + return false; + } if (i != limit) - goto syntax; + return false; month -= 1; /* convert month to 0-based */ - msec = date_msecFromDate(dateMul * (double)year, month, day, - hour, min, sec, - frac * 1000.0);; + double msec = date_msecFromDate(dateMul * double(year), month, day, + hour, min, sec, frac * 1000.0); - if (isLocalTime) { + if (isLocalTime) msec = UTC(msec, dtInfo); - } else { - msec -= ((tzMul) * ((tzHour * msPerHour) - + (tzMin * msPerMinute))); - } + else + msec -= tzMul * (tzHour * msPerHour + tzMin * msPerMinute); if (msec < -8.64e15 || msec > 8.64e15) - goto syntax; + return false; *result = msec; - return true; - syntax: - /* syntax error */ - *result = 0; - return false; - #undef PEEK #undef NEED #undef DONE_UNLESS From 46df51e071734d98ad1e1abca39aa1be08ee1ed1 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Jun 2014 11:23:39 +0200 Subject: [PATCH 09/23] Bug 1021714 part 5 - More date parsing cleanup and handle Latin1 strings. r=njn --HG-- extra : rebase_source : 441b2756563065546a24ef1723a78a5a5c032aac --- js/src/jit-test/tests/latin1/date.js | 29 +++++++ js/src/jsdate.cpp | 117 ++++++++++++--------------- 2 files changed, 81 insertions(+), 65 deletions(-) create mode 100644 js/src/jit-test/tests/latin1/date.js diff --git a/js/src/jit-test/tests/latin1/date.js b/js/src/jit-test/tests/latin1/date.js new file mode 100644 index 00000000000..5b0d86e32f9 --- /dev/null +++ b/js/src/jit-test/tests/latin1/date.js @@ -0,0 +1,29 @@ +function test(s) { + var lat1 = toLatin1(s); + + var twoByte = "\u1200" + lat1; + twoByte.indexOf("X"); // Flatten. + twoByte = twoByte.substr(1); + + assertEq(isLatin1(lat1), true); + assertEq(isLatin1(twoByte), false); + + assertEq(Date.parse(lat1), Date.parse(twoByte)); +} + +// ISO format +test("2014-06-06"); +test("2014-06-06T08:30+01:00"); +test("T11:59Z"); + +// Non-ISO format +test("06 Jun 2014, 17:20:36"); +test("6 Jun 2014"); +test("Wed Nov 05 21:49:11 GMT-0800 1997"); +test("Jan 30 2014 2:30 PM"); + +// Invalid +test("06 Aaa 2014, 17:20:36"); +test("6 Jun 10"); +test("2014-13-06"); +test("2014-06-06T08:30+99:00"); diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 682d3cb7166..4f1bcde5f49 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -50,6 +50,8 @@ using namespace js::types; using mozilla::ArrayLength; using mozilla::IsFinite; using mozilla::IsNaN; + +using JS::AutoCheckCannotGC; using JS::GenericNaN; /* @@ -547,33 +549,20 @@ static const int ttb[] = { 10000 + 8 * 60, 10000 + 7 * 60 /* PST/PDT */ }; -/* helper for date_parse */ +template static bool -date_regionMatches(const char* s1, int s1off, const jschar* s2, int s2off, - int count, int ignoreCase) +RegionMatches(const char *s1, int s1off, const CharT *s2, int s2off, int count) { - bool result = false; - /* return true if matches, otherwise, false */ - while (count > 0 && s1[s1off] && s2[s2off]) { - if (ignoreCase) { - if (unicode::ToLowerCase(s1[s1off]) != unicode::ToLowerCase(s2[s2off])) - break; - } else { - if ((jschar)s1[s1off] != s2[s2off]) { - break; - } - } + if (unicode::ToLowerCase(s1[s1off]) != unicode::ToLowerCase(s2[s2off])) + break; + s1off++; s2off++; count--; } - if (count == 0) { - result = true; - } - - return result; + return count == 0; } /* find UTC time from given date... no 1900 correction! */ @@ -649,13 +638,13 @@ date_UTC(JSContext *cx, unsigned argc, Value *vp) * Succeed if any digits are converted. Advance *i only * as digits are consumed. */ +template static bool -digits(size_t *result, const jschar *s, size_t *i, size_t limit) +ParseDigits(size_t *result, const CharT *s, size_t *i, size_t limit) { size_t init = *i; *result = 0; - while (*i < limit && - ('0' <= s[*i] && s[*i] <= '9')) { + while (*i < limit && ('0' <= s[*i] && s[*i] <= '9')) { *result *= 10; *result += (s[*i] - '0'); ++(*i); @@ -671,14 +660,14 @@ digits(size_t *result, const jschar *s, size_t *i, size_t limit) * Succeed if any digits are converted. Advance *i only * as digits are consumed. */ +template static bool -fractional(double *result, const jschar *s, size_t *i, size_t limit) +ParseFractional(double *result, const CharT *s, size_t *i, size_t limit) { double factor = 0.1; size_t init = *i; *result = 0.0; - while (*i < limit && - ('0' <= s[*i] && s[*i] <= '9')) { + while (*i < limit && ('0' <= s[*i] && s[*i] <= '9')) { *result += (s[*i] - '0') * factor; factor *= 0.1; ++(*i); @@ -693,12 +682,13 @@ fractional(double *result, const jschar *s, size_t *i, size_t limit) * Succeed if exactly n digits are converted. Advance *i only * on success. */ +template static bool -ndigits(size_t n, size_t *result, const jschar *s, size_t* i, size_t limit) +ParseDigitsN(size_t n, size_t *result, const CharT *s, size_t *i, size_t limit) { size_t init = *i; - if (digits(result, s, i, Min(limit, init+n))) + if (ParseDigits(result, s, i, Min(limit, init + n))) return (*i - init) == n; *i = init; @@ -768,9 +758,9 @@ DaysInMonth(int year, int month) * s = one or more digits representing a decimal fraction of a second * TZD = time zone designator (Z or +hh:mm or -hh:mm or missing for local) */ - +template static bool -date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) +ParseISODate(const CharT *s, size_t length, double *result, DateTimeInfo *dtInfo) { size_t i = 0; int tzMul = 1; @@ -786,30 +776,19 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) size_t tzHour = 0; size_t tzMin = 0; -#define PEEK(ch) (i < limit && s[i] == ch) +#define PEEK(ch) (i < length && s[i] == ch) -#define NEED(ch) \ - JS_BEGIN_MACRO \ - if (i >= limit || s[i] != ch) { return false; } else { ++i; } \ - JS_END_MACRO +#define NEED(ch) \ + if (i >= length || s[i] != ch) { return false; } else { ++i; } -#define DONE_DATE_UNLESS(ch) \ - JS_BEGIN_MACRO \ - if (i >= limit || s[i] != ch) { goto done_date; } else { ++i; } \ - JS_END_MACRO +#define DONE_DATE_UNLESS(ch) \ + if (i >= length || s[i] != ch) { goto done_date; } else { ++i; } -#define DONE_UNLESS(ch) \ - JS_BEGIN_MACRO \ - if (i >= limit || s[i] != ch) { goto done; } else { ++i; } \ - JS_END_MACRO +#define DONE_UNLESS(ch) \ + if (i >= length || s[i] != ch) { goto done; } else { ++i; } -#define NEED_NDIGITS(n, field) \ - JS_BEGIN_MACRO \ - if (!ndigits(n, &field, s, &i, limit)) { return false; } \ - JS_END_MACRO - - const jschar *s = str->chars(); - size_t limit = str->length(); +#define NEED_NDIGITS(n, field) \ + if (!ParseDigitsN(n, &field, s, &i, length)) { return false; } if (PEEK('+') || PEEK('-')) { if (PEEK('-')) @@ -835,7 +814,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) NEED_NDIGITS(2, sec); if (PEEK('.')) { ++i; - if (!fractional(&frac, s, &i, limit)) + if (!ParseFractional(&frac, s, &i, length)) return false; } } @@ -872,7 +851,7 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; } - if (i != limit) + if (i != length) return false; month -= 1; /* convert month to 0-based */ @@ -897,15 +876,14 @@ date_parseISOString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) #undef NEED_NDIGITS } +template static bool -date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) +ParseDate(const CharT *s, size_t length, double *result, DateTimeInfo *dtInfo) { - if (date_parseISOString(str, result, dtInfo)) + if (ParseISODate(s, length, result, dtInfo)) return true; - const jschar *s = str->chars(); - size_t limit = str->length(); - if (limit == 0) + if (length == 0) return false; int year = -1; @@ -922,7 +900,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) bool seenMonthName = false; size_t i = 0; - while (i < limit) { + while (i < length) { int c = s[i]; i++; if (c <= ' ' || c == ',' || c == '-') { @@ -932,7 +910,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } if (c == '(') { /* comments) */ int depth = 1; - while (i < limit) { + while (i < length) { c = s[i]; i++; if (c == '(') { @@ -946,7 +924,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } if ('0' <= c && c <= '9') { int n = c - '0'; - while (i < limit && '0' <= (c = s[i]) && c <= '9') { + while (i < length && '0' <= (c = s[i]) && c <= '9') { n = n * 10 + c - '0'; i++; } @@ -977,7 +955,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) tzOffset = n; } else if (prevc == '/' && mon >= 0 && mday >= 0 && year < 0) { - if (c <= ' ' || c == ',' || c == '/' || i >= limit) + if (c <= ' ' || c == ',' || c == '/' || i >= length) year = n; else return false; @@ -999,7 +977,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) mday = /*byte*/ n; else return false; - } else if (i < limit && c != ',' && c > ' ' && c != '-' && c != '(') { + } else if (i < length && c != ',' && c > ' ' && c != '-' && c != '(') { return false; } else if (seenPlusMinus && n < 60) { /* handle GMT-3:30 */ if (tzOffset < 0) @@ -1025,7 +1003,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) } else { size_t st = i - 1; int k; - while (i < limit) { + while (i < length) { c = s[i]; if (!(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))) break; @@ -1036,7 +1014,7 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return false; for (k = ArrayLength(wtb); --k >= 0;) { - if (date_regionMatches(wtb[k], 0, s, st, i-st, 1)) { + if (RegionMatches(wtb[k], 0, s, st, i - st)) { int action = ttb[k]; if (action != 0) { if (action < 0) { @@ -1173,6 +1151,15 @@ date_parseString(JSLinearString *str, double *result, DateTimeInfo *dtInfo) return true; } +static bool +ParseDate(JSLinearString *s, double *result, DateTimeInfo *dtInfo) +{ + AutoCheckCannotGC nogc; + return s->hasLatin1Chars() + ? ParseDate(s->latin1Chars(nogc), s->length(), result, dtInfo) + : ParseDate(s->twoByteChars(nogc), s->length(), result, dtInfo); +} + static bool date_parse(JSContext *cx, unsigned argc, Value *vp) { @@ -1191,7 +1178,7 @@ date_parse(JSContext *cx, unsigned argc, Value *vp) return false; double result; - if (!date_parseString(linearStr, &result, &cx->runtime()->dateTimeInfo)) { + if (!ParseDate(linearStr, &result, &cx->runtime()->dateTimeInfo)) { args.rval().setNaN(); return true; } @@ -2974,7 +2961,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp) if (!linearStr) return false; - if (!date_parseString(linearStr, &d, &cx->runtime()->dateTimeInfo)) + if (!ParseDate(linearStr, &d, &cx->runtime()->dateTimeInfo)) d = GenericNaN(); else d = TimeClip(d); From e3da688120164b34868922de69b127e9c80c5c05 Mon Sep 17 00:00:00 2001 From: "stefanh@inbox.com" Date: Tue, 10 Jun 2014 11:45:09 +0200 Subject: [PATCH 10/23] Bug 1022912 - make -moz-mac-menutextdisable lighter and remove obsolete color from widget/tests/test_platform_colors.xul. r=mstange. --- widget/cocoa/nsLookAndFeel.mm | 2 +- widget/tests/test_platform_colors.xul | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/cocoa/nsLookAndFeel.mm b/widget/cocoa/nsLookAndFeel.mm index cfddd342939..3d3dabb94e1 100644 --- a/widget/cocoa/nsLookAndFeel.mm +++ b/widget/cocoa/nsLookAndFeel.mm @@ -245,7 +245,7 @@ nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor) aColor = NS_RGB(0xA3,0xA3,0xA3); break; case eColorID__moz_mac_menutextdisable: - aColor = NS_RGB(0x88,0x88,0x88); + aColor = NS_RGB(0x98,0x98,0x98); break; case eColorID__moz_mac_menutextselect: aColor = GetColorFromNSColor([NSColor selectedMenuItemTextColor]); diff --git a/widget/tests/test_platform_colors.xul b/widget/tests/test_platform_colors.xul index 81935971983..eeef6a241c4 100644 --- a/widget/tests/test_platform_colors.xul +++ b/widget/tests/test_platform_colors.xul @@ -71,7 +71,7 @@ var colors = { //"-moz-mac-focusring": ["rgb(83, 144, 210)", "rgb(95, 112, 130)", "rgb(63, 152, 221)", "rgb(108, 126, 141)"], "-moz-mac-menuselect": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"], "-moz-mac-menushadow": ["rgb(163, 163, 163)"], - "-moz-mac-menutextdisable": ["rgb(152, 152, 152)", "rgb(136, 136, 136)"], + "-moz-mac-menutextdisable": ["rgb(152, 152, 152)"], "-moz-mac-menutextselect": ["rgb(255, 255, 255)"], "-moz-mac-disabledtoolbartext": ["rgb(127, 127, 127)"], "-moz-mac-secondaryhighlight": ["rgb(212, 212, 212)"], From 0584d0813b11135f1c23a1e7506cb3a6cb3e739e Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 10 Jun 2014 07:20:12 -0400 Subject: [PATCH 11/23] Bug 1022348 - Use the C/C++ compilers passed in through mozconfig in order to preprocess on Windows instead of hardcoding the usage of cl; r=glandium --- build/autoconf/compiler-opts.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index 76effb442df..3ed91b916c6 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -25,8 +25,8 @@ case "$target" in *-mingw*) if test -z "$CC"; then CC=cl; fi if test -z "$CXX"; then CXX=cl; fi - if test -z "$CPP"; then CPP="cl -E -nologo"; fi - if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi + if test -z "$CPP"; then CPP="$CC -E -nologo"; fi + if test -z "$CXXCPP"; then CXXCPP="$CXX -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi if test -z "$LD"; then LD=link; fi if test -z "$AS"; then case "${target_cpu}" in From a273f7a11df4cfaa707712660fd737d609fcebbc Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 10 Jun 2014 12:53:54 +0100 Subject: [PATCH 12/23] Bug 1020041 - host limit in nsStandardURL, r=jduell, r=valentin --HG-- rename : dom/base/test/test_url_empty_port.html => dom/base/test/test_url_malformedHost.html --- content/base/src/Link.cpp | 1 - dom/base/test/mochitest.ini | 1 + dom/base/test/test_url_malformedHost.html | 48 +++++++++++++++++++++++ netwerk/base/src/nsStandardURL.cpp | 25 +++++++++++- netwerk/base/src/nsStandardURL.h | 4 ++ 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 dom/base/test/test_url_malformedHost.html diff --git a/content/base/src/Link.cpp b/content/base/src/Link.cpp index f5b7fdb3844..d5994b6cbed 100644 --- a/content/base/src/Link.cpp +++ b/content/base/src/Link.cpp @@ -183,7 +183,6 @@ Link::SetHost(const nsAString &aHost) (void)uri->SetHostPort(NS_ConvertUTF16toUTF8(aHost)); SetHrefAttribute(uri); - return; } void diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index 32396bba9ad..77ee4f5e0b2 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -64,6 +64,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec [test_url.html] [test_url_data.html] [test_url_empty_port.html] +[test_url_malformedHost.html] [test_urlExceptions.html] [test_urlSearchParams.html] [test_urlutils_stringify.html] diff --git a/dom/base/test/test_url_malformedHost.html b/dom/base/test/test_url_malformedHost.html new file mode 100644 index 00000000000..5b813b817ed --- /dev/null +++ b/dom/base/test/test_url_malformedHost.html @@ -0,0 +1,48 @@ + + + + + + + Test for Bug 1020041 + + + + +Mozilla Bug 1020041 +

+ +
+
+ foobar + + + + diff --git a/netwerk/base/src/nsStandardURL.cpp b/netwerk/base/src/nsStandardURL.cpp index 9d1be8a258e..2697d93a4d9 100644 --- a/netwerk/base/src/nsStandardURL.cpp +++ b/netwerk/base/src/nsStandardURL.cpp @@ -35,6 +35,7 @@ nsIIDNService *nsStandardURL::gIDN = nullptr; bool nsStandardURL::gInitialized = false; bool nsStandardURL::gEscapeUTF8 = true; bool nsStandardURL::gAlwaysEncodeInUTF8 = true; +char nsStandardURL::gHostLimitDigits[] = { '/', '\\', '?', '#', 0 }; #if defined(PR_LOGGING) // @@ -1423,6 +1424,18 @@ nsStandardURL::SetPassword(const nsACString &input) return NS_OK; } +void +nsStandardURL::FindHostLimit(nsACString::const_iterator& aStart, + nsACString::const_iterator& aEnd) +{ + for (int32_t i = 0; gHostLimitDigits[i]; ++i) { + nsACString::const_iterator c(aStart); + if (FindCharInReadable(gHostLimitDigits[i], c, aEnd)) { + aEnd = c; + } + } +} + NS_IMETHODIMP nsStandardURL::SetHostPort(const nsACString &aValue) { @@ -1438,6 +1451,8 @@ nsStandardURL::SetHostPort(const nsACString &aValue) nsACString::const_iterator iter(start); bool isIPv6 = false; + FindHostLimit(start, end); + if (*start == '[') { // IPv6 address if (!FindCharInReadable(']', iter, end)) { // the ] character is missing @@ -1496,7 +1511,15 @@ nsStandardURL::SetHost(const nsACString &input) { ENSURE_MUTABLE(); - const nsPromiseFlatCString &flat = PromiseFlatCString(input); + const nsPromiseFlatCString &hostname = PromiseFlatCString(input); + + nsACString::const_iterator start, end; + hostname.BeginReading(start); + hostname.EndReading(end); + + FindHostLimit(start, end); + + const nsCString flat(Substring(start, end)); const char *host = flat.get(); LOG(("nsStandardURL::SetHost [host=%s]\n", host)); diff --git a/netwerk/base/src/nsStandardURL.h b/netwerk/base/src/nsStandardURL.h index be1b8720b99..e81a0e15b43 100644 --- a/netwerk/base/src/nsStandardURL.h +++ b/netwerk/base/src/nsStandardURL.h @@ -226,6 +226,9 @@ private: static void PrefsChanged(nsIPrefBranch *prefs, const char *pref); + void FindHostLimit(nsACString::const_iterator& aStart, + nsACString::const_iterator& aEnd); + // mSpec contains the normalized version of the URL spec (UTF-8 encoded). nsCString mSpec; int32_t mDefaultPort; @@ -270,6 +273,7 @@ private: // global objects. don't use COMPtr as its destructor will cause a // coredump if we leak it. static nsIIDNService *gIDN; + static char gHostLimitDigits[]; static bool gInitialized; static bool gEscapeUTF8; static bool gAlwaysEncodeInUTF8; From 00cd340bac4c6a528b9266f857068781cd92e3b9 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 10 Jun 2014 14:25:42 +0200 Subject: [PATCH 13/23] Bug 1014083: Revert taking initial adjustment offset into account when computing stack slot offsets; r=luke --- js/src/jit/shared/CodeGenerator-shared.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp index bf45365aba0..77c753d1ebc 100644 --- a/js/src/jit/shared/CodeGenerator-shared.cpp +++ b/js/src/jit/shared/CodeGenerator-shared.cpp @@ -70,10 +70,8 @@ CodeGeneratorShared::CodeGeneratorShared(MIRGenerator *gen, LIRGraph *graph, Mac // (like x64) which require the stack to be aligned. if (StackKeptAligned || gen->needsInitialStackAlignment()) { unsigned alignmentAtCall = AlignmentAtAsmJSPrologue + frameDepth_; - if (unsigned rem = alignmentAtCall % StackAlignment) { - frameInitialAdjustment_ = StackAlignment - rem; - frameDepth_ += frameInitialAdjustment_; - } + if (unsigned rem = alignmentAtCall % StackAlignment) + frameDepth_ += StackAlignment - rem; } // FrameSizeClass is only used for bailing, which cannot happen in From cf0cc1e3c0122c65fca5de246540330bddb31861 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 10 Jun 2014 09:12:45 -0400 Subject: [PATCH 14/23] Bug 1001849: expose general chmod, and chmod-to-umask, support in OS.File. r=yoric --- .../osfile/modules/osfile_async_front.jsm | 44 +++++++ .../osfile/modules/osfile_async_worker.js | 9 ++ .../osfile/modules/osfile_unix_back.jsm | 6 + .../osfile/modules/osfile_unix_front.jsm | 62 +++++++++ .../osfile/modules/osfile_win_front.jsm | 16 +++ .../xpcshell/test_osfile_async_setPerms.js | 123 ++++++++++++++++++ .../osfile/tests/xpcshell/xpcshell.ini | 3 + 7 files changed, 263 insertions(+) create mode 100644 toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 2dc92c0b9fd..87f4c8573ea 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -823,6 +823,27 @@ File.prototype = { flush: function flush() { return Scheduler.post("File_prototype_flush", [this._fdmsg]); + }, + + /** + * Set the file's access permissions. Without any options, the + * permissions are set to an approximation of what they would have + * been if the file had been created in its current directory in the + * "most typical" fashion for the operating system. In the current + * implementation, this means that on Unix-like systems (including + * Android, B2G, etc) we set the POSIX file mode to (0666 & ~umask), + * and on Windows, we do nothing. + * + * @param {*=} options + * - {number} unixMode If present, the POSIX file mode is set to exactly + * this value, unless |unixHonorUmask| is also + * present. + * - {bool} unixHonorUmask If true, any |unixMode| value is modified by the + * process umask, as open() would have done. + */ + setPermissions: function setPermissions(options = {}) { + return Scheduler.post("File_prototype_setPermissions", + [this._fdmsg, options]); } }; @@ -923,6 +944,29 @@ File.setDates = function setDates(path, accessDate, modificationDate) { this); }; +/** + * Set the file's access permissions. Without any options, the + * permissions are set to an approximation of what they would have + * been if the file had been created in its current directory in the + * "most typical" fashion for the operating system. In the current + * implementation, this means that on Unix-like systems (including + * Android, B2G, etc) we set the POSIX file mode to (0666 & ~umask), + * and on Windows, we do nothing. + * + * @param {string} path The path to the file. + * + * @param {*=} options + * - {number} unixMode If present, the POSIX file mode is set to exactly + * this value, unless |unixHonorUmask| is also + * present. + * - {bool} unixHonorUmask If true, any |unixMode| value is modified by the + * process umask, as open() would have done. + */ +File.setPermissions = function setPermissions(path, options = {}) { + return Scheduler.post("setPermissions", + [Type.path.toMsg(path), options]); +}; + /** * Fetch the current directory * diff --git a/toolkit/components/osfile/modules/osfile_async_worker.js b/toolkit/components/osfile/modules/osfile_async_worker.js index 1813f3f447f..09c5813acd7 100644 --- a/toolkit/components/osfile/modules/osfile_async_worker.js +++ b/toolkit/components/osfile/modules/osfile_async_worker.js @@ -297,6 +297,9 @@ const EXCEPTION_NAMES = { return exports.OS.File.Info.toMsg( exports.OS.File.stat(Type.path.fromMsg(path), options)); }, + setPermissions: function setPermissions(path, options = {}) { + return exports.OS.File.setPermissions(Type.path.fromMsg(path), options); + }, setDates: function setDates(path, accessDate, modificationDate) { return exports.OS.File.setDates(Type.path.fromMsg(path), accessDate, modificationDate); @@ -405,6 +408,12 @@ const EXCEPTION_NAMES = { return exports.OS.File.Info.toMsg(this.stat()); }); }, + File_prototype_setPermissions: function setPermissions(fd, options = {}) { + return withFile(fd, + function do_setPermissions() { + return this.setPermissions(options); + }); + }, File_prototype_setDates: function setDates(fd, accessTime, modificationTime) { return withFile(fd, function do_setDates() { diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm index e2e6a5879b6..d3e9dcba0fb 100644 --- a/toolkit/components/osfile/modules/osfile_unix_back.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm @@ -348,6 +348,12 @@ /*return*/ Type.negativeone_or_nothing, /*fd*/ Type.fd); + libc.declareLazyFFI(SysFile, "fchmod", + "fchmod", ctypes.default_abi, + /*return*/ Type.negativeone_or_nothing, + /*fd*/ Type.fd, + /*mode*/ Type.mode_t); + libc.declareLazyFFI(SysFile, "fchown", "fchown", ctypes.default_abi, /*return*/ Type.negativeone_or_nothing, diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm index b6173992a3a..457a475881d 100644 --- a/toolkit/components/osfile/modules/osfile_unix_front.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm @@ -173,6 +173,27 @@ return new File.Info(gStatData, this._path); }; + /** + * Set the file's access permissions. Without any options, the + * permissions are set to an approximation of what they would + * have been if the file had been created in its current + * directory in the "most typical" fashion for the operating + * system. In the current implementation, this means we set + * the POSIX file mode to (0666 & ~umask). + * + * @param {*=} options + * - {number} unixMode If present, the POSIX file mode is set to + * exactly this value, unless |unixHonorUmask| is + * also present. + * - {bool} unixHonorUmask If true, any |unixMode| value is modified by + * the process umask, as open() would have done. + */ + File.prototype.setPermissions = function setPermissions(options = {}) { + throw_on_negative("setPermissions", + UnixFile.fchmod(this.fd, unixMode(options)), + this._path); + }; + /** * Set the last access and modification date of the file. * The time stamp resolution is 1 second at best, but might be worse @@ -909,6 +930,28 @@ return new File.Info(gStatData, path); }; + /** + * Set the file's access permissions. Without any options, the + * permissions are set to an approximation of what they would + * have been if the file had been created in its current + * directory in the "most typical" fashion for the operating + * system. In the current implementation, this means we set + * the POSIX file mode to (0666 & ~umask). + * + * @param {string} path The name of the file to reset the permissions of. + * @param {*=} options + * - {number} unixMode If present, the POSIX file mode is set to + * exactly this value, unless |unixHonorUmask| is + * also present. + * - {bool} unixHonorUmask If true, any |unixMode| value is modified by + * the process umask, as open() would have done. + */ + File.setPermissions = function setPermissions(path, options = {}) { + throw_on_negative("setPermissions", + UnixFile.chmod(path, unixMode(options)), + path); + }; + /** * Convert an access date and a modification date to an array * of two |timeval|. @@ -1111,6 +1154,25 @@ return date; }; + /** + * Helper used by both versions of setPermissions. + */ + function unixMode(options) { + let mode = 438; /* 0666 */ + let unixHonorUmask = true; + if ("unixMode" in options) { + unixHonorUmask = false; + mode = options.unixMode; + } + if ("unixHonorUmask" in options) { + unixHonorUmask = options.unixHonorUmask; + } + if (unixHonorUmask) { + mode &= ~SharedAll.Constants.Sys.umask; + } + return mode; + } + File.Unix = exports.OS.Unix.File; File.Error = SysAll.Error; exports.OS.File = File; diff --git a/toolkit/components/osfile/modules/osfile_win_front.jsm b/toolkit/components/osfile/modules/osfile_win_front.jsm index a53f92cadb8..fb6e560fc5d 100644 --- a/toolkit/components/osfile/modules/osfile_win_front.jsm +++ b/toolkit/components/osfile/modules/osfile_win_front.jsm @@ -234,6 +234,14 @@ this._path); }; + /** + * Set the file's access permission bits. + * Not implemented for Windows (bug 1022816). + */ + File.prototype.setPermissions = function setPermissions(options = {}) { + // do nothing + }; + /** * Flushes the file's buffers and causes all buffered data * to be written. @@ -953,6 +961,14 @@ winDisposition: Const.OPEN_EXISTING }; + /** + * Set the file's access permission bits. + * Not implemented for Windows (bug 1022816). + */ + File.setPermissions = function setPermissions(path, options = {}) { + // do nothing + }; + /** * Set the last access and modification date of the file. * The time stamp resolution is 1 second at best, but might be worse diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js new file mode 100644 index 00000000000..3d01a547abe --- /dev/null +++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js @@ -0,0 +1,123 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * A test to ensure that OS.File.setPermissions and + * OS.File.prototype.setPermissions are all working correctly. + * (see bug 1001849) + * These functions are currently Unix-specific. The manifest skips + * the test on Windows. + */ + +/** + * Helper function for test logging: prints a POSIX file permission mode as an + * octal number, with a leading '0' per C (not JS) convention. When the + * numeric value is 0777 or lower, it is padded on the left with zeroes to + * four digits wide. + * Sample outputs: 0022, 0644, 04755. + */ +function format_mode(mode) { + if (mode <= 0o777) { + return ("0000" + mode.toString(8)).slice(-4); + } else { + return "0" + mode.toString(8); + } +} + +/** + * Use this function to compare two mode values; it prints both values as + * octal numbers in the log. + */ +function do_check_modes_eq(left, right, text) { + text = text + ": " + format_mode(left) + " === " + format_mode(right); + do_report_result(left === right, text, Components.stack.caller, false); +} + +const _umask = OS.Constants.Sys.umask; +do_print("umask: " + format_mode(_umask)); + +/** + * Compute the mode that a file should have after applying the umask, + * whatever it happens to be. + */ +function apply_umask(mode) { + return mode & ~_umask; +} + +// Test application to paths. +add_task(function*() { + let path = OS.Path.join(OS.Constants.Path.tmpDir, + "test_osfile_async_setPerms_nonproto.tmp"); + yield OS.File.writeAtomic(path, new Uint8Array(1)); + + try { + let stat; + + yield OS.File.setPermissions(path, {unixMode: 0o4777}); + stat = yield OS.File.stat(path); + do_check_modes_eq(stat.unixMode, 0o4777, + "setPermissions(path, 04777)"); + + yield OS.File.setPermissions(path, {unixMode: 0o4777, + unixHonorUmask: true}); + stat = yield OS.File.stat(path); + do_check_modes_eq(stat.unixMode, apply_umask(0o4777), + "setPermissions(path, 04777&~umask)"); + + yield OS.File.setPermissions(path); + stat = yield OS.File.stat(path); + do_check_modes_eq(stat.unixMode, apply_umask(0o666), + "setPermissions(path, {})"); + + yield OS.File.setPermissions(path, {unixMode: 0}); + stat = yield OS.File.stat(path); + do_check_modes_eq(stat.unixMode, 0, + "setPermissions(path, 0000)"); + + } finally { + yield OS.File.remove(path); + } +}); + +// Test application to open files. +add_task(function*() { + // First, create a file we can mess with. + let path = OS.Path.join(OS.Constants.Path.tmpDir, + "test_osfile_async_setDates_proto.tmp"); + yield OS.File.writeAtomic(path, new Uint8Array(1)); + + try { + let fd = yield OS.File.open(path, {write: true}); + let stat; + + yield fd.setPermissions({unixMode: 0o4777}); + stat = yield fd.stat(); + do_check_modes_eq(stat.unixMode, 0o4777, + "fd.setPermissions(04777)"); + + yield fd.setPermissions({unixMode: 0o4777, unixHonorUmask: true}); + stat = yield fd.stat(); + do_check_modes_eq(stat.unixMode, apply_umask(0o4777), + "fd.setPermissions(04777&~umask)"); + + yield fd.setPermissions(); + stat = yield fd.stat(); + do_check_modes_eq(stat.unixMode, apply_umask(0o666), + "fd.setPermissions({})"); + + yield fd.setPermissions({unixMode: 0}); + stat = yield fd.stat(); + do_check_modes_eq(stat.unixMode, 0, + "fd.setPermissions(0000)"); + + yield fd.close(); + } finally { + yield OS.File.remove(path); + } +}); + +function run_test() { + run_next_test(); +} diff --git a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini index 00b7ee773f3..aefc9625a2f 100644 --- a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini +++ b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini @@ -36,3 +36,6 @@ support-files = [test_queue.js] [test_loader.js] [test_constants.js] + +[test_osfile_async_setPerms.js] +skip-if = os == 'win' From 5076fc930a8fe0ec67b6a1ae1e2b8df1b2dce2ae Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Sat, 7 Jun 2014 11:54:38 -0400 Subject: [PATCH 15/23] bug 1022195 - http2 allow indexing of cookie crumbs with decent entropy r=hurley --HG-- extra : rebase_source : fb48d4aaf4d81007ac5532f493a87babb23257f7 --- netwerk/protocol/http/Http2Compression.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index 021fd095496..8dd09367e50 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -1062,10 +1062,12 @@ Http2Compressor::EncodeHeaderBlock(const nsCString &nvInput, } nsDependentCSubstring cookie = Substring(beginBuffer + nextCookie, beginBuffer + semiSpaceIndex); - ProcessHeader(nvPair(name, cookie), true); + // cookies less than 20 bytes are not indexed + ProcessHeader(nvPair(name, cookie), name.Length() < 20); nextCookie = semiSpaceIndex + 2; } } else { + // allow indexing of every non-cookie except authorization ProcessHeader(nvPair(name, value), name.EqualsLiteral("authorization")); } } From 5eb912a5c5776f1bf693382366f75eeeafda9775 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Fri, 6 Jun 2014 11:18:00 -0400 Subject: [PATCH 16/23] bug 1021396 - duplicate spdy syn_stream can hang necko thread r=hurley bug 1021396 - duplicate spdy syn_stream can hang necko thread r=hurley --HG-- extra : rebase_source : caf1ad18fced8e9c7ef78c1eccbfb2dec2d6181c --- netwerk/protocol/http/SpdyStream3.cpp | 17 +++++++++++------ netwerk/protocol/http/SpdyStream31.cpp | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/netwerk/protocol/http/SpdyStream3.cpp b/netwerk/protocol/http/SpdyStream3.cpp index efc2b3e0666..3599ec2f0cb 100644 --- a/netwerk/protocol/http/SpdyStream3.cpp +++ b/netwerk/protocol/http/SpdyStream3.cpp @@ -1031,6 +1031,10 @@ SpdyStream3::Uncompress(z_stream *context, char *blockStart, uint32_t blockLen) { + // ensure the minimum size + EnsureBuffer(mDecompressBuffer, SpdySession3::kDefaultBufferSize, + mDecompressBufferUsed, mDecompressBufferSize); + mDecompressedBytes += blockLen; context->avail_in = blockLen; @@ -1043,22 +1047,23 @@ SpdyStream3::Uncompress(z_stream *context, mDecompressBufferUsed; context->avail_out = mDecompressBufferSize - mDecompressBufferUsed; int zlib_rv = inflate(context, Z_NO_FLUSH); + LOG3(("SpdyStream3::Uncompress %p zlib_rv %d\n", this, zlib_rv)); if (zlib_rv == Z_NEED_DICT) { if (triedDictionary) { - LOG3(("SpdySession3::Uncompress %p Dictionary Error\n", this)); + LOG3(("SpdyStream3::Uncompress %p Dictionary Error\n", this)); return NS_ERROR_ILLEGAL_VALUE; } triedDictionary = true; inflateSetDictionary(context, kDictionary, sizeof(kDictionary)); - } - - if (zlib_rv == Z_DATA_ERROR) + } else if (zlib_rv == Z_DATA_ERROR) { + LOG3(("SpdyStream3::Uncompress %p inflate returned data err\n", this)); return NS_ERROR_ILLEGAL_VALUE; - - if (zlib_rv == Z_MEM_ERROR) + } else if (zlib_rv < Z_OK) { // probably Z_MEM_ERROR + LOG3(("SpdyStream3::Uncompress %p inflate returned %d\n", this, zlib_rv)); return NS_ERROR_FAILURE; + } // zlib's inflate() decreases context->avail_out by the amount it places // in the output buffer diff --git a/netwerk/protocol/http/SpdyStream31.cpp b/netwerk/protocol/http/SpdyStream31.cpp index f8a32c8f294..ad1a9264a6f 100644 --- a/netwerk/protocol/http/SpdyStream31.cpp +++ b/netwerk/protocol/http/SpdyStream31.cpp @@ -1047,6 +1047,10 @@ SpdyStream31::Uncompress(z_stream *context, char *blockStart, uint32_t blockLen) { + // ensure the minimum size + EnsureBuffer(mDecompressBuffer, SpdySession31::kDefaultBufferSize, + mDecompressBufferUsed, mDecompressBufferSize); + mDecompressedBytes += blockLen; context->avail_in = blockLen; @@ -1059,22 +1063,23 @@ SpdyStream31::Uncompress(z_stream *context, mDecompressBufferUsed; context->avail_out = mDecompressBufferSize - mDecompressBufferUsed; int zlib_rv = inflate(context, Z_NO_FLUSH); + LOG3(("SpdyStream31::Uncompress %p zlib_rv %d\n", this, zlib_rv)); if (zlib_rv == Z_NEED_DICT) { if (triedDictionary) { - LOG3(("SpdySession31::Uncompress %p Dictionary Error\n", this)); + LOG3(("SpdyStream31::Uncompress %p Dictionary Error\n", this)); return NS_ERROR_ILLEGAL_VALUE; } triedDictionary = true; inflateSetDictionary(context, kDictionary, sizeof(kDictionary)); - } - - if (zlib_rv == Z_DATA_ERROR) + } else if (zlib_rv == Z_DATA_ERROR) { + LOG3(("SpdyStream31::Uncompress %p inflate returned data err\n", this)); return NS_ERROR_ILLEGAL_VALUE; - - if (zlib_rv == Z_MEM_ERROR) + } else if (zlib_rv < Z_OK) { // probably Z_MEM_ERROR + LOG3(("SpdyStream31::Uncompress %p inflate returned %d\n", this, zlib_rv)); return NS_ERROR_FAILURE; + } // zlib's inflate() decreases context->avail_out by the amount it places // in the output buffer From 7a06049ac4833649dfc98f35531ab3a34a05bbac Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Fri, 6 Jun 2014 19:18:00 -0400 Subject: [PATCH 17/23] bug 1022076 - http/2 explicit gzip for post h2-12 r=hurley bug 1022076 - http/2 explicit gzip for post h2-12 r=hurley --HG-- extra : rebase_source : 8603c97c9ed664520e748ebba405e6a1bce6b3e8 --- netwerk/protocol/http/Http2Compression.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index 8dd09367e50..2b0ee3a9587 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -1003,8 +1003,7 @@ Http2Compressor::EncodeHeaderBlock(const nsCString &nvInput, name.EqualsLiteral("proxy-connection") || name.EqualsLiteral("te") || name.EqualsLiteral("transfer-encoding") || - name.EqualsLiteral("upgrade") || - name.EqualsLiteral("accept-encoding")) { + name.EqualsLiteral("upgrade")) { continue; } From 3d39114141131479cc033e1ae36616260f8bda24 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Mon, 9 Jun 2014 22:16:57 -0400 Subject: [PATCH 18/23] bug 1022268 - cleaned up ssl type list too early r=honzab --HG-- extra : rebase_source : 0e4204b61977f969f95906e18ff481c400801b7f --- netwerk/base/src/nsSocketTransport2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/netwerk/base/src/nsSocketTransport2.cpp b/netwerk/base/src/nsSocketTransport2.cpp index b0596b60047..643c15a4d5e 100644 --- a/netwerk/base/src/nsSocketTransport2.cpp +++ b/netwerk/base/src/nsSocketTransport2.cpp @@ -1163,7 +1163,6 @@ nsSocketTransport::BuildSocket(PRFileDesc *&fd, bool &proxyTransparent, bool &us } } - CleanupTypes(); return rv; } From 117feef833f2c33824bd681734f066a9abec7915 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Tue, 10 Jun 2014 15:08:49 +0100 Subject: [PATCH 19/23] Backed out changeset 6d172e86ce2e (bug 1022002) for tipping Android 2.3 reftest-6 runtimes over the max time limit --- js/xpconnect/src/XPCComponents.cpp | 2 +- js/xpconnect/tests/chrome/test_cloneInto.xul | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 0f12641d1eb..abb8888cecb 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -3531,7 +3531,7 @@ CloneIntoReadStructuredClone(JSContext *cx, if (!JS_WrapObject(cx, &obj)) return nullptr; - if (!xpc::NewFunctionForwarder(cx, obj, true, &functionValue)) + if (!xpc::NewFunctionForwarder(cx, obj, false, &functionValue)) return nullptr; return &functionValue.toObject(); diff --git a/js/xpconnect/tests/chrome/test_cloneInto.xul b/js/xpconnect/tests/chrome/test_cloneInto.xul index 7a59d8c2f5e..bb2bed90805 100644 --- a/js/xpconnect/tests/chrome/test_cloneInto.xul +++ b/js/xpconnect/tests/chrome/test_cloneInto.xul @@ -161,14 +161,8 @@ 'CloneInto should only work on less privileged target scopes.'); } - var test = { a: function() { return 42; } }; + var test = { a: function() { return 42; } } cloneAndTestWithFunctions(test); - - // Check that we're cloning input to functions: - test = { a: function(obj) { return obj; } }; - var clonedTest = Cu.cloneInto(test, sandbox, {cloneFunctions: true}); - var testInput = {}; - isnot(clonedTest.a(testInput), testInput, "Objects should not be identical"); ]]> From 32b2bd79a4ed56406e994f9ff6de67436ffbb301 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Tue, 10 Jun 2014 15:31:39 +0100 Subject: [PATCH 20/23] Backed out changeset 46f584afbed5 (bug 1001849) for test_osfile_async_setPerms.js failures on Android; CLOSED TREE --- .../osfile/modules/osfile_async_front.jsm | 44 ------- .../osfile/modules/osfile_async_worker.js | 9 -- .../osfile/modules/osfile_unix_back.jsm | 6 - .../osfile/modules/osfile_unix_front.jsm | 62 --------- .../osfile/modules/osfile_win_front.jsm | 16 --- .../xpcshell/test_osfile_async_setPerms.js | 123 ------------------ .../osfile/tests/xpcshell/xpcshell.ini | 3 - 7 files changed, 263 deletions(-) delete mode 100644 toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 87f4c8573ea..2dc92c0b9fd 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -823,27 +823,6 @@ File.prototype = { flush: function flush() { return Scheduler.post("File_prototype_flush", [this._fdmsg]); - }, - - /** - * Set the file's access permissions. Without any options, the - * permissions are set to an approximation of what they would have - * been if the file had been created in its current directory in the - * "most typical" fashion for the operating system. In the current - * implementation, this means that on Unix-like systems (including - * Android, B2G, etc) we set the POSIX file mode to (0666 & ~umask), - * and on Windows, we do nothing. - * - * @param {*=} options - * - {number} unixMode If present, the POSIX file mode is set to exactly - * this value, unless |unixHonorUmask| is also - * present. - * - {bool} unixHonorUmask If true, any |unixMode| value is modified by the - * process umask, as open() would have done. - */ - setPermissions: function setPermissions(options = {}) { - return Scheduler.post("File_prototype_setPermissions", - [this._fdmsg, options]); } }; @@ -944,29 +923,6 @@ File.setDates = function setDates(path, accessDate, modificationDate) { this); }; -/** - * Set the file's access permissions. Without any options, the - * permissions are set to an approximation of what they would have - * been if the file had been created in its current directory in the - * "most typical" fashion for the operating system. In the current - * implementation, this means that on Unix-like systems (including - * Android, B2G, etc) we set the POSIX file mode to (0666 & ~umask), - * and on Windows, we do nothing. - * - * @param {string} path The path to the file. - * - * @param {*=} options - * - {number} unixMode If present, the POSIX file mode is set to exactly - * this value, unless |unixHonorUmask| is also - * present. - * - {bool} unixHonorUmask If true, any |unixMode| value is modified by the - * process umask, as open() would have done. - */ -File.setPermissions = function setPermissions(path, options = {}) { - return Scheduler.post("setPermissions", - [Type.path.toMsg(path), options]); -}; - /** * Fetch the current directory * diff --git a/toolkit/components/osfile/modules/osfile_async_worker.js b/toolkit/components/osfile/modules/osfile_async_worker.js index 09c5813acd7..1813f3f447f 100644 --- a/toolkit/components/osfile/modules/osfile_async_worker.js +++ b/toolkit/components/osfile/modules/osfile_async_worker.js @@ -297,9 +297,6 @@ const EXCEPTION_NAMES = { return exports.OS.File.Info.toMsg( exports.OS.File.stat(Type.path.fromMsg(path), options)); }, - setPermissions: function setPermissions(path, options = {}) { - return exports.OS.File.setPermissions(Type.path.fromMsg(path), options); - }, setDates: function setDates(path, accessDate, modificationDate) { return exports.OS.File.setDates(Type.path.fromMsg(path), accessDate, modificationDate); @@ -408,12 +405,6 @@ const EXCEPTION_NAMES = { return exports.OS.File.Info.toMsg(this.stat()); }); }, - File_prototype_setPermissions: function setPermissions(fd, options = {}) { - return withFile(fd, - function do_setPermissions() { - return this.setPermissions(options); - }); - }, File_prototype_setDates: function setDates(fd, accessTime, modificationTime) { return withFile(fd, function do_setDates() { diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm index d3e9dcba0fb..e2e6a5879b6 100644 --- a/toolkit/components/osfile/modules/osfile_unix_back.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm @@ -348,12 +348,6 @@ /*return*/ Type.negativeone_or_nothing, /*fd*/ Type.fd); - libc.declareLazyFFI(SysFile, "fchmod", - "fchmod", ctypes.default_abi, - /*return*/ Type.negativeone_or_nothing, - /*fd*/ Type.fd, - /*mode*/ Type.mode_t); - libc.declareLazyFFI(SysFile, "fchown", "fchown", ctypes.default_abi, /*return*/ Type.negativeone_or_nothing, diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm index 457a475881d..b6173992a3a 100644 --- a/toolkit/components/osfile/modules/osfile_unix_front.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm @@ -173,27 +173,6 @@ return new File.Info(gStatData, this._path); }; - /** - * Set the file's access permissions. Without any options, the - * permissions are set to an approximation of what they would - * have been if the file had been created in its current - * directory in the "most typical" fashion for the operating - * system. In the current implementation, this means we set - * the POSIX file mode to (0666 & ~umask). - * - * @param {*=} options - * - {number} unixMode If present, the POSIX file mode is set to - * exactly this value, unless |unixHonorUmask| is - * also present. - * - {bool} unixHonorUmask If true, any |unixMode| value is modified by - * the process umask, as open() would have done. - */ - File.prototype.setPermissions = function setPermissions(options = {}) { - throw_on_negative("setPermissions", - UnixFile.fchmod(this.fd, unixMode(options)), - this._path); - }; - /** * Set the last access and modification date of the file. * The time stamp resolution is 1 second at best, but might be worse @@ -930,28 +909,6 @@ return new File.Info(gStatData, path); }; - /** - * Set the file's access permissions. Without any options, the - * permissions are set to an approximation of what they would - * have been if the file had been created in its current - * directory in the "most typical" fashion for the operating - * system. In the current implementation, this means we set - * the POSIX file mode to (0666 & ~umask). - * - * @param {string} path The name of the file to reset the permissions of. - * @param {*=} options - * - {number} unixMode If present, the POSIX file mode is set to - * exactly this value, unless |unixHonorUmask| is - * also present. - * - {bool} unixHonorUmask If true, any |unixMode| value is modified by - * the process umask, as open() would have done. - */ - File.setPermissions = function setPermissions(path, options = {}) { - throw_on_negative("setPermissions", - UnixFile.chmod(path, unixMode(options)), - path); - }; - /** * Convert an access date and a modification date to an array * of two |timeval|. @@ -1154,25 +1111,6 @@ return date; }; - /** - * Helper used by both versions of setPermissions. - */ - function unixMode(options) { - let mode = 438; /* 0666 */ - let unixHonorUmask = true; - if ("unixMode" in options) { - unixHonorUmask = false; - mode = options.unixMode; - } - if ("unixHonorUmask" in options) { - unixHonorUmask = options.unixHonorUmask; - } - if (unixHonorUmask) { - mode &= ~SharedAll.Constants.Sys.umask; - } - return mode; - } - File.Unix = exports.OS.Unix.File; File.Error = SysAll.Error; exports.OS.File = File; diff --git a/toolkit/components/osfile/modules/osfile_win_front.jsm b/toolkit/components/osfile/modules/osfile_win_front.jsm index fb6e560fc5d..a53f92cadb8 100644 --- a/toolkit/components/osfile/modules/osfile_win_front.jsm +++ b/toolkit/components/osfile/modules/osfile_win_front.jsm @@ -234,14 +234,6 @@ this._path); }; - /** - * Set the file's access permission bits. - * Not implemented for Windows (bug 1022816). - */ - File.prototype.setPermissions = function setPermissions(options = {}) { - // do nothing - }; - /** * Flushes the file's buffers and causes all buffered data * to be written. @@ -961,14 +953,6 @@ winDisposition: Const.OPEN_EXISTING }; - /** - * Set the file's access permission bits. - * Not implemented for Windows (bug 1022816). - */ - File.setPermissions = function setPermissions(path, options = {}) { - // do nothing - }; - /** * Set the last access and modification date of the file. * The time stamp resolution is 1 second at best, but might be worse diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js deleted file mode 100644 index 3d01a547abe..00000000000 --- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPerms.js +++ /dev/null @@ -1,123 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -/** - * A test to ensure that OS.File.setPermissions and - * OS.File.prototype.setPermissions are all working correctly. - * (see bug 1001849) - * These functions are currently Unix-specific. The manifest skips - * the test on Windows. - */ - -/** - * Helper function for test logging: prints a POSIX file permission mode as an - * octal number, with a leading '0' per C (not JS) convention. When the - * numeric value is 0777 or lower, it is padded on the left with zeroes to - * four digits wide. - * Sample outputs: 0022, 0644, 04755. - */ -function format_mode(mode) { - if (mode <= 0o777) { - return ("0000" + mode.toString(8)).slice(-4); - } else { - return "0" + mode.toString(8); - } -} - -/** - * Use this function to compare two mode values; it prints both values as - * octal numbers in the log. - */ -function do_check_modes_eq(left, right, text) { - text = text + ": " + format_mode(left) + " === " + format_mode(right); - do_report_result(left === right, text, Components.stack.caller, false); -} - -const _umask = OS.Constants.Sys.umask; -do_print("umask: " + format_mode(_umask)); - -/** - * Compute the mode that a file should have after applying the umask, - * whatever it happens to be. - */ -function apply_umask(mode) { - return mode & ~_umask; -} - -// Test application to paths. -add_task(function*() { - let path = OS.Path.join(OS.Constants.Path.tmpDir, - "test_osfile_async_setPerms_nonproto.tmp"); - yield OS.File.writeAtomic(path, new Uint8Array(1)); - - try { - let stat; - - yield OS.File.setPermissions(path, {unixMode: 0o4777}); - stat = yield OS.File.stat(path); - do_check_modes_eq(stat.unixMode, 0o4777, - "setPermissions(path, 04777)"); - - yield OS.File.setPermissions(path, {unixMode: 0o4777, - unixHonorUmask: true}); - stat = yield OS.File.stat(path); - do_check_modes_eq(stat.unixMode, apply_umask(0o4777), - "setPermissions(path, 04777&~umask)"); - - yield OS.File.setPermissions(path); - stat = yield OS.File.stat(path); - do_check_modes_eq(stat.unixMode, apply_umask(0o666), - "setPermissions(path, {})"); - - yield OS.File.setPermissions(path, {unixMode: 0}); - stat = yield OS.File.stat(path); - do_check_modes_eq(stat.unixMode, 0, - "setPermissions(path, 0000)"); - - } finally { - yield OS.File.remove(path); - } -}); - -// Test application to open files. -add_task(function*() { - // First, create a file we can mess with. - let path = OS.Path.join(OS.Constants.Path.tmpDir, - "test_osfile_async_setDates_proto.tmp"); - yield OS.File.writeAtomic(path, new Uint8Array(1)); - - try { - let fd = yield OS.File.open(path, {write: true}); - let stat; - - yield fd.setPermissions({unixMode: 0o4777}); - stat = yield fd.stat(); - do_check_modes_eq(stat.unixMode, 0o4777, - "fd.setPermissions(04777)"); - - yield fd.setPermissions({unixMode: 0o4777, unixHonorUmask: true}); - stat = yield fd.stat(); - do_check_modes_eq(stat.unixMode, apply_umask(0o4777), - "fd.setPermissions(04777&~umask)"); - - yield fd.setPermissions(); - stat = yield fd.stat(); - do_check_modes_eq(stat.unixMode, apply_umask(0o666), - "fd.setPermissions({})"); - - yield fd.setPermissions({unixMode: 0}); - stat = yield fd.stat(); - do_check_modes_eq(stat.unixMode, 0, - "fd.setPermissions(0000)"); - - yield fd.close(); - } finally { - yield OS.File.remove(path); - } -}); - -function run_test() { - run_next_test(); -} diff --git a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini index aefc9625a2f..00b7ee773f3 100644 --- a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini +++ b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini @@ -36,6 +36,3 @@ support-files = [test_queue.js] [test_loader.js] [test_constants.js] - -[test_osfile_async_setPerms.js] -skip-if = os == 'win' From 5d2a4b88172dd0aeecfd34baeeed7c86558e009a Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Mon, 9 Jun 2014 17:26:55 -0400 Subject: [PATCH 21/23] Bug 1022049. Switch to . r=nfroyd Instead of declaring these ourselves just use intrin.h This has the advantage of allowing them to work with clang-cl --HG-- extra : rebase_source : b78c756edb5dcdf1fd9127ad5e1a7ae183e72e3c --- mfbt/MathAlgorithms.h | 7 +------ netwerk/protocol/http/HttpChannelChild.h | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mfbt/MathAlgorithms.h b/mfbt/MathAlgorithms.h index 7a77b00042d..c39efebd846 100644 --- a/mfbt/MathAlgorithms.h +++ b/mfbt/MathAlgorithms.h @@ -148,18 +148,13 @@ Abs(const long double d) #if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) # define MOZ_BITSCAN_WINDOWS - extern "C" { - unsigned char _BitScanForward(unsigned long* Index, unsigned long mask); - unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask); +# include # pragma intrinsic(_BitScanForward, _BitScanReverse) # if defined(_M_AMD64) || defined(_M_X64) # define MOZ_BITSCAN_WINDOWS64 - unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask); - unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask); # pragma intrinsic(_BitScanForward64, _BitScanReverse64) # endif - } // extern "C" #endif diff --git a/netwerk/protocol/http/HttpChannelChild.h b/netwerk/protocol/http/HttpChannelChild.h index 26a60fe4ee2..5d7e6eff737 100644 --- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -33,6 +33,10 @@ namespace mozilla { namespace net { +#if defined(_MSC_VER) && defined(__clang__) +// This is needed until http://llvm.org/PR19987 is fixed +class __multiple_inheritance HttpChannelChild; +#endif class HttpChannelChild : public PHttpChannelChild , public HttpBaseChannel , public HttpAsyncAborter From dd852792ea1501a2a6464ed94afa8d4e45740704 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Mon, 9 Jun 2014 19:09:51 +0100 Subject: [PATCH 22/23] Bug 1022002 - make cloneInto create functions that clone their arguments, r=bholley --- js/xpconnect/src/XPCComponents.cpp | 2 +- js/xpconnect/tests/chrome/test_cloneInto.xul | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index abb8888cecb..0f12641d1eb 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -3531,7 +3531,7 @@ CloneIntoReadStructuredClone(JSContext *cx, if (!JS_WrapObject(cx, &obj)) return nullptr; - if (!xpc::NewFunctionForwarder(cx, obj, false, &functionValue)) + if (!xpc::NewFunctionForwarder(cx, obj, true, &functionValue)) return nullptr; return &functionValue.toObject(); diff --git a/js/xpconnect/tests/chrome/test_cloneInto.xul b/js/xpconnect/tests/chrome/test_cloneInto.xul index bb2bed90805..7a59d8c2f5e 100644 --- a/js/xpconnect/tests/chrome/test_cloneInto.xul +++ b/js/xpconnect/tests/chrome/test_cloneInto.xul @@ -161,8 +161,14 @@ 'CloneInto should only work on less privileged target scopes.'); } - var test = { a: function() { return 42; } } + var test = { a: function() { return 42; } }; cloneAndTestWithFunctions(test); + + // Check that we're cloning input to functions: + test = { a: function(obj) { return obj; } }; + var clonedTest = Cu.cloneInto(test, sandbox, {cloneFunctions: true}); + var testInput = {}; + isnot(clonedTest.a(testInput), testInput, "Objects should not be identical"); ]]> From c7ce42f86d40f9696f278b105d797569c4db806d Mon Sep 17 00:00:00 2001 From: Joel Maher Date: Tue, 10 Jun 2014 11:28:12 -0400 Subject: [PATCH 23/23] Bug 964498 - Add SNR measurements to Talos for audio tests [talos.json]. r=kmoir DONTBUILD --- testing/talos/talos.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testing/talos/talos.json b/testing/talos/talos.json index 2f383d3af5d..0fdcdaaf7db 100644 --- a/testing/talos/talos.json +++ b/testing/talos/talos.json @@ -24,6 +24,12 @@ "other": { "tests": ["a11yr", "ts_paint", "tpaint", "sessionrestore", "sessionrestore_no_auto_restore"] }, + "other_nolinux64": { + "tests": ["a11yr", "ts_paint", "tpaint", "sessionrestore", "sessionrestore_no_auto_restore"] + }, + "other_linux64": { + "tests": ["a11yr", "ts_paint", "tpaint", "sessionrestore", "sessionrestore_no_auto_restore", "media_tests"] + }, "svgr": { "tests": ["tsvgx", "tsvgr_opacity", "tart", "tscrollx", "cart"] },