From 416d586a1420dd82094c0cac417ee01213eb9ad6 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 24 Nov 2014 11:19:36 +0100 Subject: [PATCH 01/88] Bug 1102809 - Fixed -Wunused-function warnings found in mingw build. r=mattwoodrow --- browser/app/nsBrowserApp.cpp | 2 +- gfx/2d/HelpersD2D.h | 10 +++++----- gfx/thebes/gfxDWriteCommon.h | 4 ++-- toolkit/mozapps/update/common/updatedefines.h | 4 ++-- widget/windows/GfxInfo.cpp | 11 ----------- xpcom/base/nsWindowsHelpers.h | 4 ++-- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index b3981384948f..a56d9ccdde1e 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -121,7 +121,7 @@ static bool IsArg(const char* arg, const char* s) return false; } -#ifdef XP_WIN +#if defined(XP_WIN) && defined(MOZ_METRO) /* * AttachToTestHarness - Windows helper for when we are running * in the immersive environment. Firefox is launched by Windows in diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h index 9599705c9bde..9004ff2c74a3 100644 --- a/gfx/2d/HelpersD2D.h +++ b/gfx/2d/HelpersD2D.h @@ -396,7 +396,7 @@ DWriteGlyphRunFromGlyphs(const GlyphBuffer &aGlyphs, ScaledFontDWrite *aFont, Au run->isSideways = FALSE; } -static TemporaryRef +static inline TemporaryRef ConvertRectToGeometry(const D2D1_RECT_F& aRect) { RefPtr rectGeom; @@ -404,7 +404,7 @@ ConvertRectToGeometry(const D2D1_RECT_F& aRect) return rectGeom.forget(); } -static TemporaryRef +static inline TemporaryRef GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform) { RefPtr tmpGeometry; @@ -417,7 +417,7 @@ GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTrans return tmpGeometry.forget(); } -static TemporaryRef +static inline TemporaryRef IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB) { RefPtr pathGeom; @@ -430,7 +430,7 @@ IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB) return pathGeom.forget(); } -static TemporaryRef +static inline TemporaryRef CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions) { RefPtr style; @@ -510,7 +510,7 @@ CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions) // This creates a (partially) uploaded bitmap for a DataSourceSurface. It // uploads the minimum requirement and possibly downscales. It adjusts the // input Matrix to compensate. -static TemporaryRef +static inline TemporaryRef CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestinationTransform, const IntSize &aDestinationSize, ExtendMode aExtendMode, Matrix &aSourceTransform, ID2D1RenderTarget *aRT, diff --git a/gfx/thebes/gfxDWriteCommon.h b/gfx/thebes/gfxDWriteCommon.h index 46146808cdda..fbf7005a6d4e 100644 --- a/gfx/thebes/gfxDWriteCommon.h +++ b/gfx/thebes/gfxDWriteCommon.h @@ -20,7 +20,7 @@ #include #include -static DWRITE_FONT_STRETCH +static inline DWRITE_FONT_STRETCH DWriteFontStretchFromStretch(int16_t aStretch) { switch (aStretch) { @@ -47,7 +47,7 @@ DWriteFontStretchFromStretch(int16_t aStretch) } } -static int16_t +static inline int16_t FontStretchFromDWriteStretch(DWRITE_FONT_STRETCH aStretch) { switch (aStretch) { diff --git a/toolkit/mozapps/update/common/updatedefines.h b/toolkit/mozapps/update/common/updatedefines.h index 6a3512909599..266a47fd7aa1 100644 --- a/toolkit/mozapps/update/common/updatedefines.h +++ b/toolkit/mozapps/update/common/updatedefines.h @@ -51,7 +51,7 @@ // multiple nulls in a string is fine and this approach is simpler (possibly // faster) than calculating the string length to place the null terminator and // truncates the string as _snprintf and _snwprintf do on other platforms. -static int mysnprintf(char* dest, size_t count, const char* fmt, ...) +static inline int mysnprintf(char* dest, size_t count, const char* fmt, ...) { size_t _count = count - 1; va_list varargs; @@ -62,7 +62,7 @@ static int mysnprintf(char* dest, size_t count, const char* fmt, ...) return result; } #define snprintf mysnprintf -static int mywcsprintf(WCHAR* dest, size_t count, const WCHAR* fmt, ...) +static inline int mywcsprintf(WCHAR* dest, size_t count, const WCHAR* fmt, ...) { size_t _count = count - 1; va_list varargs; diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 868596360b33..ee215fe2f0d7 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -194,17 +194,6 @@ static nsresult GetKeyValue(const WCHAR* keyLocation, const WCHAR* keyName, nsAS return retval; } -// The driver ID is a string like PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD, possibly -// followed by &REV_XXXX. We uppercase the string, and strip the &REV_ part -// from it, if found. -static void normalizeDriverId(nsString& driverid) { - ToUpperCase(driverid); - int32_t rev = driverid.Find(NS_LITERAL_CSTRING("&REV_")); - if (rev != -1) { - driverid.Cut(rev, driverid.Length()); - } -} - // The device ID is a string like PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD // this function is used to extract the id's out of it uint32_t diff --git a/xpcom/base/nsWindowsHelpers.h b/xpcom/base/nsWindowsHelpers.h index 5e28c7b0c93f..5f611aa37898 100644 --- a/xpcom/base/nsWindowsHelpers.h +++ b/xpcom/base/nsWindowsHelpers.h @@ -127,7 +127,7 @@ typedef nsAutoRef nsModuleHandle; namespace { -bool +bool inline IsRunningInWindowsMetro() { static bool alreadyChecked = false; @@ -157,7 +157,7 @@ IsRunningInWindowsMetro() return isMetro; } -HMODULE +HMODULE inline LoadLibrarySystem32(LPCWSTR aModule) { WCHAR systemPath[MAX_PATH + 1] = { L'\0' }; From e3df57f59e96d4874a988802845d04384daf779a Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 24 Nov 2014 10:40:33 +0000 Subject: [PATCH 02/88] Bug 650161 - Remove an assertion that things don't move r=terrence --- js/public/RootingAPI.h | 1 - 1 file changed, 1 deletion(-) diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 275d06005c26..4ed0394efc16 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -1266,7 +1266,6 @@ CallTraceCallbackOnNonHeap(T *v, const TraceCallbacks &aCallbacks, const char *a MOZ_ASSERT(!IsInsideNursery(cell)); JS::Heap *asHeapT = reinterpret_cast*>(v); aCallbacks.Trace(asHeapT, aName, aClosure); - MOZ_ASSERT(GCMethods::asGCThingOrNull(*v) == cell); } } /* namespace gc */ From 707785ce7e6ea16abe600c4ce495cc81356418f1 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 24 Nov 2014 10:42:21 +0000 Subject: [PATCH 03/88] Bug 1102542 - Release any relocated arenas on out of memory r=terrence --- js/src/gc/GCRuntime.h | 1 + js/src/jsgc.cpp | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index cbd36fa70061..c85871fe2f81 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -611,6 +611,7 @@ class GCRuntime void updateAllCellPointersSerial(MovingTracer *trc, ArenasToUpdate &source); void updatePointersToRelocatedCells(); void releaseRelocatedArenas(ArenaHeader *relocatedList); + void releaseRelocatedArenasWithoutUnlocking(ArenaHeader *relocatedList, const AutoLockGC& lock); #ifdef DEBUG void protectRelocatedArenas(ArenaHeader *relocatedList); void unprotectRelocatedArenas(ArenaHeader *relocatedList); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 8bc7a333f03b..c5bf7545182b 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2732,9 +2732,15 @@ GCRuntime::unprotectRelocatedArenas(ArenaHeader *relocatedList) void GCRuntime::releaseRelocatedArenas(ArenaHeader *relocatedList) { - // Release the relocated arenas, now containing only forwarding pointers AutoLockGC lock(rt); + releaseRelocatedArenasWithoutUnlocking(relocatedList, lock); + expireChunksAndArenas(true, lock); +} +void +GCRuntime::releaseRelocatedArenasWithoutUnlocking(ArenaHeader *relocatedList, const AutoLockGC &lock) +{ + // Release the relocated arenas, now containing only forwarding pointers unsigned count = 0; while (relocatedList) { ArenaHeader *aheader = relocatedList; @@ -2759,8 +2765,6 @@ GCRuntime::releaseRelocatedArenas(ArenaHeader *relocatedList) releaseArena(aheader, lock); ++count; } - - expireChunksAndArenas(true, lock); } #endif // JSGC_COMPACTING @@ -6406,6 +6410,13 @@ GCRuntime::onOutOfMallocMemory(const AutoLockGC &lock) // Throw away any excess chunks we have lying around. freeEmptyChunks(rt, lock); + // Release any relocated areans we may be holding on to. +#if defined(JSGC_COMPACTING) && defined(DEBUG) + unprotectRelocatedArenas(relocatedArenasToRelease); + releaseRelocatedArenasWithoutUnlocking(relocatedArenasToRelease, lock); + relocatedArenasToRelease = nullptr; +#endif + // Immediately decommit as many arenas as possible in the hopes that this // might let the OS scrape together enough pages to satisfy the failing // malloc request. From 2d3611488dc132a46fcfee2a8c4ae8a372650f56 Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Mon, 24 Nov 2014 04:06:44 -0800 Subject: [PATCH 04/88] Fix errors in cset bd04d03f7980 (test for bug 894137) --HG-- rename : content/base/crashtests/894137.html => dom/base/crashtests/894137.html --- {content => dom}/base/crashtests/894137.html | 0 dom/base/crashtests/crashtests.list | 1 + 2 files changed, 1 insertion(+) rename {content => dom}/base/crashtests/894137.html (100%) diff --git a/content/base/crashtests/894137.html b/dom/base/crashtests/894137.html similarity index 100% rename from content/base/crashtests/894137.html rename to dom/base/crashtests/894137.html diff --git a/dom/base/crashtests/crashtests.list b/dom/base/crashtests/crashtests.list index 69b47c611974..4ffe7b85d3ae 100644 --- a/dom/base/crashtests/crashtests.list +++ b/dom/base/crashtests/crashtests.list @@ -188,6 +188,7 @@ load 852381.html load 863950.html load 864448.html load 886213.html +load 894137.html load 898906.html load 930250.html load 942979.html From 1b1a24b820992d2410699221db4dbc2932bc76f6 Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 24 Nov 2014 12:56:29 +0000 Subject: [PATCH 05/88] Bug 1103906 - Update to latest wptrunner, a=testonly --- testing/web-platform/harness/setup.py | 2 +- .../browsers/b2g_setup/certtest_app.zip | Bin 0 -> 1244 bytes .../wptrunner/executors/executorservo.py | 3 +- .../harness/wptrunner/testrunner.py | 2 +- .../web-platform/harness/wptrunner/update.py | 15 +++++++ testing/web-platform/harness/wptrunner/vcs.py | 12 +++-- .../harness/wptrunner/wptcommandline.py | 32 ++++++++------ .../harness/wptrunner/wptrunner.py | 41 ++++++++++++++++-- 8 files changed, 83 insertions(+), 24 deletions(-) diff --git a/testing/web-platform/harness/setup.py b/testing/web-platform/harness/setup.py index 54c3c5e9ce28..be5b560a5e6b 100644 --- a/testing/web-platform/harness/setup.py +++ b/testing/web-platform/harness/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages here = os.path.split(__file__)[0] PACKAGE_NAME = 'wptrunner' -PACKAGE_VERSION = '1.5' +PACKAGE_VERSION = '1.7' # Dependencies with open(os.path.join(here, "requirements.txt")) as f: diff --git a/testing/web-platform/harness/wptrunner/browsers/b2g_setup/certtest_app.zip b/testing/web-platform/harness/wptrunner/browsers/b2g_setup/certtest_app.zip index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ade8879b212871878e63586598b7bca555b4c2ba 100644 GIT binary patch literal 1244 zcmWIWW@Zs#U|`^2FmK6rDfzT}tqYJB1;ktoG7On{DXA5D86~+np&^_M%$mjW!KOD9 zgG(#885miQ`K^1nb|J`DV6_Ye0Ljc?z*AsJH0=~t53}9wpIM2nv zzz=jsZem_$T555LUU_O#VnG4eF{L*ZgQoy7nq%gM`Q|^i;Mw~=IEBd- zJ%yjwR=f~l?@#N`)tPZIN8xpfawHFT%;X&RV${89a*drP{)z#KRu>!i;JOs&i1{wH>&&huPJ^dce(EO z4M8ublFGvk+Z7q*-{zi+DVP_mv3!#JzWd7-iwd@ETzm7HWOvYNkJu*H4=*x8IUYPI zxM7;}Xaei-8VW{TY#;j)7#codUQ ztv<)|GQ;$W-F3$P9czlWslNHVh~ccY&nmNqVwq(^$JQnp-qa ztBg_R)laK40d z8JrQpGmmPXV3FfYIsd7(_G!$D(>YI1vn_lqxcoHhtgFgN`#l79$HXt=ajBV~pWywi z^pcFDtO9S->_UEUc-&+1Q^P|?>uTP#W&pB|0RU#wg z`HSNb9*+H@Jbvf7A9s0I{_ouxx19a?U*?Lq6wVzdRvnR0RTV8V*17D?&a&NkcSgja z6rUab!lil4o2r^@jXtLw7GHm1#l}A-bDw`cdg!N=+Ap5;t&@-~H+couATCclDe2e87ZQFuB-xDuy&I^tClCVZA_UWt%?@u24r{~i@ zfE(sxxzfg?72()OCJ z2c;d)9Tnnun3`frf%IK8B&JY#{5IfN&|0R%8M3 E0Psr+#{d8T literal 0 HcmV?d00001 diff --git a/testing/web-platform/harness/wptrunner/executors/executorservo.py b/testing/web-platform/harness/wptrunner/executors/executorservo.py index c7703903356c..e4393d731a00 100644 --- a/testing/web-platform/harness/wptrunner/executors/executorservo.py +++ b/testing/web-platform/harness/wptrunner/executors/executorservo.py @@ -42,8 +42,7 @@ class ServoTestharnessExecutor(ProcessTestExecutor): # Now wait to get the output we expect, or until we reach the timeout self.result_flag.wait(timeout + 5) - if self.result_flag.is_set(): - assert self.result_data is not None + if self.result_flag.is_set() and self.result_data is not None: self.result_data["test"] = test.url result = self.convert_result(test, self.result_data) self.proc.kill() diff --git a/testing/web-platform/harness/wptrunner/testrunner.py b/testing/web-platform/harness/wptrunner/testrunner.py index 6637d5349828..8a88a73c2b58 100644 --- a/testing/web-platform/harness/wptrunner/testrunner.py +++ b/testing/web-platform/harness/wptrunner/testrunner.py @@ -359,7 +359,7 @@ class TestRunnerManager(threading.Thread): """Callback when we can't connect to the browser via marionette for some reason""" self.init_fail_count += 1 - self.logger.error("Init failed %i" % self.init_fail_count) + self.logger.warning("Init failed %i" % self.init_fail_count) self.init_timer.cancel() if self.init_fail_count < self.max_init_fails: self.restart_runner() diff --git a/testing/web-platform/harness/wptrunner/update.py b/testing/web-platform/harness/wptrunner/update.py index b0a2f9aea655..e0c9fba41f81 100644 --- a/testing/web-platform/harness/wptrunner/update.py +++ b/testing/web-platform/harness/wptrunner/update.py @@ -9,6 +9,8 @@ import sys import traceback import uuid +from mozlog.structured import commandline + import vcs from vcs import git, hg manifest = None @@ -16,6 +18,8 @@ import metadata import testloader import wptcommandline +logger = None + base_path = os.path.abspath(os.path.split(__file__)[0]) bsd_license = """W3C 3-clause BSD License @@ -49,12 +53,23 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ + def do_delayed_imports(serve_root): global manifest sys.path.insert(0, os.path.join(serve_root, "tools", "scripts")) import manifest +def setup_logging(args, defaults): + global logger + logger = commandline.setup_logging("web-platform-tests-update", args, defaults) + + for name in args.keys(): + if name.startswith("log_"): + args.pop(name) + + return logger + class RepositoryError(Exception): pass diff --git a/testing/web-platform/harness/wptrunner/vcs.py b/testing/web-platform/harness/wptrunner/vcs.py index fb49d471a7f2..e24acc6d810d 100644 --- a/testing/web-platform/harness/wptrunner/vcs.py +++ b/testing/web-platform/harness/wptrunner/vcs.py @@ -5,9 +5,15 @@ import subprocess from functools import partial +from mozlog.structured import get_default_logger + +logger = None def vcs(bin_name): def inner(command, *args, **kwargs): + global logger + if logger is None: + logger = get_default_logger("vcs") repo = kwargs.pop("repo", None) if kwargs: raise TypeError, kwargs @@ -19,12 +25,11 @@ def vcs(bin_name): proc_kwargs["cwd"] = repo command_line = [bin_name, command] + args - print " ".join(command_line) + logger.debug(" ".join(command_line)) try: return subprocess.check_output(command_line, **proc_kwargs) except subprocess.CalledProcessError as e: - print proc_kwargs - print e.output + logger.error(e.output) raise return inner @@ -41,5 +46,4 @@ def is_git_root(path): rv = git("rev-parse", "--show-cdup", repo=path) except subprocess.CalledProcessError: return False - print rv return rv == "\n" diff --git a/testing/web-platform/harness/wptrunner/wptcommandline.py b/testing/web-platform/harness/wptrunner/wptcommandline.py index cec95d39b45a..659cd2a96cb3 100644 --- a/testing/web-platform/harness/wptrunner/wptcommandline.py +++ b/testing/web-platform/harness/wptrunner/wptcommandline.py @@ -135,7 +135,6 @@ def set_from_config(kwargs): kwargs["config_path"] = config_path kwargs["config"] = config.read(kwargs["config_path"]) - kwargs["test_paths"] = OrderedDict() keys = {"paths": [("serve", "serve_root", True), ("prefs", "prefs_root", True), @@ -153,15 +152,7 @@ def set_from_config(kwargs): new_value = kwargs["config"].get(section, {}).get_path(config_value) kwargs[kw_value] = new_value - # Set up test_paths - - for section in kwargs["config"].iterkeys(): - if section.startswith("manifest:"): - manifest_opts = kwargs["config"].get(section) - url_base = manifest_opts.get("url_base", "/") - kwargs["test_paths"][url_base] = { - "tests_path": manifest_opts.get_path("tests"), - "metadata_path": manifest_opts.get_path("metadata")} + kwargs["test_paths"] = get_test_paths(kwargs["config"]) if kwargs["tests_root"]: if "/" not in kwargs["test_paths"]: @@ -173,9 +164,24 @@ def set_from_config(kwargs): kwargs["test_paths"]["/"] = {} kwargs["test_paths"]["/"]["metadata_path"] = kwargs["metadata_root"] +def get_test_paths(config): + # Set up test_paths + test_paths = OrderedDict() + + for section in config.iterkeys(): + if section.startswith("manifest:"): + manifest_opts = config.get(section) + url_base = manifest_opts.get("url_base", "/") + test_paths[url_base] = { + "tests_path": manifest_opts.get_path("tests"), + "metadata_path": manifest_opts.get_path("metadata")} + + return test_paths + + def check_args(kwargs): - from mozrunner import cli + from mozrunner import debugger_arguments set_from_config(kwargs) @@ -215,8 +221,8 @@ def check_args(kwargs): kwargs["chunk_type"] = "none" if kwargs["debugger"] is not None: - debug_args, interactive = cli.debugger_arguments(kwargs["debugger"], - kwargs["debugger_args"]) + debug_args, interactive = debugger_arguments(kwargs["debugger"], + kwargs["debugger_args"]) if interactive: require_arg(kwargs, "processes", lambda x: x == 1) kwargs["no_capture_stdio"] = True diff --git a/testing/web-platform/harness/wptrunner/wptrunner.py b/testing/web-platform/harness/wptrunner/wptrunner.py index 6896eb58ddb1..3883e00b5b61 100644 --- a/testing/web-platform/harness/wptrunner/wptrunner.py +++ b/testing/web-platform/harness/wptrunner/wptrunner.py @@ -18,7 +18,8 @@ from StringIO import StringIO from multiprocessing import Queue -from mozlog.structured import commandline, stdadapter +from mozlog.structured import (commandline, stdadapter, get_default_logger, + structuredlog, handlers, formatters) import products import testloader @@ -92,6 +93,29 @@ class TestEnvironmentError(Exception): pass +class LogLevelRewriter(object): + """Filter that replaces log messages at specified levels with messages + at a different level. + + This can be used to e.g. downgrade log messages from ERROR to WARNING + in some component where ERRORs are not critical. + + :param inner: Handler to use for messages that pass this filter + :param from_levels: List of levels which should be affected + :param to_level: Log level to set for the affected messages + """ + def __init__(self, inner, from_levels, to_level): + self.inner = inner + self.from_levels = [item.upper() for item in from_levels] + self.to_level = to_level.upper() + + def __call__(self, data): + if data["action"] == "log" and data["level"].upper() in self.from_levels: + data = data.copy() + data["level"] = self.to_level + return self.inner(data) + + class TestEnvironment(object): def __init__(self, serve_path, test_paths, options): """Context manager that owns the test environment i.e. the http and @@ -108,11 +132,10 @@ class TestEnvironment(object): def __enter__(self): self.copy_required_files() + self.setup_server_logging() self.setup_routes() self.config = self.load_config() serve.set_computed_defaults(self.config) - - serve.logger = serve.default_logger("info") self.external_config, self.servers = serve.start(self.config) return self @@ -140,6 +163,18 @@ class TestEnvironment(object): return config + def setup_server_logging(self): + server_logger = get_default_logger(component="wptserve") + assert server_logger is not None + log_filter = handlers.LogLevelFilter(lambda x:x, "info") + # Downgrade errors to warnings for the server + log_filter = LogLevelRewriter(log_filter, ["error"], "warning") + server_logger.component_filter = log_filter + + serve.logger = server_logger + #Set as the default logger for wptserve + serve.set_logger(server_logger) + def setup_routes(self): for url, paths in self.test_paths.iteritems(): if url == "/": From 174983d7b3b9ec522829bd83456ef4a907c76ee9 Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 24 Nov 2014 12:56:30 +0000 Subject: [PATCH 06/88] Bug 1103906 - Update web-platform-tests to revision 551060ba2eb3fa6d1c713c179d52fdf1132ea50c, a=testonly --HG-- rename : testing/web-platform/tests/dom/nodes/Document-createComment.html => testing/web-platform/tests/dom/nodes/Document-createTextNode.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html => testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html => testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js => testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js --- .../init-event-while-dispatching.html | 83 ++++ .../addEventListener.optional.useCapture.html | 75 ---- .../approved/dispatchEvent.return.value.html | 61 --- .../addEventListener.optional.useCapture.html | 75 ---- .../converted/dispatchEvent.return.value.html | 62 --- .../tests/XMLHttpRequest/interfaces.html | 90 +++- .../XMLHttpRequest/resources/auth1/auth.py | 7 +- .../XMLHttpRequest/resources/auth2/auth.py | 7 +- .../XMLHttpRequest/resources/auth3/auth.py | 7 +- .../XMLHttpRequest/resources/auth4/auth.py | 7 +- .../XMLHttpRequest/send-data-es-object.htm | 61 +++ .../send-data-unexpected-tostring.htm | 57 +++ .../web-platform/tests/docs/running_tests.md | 2 +- testing/web-platform/tests/dom/common.js | 2 - .../Event-dispatch-omitted-capture.html | 70 +++ ...EventTarget-dispatchEvent-returnvalue.html | 43 ++ .../web-platform/tests/dom/interfaces.html | 3 +- .../dom/nodes/Comment-Text-constructor.js | 77 ++++ .../tests/dom/nodes/Comment-constructor.html | 77 +--- .../DOMImplementation-createDocument.html | 1 + .../DOMImplementation-createHTMLDocument.html | 88 ++-- .../DOMImplementation-createHTMLDocument.js | 25 ++ .../dom/nodes/Document-createAttribute.html | 4 +- .../Document-createComment-createTextNode.js | 22 + .../dom/nodes/Document-createComment.html | 23 +- .../dom/nodes/Document-createTextNode.html | 21 + .../dom/nodes/Document-getElementById.html | 6 +- .../tests/dom/nodes/Text-constructor.html | 11 + .../tests/dom/nodes/attributes.js | 1 + .../tests/encoding/gb18030-encoder.html | 21 + .../tests/encoding/gbk-encoder.html | 21 + .../tests/encoding/iso-2022-jp-decoder.html | 57 +++ .../tests/encoding/iso-2022-jp-encoder.html | 18 + .../encoding/resources/single-byte-raw.py | 3 + .../tests/encoding/single-byte-decoder.html | 176 ++++++++ .../dom-tree-accessors/document.title-07.html | 23 +- .../move_iframe_in_dom_01.html | 8 +- .../move_iframe_in_dom_02.html | 6 +- .../move_iframe_in_dom_03.html | 6 +- .../move_iframe_in_dom_04.html | 8 +- .../SourceBuffer-abort-readyState.html | 9 +- .../SourceBuffer-abort-removed.html | 19 +- .../SourceBuffer-abort-updating.html | 45 +- .../media-source/SourceBuffer-abort.html | 38 +- ...etpointercapture_relatedtarget-manual.html | 2 +- .../Samsung/resources/no-content-length.py | 2 +- .../tests/resources/idlharness.js | 5 + .../web-platform/tests/resources/readme.md | 3 +- .../submissions/Opera/Element-matches.html | 87 ++++ .../submissions/Opera/Element-matches.js | 127 ++++++ ...line.html => ParentNode-find-findAll.html} | 30 +- .../Opera/ParentNode-find-findAll.js | 278 ++++++++++++ .../tests/submissions/Opera/level2-lib.js | 421 +----------------- testing/web-platform/tests/serve.py | 15 +- .../stub-4.1-service-worker-global-scope.html | 4 +- .../service-workers/stub-4.6.2-cache.html | 14 +- .../stub-4.6.3-cache-storage.html | 4 +- .../stub-4.7.4.1-fetch-event-section.html | 4 +- .../tests/tools/wptserve/wptserve/handlers.py | 49 +- .../tests/tools/wptserve/wptserve/logger.py | 29 ++ .../tests/tools/wptserve/wptserve/pipes.py | 11 +- .../tests/tools/wptserve/wptserve/request.py | 5 +- .../tests/tools/wptserve/wptserve/response.py | 10 +- .../tests/tools/wptserve/wptserve/router.py | 9 +- .../tests/tools/wptserve/wptserve/server.py | 39 +- .../web-platform/tests/url/interfaces.html | 38 +- .../web-platform/tests/url/urltestdata.txt | 16 +- .../tests/vibration/simple-array-manual.html | 17 +- .../tests/webdriver/webdriver.cfg | 5 + .../postMessage/event-ports-dedicated.html | 2 +- .../semantics/structured-clone/common.js | 36 +- .../structured-clone/worker-common.js | 9 +- 72 files changed, 1682 insertions(+), 1115 deletions(-) create mode 100644 testing/web-platform/tests/DOMEvents/init-event-while-dispatching.html delete mode 100644 testing/web-platform/tests/DOMEvents/tests/approved/addEventListener.optional.useCapture.html delete mode 100644 testing/web-platform/tests/DOMEvents/tests/approved/dispatchEvent.return.value.html delete mode 100644 testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html delete mode 100644 testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html create mode 100644 testing/web-platform/tests/XMLHttpRequest/send-data-es-object.htm create mode 100644 testing/web-platform/tests/XMLHttpRequest/send-data-unexpected-tostring.htm create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html create mode 100644 testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html create mode 100644 testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createComment-createTextNode.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createTextNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Text-constructor.html create mode 100644 testing/web-platform/tests/encoding/gb18030-encoder.html create mode 100644 testing/web-platform/tests/encoding/gbk-encoder.html create mode 100644 testing/web-platform/tests/encoding/iso-2022-jp-decoder.html create mode 100644 testing/web-platform/tests/encoding/iso-2022-jp-encoder.html create mode 100644 testing/web-platform/tests/encoding/resources/single-byte-raw.py create mode 100644 testing/web-platform/tests/encoding/single-byte-decoder.html create mode 100644 testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html create mode 100644 testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.js rename testing/web-platform/tests/selectors-api/tests/submissions/Opera/{level2-baseline.html => ParentNode-find-findAll.html} (72%) create mode 100644 testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js create mode 100644 testing/web-platform/tests/tools/wptserve/wptserve/logger.py diff --git a/testing/web-platform/tests/DOMEvents/init-event-while-dispatching.html b/testing/web-platform/tests/DOMEvents/init-event-while-dispatching.html new file mode 100644 index 000000000000..2aa1f6701c4c --- /dev/null +++ b/testing/web-platform/tests/DOMEvents/init-event-while-dispatching.html @@ -0,0 +1,83 @@ + + +Re-initializing events while dispatching them + + + +
+ diff --git a/testing/web-platform/tests/DOMEvents/tests/approved/addEventListener.optional.useCapture.html b/testing/web-platform/tests/DOMEvents/tests/approved/addEventListener.optional.useCapture.html deleted file mode 100644 index 02ee847828f3..000000000000 --- a/testing/web-platform/tests/DOMEvents/tests/approved/addEventListener.optional.useCapture.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - addEventListener() optional parameter: useCapture - - - - -
- - - - - - - - - - - - - - - - - diff --git a/testing/web-platform/tests/DOMEvents/tests/approved/dispatchEvent.return.value.html b/testing/web-platform/tests/DOMEvents/tests/approved/dispatchEvent.return.value.html deleted file mode 100644 index fcbedb04d96f..000000000000 --- a/testing/web-platform/tests/DOMEvents/tests/approved/dispatchEvent.return.value.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - dispatchEvent() return value and Event.preventDefault() - - - - -
- - - - - - - - - - - - - - - - - diff --git a/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html b/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html deleted file mode 100644 index 779435a5e79d..000000000000 --- a/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - addEventListener() optional parameter: useCapture - - - - -
- - - - - - - - - - - - - - - - - diff --git a/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html b/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html deleted file mode 100644 index 28edc3089f63..000000000000 --- a/testing/web-platform/tests/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - dispatchEvent() return value and Event.preventDefault() - - - - -
- - - - - - - - - - - - - - - - - diff --git a/testing/web-platform/tests/XMLHttpRequest/interfaces.html b/testing/web-platform/tests/XMLHttpRequest/interfaces.html index fbea8bef1f82..e987b49695a6 100644 --- a/testing/web-platform/tests/XMLHttpRequest/interfaces.html +++ b/testing/web-platform/tests/XMLHttpRequest/interfaces.html @@ -10,9 +10,42 @@
@@ -22,7 +55,8 @@ callback EventHandlerNonNull = any (Event event); typedef EventHandlerNonNull? EventHandler; + + + + +
+ + diff --git a/testing/web-platform/tests/XMLHttpRequest/send-data-unexpected-tostring.htm b/testing/web-platform/tests/XMLHttpRequest/send-data-unexpected-tostring.htm new file mode 100644 index 000000000000..357a9cff9d9d --- /dev/null +++ b/testing/web-platform/tests/XMLHttpRequest/send-data-unexpected-tostring.htm @@ -0,0 +1,57 @@ + + +XMLHttpRequest: passing objects that interfere with the XHR instance to send() + + + + + + +
+ + diff --git a/testing/web-platform/tests/docs/running_tests.md b/testing/web-platform/tests/docs/running_tests.md index a45223f08116..affbc90059d6 100644 --- a/testing/web-platform/tests/docs/running_tests.md +++ b/testing/web-platform/tests/docs/running_tests.md @@ -22,7 +22,7 @@ edge-cases like tests that cause the browser to crash or hang. ## By Automating the Browser For automated test running designed to be robust enough to use in a CI -environment, the [wptrunner](http://github.com/wptrunner) test runner +environment, the [wptrunner](http://github.com/w3c/wptrunner) test runner can be used. This is a test runner written in Python and designed to control the browser from the outside using some remote control protocol such as WebDriver. This allows it to handle cases such as the diff --git a/testing/web-platform/tests/dom/common.js b/testing/web-platform/tests/dom/common.js index 91ccb4425d7d..2cc36bf6a079 100644 --- a/testing/web-platform/tests/dom/common.js +++ b/testing/web-platform/tests/dom/common.js @@ -5,7 +5,6 @@ // Everything is done in functions in this test harness, so we have to declare // all the variables before use to make sure they can be reused. -var selection; var testDiv, paras, detachedDiv, detachedPara1, detachedPara2, foreignDoc, foreignPara1, foreignPara2, xmlDoc, xmlElement, detachedXmlElement, detachedTextNode, foreignTextNode, @@ -17,7 +16,6 @@ var testDiv, paras, detachedDiv, detachedPara1, detachedPara2, var testRangesShort, testRanges, testPoints, testNodesShort, testNodes; function setupRangeTests() { - selection = getSelection(); testDiv = document.querySelector("#test"); if (testDiv) { testDiv.parentNode.removeChild(testDiv); diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html b/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html new file mode 100644 index 000000000000..77074d9a3ec2 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html @@ -0,0 +1,70 @@ + + +EventTarget.addEventListener: capture argument omitted + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html new file mode 100644 index 000000000000..8804c38a53b8 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html @@ -0,0 +1,43 @@ + + +EventTarget.dispatchEvent: return value + + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/interfaces.html b/testing/web-platform/tests/dom/interfaces.html index 60c7c83e5145..b5c10eec19d4 100644 --- a/testing/web-platform/tests/dom/interfaces.html +++ b/testing/web-platform/tests/dom/interfaces.html @@ -360,7 +360,8 @@ interface Attr { readonly attribute DOMString localName; readonly attribute DOMString name; attribute DOMString value; - attribute DOMString textContent; // alias of .value + attribute DOMString nodeValue; // legacy alias of .value + attribute DOMString textContent; // legacy alias of .value readonly attribute Element? ownerElement; diff --git a/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js b/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js new file mode 100644 index 000000000000..360b9760e3e2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js @@ -0,0 +1,77 @@ +function test_constructor(ctor) { + test(function() { + var object = new window[ctor](); + assert_equals(Object.getPrototypeOf(object), + window[ctor].prototype, "Prototype chain: " + ctor); + assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(object)), + CharacterData.prototype, "Prototype chain: CharacterData"); + assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(object))), + Node.prototype, "Prototype chain: Node"); + }, "new " + ctor + "(): prototype chain"); + + test(function() { + var object = new window[ctor](); + assert_true(object instanceof Node, "Should be a Node"); + assert_true(object instanceof CharacterData, "Should be a CharacterData"); + assert_true(object instanceof window[ctor], "Should be a " + ctor); + }, "new " + ctor + "(): instanceof"); + + test(function() { + var object = new window[ctor](); + assert_equals(object.data, ""); + assert_equals(object.nodeValue, ""); + assert_equals(object.ownerDocument, document); + }, "new " + ctor + "(): no arguments"); + + var arguments = [ + [undefined, ""], + [null, "null"], + [42, "42"], + ["", ""], + ["-", "-"], + ["--", "--"], + ["-->", "-->"], + ["", "-->"], - [" + + +
+ diff --git a/testing/web-platform/tests/encoding/gbk-encoder.html b/testing/web-platform/tests/encoding/gbk-encoder.html new file mode 100644 index 000000000000..a6074f975d34 --- /dev/null +++ b/testing/web-platform/tests/encoding/gbk-encoder.html @@ -0,0 +1,21 @@ + + + + +
+ diff --git a/testing/web-platform/tests/encoding/iso-2022-jp-decoder.html b/testing/web-platform/tests/encoding/iso-2022-jp-decoder.html new file mode 100644 index 000000000000..c86ffc158992 --- /dev/null +++ b/testing/web-platform/tests/encoding/iso-2022-jp-decoder.html @@ -0,0 +1,57 @@ + + + + +
+ diff --git a/testing/web-platform/tests/encoding/iso-2022-jp-encoder.html b/testing/web-platform/tests/encoding/iso-2022-jp-encoder.html new file mode 100644 index 000000000000..d3124e5f54b6 --- /dev/null +++ b/testing/web-platform/tests/encoding/iso-2022-jp-encoder.html @@ -0,0 +1,18 @@ + + + + +
+ diff --git a/testing/web-platform/tests/encoding/resources/single-byte-raw.py b/testing/web-platform/tests/encoding/resources/single-byte-raw.py new file mode 100644 index 000000000000..b4a6c90405ec --- /dev/null +++ b/testing/web-platform/tests/encoding/resources/single-byte-raw.py @@ -0,0 +1,3 @@ +def main(request, response): + response.headers.set("Content-Type", "text/plain;charset=" + request.GET.first("label")) + response.content = "".join(chr(byte) for byte in xrange(255)) diff --git a/testing/web-platform/tests/encoding/single-byte-decoder.html b/testing/web-platform/tests/encoding/single-byte-decoder.html new file mode 100644 index 000000000000..e92af46b2bf0 --- /dev/null +++ b/testing/web-platform/tests/encoding/single-byte-decoder.html @@ -0,0 +1,176 @@ + + + +
+ diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html index eea97c9ede1b..9723d3f81155 100644 --- a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html +++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-07.html @@ -2,25 +2,10 @@ Document.title and DOMImplementation.createHTMLDocument +
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html index 128a62746df3..efd563f51ac0 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html @@ -9,12 +9,12 @@ onload = function() { var ifr = document.getElementsByTagName('iframe')[0]; ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document'; - setTimeout(function () { - document.getElementById('target').appendChild(ifr); - setTimeout(function() { + setTimeout(function() { + ifr.onload = function() { assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1); done(); - }, 100); + }; + document.getElementById('target').appendChild(ifr); }, 100); } diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html index e93bbb3b5ff2..dbe266b2930a 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_02.html @@ -12,11 +12,11 @@ onload = function() { ifr.contentDocument.write('Modified document'); ifr.contentDocument.close(); setTimeout(function() { - document.getElementById('target').appendChild(ifr); - setTimeout(function() { + ifr.onload = function() { assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1); done(); - }, 100); + }; + document.getElementById('target').appendChild(ifr); }, 100); } diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html index 498ac771a1e2..c07dd42dc813 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html @@ -10,11 +10,11 @@ onload = function() { var ifr = document.getElementsByTagName('iframe')[0]; ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document'; setTimeout(function() { - document.getElementById('target').appendChild(ifr); - setTimeout(function() { + ifr.onload = function() { assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1); done(); - }, 100); + }; + document.getElementById('target').appendChild(ifr); }, 100); } \ No newline at end of file diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html index b16caf1e4b27..755cd45d34b7 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_04.html @@ -11,12 +11,12 @@ onload = function(){ ifr.contentDocument.open(); ifr.contentDocument.write('Modified document'); ifr.contentDocument.close(); - setTimeout(function () { - document.getElementById('target').appendChild(ifr); - setTimeout(function () { + setTimeout(function() { + ifr.onload = function () { assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1); done(); - }, 100); + }; + document.getElementById('target').appendChild(ifr); }, 100); } \ No newline at end of file diff --git a/testing/web-platform/tests/media-source/SourceBuffer-abort-readyState.html b/testing/web-platform/tests/media-source/SourceBuffer-abort-readyState.html index c29f7611f42b..515031687ae7 100644 --- a/testing/web-platform/tests/media-source/SourceBuffer-abort-readyState.html +++ b/testing/web-platform/tests/media-source/SourceBuffer-abort-readyState.html @@ -10,7 +10,6 @@
diff --git a/testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_relatedtarget-manual.html b/testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_relatedtarget-manual.html index e973c2101f3b..45b67414b267 100644 --- a/testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_relatedtarget-manual.html +++ b/testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_relatedtarget-manual.html @@ -15,7 +15,7 @@
  1. Put your mouse over the lower rectangle. pointerover should be received for the purple rectangle
  2. Press and hold left mouse button over "Set Capture" button -
  3. Put your mouse over the lower rectangle. pointerover should be received for the black rectangle +
  4. Put your mouse over the upper rectangle. pointerover should be received for the black rectangle
  5. Release left mouse button to complete the test.
diff --git a/testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/no-content-length.py b/testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/no-content-length.py index bf73dc707153..0b47ff146ccf 100644 --- a/testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/no-content-length.py +++ b/testing/web-platform/tests/progress-events/tests/submissions/Samsung/resources/no-content-length.py @@ -1,5 +1,5 @@ def main(request, response): - response.headers.extend([('Transfer-Encoding', 'chunked'), + response.headers.update([('Transfer-Encoding', 'chunked'), ('Content-Type', 'text/html'), ('Connection', 'keep-alive')]) response.write_status_headers() diff --git a/testing/web-platform/tests/resources/idlharness.js b/testing/web-platform/tests/resources/idlharness.js index e1aeae378f36..b6c02a3f8ddb 100644 --- a/testing/web-platform/tests/resources/idlharness.js +++ b/testing/web-platform/tests/resources/idlharness.js @@ -426,6 +426,9 @@ IdlArray.prototype.assert_type_is = function(value, type) return; case "DOMString": + case "ByteString": + case "USVString": + // TODO: https://github.com/w3c/testharness.js/issues/92 assert_equals(typeof value, "string"); return; @@ -1798,6 +1801,8 @@ function create_suitable_object(type) return 7; case "DOMString": + case "ByteString": + case "USVString": return "foo"; case "object": diff --git a/testing/web-platform/tests/resources/readme.md b/testing/web-platform/tests/resources/readme.md index 7e54cf6cc2ce..5c5b36c28693 100644 --- a/testing/web-platform/tests/resources/readme.md +++ b/testing/web-platform/tests/resources/readme.md @@ -16,7 +16,8 @@ To use testharness.js you must include two scripts, in the order given: ## Full documentation ## -Full documentation of the API is kept in the source of testharness.js. +Full user documentation for the API is in the +[docs/api.md](https://github.com/w3c/testharness.js/blob/master/docs/api.md) file. You can also read a tutorial on [Using testharness.js](http://darobin.github.com/test-harness-tutorial/docs/using-testharness.html). diff --git a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html new file mode 100644 index 000000000000..db73e4012c3e --- /dev/null +++ b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html @@ -0,0 +1,87 @@ + + +Selectors-API Level 2 Test Suite: HTML with Selectors Level 3 + + + + + + + + +
This test requires JavaScript.
+ + diff --git a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.js b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.js new file mode 100644 index 000000000000..1bc0f3d0887d --- /dev/null +++ b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.js @@ -0,0 +1,127 @@ +/* + * Check that the matches() method exists on the given Node + */ +function interfaceCheckMatches(type, obj) { + if (obj.nodeType === obj.ELEMENT_NODE) { + test(function() { + assert_idl_attribute(obj, "matches", type + " supports matches"); + }, type + " supports matches") + } +} + +function runSpecialMatchesTests(type, element) { + test(function() { // 1 + if (element.tagName.toLowerCase() === "null") { + assert_true(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); + } else { + assert_false(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); + } + }, type + ".matches(null)") + + test(function() { // 2 + if (element.tagName.toLowerCase() === "undefined") { + assert_true(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); + } else { + assert_false(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); + } + }, type + ".matches(undefined)") + + test(function() { // 3 + assert_throws(TypeError(), function() { + element.matches(); + }, "This should throw a TypeError.") + }, type + ".matches no parameter") +} + +/* + * Execute queries with the specified invalid selectors for matches() + * Only run these tests when errors are expected. Don't run for valid selector tests. + */ +function runInvalidSelectorTestMatches(type, root, selectors) { + if (root.nodeType === root.ELEMENT_NODE) { + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + + test(function() { + assert_throws("SyntaxError", function() { + root.matches(q) + }) + }, type + ".matches: " + n + ": " + q); + } + } +} + +function runMatchesTest(type, root, selectors, docType) { + var nodeType = getNodeType(root); + + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + var e = s["expect"]; + var u = s["unexpected"]; + + var ctx = s["ctx"]; + var ref = s["ref"]; + + if ((!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) + && (s["testType"] & TEST_MATCH) ) { + + if (ctx && !ref) { + test(function() { + var j, element, refNode; + for (j = 0; j < e.length; j++) { + element = root.querySelector("#" + e[j]); + refNode = root.querySelector(ctx); + assert_true(element.matches(q, refNode), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + refNode = root.querySelector(ctx); + assert_false(element.matches(q, refNode), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with refNode Element): " + q); + } + + if (ref) { + test(function() { + var j, element, refNodes; + for (j = 0; j < e.length; j++) { + element = root.querySelector("#" + e[j]); + refNodes = root.querySelectorAll(ref); + assert_true(element.matches(q, refNodes), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + refNodes = root.querySelectorAll(ref); + assert_false(element.matches(q, refNodes), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with refNodes NodeList): " + q); + } + + if (!ctx && !ref) { + test(function() { + for (var j = 0; j < e.length; j++) { + var element = root.querySelector("#" + e[j]); + assert_true(element.matches(q), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + assert_false(element.matches(q), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with no refNodes): " + q); + } + } + } +} diff --git a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.html similarity index 72% rename from testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html rename to testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.html index 9d1e61d9b0d7..e319f60cef5a 100644 --- a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html +++ b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.html @@ -6,12 +6,12 @@ +
This test requires JavaScript.
diff --git a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js new file mode 100644 index 000000000000..b27bfd91c261 --- /dev/null +++ b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js @@ -0,0 +1,278 @@ +/* + * Check that the find and findAll methods exist on the given Node + */ +function interfaceCheckFind(type, obj) { + test(function() { + var q = typeof obj.find === "function"; + assert_true(q, type + " supports find."); + }, type + " supports find") + + test(function() { + var qa = typeof obj.findAll === "function"; + assert_true( qa, type + " supports findAll."); + }, type + " supports findAll") +} + +/* + * Verify that the NodeList returned by findAll is static and and that a new list is created after + * each call. A static list should not be affected by subsequent changes to the DOM. + */ +function verifyStaticList(type, root) { + var pre, post, preLength; + + test(function() { + pre = root.findAll("div"); + preLength = pre.length; + + var div = doc.createElement("div"); + (root.body || root).appendChild(div); + + assert_equals(pre.length, preLength, "The length of the NodeList should not change.") + }, type + ": static NodeList") + + test(function() { + post = root.findAll("div"), + assert_equals(post.length, preLength + 1, "The length of the new NodeList should be 1 more than the previous list.") + }, type + ": new NodeList") +} + +/* + * Verify handling of special values for the selector parameter, including stringification of + * null and undefined, and the handling of the empty string. + */ +function runSpecialSelectorTests(type, root) { + test(function() { // 1 + assert_equals(root.findAll(null).length, 1, "This should find one element with the tag name 'NULL'."); + }, type + ".findAll null") + + test(function() { // 2 + assert_equals(root.findAll(undefined).length, 1, "This should find one elements with the tag name 'UNDEFINED'."); + }, type + ".findAll undefined") + + test(function() { // 3 + assert_throws(TypeError(), function() { + root.findAll(); + }, "This should throw a TypeError.") + }, type + ".findAll no parameter") + + test(function() { // 4 + var elm = root.find(null) + assert_not_equals(elm, null, "This should find an element."); + assert_equals(elm.tagName.toUpperCase(), "NULL", "The tag name should be 'NULL'.") + }, type + ".find null") + + test(function() { // 5 + var elm = root.find(undefined) + assert_not_equals(elm, undefined, "This should find an element."); + assert_equals(elm.tagName.toUpperCase(), "UNDEFINED", "The tag name should be 'UNDEFINED'.") + }, type + ".find undefined") + + test(function() { // 6 + assert_throws(TypeError(), function() { + root.find(); + }, "This should throw a TypeError.") + }, type + ".find no parameter.") + + test(function() { // 7 + result = root.findAll("*"); + var i = 0; + traverse(root, function(elem) { + if (elem !== root) { + assert_equals(elem, result[i++], "The result in index " + i + " should be in tree order.") + } + }) + }, type + ".findAll tree order"); +} + +/* + * Execute queries with the specified valid selectors for both find() and findAll() + * Only run these tests when results are expected. Don't run for syntax error tests. + * + * context.findAll(selector, refNodes) + * context.findAll(selector) // Only if refNodes is not specified + * root.findAll(selector, context) // Only if refNodes is not specified + * root.findAll(selector, refNodes) // Only if context is not specified + * root.findAll(selector) // Only if neither context nor refNodes is specified + * + * Equivalent tests will be run for .find() as well. + */ +function runValidSelectorTest(type, root, selectors, docType) { + var nodeType = getNodeType(root); + + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + var e = s["expect"]; + + var ctx = s["ctx"]; + var ref = s["ref"]; + + if (!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) { + //console.log("Running tests " + nodeType + ": " + s["testType"] + "&" + testType + "=" + (s["testType"] & testType) + ": " + JSON.stringify(s)) + var foundall, found, context, refNodes, refArray; + + if (s["testType"] & TEST_FIND) { + + + /* + * If ctx and ref are specified: + * context.findAll(selector, refNodes) + * context.find(selector, refNodes) + */ + if (ctx && ref) { + context = root.querySelector(ctx); + refNodes = root.querySelectorAll(ref); + refArray = Array.prototype.slice.call(refNodes, 0); + + test(function() { + foundall = context.findAll(q, refNodes); + verifyNodeList(foundall, expect); + }, type + " [Context Element].findAll: " + n + " (with refNodes NodeList): " + q); + + test(function() { + foundall = context.findAll(q, refArray); + verifyNodeList(foundall, expect); + }, type + " [Context Element].findAll: " + n + " (with refNodes Array): " + q); + + test(function() { + found = context.find(q, refNodes); + verifyElement(found, foundall, expect) + }, type + " [Context Element].find: " + n + " (with refNodes NodeList): " + q); + + test(function() { + found = context.find(q, refArray); + verifyElement(found, foundall, expect) + }, type + " [Context Element].find: " + n + " (with refNodes Array): " + q); + } + + + /* + * If ctx is specified, ref is not: + * context.findAll(selector) + * context.find(selector) + * root.findAll(selector, context) + * root.find(selector, context) + */ + if (ctx && !ref) { + context = root.querySelector(ctx); + + test(function() { + foundall = context.findAll(q); + verifyNodeList(foundall, expect); + }, type + " [Context Element].findAll: " + n + " (with no refNodes): " + q); + + test(function() { + found = context.find(q); + verifyElement(found, foundall, expect) + }, type + " [Context Element].find: " + n + " (with no refNodes): " + q); + + test(function() { + foundall = root.findAll(q, context); + verifyNodeList(foundall, expect); + }, type + " [Root Node].findAll: " + n + " (with refNode Element): " + q); + + test(function() { + foundall = root.find(q, context); + verifyElement(found, foundall, expect); + }, type + " [Root Node].find: " + n + " (with refNode Element): " + q); + } + + /* + * If ref is specified, ctx is not: + * root.findAll(selector, refNodes) + * root.find(selector, refNodes) + */ + if (!ctx && ref) { + refNodes = root.querySelectorAll(ref); + refArray = Array.prototype.slice.call(refNodes, 0); + + test(function() { + foundall = root.findAll(q, refNodes); + verifyNodeList(foundall, expect); + }, type + " [Root Node].findAll: " + n + " (with refNodes NodeList): " + q); + + test(function() { + foundall = root.findAll(q, refArray); + verifyNodeList(foundall, expect); + }, type + " [Root Node].findAll: " + n + " (with refNodes Array): " + q); + + test(function() { + found = root.find(q, refNodes); + verifyElement(found, foundall, expect); + }, type + " [Root Node].find: " + n + " (with refNodes NodeList): " + q); + + test(function() { + found = root.find(q, refArray); + verifyElement(found, foundall, expect); + }, type + " [Root Node].find: " + n + " (with refNodes Array): " + q); + } + + /* + * If neither ctx nor ref is specified: + * root.findAll(selector) + * root.find(selector) + */ + if (!ctx && !ref) { + test(function() { + foundall = root.findAll(q); + verifyNodeList(foundall, expect); + }, type + ".findAll: " + n + " (with no refNodes): " + q); + + test(function() { + found = root.find(q); + verifyElement(found, foundall, expect); + }, type + ".find: " + n + " (with no refNodes): " + q); + } + } + } else { + //console.log("Excluding for " + nodeType + ": " + s["testType"] + "&" + testType + "=" + (s["testType"] & testType) + ": " + JSON.stringify(s)) + } + } +} + +/* + * Execute queries with the specified invalid selectors for both find() and findAll() + * Only run these tests when errors are expected. Don't run for valid selector tests. + */ +function runInvalidSelectorTestFind(type, root, selectors) { + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + + test(function() { + assert_throws("SyntaxError", function() { + root.find(q) + }) + }, type + ".find: " + n + ": " + q); + + test(function() { + assert_throws("SyntaxError", function() { + root.findAll(q) + }) + }, type + ".findAll: " + n + ": " + q); + } +} + +function verifyNodeList(resultAll, expect) { + assert_not_equals(resultAll, null, "The method should not return null."); + assert_equals(resultAll.length, e.length, "The method should return the expected number of matches."); + + for (var i = 0; i < e.length; i++) { + assert_not_equals(resultAll[i], null, "The item in index " + i + " should not be null.") + assert_equals(resultAll[i].getAttribute("id"), e[i], "The item in index " + i + " should have the expected ID."); + assert_false(resultAll[i].hasAttribute("data-clone"), "This should not be a cloned element."); + } +} + +function verifyElement(result, resultAll, expect) { + if (expect.length > 0) { + assert_not_equals(result, null, "The method should return a match.") + assert_equals(found.getAttribute("id"), e[0], "The method should return the first match."); + assert_equals(result, resultAll[0], "The result should match the first item from querySelectorAll."); + assert_false(found.hasAttribute("data-clone"), "This should not be annotated as a cloned element."); + } else { + assert_equals(result, null, "The method should not match anything."); + } +} diff --git a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js index eb2c0f4b9c02..afcdb9720434 100644 --- a/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js +++ b/testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js @@ -47,403 +47,14 @@ function setupSpecialElements(parent) { parent.appendChild(noNS); } -/* - * Check that the find, findAll and matches() methods exist on the given Node - */ -function interfaceCheck(type, obj) { - test(function() { - var q = typeof obj.find === "function"; - assert_true(q, type + " supports find."); - }, type + " supports find") - - test(function() { - var qa = typeof obj.findAll === "function"; - assert_true( qa, type + " supports findAll."); - }, type + " supports findAll") - - if (obj.nodeType === obj.ELEMENT_NODE) { - test(function() { - assert_idl_attribute(obj, "matches", type + " supports matches"); - }, type + " supports matches") - } -} - -/* - * Verify that the NodeList returned by findAll is static and and that a new list is created after - * each call. A static list should not be affected by subsequent changes to the DOM. - */ -function verifyStaticList(type, root) { - var pre, post, preLength; - - test(function() { - pre = root.findAll("div"); - preLength = pre.length; - - var div = doc.createElement("div"); - (root.body || root).appendChild(div); - - assert_equals(pre.length, preLength, "The length of the NodeList should not change.") - }, type + ": static NodeList") - - test(function() { - post = root.findAll("div"), - assert_equals(post.length, preLength + 1, "The length of the new NodeList should be 1 more than the previous list.") - }, type + ": new NodeList") -} - -/* - * Verify handling of special values for the selector parameter, including stringification of - * null and undefined, and the handling of the empty string. - */ -function runSpecialSelectorTests(type, root) { - test(function() { // 1 - assert_equals(root.findAll(null).length, 1, "This should find one element with the tag name 'NULL'."); - }, type + ".findAll null") - - test(function() { // 2 - assert_equals(root.findAll(undefined).length, 1, "This should find one elements with the tag name 'UNDEFINED'."); - }, type + ".findAll undefined") - - test(function() { // 3 - assert_throws(TypeError(), function() { - root.findAll(); - }, "This should throw a TypeError.") - }, type + ".findAll no parameter") - - test(function() { // 4 - var elm = root.find(null) - assert_not_equals(elm, null, "This should find an element."); - assert_equals(elm.tagName.toUpperCase(), "NULL", "The tag name should be 'NULL'.") - }, type + ".find null") - - test(function() { // 5 - var elm = root.find(undefined) - assert_not_equals(elm, undefined, "This should find an element."); - assert_equals(elm.tagName.toUpperCase(), "UNDEFINED", "The tag name should be 'UNDEFINED'.") - }, type + ".find undefined") - - test(function() { // 6 - assert_throws(TypeError(), function() { - root.find(); - }, "This should throw a TypeError.") - }, type + ".find no parameter.") - - test(function() { // 7 - result = root.findAll("*"); - var i = 0; - traverse(root, function(elem) { - if (elem !== root) { - assert_equals(elem, result[i++], "The result in index " + i + " should be in tree order.") - } - }) - }, type + ".findAll tree order"); -} - -function runSpecialMatchesTests(type, element) { - test(function() { // 1 - if (element.tagName.toLowerCase() === "null") { - assert_true(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); - } else { - assert_false(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); - } - }, type + ".matches(null)") - - test(function() { // 2 - if (element.tagName.toLowerCase() === "undefined") { - assert_true(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); - } else { - assert_false(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); - } - }, type + ".matches(undefined)") - - test(function() { // 3 - assert_throws(TypeError(), function() { - element.matches(); - }, "This should throw a TypeError.") - }, type + ".matches no parameter") -} - -/* - * Execute queries with the specified valid selectors for both find() and findAll() - * Only run these tests when results are expected. Don't run for syntax error tests. - * - * Where testType is TEST_FIND_BASELINE or TEST_FIND_ADDITIONAL: - * - * context.findAll(selector, refNodes) - * context.findAll(selector) // Only if refNodes is not specified - * root.findAll(selector, context) // Only if refNodes is not specified - * root.findAll(selector, refNodes) // Only if context is not specified - * root.findAll(selector) // Only if neither context nor refNodes is specified - * - * Where testType is TEST_QSA_BASELINE or TEST_QSA_ADDITIONAL - * - * context.querySelectorAll(selector) // Only if refNodes is not specified - * root.querySelectorAll(selector) // Only if neither context nor refNodes is specified - * - * Equivalent tests will be run for .find() as well. - * Note: Do not specify a testType of TEST_QSA_* where either implied :scope or explicit refNodes - * are required. - */ -function runValidSelectorTest(type, root, selectors, testType, docType) { - var nodeType = getNodeType(root); - - for (var i = 0; i < selectors.length; i++) { - var s = selectors[i]; - var n = s["name"]; - var q = s["selector"]; - var e = s["expect"]; - - var ctx = s["ctx"]; - var ref = s["ref"]; - - if (!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) { - //console.log("Running tests " + nodeType + ": " + s["testType"] + "&" + testType + "=" + (s["testType"] & testType) + ": " + JSON.stringify(s)) - var foundall, found, context, refNodes, refArray; - - if (s["testType"] & testType & (TEST_FIND)) { - - - /* - * If ctx and ref are specified: - * context.findAll(selector, refNodes) - * context.find(selector, refNodes) - */ - if (ctx && ref) { - context = root.querySelector(ctx); - refNodes = root.querySelectorAll(ref); - refArray = Array.prototype.slice.call(refNodes, 0); - - test(function() { - foundall = context.findAll(q, refNodes); - verifyNodeList(foundall, expect); - }, type + " [Context Element].findAll: " + n + " (with refNodes NodeList): " + q); - - test(function() { - foundall = context.findAll(q, refArray); - verifyNodeList(foundall, expect); - }, type + " [Context Element].findAll: " + n + " (with refNodes Array): " + q); - - test(function() { - found = context.find(q, refNodes); - verifyElement(found, foundall, expect) - }, type + " [Context Element].find: " + n + " (with refNodes NodeList): " + q); - - test(function() { - found = context.find(q, refArray); - verifyElement(found, foundall, expect) - }, type + " [Context Element].find: " + n + " (with refNodes Array): " + q); - } - - - /* - * If ctx is specified, ref is not: - * context.findAll(selector) - * context.find(selector) - * root.findAll(selector, context) - * root.find(selector, context) - */ - if (ctx && !ref) { - context = root.querySelector(ctx); - - test(function() { - foundall = context.findAll(q); - verifyNodeList(foundall, expect); - }, type + " [Context Element].findAll: " + n + " (with no refNodes): " + q); - - test(function() { - found = context.find(q); - verifyElement(found, foundall, expect) - }, type + " [Context Element].find: " + n + " (with no refNodes): " + q); - - test(function() { - foundall = root.findAll(q, context); - verifyNodeList(foundall, expect); - }, type + " [Root Node].findAll: " + n + " (with refNode Element): " + q); - - test(function() { - foundall = root.find(q, context); - verifyElement(found, foundall, expect); - }, type + " [Root Node].find: " + n + " (with refNode Element): " + q); - } - - /* - * If ref is specified, ctx is not: - * root.findAll(selector, refNodes) - * root.find(selector, refNodes) - */ - if (!ctx && ref) { - refNodes = root.querySelectorAll(ref); - refArray = Array.prototype.slice.call(refNodes, 0); - - test(function() { - foundall = root.findAll(q, refNodes); - verifyNodeList(foundall, expect); - }, type + " [Root Node].findAll: " + n + " (with refNodes NodeList): " + q); - - test(function() { - foundall = root.findAll(q, refArray); - verifyNodeList(foundall, expect); - }, type + " [Root Node].findAll: " + n + " (with refNodes Array): " + q); - - test(function() { - found = root.find(q, refNodes); - verifyElement(found, foundall, expect); - }, type + " [Root Node].find: " + n + " (with refNodes NodeList): " + q); - - test(function() { - found = root.find(q, refArray); - verifyElement(found, foundall, expect); - }, type + " [Root Node].find: " + n + " (with refNodes Array): " + q); - } - - /* - * If neither ctx nor ref is specified: - * root.findAll(selector) - * root.find(selector) - */ - if (!ctx && !ref) { - test(function() { - foundall = root.findAll(q); - verifyNodeList(foundall, expect); - }, type + ".findAll: " + n + " (with no refNodes): " + q); - - test(function() { - found = root.find(q); - verifyElement(found, foundall, expect); - }, type + ".find: " + n + " (with no refNodes): " + q); - } - } - - if (s["testType"] & testType & (TEST_QSA)) { - if (ctx && !ref) { - // context.querySelectorAll(selector) // Only if refNodes is not specified - } - - if (!ctx && !ref) { - // root.querySelectorAll(selector) // Only if neither context nor refNodes is specified - } - } - } else { - //console.log("Excluding for " + nodeType + ": " + s["testType"] + "&" + testType + "=" + (s["testType"] & testType) + ": " + JSON.stringify(s)) - } - } -} - -/* - * Execute queries with the specified invalid selectors for both find() and findAll() - * Only run these tests when errors are expected. Don't run for valid selector tests. - */ -function runInvalidSelectorTest(type, root, selectors) { - for (var i = 0; i < selectors.length; i++) { - var s = selectors[i]; - var n = s["name"]; - var q = s["selector"]; - - test(function() { - assert_throws("SyntaxError", function() { - root.find(q) - }) - }, type + ".find: " + n + ": " + q); - - test(function() { - assert_throws("SyntaxError", function() { - root.findAll(q) - }) - }, type + ".findAll: " + n + ": " + q); - - if (root.nodeType === root.ELEMENT_NODE) { - test(function() { - assert_throws("SyntaxError", function() { - root.matches(q) - }) - }, type + ".matches: " + n + ": " + q); - } - } -} - -function runMatchesTest(type, root, selectors, testType, docType) { - var nodeType = getNodeType(root); - - for (var i = 0; i < selectors.length; i++) { - var s = selectors[i]; - var n = s["name"]; - var q = s["selector"]; - var e = s["expect"]; - var u = s["unexpected"]; - - var ctx = s["ctx"]; - var ref = s["ref"]; - - if ((!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) - && (s["testType"] & testType & (TEST_MATCH)) ) { - - if (ctx && !ref) { - test(function() { - var j, element, refNode; - for (j = 0; j < e.length; j++) { - element = root.querySelector("#" + e[j]); - refNode = root.querySelector(ctx); - assert_true(element.matches(q, refNode), "The element #" + e[j] + " should match the selector.") - } - - if (u) { - for (j = 0; j < u.length; j++) { - element = root.querySelector("#" + u[j]); - refNode = root.querySelector(ctx); - assert_false(element.matches(q, refNode), "The element #" + u[j] + " should not match the selector.") - } - } - }, type + " Element.matches: " + n + " (with refNode Element): " + q); - } - - if (ref) { - test(function() { - var j, element, refNodes; - for (j = 0; j < e.length; j++) { - element = root.querySelector("#" + e[j]); - refNodes = root.querySelectorAll(ref); - assert_true(element.matches(q, refNodes), "The element #" + e[j] + " should match the selector.") - } - - if (u) { - for (j = 0; j < u.length; j++) { - element = root.querySelector("#" + u[j]); - refNodes = root.querySelectorAll(ref); - assert_false(element.matches(q, refNodes), "The element #" + u[j] + " should not match the selector.") - } - } - }, type + " Element.matches: " + n + " (with refNodes NodeList): " + q); - } - - if (!ctx && !ref) { - test(function() { - for (var j = 0; j < e.length; j++) { - var element = root.querySelector("#" + e[j]); - assert_true(element.matches(q), "The element #" + e[j] + " should match the selector.") - } - - if (u) { - for (j = 0; j < u.length; j++) { - element = root.querySelector("#" + u[j]); - assert_false(element.matches(q), "The element #" + u[j] + " should not match the selector.") - } - } - }, type + " Element.matches: " + n + " (with no refNodes): " + q); - } - } - } -} - - function traverse(elem, fn) { if (elem.nodeType === elem.ELEMENT_NODE) { fn(elem); - - elem = elem.firstChild; - while (elem) { - traverse(elem, fn); - elem = elem.nextSibling; - } + } + elem = elem.firstChild; + while (elem) { + traverse(elem, fn); + elem = elem.nextSibling; } } @@ -460,25 +71,3 @@ function getNodeType(node) { return "unknown"; // This should never happen. } } - -function verifyNodeList(resultAll, expect) { - assert_not_equals(resultAll, null, "The method should not return null."); - assert_equals(resultAll.length, e.length, "The method should return the expected number of matches."); - - for (var i = 0; i < e.length; i++) { - assert_not_equals(resultAll[i], null, "The item in index " + i + " should not be null.") - assert_equals(resultAll[i].getAttribute("id"), e[i], "The item in index " + i + " should have the expected ID."); - assert_false(resultAll[i].hasAttribute("data-clone"), "This should not be a cloned element."); - } -} - -function verifyElement(result, resultAll, expect) { - if (expect.length > 0) { - assert_not_equals(result, null, "The method should return a match.") - assert_equals(found.getAttribute("id"), e[0], "The method should return the first match."); - assert_equals(result, resultAll[0], "The result should match the first item from querySelectorAll."); - assert_false(found.hasAttribute("data-clone"), "This should not be annotated as a cloned element."); - } else { - assert_equals(result, null, "The method should not match anything."); - } -} diff --git a/testing/web-platform/tests/serve.py b/testing/web-platform/tests/serve.py index 4122f4853d9f..d0f16537a764 100644 --- a/testing/web-platform/tests/serve.py +++ b/testing/web-platform/tests/serve.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import argparse import json -import logging import os import signal import socket @@ -19,6 +18,8 @@ repo_root = os.path.abspath(os.path.split(__file__)[0]) sys.path.insert(1, os.path.join(repo_root, "tools", "wptserve")) from wptserve import server as wptserve, handlers from wptserve.router import any_method +from wptserve.logger import set_logger + sys.path.insert(1, os.path.join(repo_root, "tools", "pywebsocket", "src")) from mod_pywebsocket import standalone as pywebsocket @@ -39,12 +40,12 @@ subdomains = [u"www", u"天気の良い日", u"élève"] -logger = None - -def default_logger(level): +def setup_logger(level): + import logging + global logger logger = logging.getLogger("web-platform-tests") logging.basicConfig(level=getattr(logging, level.upper())) - return logger + set_logger(logger) def open_socket(port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -323,12 +324,10 @@ def load_config(default_path, override_path=None): return rv def main(): - global logger - config = load_config("config.default.json", "config.json") - logger = default_logger(config["log_level"]) + setup_logger(config["log_level"]) config_, servers = start(config) diff --git a/testing/web-platform/tests/service-workers/stub-4.1-service-worker-global-scope.html b/testing/web-platform/tests/service-workers/stub-4.1-service-worker-global-scope.html index 10501de21e61..ce6a045e25e4 100644 --- a/testing/web-platform/tests/service-workers/stub-4.1-service-worker-global-scope.html +++ b/testing/web-platform/tests/service-workers/stub-4.1-service-worker-global-scope.html @@ -21,7 +21,7 @@ interface ServiceWorkerGlobalScope : WorkerGlobalScope { readonly attribute ServiceWorkerClients clients; [Unforgeable] readonly attribute DOMString scope; - Promise fetch((Request or USVString) request); + Promise fetch((Request or ScalarValueString) request); void update(); void unregister(); @@ -55,7 +55,7 @@ synchronous requests MUST NOT be initiated inside of a Service Worker. interface CacheStorage {}; interface ServiceWorkerClients {}; interface Request {}; - interface USVString {}; + interface ScalarValueString {}; interface EventHandler {}; interface WorkerGlobalScope {}; diff --git a/testing/web-platform/tests/service-workers/stub-4.6.2-cache.html b/testing/web-platform/tests/service-workers/stub-4.6.2-cache.html index b899ae8d7940..5f0c6f07a93d 100644 --- a/testing/web-platform/tests/service-workers/stub-4.6.2-cache.html +++ b/testing/web-platform/tests/service-workers/stub-4.6.2-cache.html @@ -15,11 +15,11 @@ - diff --git a/testing/web-platform/tests/webdriver/webdriver.cfg b/testing/web-platform/tests/webdriver/webdriver.cfg index 06ac7e9e5ba6..98ecde7bd7c4 100644 --- a/testing/web-platform/tests/webdriver/webdriver.cfg +++ b/testing/web-platform/tests/webdriver/webdriver.cfg @@ -24,3 +24,8 @@ mode: compatibility [ios-driver] capabilities: {"browserName": "iphone"} mode: compatibility + +[blackberry] +url: http://169.254.0.1:1338 +capabilities: {"browserName": "blackberry"} +mode: compatibility diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html index f28f4d3043a3..7ae4b0704744 100644 --- a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html @@ -1,6 +1,6 @@ diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/common.js b/testing/web-platform/tests/workers/semantics/structured-clone/common.js index bcf52b614380..56c2a3004018 100644 --- a/testing/web-platform/tests/workers/semantics/structured-clone/common.js +++ b/testing/web-platform/tests/workers/semantics/structured-clone/common.js @@ -25,7 +25,7 @@ function compare_primitive(actual, input, test_obj) { if (test_obj) test_obj.done(); } -function compare_Array(callback) { +function compare_Array(callback, callback_is_async) { return function(actual, input, test_obj) { if (typeof actual === 'string') assert_unreached(actual); @@ -33,12 +33,12 @@ function compare_Array(callback) { assert_not_equals(actual, input); assert_equals(actual.length, input.length, 'length'); callback(actual, input); - if (test_obj) + if (test_obj && !callback_is_async) test_obj.done(); } } -function compare_Object(callback) { +function compare_Object(callback, callback_is_async) { return function(actual, input, test_obj) { if (typeof actual === 'string') assert_unreached(actual); @@ -46,15 +46,15 @@ function compare_Object(callback) { assert_false(actual instanceof Array, 'instanceof Array'); assert_not_equals(actual, input); callback(actual, input); - if (test_obj) + if (test_obj && !callback_is_async) test_obj.done(); } } -function enumerate_props(compare_func) { +function enumerate_props(compare_func, test_obj) { return function(actual, input) { for (var x in input) { - compare_func(actual[x], input[x]); + compare_func(actual[x], input[x], test_obj); } }; } @@ -339,41 +339,41 @@ function func_Blob_NUL() { check('Blob NUL', func_Blob_NUL, compare_Blob); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_basic)], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_basic)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob basic'); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800]))], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob unpaired high surrogate (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_bytes([0xDC00]))], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob unpaired low surrogate (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob paired surrogates (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_empty)], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_empty)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob empty'); async_test(function(test_obj) { - check(test_obj.name, [test_obj.step(func_Blob_NUL)], compare_Array(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, [test_obj.step(func_Blob_NUL)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Array Blob object, Blob NUL'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_basic)}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_basic)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob basic'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800]))}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob unpaired high surrogate (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xDC00]))}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob unpaired low surrogate (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob paired surrogates (invalid utf-8)'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_empty)}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_empty)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob empty'); async_test(function(test_obj) { - check(test_obj.name, {'x':test_obj.step(func_Blob_NUL)}, compare_Object(enumerate_props(compare_Blob)), test_obj); + check(test_obj.name, {'x':test_obj.step(func_Blob_NUL)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); }, 'Object Blob object, Blob NUL'); function compare_File(actual, input, test_obj) { diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js b/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js index f46df8257306..fd63ff5a5d71 100644 --- a/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js +++ b/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js @@ -9,8 +9,9 @@ function check_true(actual, msg) { return true; } -function check_Blob(msg, input, port, expect_File) { +function check_Blob(msg, input, port, expect_File, orig_input) { expect_File = !!expect_File; + orig_input = orig_input || input; try { var expected; switch (msg) { @@ -64,7 +65,7 @@ function check_Blob(msg, input, port, expect_File) { check_true(view.getUint8(i) === expected[i], 'view.getUint8('+i+') === expected['+i+']') } if (log.length === 0) { - port.postMessage(input); + port.postMessage(orig_input); } else { port.postMessage('FAIL '+log); } @@ -724,7 +725,7 @@ function check(input, port) { case 'Array Blob object, Blob NUL': if (check_true(input instanceof Array, 'input instanceof Array') && check_true(input.length === 1, 'input.length === 1')) { - check_Blob(msg.substr('Array Blob object, '.length), input[0], port); + check_Blob(msg.substr('Array Blob object, '.length), input[0], port, false, input); // no postMessage or close here, check_Blob takes care of that } break; @@ -742,7 +743,7 @@ function check(input, port) { i++; } if (check_true(i === 1, 'i === 1')) { - check_Blob(msg.substr('Object Blob object, '.length), input['x'], port); + check_Blob(msg.substr('Object Blob object, '.length), input['x'], port, false, input); // no postMessage or close here, check_Blob takes care of that } } From ace556f63b2ccae2cd973ff68896b921311f23af Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 24 Nov 2014 12:56:31 +0000 Subject: [PATCH 07/88] Bug 1103906 - Enable logger for mach web-platform-tests-update script, r=ato --- testing/web-platform/mach_commands.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/web-platform/mach_commands.py b/testing/web-platform/mach_commands.py index 14c39003c4ee..a327c16c8589 100644 --- a/testing/web-platform/mach_commands.py +++ b/testing/web-platform/mach_commands.py @@ -74,6 +74,7 @@ class WebPlatformTestsUpdater(MozbuildObject): kwargs["config"] = os.path.join(self.topsrcdir, 'testing', 'web-platform', 'wptrunner.ini') wptcommandline.set_from_config(kwargs) + update.setup_logging(kwargs, {"mach": sys.stdout}) update.run_update(**kwargs) From cfe3876dca14e378ad74cb7d37ce9926174bcc23 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 24 Nov 2014 12:56:32 +0000 Subject: [PATCH 08/88] Bug 1089079. Make .length on interface objects configurable. r=peterv --- dom/bindings/BindingUtils.cpp | 2 +- dom/imptests/idlharness.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index c454f6c0394c..7a4606890bd3 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -459,7 +459,7 @@ CreateInterfaceObject(JSContext* cx, JS::Handle global, } if (!JS_DefineProperty(cx, constructor, "length", ctorNargs, - JSPROP_READONLY | JSPROP_PERMANENT)) { + JSPROP_READONLY)) { return nullptr; } diff --git a/dom/imptests/idlharness.js b/dom/imptests/idlharness.js index 25e1117b4abd..613da0cb4c00 100644 --- a/dom/imptests/idlharness.js +++ b/dom/imptests/idlharness.js @@ -1150,15 +1150,15 @@ IdlInterface.prototype.test_self = function() if (!this.is_callback()) { test(function() { - // This function tests WebIDL as of 2013-08-25. - // http://dev.w3.org/2006/webapi/WebIDL/#es-interface-call + // This function tests WebIDL as of 2014-10-25. + // https://heycam.github.io/webidl/#es-interface-call assert_own_property(window, this.name, "window does not have own property " + format_value(this.name)); // "Interface objects for non-callback interfaces MUST have a // property named “length” with attributes { [[Writable]]: false, - // [[Enumerable]]: false, [[Configurable]]: false } whose value is + // [[Enumerable]]: false, [[Configurable]]: true } whose value is // a Number." assert_own_property(window[this.name], "length"); var desc = Object.getOwnPropertyDescriptor(window[this.name], "length"); @@ -1166,7 +1166,7 @@ IdlInterface.prototype.test_self = function() assert_false("set" in desc, this.name + ".length has setter"); assert_false(desc.writable, this.name + ".length is writable"); assert_false(desc.enumerable, this.name + ".length is enumerable"); - assert_false(desc.configurable, this.name + ".length is configurable"); + assert_true(desc.configurable, this.name + ".length is not configurable"); var constructors = this.extAttrs .filter(function(attr) { return attr.name == "Constructor"; }); From e8c8c7e321b6dad84f67508b6c94cf5e6b69d3c3 Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 24 Nov 2014 12:56:32 +0000 Subject: [PATCH 09/88] Bug 1103906 - Update web-platform-tests expected data, a=testonly --- ...EventListener.optional.useCapture.html.ini | 3 + .../dispatchEvent.return.value.html.ini | 3 + ...EventListener.optional.useCapture.html.ini | 3 + .../dispatchEvent.return.value.html.ini | 3 + .../meta/FileAPI/idlharness.html.ini | 9 - .../meta/IndexedDB/interfaces.html.ini | 33 -- .../meta/XMLHttpRequest/interfaces.html.ini | 63 +++- ...uthentication-basic-repeat-no-args.htm.ini | 5 - ...hentication-basic-setrequestheader.htm.ini | 5 - .../meta/ambient-light/idlharness.html.ini | 3 - .../battery-interface-idlharness.html.ini | 3 - .../meta/cors/response-headers.htm.ini | 39 -- .../web-platform/meta/dom/interfaces.html.ini | 77 +--- .../nodes/Document-getElementById.html.ini | 3 - .../meta/eventsource/interfaces.html.ini | 3 - .../document.title-07.html.ini | 3 + .../document-cookie.html.ini | 1 + .../meta/html/dom/interfaces.html.ini | 333 ------------------ .../SourceBuffer-abort-readyState.html.ini | 4 - .../audiostreamtrack.html.ini | 3 - .../videostreamtrack.html.ini | 3 - .../navigation-timing/idlharness.html.ini | 9 - .../meta/notifications/interfaces.html.ini | 3 - .../performance-timeline/idlharness.html.ini | 5 - .../meta/progress-events/interface.html.ini | 5 + .../meta/proximity/idlharness.html.ini | 6 - .../test_resource_timing.html.ini | 1 + .../Opera/level2-baseline.html.ini | 1 + .../web-platform/meta/url/a-element.html.ini | 12 + .../web-platform/meta/url/a-element.xhtml.ini | 12 + .../web-platform/meta/url/interfaces.html.ini | 4 +- .../idl-test.html.ini | 5 - .../idl-test.html.ini | 3 - .../the-delaynode-interface/idl-test.html.ini | 3 - .../the-gainnode-interface/idl-test.html.ini | 3 - .../meta/websockets/interfaces.html.ini | 6 - .../meta/webstorage/idlharness.html.ini | 6 - .../meta/webvtt/interfaces.html.ini | 3 - .../event-ports-dedicated.html.ini | 5 + 39 files changed, 112 insertions(+), 582 deletions(-) create mode 100644 testing/web-platform/meta/DOMEvents/tests/approved/addEventListener.optional.useCapture.html.ini create mode 100644 testing/web-platform/meta/DOMEvents/tests/approved/dispatchEvent.return.value.html.ini create mode 100644 testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html.ini create mode 100644 testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html.ini delete mode 100644 testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm.ini delete mode 100644 testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-setrequestheader.htm.ini delete mode 100644 testing/web-platform/meta/dom/nodes/Document-getElementById.html.ini delete mode 100644 testing/web-platform/meta/performance-timeline/idlharness.html.ini create mode 100644 testing/web-platform/meta/progress-events/interface.html.ini delete mode 100644 testing/web-platform/meta/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html.ini create mode 100644 testing/web-platform/meta/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html.ini diff --git a/testing/web-platform/meta/DOMEvents/tests/approved/addEventListener.optional.useCapture.html.ini b/testing/web-platform/meta/DOMEvents/tests/approved/addEventListener.optional.useCapture.html.ini new file mode 100644 index 000000000000..76170cdc0e4d --- /dev/null +++ b/testing/web-platform/meta/DOMEvents/tests/approved/addEventListener.optional.useCapture.html.ini @@ -0,0 +1,3 @@ +[addEventListener.optional.useCapture.html] + type: testharness + expected: TIMEOUT diff --git a/testing/web-platform/meta/DOMEvents/tests/approved/dispatchEvent.return.value.html.ini b/testing/web-platform/meta/DOMEvents/tests/approved/dispatchEvent.return.value.html.ini new file mode 100644 index 000000000000..61d713620040 --- /dev/null +++ b/testing/web-platform/meta/DOMEvents/tests/approved/dispatchEvent.return.value.html.ini @@ -0,0 +1,3 @@ +[dispatchEvent.return.value.html] + type: testharness + expected: TIMEOUT diff --git a/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html.ini b/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html.ini new file mode 100644 index 000000000000..76170cdc0e4d --- /dev/null +++ b/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/addEventListener.optional.useCapture.html.ini @@ -0,0 +1,3 @@ +[addEventListener.optional.useCapture.html] + type: testharness + expected: TIMEOUT diff --git a/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html.ini b/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html.ini new file mode 100644 index 000000000000..61d713620040 --- /dev/null +++ b/testing/web-platform/meta/DOMEvents/tests/submissions/Microsoft/converted/dispatchEvent.return.value.html.ini @@ -0,0 +1,3 @@ +[dispatchEvent.return.value.html] + type: testharness + expected: TIMEOUT diff --git a/testing/web-platform/meta/FileAPI/idlharness.html.ini b/testing/web-platform/meta/FileAPI/idlharness.html.ini index a7f9c19cd919..f00916f83b30 100644 --- a/testing/web-platform/meta/FileAPI/idlharness.html.ini +++ b/testing/web-platform/meta/FileAPI/idlharness.html.ini @@ -194,12 +194,3 @@ [FileReaderSync interface: operation readAsDataURL(Blob)] expected: FAIL - [Blob interface object length] - expected: FAIL - - [FileList interface object length] - expected: FAIL - - [FileReader interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/IndexedDB/interfaces.html.ini b/testing/web-platform/meta/IndexedDB/interfaces.html.ini index cb47cf318549..f06ae89f5d52 100644 --- a/testing/web-platform/meta/IndexedDB/interfaces.html.ini +++ b/testing/web-platform/meta/IndexedDB/interfaces.html.ini @@ -30,36 +30,3 @@ [WorkerUtils interface: attribute indexedDB] expected: FAIL - [IDBKeyRange interface object length] - expected: FAIL - - [IDBRequest interface object length] - expected: FAIL - - [IDBOpenDBRequest interface object length] - expected: FAIL - - [IDBVersionChangeEvent interface object length] - expected: FAIL - - [IDBFactory interface object length] - expected: FAIL - - [IDBDatabase interface object length] - expected: FAIL - - [IDBObjectStore interface object length] - expected: FAIL - - [IDBIndex interface object length] - expected: FAIL - - [IDBCursor interface object length] - expected: FAIL - - [IDBCursorWithValue interface object length] - expected: FAIL - - [IDBTransaction interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/XMLHttpRequest/interfaces.html.ini b/testing/web-platform/meta/XMLHttpRequest/interfaces.html.ini index f07e38a27bba..d6613ba36e66 100644 --- a/testing/web-platform/meta/XMLHttpRequest/interfaces.html.ini +++ b/testing/web-platform/meta/XMLHttpRequest/interfaces.html.ini @@ -15,9 +15,6 @@ [XMLHttpRequest interface: new XMLHttpRequest() must inherit property "statusText" with the proper type (16)] expected: FAIL - [FormData interface: existence and properties of interface object] - expected: FAIL - [FormData interface: operation delete(DOMString)] expected: FAIL @@ -108,12 +105,66 @@ [FormData interface: calling set(DOMString,DOMString) on new FormData(form) with too few arguments must throw TypeError] expected: FAIL - [XMLHttpRequestUpload interface object length] + [XMLHttpRequest interface: operation open(ByteString,USVString,boolean,USVString,USVString)] expected: FAIL - [XMLHttpRequest interface object length] + [XMLHttpRequest interface: calling open(ByteString,USVString,boolean,USVString,USVString) on new XMLHttpRequest() with too few arguments must throw TypeError] expected: FAIL - [FormData interface object length] + [FormData interface: operation delete(USVString)] + expected: FAIL + + [FormData interface: operation get(USVString)] + expected: FAIL + + [FormData interface: operation getAll(USVString)] + expected: FAIL + + [FormData interface: operation has(USVString)] + expected: FAIL + + [FormData interface: operation set(USVString,Blob,USVString)] + expected: FAIL + + [FormData interface: operation set(USVString,USVString)] + expected: FAIL + + [FormData interface: calling delete(USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling get(USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling getAll(USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling has(USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling set(USVString,Blob,USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling set(USVString,USVString) on new FormData() with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling delete(USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling get(USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling getAll(USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling has(USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling set(USVString,Blob,USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [FormData interface: calling set(USVString,USVString) on new FormData(form) with too few arguments must throw TypeError] + expected: FAIL + + [ProgressEvent interface: existence and properties of interface object] expected: FAIL diff --git a/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm.ini b/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm.ini deleted file mode 100644 index da77d3cb4a9d..000000000000 --- a/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm.ini +++ /dev/null @@ -1,5 +0,0 @@ -[send-authentication-basic-repeat-no-args.htm] - type: testharness - [XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open() in first request, without in second] - expected: FAIL - diff --git a/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-setrequestheader.htm.ini b/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-setrequestheader.htm.ini deleted file mode 100644 index 529629762521..000000000000 --- a/testing/web-platform/meta/XMLHttpRequest/send-authentication-basic-setrequestheader.htm.ini +++ /dev/null @@ -1,5 +0,0 @@ -[send-authentication-basic-setrequestheader.htm] - type: testharness - [XMLHttpRequest: send() - "Basic" authenticated request using setRequestHeader()] - expected: FAIL - diff --git a/testing/web-platform/meta/ambient-light/idlharness.html.ini b/testing/web-platform/meta/ambient-light/idlharness.html.ini index bb14764dbbf2..f2a803d6e071 100644 --- a/testing/web-platform/meta/ambient-light/idlharness.html.ini +++ b/testing/web-platform/meta/ambient-light/idlharness.html.ini @@ -9,6 +9,3 @@ [DeviceLightEvent interface: existence and properties of interface object] expected: FAIL - [DeviceLightEvent interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/battery-status/battery-interface-idlharness.html.ini b/testing/web-platform/meta/battery-status/battery-interface-idlharness.html.ini index 0380b7a25398..2f3e49d69af9 100644 --- a/testing/web-platform/meta/battery-status/battery-interface-idlharness.html.ini +++ b/testing/web-platform/meta/battery-status/battery-interface-idlharness.html.ini @@ -3,6 +3,3 @@ [BatteryManager interface: existence and properties of interface object] expected: FAIL - [BatteryManager interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/cors/response-headers.htm.ini b/testing/web-platform/meta/cors/response-headers.htm.ini index d9523203aa62..4f607ec7c34b 100644 --- a/testing/web-platform/meta/cors/response-headers.htm.ini +++ b/testing/web-platform/meta/cors/response-headers.htm.ini @@ -6,42 +6,3 @@ [getResponse: don\'t expose x-nonexposed] expected: FAIL - [getResponseHeader: Expose Access-Control-Expose-Headers (x-custom-header-comma)] - expected: FAIL - - [getResponseHeader: Expose second Access-Control-Expose-Headers (x-second-expose)] - expected: FAIL - - [getResponseHeader: Don\'t trim whitespace] - expected: FAIL - - [getResponseHeader: x-custom-header bytes] - expected: FAIL - - [getResponseHeader: Exposed server field readable (Date)] - expected: FAIL - - [getResponseHeader: Cache-Control: readable by default] - expected: FAIL - - [getResponseHeader: Content-Language: readable by default] - expected: FAIL - - [getResponseHeader: Expires: readable by default] - expected: FAIL - - [getResponseHeader: Last-Modified: readable by default] - expected: FAIL - - [getResponseHeader: Pragma: readable by default] - expected: FAIL - - [getResponseHeader: Server: unreadable by default] - expected: FAIL - - [getResponseHeader: X-Powered-By: unreadable by default] - expected: FAIL - - [getAllResponseHeaders: don\'t expose x-nonexposed] - expected: FAIL - diff --git a/testing/web-platform/meta/dom/interfaces.html.ini b/testing/web-platform/meta/dom/interfaces.html.ini index d20715a6511d..8d86e61cd034 100644 --- a/testing/web-platform/meta/dom/interfaces.html.ini +++ b/testing/web-platform/meta/dom/interfaces.html.ini @@ -351,81 +351,6 @@ [Attr interface: attribute textContent] expected: FAIL - [DOMError interface object length] - expected: FAIL - - [Event interface object length] - expected: FAIL - - [CustomEvent interface object length] - expected: FAIL - - [EventTarget interface object length] - expected: FAIL - - [NodeList interface object length] - expected: FAIL - - [HTMLCollection interface object length] - expected: FAIL - - [MutationObserver interface object length] - expected: FAIL - - [MutationRecord interface object length] - expected: FAIL - - [Node interface object length] - expected: FAIL - - [Document interface object length] - expected: FAIL - - [XMLDocument interface object length] - expected: FAIL - - [DOMImplementation interface object length] - expected: FAIL - - [DocumentFragment interface object length] - expected: FAIL - - [DocumentType interface object length] - expected: FAIL - - [Element interface object length] - expected: FAIL - - [NamedNodeMap interface object length] - expected: FAIL - - [Attr interface object length] - expected: FAIL - - [CharacterData interface object length] - expected: FAIL - - [Text interface object length] - expected: FAIL - - [ProcessingInstruction interface object length] - expected: FAIL - - [Comment interface object length] - expected: FAIL - - [Range interface object length] - expected: FAIL - - [NodeIterator interface object length] - expected: FAIL - - [TreeWalker interface object length] - expected: FAIL - - [DOMTokenList interface object length] - expected: FAIL - - [DOMSettableTokenList interface object length] + [Attr interface: attribute nodeValue] expected: FAIL diff --git a/testing/web-platform/meta/dom/nodes/Document-getElementById.html.ini b/testing/web-platform/meta/dom/nodes/Document-getElementById.html.ini deleted file mode 100644 index 5ad19dff4e4d..000000000000 --- a/testing/web-platform/meta/dom/nodes/Document-getElementById.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[Document-getElementById.html] - type: testharness - expected: ERROR diff --git a/testing/web-platform/meta/eventsource/interfaces.html.ini b/testing/web-platform/meta/eventsource/interfaces.html.ini index 07f6e7763ad4..66e642617894 100644 --- a/testing/web-platform/meta/eventsource/interfaces.html.ini +++ b/testing/web-platform/meta/eventsource/interfaces.html.ini @@ -9,6 +9,3 @@ [Stringification of new EventSource("http://foo")] expected: FAIL - [EventSource interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/html/dom/documents/dom-tree-accessors/document.title-07.html.ini b/testing/web-platform/meta/html/dom/documents/dom-tree-accessors/document.title-07.html.ini index 58df84b3173b..a0eab9fe499d 100644 --- a/testing/web-platform/meta/html/dom/documents/dom-tree-accessors/document.title-07.html.ini +++ b/testing/web-platform/meta/html/dom/documents/dom-tree-accessors/document.title-07.html.ini @@ -3,3 +3,6 @@ [Document.title and DOMImplementation.createHTMLDocument 6] expected: FAIL + [createHTMLDocument test 6: "foo\\f\\fbar baz","foo\\f\\fbar baz","foo bar baz"] + expected: FAIL + diff --git a/testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini b/testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini index 5c40910e6bbb..74249d5a63d6 100644 --- a/testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini +++ b/testing/web-platform/meta/html/dom/documents/resource-metadata-management/document-cookie.html.ini @@ -2,3 +2,4 @@ type: testharness [getting cookie for a cookie-averse document returns empty string, setting does nothing] expected: FAIL + diff --git a/testing/web-platform/meta/html/dom/interfaces.html.ini b/testing/web-platform/meta/html/dom/interfaces.html.ini index 9c19b55059e4..85be110382fb 100644 --- a/testing/web-platform/meta/html/dom/interfaces.html.ini +++ b/testing/web-platform/meta/html/dom/interfaces.html.ini @@ -3876,336 +3876,3 @@ [HTMLFontElement interface: existence and properties of interface object] expected: FAIL - [HTMLAllCollection interface object length] - expected: FAIL - - [HTMLFormControlsCollection interface object length] - expected: FAIL - - [RadioNodeList interface object length] - expected: FAIL - - [HTMLOptionsCollection interface object length] - expected: FAIL - - [HTMLPropertiesCollection interface object length] - expected: FAIL - - [PropertyNodeList interface object length] - expected: FAIL - - [DOMStringMap interface object length] - expected: FAIL - - [HTMLElement interface object length] - expected: FAIL - - [HTMLUnknownElement interface object length] - expected: FAIL - - [HTMLHtmlElement interface object length] - expected: FAIL - - [HTMLHeadElement interface object length] - expected: FAIL - - [HTMLTitleElement interface object length] - expected: FAIL - - [HTMLBaseElement interface object length] - expected: FAIL - - [HTMLLinkElement interface object length] - expected: FAIL - - [HTMLMetaElement interface object length] - expected: FAIL - - [HTMLStyleElement interface object length] - expected: FAIL - - [HTMLBodyElement interface object length] - expected: FAIL - - [HTMLHeadingElement interface object length] - expected: FAIL - - [HTMLParagraphElement interface object length] - expected: FAIL - - [HTMLHRElement interface object length] - expected: FAIL - - [HTMLPreElement interface object length] - expected: FAIL - - [HTMLQuoteElement interface object length] - expected: FAIL - - [HTMLOListElement interface object length] - expected: FAIL - - [HTMLUListElement interface object length] - expected: FAIL - - [HTMLLIElement interface object length] - expected: FAIL - - [HTMLDListElement interface object length] - expected: FAIL - - [HTMLDivElement interface object length] - expected: FAIL - - [HTMLAnchorElement interface object length] - expected: FAIL - - [HTMLDataElement interface object length] - expected: FAIL - - [HTMLTimeElement interface object length] - expected: FAIL - - [HTMLSpanElement interface object length] - expected: FAIL - - [HTMLBRElement interface object length] - expected: FAIL - - [HTMLModElement interface object length] - expected: FAIL - - [HTMLImageElement interface object length] - expected: FAIL - - [HTMLIFrameElement interface object length] - expected: FAIL - - [HTMLEmbedElement interface object length] - expected: FAIL - - [HTMLObjectElement interface object length] - expected: FAIL - - [HTMLParamElement interface object length] - expected: FAIL - - [HTMLVideoElement interface object length] - expected: FAIL - - [HTMLAudioElement interface object length] - expected: FAIL - - [HTMLSourceElement interface object length] - expected: FAIL - - [HTMLTrackElement interface object length] - expected: FAIL - - [HTMLMediaElement interface object length] - expected: FAIL - - [MediaError interface object length] - expected: FAIL - - [TextTrackList interface object length] - expected: FAIL - - [TextTrack interface object length] - expected: FAIL - - [TextTrackCueList interface object length] - expected: FAIL - - [TimeRanges interface object length] - expected: FAIL - - [TrackEvent interface object length] - expected: FAIL - - [HTMLMapElement interface object length] - expected: FAIL - - [HTMLAreaElement interface object length] - expected: FAIL - - [HTMLTableElement interface object length] - expected: FAIL - - [HTMLTableCaptionElement interface object length] - expected: FAIL - - [HTMLTableColElement interface object length] - expected: FAIL - - [HTMLTableSectionElement interface object length] - expected: FAIL - - [HTMLTableRowElement interface object length] - expected: FAIL - - [HTMLTableCellElement interface object length] - expected: FAIL - - [HTMLFormElement interface object length] - expected: FAIL - - [HTMLLabelElement interface object length] - expected: FAIL - - [HTMLInputElement interface object length] - expected: FAIL - - [HTMLButtonElement interface object length] - expected: FAIL - - [HTMLSelectElement interface object length] - expected: FAIL - - [HTMLDataListElement interface object length] - expected: FAIL - - [HTMLOptGroupElement interface object length] - expected: FAIL - - [HTMLOptionElement interface object length] - expected: FAIL - - [HTMLTextAreaElement interface object length] - expected: FAIL - - [HTMLOutputElement interface object length] - expected: FAIL - - [HTMLProgressElement interface object length] - expected: FAIL - - [HTMLMeterElement interface object length] - expected: FAIL - - [HTMLFieldSetElement interface object length] - expected: FAIL - - [HTMLLegendElement interface object length] - expected: FAIL - - [ValidityState interface object length] - expected: FAIL - - [HTMLMenuElement interface object length] - expected: FAIL - - [HTMLMenuItemElement interface object length] - expected: FAIL - - [HTMLScriptElement interface object length] - expected: FAIL - - [HTMLTemplateElement interface object length] - expected: FAIL - - [HTMLCanvasElement interface object length] - expected: FAIL - - [CanvasGradient interface object length] - expected: FAIL - - [CanvasPattern interface object length] - expected: FAIL - - [TextMetrics interface object length] - expected: FAIL - - [ImageData interface object length] - expected: FAIL - - [Path2D interface object length] - expected: FAIL - - [Window interface object length] - expected: FAIL - - [BarProp interface object length] - expected: FAIL - - [History interface object length] - expected: FAIL - - [Location interface object length] - expected: FAIL - - [PopStateEvent interface object length] - expected: FAIL - - [HashChangeEvent interface object length] - expected: FAIL - - [PageTransitionEvent interface object length] - expected: FAIL - - [BeforeUnloadEvent interface object length] - expected: FAIL - - [ErrorEvent interface object length] - expected: FAIL - - [Navigator interface object length] - expected: FAIL - - [PluginArray interface object length] - expected: FAIL - - [MimeTypeArray interface object length] - expected: FAIL - - [Plugin interface object length] - expected: FAIL - - [MimeType interface object length] - expected: FAIL - - [External interface object length] - expected: FAIL - - [MessageEvent interface object length] - expected: FAIL - - [EventSource interface object length] - expected: FAIL - - [WebSocket interface object length] - expected: FAIL - - [CloseEvent interface object length] - expected: FAIL - - [MessagePort interface object length] - expected: FAIL - - [Worker interface object length] - expected: FAIL - - [SharedWorker interface object length] - expected: FAIL - - [Storage interface object length] - expected: FAIL - - [StorageEvent interface object length] - expected: FAIL - - [HTMLAppletElement interface object length] - expected: FAIL - - [HTMLFrameSetElement interface object length] - expected: FAIL - - [HTMLFrameElement interface object length] - expected: FAIL - - [HTMLDirectoryElement interface object length] - expected: FAIL - - [HTMLFontElement interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/media-source/SourceBuffer-abort-readyState.html.ini b/testing/web-platform/meta/media-source/SourceBuffer-abort-readyState.html.ini index b978bc9d15c5..a46a221ca971 100644 --- a/testing/web-platform/meta/media-source/SourceBuffer-abort-readyState.html.ini +++ b/testing/web-platform/meta/media-source/SourceBuffer-abort-readyState.html.ini @@ -1,9 +1,5 @@ [SourceBuffer-abort-readyState.html] type: testharness - expected: TIMEOUT - [SourceBuffer#abort() (video/webm; codecs="vorbis,vp8") : If the readyState attribute of the parent media source is not in the "open" state then throw an INVALID_STATE_ERR exception and abort these steps.] - expected: TIMEOUT - [SourceBuffer#abort() (video/mp4) : If the readyState attribute of the parent media source is not in the "open" state then throw an INVALID_STATE_ERR exception and abort these steps.] expected: FAIL diff --git a/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/audiostreamtrack.html.ini b/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/audiostreamtrack.html.ini index 4ec1377f0e22..3833a7180855 100644 --- a/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/audiostreamtrack.html.ini +++ b/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/audiostreamtrack.html.ini @@ -9,6 +9,3 @@ [AudioStreamTrack interface: operation getSourceIds()] expected: FAIL - [AudioStreamTrack interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/videostreamtrack.html.ini b/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/videostreamtrack.html.ini index 02bdbd1de55c..ef10b06668da 100644 --- a/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/videostreamtrack.html.ini +++ b/testing/web-platform/meta/mediacapture-streams/stream-api/video-and-audio-tracks/videostreamtrack.html.ini @@ -9,6 +9,3 @@ [VideoStreamTrack interface: operation getSourceIds()] expected: FAIL - [VideoStreamTrack interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/navigation-timing/idlharness.html.ini b/testing/web-platform/meta/navigation-timing/idlharness.html.ini index c7c0d6c70428..fc1251597166 100644 --- a/testing/web-platform/meta/navigation-timing/idlharness.html.ini +++ b/testing/web-platform/meta/navigation-timing/idlharness.html.ini @@ -33,12 +33,3 @@ [Window interface: attribute performance] expected: FAIL - [PerformanceTiming interface object length] - expected: FAIL - - [PerformanceNavigation interface object length] - expected: FAIL - - [Performance interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/notifications/interfaces.html.ini b/testing/web-platform/meta/notifications/interfaces.html.ini index ff84b2bd1328..382b421cb1c6 100644 --- a/testing/web-platform/meta/notifications/interfaces.html.ini +++ b/testing/web-platform/meta/notifications/interfaces.html.ini @@ -3,6 +3,3 @@ [Notification interface: existence and properties of interface object] expected: FAIL - [Notification interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/performance-timeline/idlharness.html.ini b/testing/web-platform/meta/performance-timeline/idlharness.html.ini deleted file mode 100644 index e7ec4e9715b6..000000000000 --- a/testing/web-platform/meta/performance-timeline/idlharness.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[idlharness.html] - type: testharness - [PerformanceEntry interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/progress-events/interface.html.ini b/testing/web-platform/meta/progress-events/interface.html.ini new file mode 100644 index 000000000000..d9290c50a1b1 --- /dev/null +++ b/testing/web-platform/meta/progress-events/interface.html.ini @@ -0,0 +1,5 @@ +[interface.html] + type: testharness + [The ProgressEvent interface] + expected: FAIL + diff --git a/testing/web-platform/meta/proximity/idlharness.html.ini b/testing/web-platform/meta/proximity/idlharness.html.ini index 1853e0e33f5c..094ebf05b53b 100644 --- a/testing/web-platform/meta/proximity/idlharness.html.ini +++ b/testing/web-platform/meta/proximity/idlharness.html.ini @@ -18,9 +18,3 @@ [UserProximityEvent interface: existence and properties of interface object] expected: FAIL - [DeviceProximityEvent interface object length] - expected: FAIL - - [UserProximityEvent interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/resource-timing/test_resource_timing.html.ini b/testing/web-platform/meta/resource-timing/test_resource_timing.html.ini index 9424f4554c62..69c9ea7d1bb1 100644 --- a/testing/web-platform/meta/resource-timing/test_resource_timing.html.ini +++ b/testing/web-platform/meta/resource-timing/test_resource_timing.html.ini @@ -2,3 +2,4 @@ type: testharness [PerformanceEntry has correct name, initiatorType, startTime, and duration (link)] disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1079837 + diff --git a/testing/web-platform/meta/selectors-api/tests/submissions/Opera/level2-baseline.html.ini b/testing/web-platform/meta/selectors-api/tests/submissions/Opera/level2-baseline.html.ini index 36faa80ad2fe..2bdf5698fb3c 100644 --- a/testing/web-platform/meta/selectors-api/tests/submissions/Opera/level2-baseline.html.ini +++ b/testing/web-platform/meta/selectors-api/tests/submissions/Opera/level2-baseline.html.ini @@ -1,5 +1,6 @@ [level2-baseline.html] type: testharness + expected: TIMEOUT [Document supports find] expected: FAIL diff --git a/testing/web-platform/meta/url/a-element.html.ini b/testing/web-platform/meta/url/a-element.html.ini index b6d363df78c5..8fa645f16cc8 100644 --- a/testing/web-platform/meta/url/a-element.html.ini +++ b/testing/web-platform/meta/url/a-element.html.ini @@ -336,3 +336,15 @@ [Parsing: <#\xce\xb2> against ] expected: FAIL + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + diff --git a/testing/web-platform/meta/url/a-element.xhtml.ini b/testing/web-platform/meta/url/a-element.xhtml.ini index 34ec372b6728..733f5cd899b2 100644 --- a/testing/web-platform/meta/url/a-element.xhtml.ini +++ b/testing/web-platform/meta/url/a-element.xhtml.ini @@ -360,3 +360,15 @@ [Parsing: <#\xce\xb2> against ] expected: FAIL + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + + [Parsing: against ] + expected: FAIL + diff --git a/testing/web-platform/meta/url/interfaces.html.ini b/testing/web-platform/meta/url/interfaces.html.ini index 6c62320dc4ba..0ddc90c980da 100644 --- a/testing/web-platform/meta/url/interfaces.html.ini +++ b/testing/web-platform/meta/url/interfaces.html.ini @@ -9,9 +9,9 @@ [URLSearchParams interface: existence and properties of interface object] expected: FAIL - [URL interface object length] + [URL interface: operation domainToASCII(ScalarValueString)] expected: FAIL - [URLSearchParams interface object length] + [URL interface: operation domainToUnicode(ScalarValueString)] expected: FAIL diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html.ini deleted file mode 100644 index e28dd2b3c2d9..000000000000 --- a/testing/web-platform/meta/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[idl-test.html] - type: testharness - [AudioBuffer interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html.ini index e8064a2bfba5..6b940b0d9cf9 100644 --- a/testing/web-platform/meta/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html.ini +++ b/testing/web-platform/meta/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html.ini @@ -3,6 +3,3 @@ [AudioDestinationNode interface: existence and properties of interface object] expected: FAIL - [AudioDestinationNode interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-delaynode-interface/idl-test.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-delaynode-interface/idl-test.html.ini index 25030edeace2..79e51800538f 100644 --- a/testing/web-platform/meta/webaudio/the-audio-api/the-delaynode-interface/idl-test.html.ini +++ b/testing/web-platform/meta/webaudio/the-audio-api/the-delaynode-interface/idl-test.html.ini @@ -3,6 +3,3 @@ [DelayNode interface: existence and properties of interface object] expected: FAIL - [DelayNode interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/webaudio/the-audio-api/the-gainnode-interface/idl-test.html.ini b/testing/web-platform/meta/webaudio/the-audio-api/the-gainnode-interface/idl-test.html.ini index 5f132203b9dc..27886aa6e261 100644 --- a/testing/web-platform/meta/webaudio/the-audio-api/the-gainnode-interface/idl-test.html.ini +++ b/testing/web-platform/meta/webaudio/the-audio-api/the-gainnode-interface/idl-test.html.ini @@ -3,6 +3,3 @@ [GainNode interface: existence and properties of interface object] expected: FAIL - [GainNode interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/websockets/interfaces.html.ini b/testing/web-platform/meta/websockets/interfaces.html.ini index cf1aef8343f4..ddb18eb71eb3 100644 --- a/testing/web-platform/meta/websockets/interfaces.html.ini +++ b/testing/web-platform/meta/websockets/interfaces.html.ini @@ -15,9 +15,3 @@ [CloseEvent interface: existence and properties of interface prototype object] expected: FAIL - [WebSocket interface object length] - expected: FAIL - - [CloseEvent interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/webstorage/idlharness.html.ini b/testing/web-platform/meta/webstorage/idlharness.html.ini index 3d2f1d56825a..8d0db152f0ef 100644 --- a/testing/web-platform/meta/webstorage/idlharness.html.ini +++ b/testing/web-platform/meta/webstorage/idlharness.html.ini @@ -9,9 +9,3 @@ [StorageEvent interface: existence and properties of interface object] expected: FAIL - [Storage interface object length] - expected: FAIL - - [StorageEvent interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/webvtt/interfaces.html.ini b/testing/web-platform/meta/webvtt/interfaces.html.ini index ffe33d269de3..3cee139e2ec1 100644 --- a/testing/web-platform/meta/webvtt/interfaces.html.ini +++ b/testing/web-platform/meta/webvtt/interfaces.html.ini @@ -78,6 +78,3 @@ [VTTRegion interface: new VTTRegion() must inherit property "scroll" with the proper type (6)] expected: FAIL - [VTTCue interface object length] - expected: FAIL - diff --git a/testing/web-platform/meta/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html.ini b/testing/web-platform/meta/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html.ini new file mode 100644 index 000000000000..6dfbdc124e0e --- /dev/null +++ b/testing/web-platform/meta/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html.ini @@ -0,0 +1,5 @@ +[event-ports-dedicated.html] + type: testharness + [e.ports in dedicated worker] + expected: FAIL + From 26505efb5ac062eea50e3e5850286f75b37ffefa Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 24 Nov 2014 12:56:32 +0000 Subject: [PATCH 10/88] Bug 1103905 - Bump version number of mozlog, r=davehunt --- testing/mozbase/mozlog/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/mozbase/mozlog/setup.py b/testing/mozbase/mozlog/setup.py index 65991cfad42e..7463b9016af8 100644 --- a/testing/mozbase/mozlog/setup.py +++ b/testing/mozbase/mozlog/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages PACKAGE_NAME = 'mozlog' -PACKAGE_VERSION = '2.7' +PACKAGE_VERSION = '2.8' setup(name=PACKAGE_NAME, version=PACKAGE_VERSION, From 719c1c269df3019184a795053c62d6c9e9d9d0a7 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Mon, 24 Nov 2014 22:18:08 +0900 Subject: [PATCH 11/88] Bug 862655 - Increase a margin number a bit to accommodate the taller title bar on Windows with DWM enabled. r=Enn --- toolkit/content/tests/chrome/window_panel.xul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/content/tests/chrome/window_panel.xul b/toolkit/content/tests/chrome/window_panel.xul index 7e1ab80800ea..b99b52dfafe4 100644 --- a/toolkit/content/tests/chrome/window_panel.xul +++ b/toolkit/content/tests/chrome/window_panel.xul @@ -196,7 +196,7 @@ var tests = [ if (navigator.platform.indexOf("Linux") < 0) { ok(panelrect.top >= 210 - mozInnerScreenY + 10, testname + "top greater"); } - ok(panelrect.top <= 210 - mozInnerScreenY + 30, testname + "top less"); + ok(panelrect.top <= 210 - mozInnerScreenY + 32, testname + "top less"); is(panelrect.width, 120, testname + "width"); is(panelrect.height, 40, testname + "height"); From f226e5813fe1371735b32f8c162977aeed1764a9 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Mon, 24 Nov 2014 22:18:09 +0900 Subject: [PATCH 12/88] Bug 1094013 - Bump subsytem version to 6.1 (Win7) for Win64 builds. r=glandium,jorendorff --- configure.in | 2 +- js/src/configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 2b8db8d4a4f5..11bcbafee3a4 100644 --- a/configure.in +++ b/configure.in @@ -2212,7 +2212,7 @@ ia64*-hpux*) if test "$CPU_ARCH" = "x86"; then WIN32_SUBSYSTEM_VERSION=5.01 else - WIN32_SUBSYSTEM_VERSION=5.02 + WIN32_SUBSYSTEM_VERSION=6.01 fi WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION diff --git a/js/src/configure.in b/js/src/configure.in index 8f1d72317b3c..c270df1b60b1 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1770,7 +1770,7 @@ ia64*-hpux*) if test "$CPU_ARCH" = "x86"; then WIN32_SUBSYSTEM_VERSION=5.01 else - WIN32_SUBSYSTEM_VERSION=5.02 + WIN32_SUBSYSTEM_VERSION=6.01 fi WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION From 477326e9e0ac29f454e35f34fcc632f9807a017e Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Mon, 24 Nov 2014 22:18:10 +0900 Subject: [PATCH 13/88] Bug 1094012 - Assume Win7 or later on Win64. r=jimm --- mfbt/WindowsVersion.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/mfbt/WindowsVersion.h b/mfbt/WindowsVersion.h index fcf24acc2e92..2e9621cb5d6e 100644 --- a/mfbt/WindowsVersion.h +++ b/mfbt/WindowsVersion.h @@ -84,6 +84,44 @@ IsWindowsBuildOrLater(uint32_t aBuild) return false; } +#if defined(_M_X64) || defined(_M_AMD64) +// We support only Win7 or later on Win64. +MOZ_ALWAYS_INLINE bool +IsXPSP3OrLater() +{ + return true; +} + +MOZ_ALWAYS_INLINE bool +IsWin2003OrLater() +{ + return true; +} + +MOZ_ALWAYS_INLINE bool +IsWin2003SP2OrLater() +{ + return true; +} + +MOZ_ALWAYS_INLINE bool +IsVistaOrLater() +{ + return true; +} + +MOZ_ALWAYS_INLINE bool +IsVistaSP1OrLater() +{ + return true; +} + +MOZ_ALWAYS_INLINE bool +IsWin7OrLater() +{ + return true; +} +#else MOZ_ALWAYS_INLINE bool IsXPSP3OrLater() { @@ -119,6 +157,7 @@ IsWin7OrLater() { return IsWindowsVersionOrLater(0x06010000ul); } +#endif MOZ_ALWAYS_INLINE bool IsWin7SP1OrLater() From 359fd77ce40431f9a2fab7a30111ec770987d774 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Mon, 24 Nov 2014 22:18:10 +0900 Subject: [PATCH 14/88] Bug 1094016 - Do not ship d3dcompiler_43 for 64-bit builds. r=mshal --- configure.in | 74 +++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/configure.in b/configure.in index 11bcbafee3a4..1aae34cf00fe 100644 --- a/configure.in +++ b/configure.in @@ -5935,53 +5935,57 @@ if test -n "$MOZ_ANGLE_RENDERER"; then ###################################### # Find _43 for use by XP. - # Get the SDK path from the registry. - # First try to get the June 2010 SDK - MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1` - if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then - # Otherwise just take whatever comes first - MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1` - fi - MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'` - - if test -n "$MOZ_DIRECTX_SDK_PATH" && - test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/dxguid.lib ; then - AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH]) + if test "$HAVE_64BIT_BUILD"; then + AC_MSG_RESULT([We are building a 64-bit binary, skip checking d3dcompiler_43.]) else - AC_MSG_RESULT([DirectX SDK not found.]) - MOZ_DIRECTX_SDK_PATH= - fi + # Get the SDK path from the registry. + # First try to get the June 2010 SDK + MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1` + if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then + # Otherwise just take whatever comes first + MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1` + fi + MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'` - # Check that our DirectX SDK is acceptable. - if test -n "$MOZ_DIRECTX_SDK_PATH"; then - if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then - AC_MSG_RESULT([Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.]) + if test -n "$MOZ_DIRECTX_SDK_PATH" && + test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/dxguid.lib ; then + AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH]) + else + AC_MSG_RESULT([DirectX SDK not found.]) MOZ_DIRECTX_SDK_PATH= fi - fi - if test -n "$MOZ_DIRECTX_SDK_PATH"; then - # Find a D3D compiler DLL in the DirectX SDK, if we didn't find one already. - # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib - MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'` + # Check that our DirectX SDK is acceptable. + if test -n "$MOZ_DIRECTX_SDK_PATH"; then + if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then + AC_MSG_RESULT([Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.]) + MOZ_DIRECTX_SDK_PATH= + fi + fi - if test -n "$MOZ_D3DX9_VERSION" ; then - MOZ_D3DCOMPILER_XP_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_D3D_CPU_SUFFIX}.cab | head -n1` + if test -n "$MOZ_DIRECTX_SDK_PATH"; then + # Find a D3D compiler DLL in the DirectX SDK, if we didn't find one already. + # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib + MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'` - if test -n "$MOZ_D3DCOMPILER_XP_CAB"; then - MOZ_D3DCOMPILER_XP_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll + if test -n "$MOZ_D3DX9_VERSION" ; then + MOZ_D3DCOMPILER_XP_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_D3D_CPU_SUFFIX}.cab | head -n1` + + if test -n "$MOZ_D3DCOMPILER_XP_CAB"; then + MOZ_D3DCOMPILER_XP_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll + else + AC_MSG_RESULT([Couldn't find a CAB containing the D3D compiler DLL.]) + AC_MSG_ERROR([DirectX SDK at "$MOZ_DIRECTX_SDK_PATH" appears broken.]) + MOZ_DIRECTX_SDK_PATH= + fi else - AC_MSG_RESULT([Couldn't find a CAB containing the D3D compiler DLL.]) - AC_MSG_ERROR([DirectX SDK at "$MOZ_DIRECTX_SDK_PATH" appears broken.]) + AC_MSG_RESULT([Couldn't determine the D3DX9 version for the DirectX SDK.]) MOZ_DIRECTX_SDK_PATH= fi else - AC_MSG_RESULT([Couldn't determine the D3DX9 version for the DirectX SDK.]) - MOZ_DIRECTX_SDK_PATH= + AC_MSG_RESULT([Couldn't find an acceptable DirectX SDK for ANGLE, needed for d3dcompiler_43.]) + AC_MSG_RESULT([ Either ignore, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.]) fi - else - AC_MSG_RESULT([Couldn't find an acceptable DirectX SDK for ANGLE, needed for d3dcompiler_43.]) - AC_MSG_RESULT([ Either ignore, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.]) fi ###################################### From bc1fe658636b9791ee7bb57350a17a75e0ed2049 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 24 Nov 2014 14:38:51 +0100 Subject: [PATCH 15/88] Backed out changeset d26673206131 (bug 894137) for crashtest bustage --HG-- rename : dom/base/crashtests/894137.html => content/base/crashtests/894137.html --- {dom => content}/base/crashtests/894137.html | 0 dom/base/crashtests/crashtests.list | 1 - 2 files changed, 1 deletion(-) rename {dom => content}/base/crashtests/894137.html (100%) diff --git a/dom/base/crashtests/894137.html b/content/base/crashtests/894137.html similarity index 100% rename from dom/base/crashtests/894137.html rename to content/base/crashtests/894137.html diff --git a/dom/base/crashtests/crashtests.list b/dom/base/crashtests/crashtests.list index 4ffe7b85d3ae..69b47c611974 100644 --- a/dom/base/crashtests/crashtests.list +++ b/dom/base/crashtests/crashtests.list @@ -188,7 +188,6 @@ load 852381.html load 863950.html load 864448.html load 886213.html -load 894137.html load 898906.html load 930250.html load 942979.html From b458452297531bd77a90821abfff9a5f7bf49be2 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 19 Nov 2014 15:01:04 -0500 Subject: [PATCH 16/88] Bug 1101773 - Add an --update-only option to |mach mercurial-setup| for updating extensions without running the wizard, r=gps --HG-- extra : rebase_source : 93de55544f2f907255a286b1074ed201de62a46b --- tools/mercurial/hgsetup/update.py | 93 +++++++++++++++++++++++++++++++ tools/mercurial/hgsetup/wizard.py | 30 ++-------- tools/mercurial/mach_commands.py | 20 +++++-- 3 files changed, 112 insertions(+), 31 deletions(-) create mode 100644 tools/mercurial/hgsetup/update.py diff --git a/tools/mercurial/hgsetup/update.py b/tools/mercurial/hgsetup/update.py new file mode 100644 index 000000000000..f73c20dfea88 --- /dev/null +++ b/tools/mercurial/hgsetup/update.py @@ -0,0 +1,93 @@ +# 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/. + +from __future__ import unicode_literals + +import errno +import os +import which + +from configobj import ConfigObjError + +from mozversioncontrol.repoupdate import update_mercurial_repo + +from .config import ( + HgIncludeException, + MercurialConfig, + HOST_FINGERPRINTS, +) + +FINISHED = ''' +Your Mercurial recommended extensions are now up to date! +'''.lstrip() + + +class MercurialUpdater(object): + + def __init__(self, state_dir): + self.state_dir = os.path.normpath(state_dir) + self.ext_dir = os.path.join(self.state_dir, 'mercurial', 'extensions') + self.vcs_tools_dir = os.path.join(self.state_dir, 'version-control-tools') + + def update_all(self, config_paths): + try: + os.makedirs(self.ext_dir) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + try: + hg = which.which('hg') + except which.WhichError as e: + print(e) + print('Try running |mach bootstrap| to ensure your environment is ' + 'up to date.') + return 1 + + try: + c = MercurialConfig(config_paths) + except ConfigObjError as e: + print('Error importing existing Mercurial config!\n') + for error in e.errors: + print(error.message) + + return 1 + except HgIncludeException as e: + print(e.message) + + return 1 + + if 'mqext' in c.extensions: + self.update_mercurial_repo( + hg, + 'https://bitbucket.org/sfink/mqext', + os.path.join(self.ext_dir, 'mqext'), + 'default', + 'Ensuring mqext is up to date...') + + if os.path.isdir(self.vcs_tools_dir): + self.update_mercurial_repo( + hg, + 'https://hg.mozilla.org/hgcustom/version-control-tools', + self.vcs_tools_dir, + 'default', + 'Ensuring version-control-tools is up to date...') + print(FINISHED) + return 0 + + def update_mercurial_repo(self, hg, url, dest, branch, msg): + # We always pass the host fingerprints that we "know" to be canonical + # because the existing config may have outdated fingerprints and this + # may cause Mercurial to abort. + return self._update_repo(hg, url, dest, branch, msg, + update_mercurial_repo, hostfingerprints=HOST_FINGERPRINTS) + + def _update_repo(self, binary, url, dest, branch, msg, fn, *args, **kwargs): + print('=' * 80) + print(msg) + try: + fn(binary, url, dest, branch, *args, **kwargs) + finally: + print('=' * 80) + print('') diff --git a/tools/mercurial/hgsetup/wizard.py b/tools/mercurial/hgsetup/wizard.py index 27a91e69f849..c666d5b443ea 100644 --- a/tools/mercurial/hgsetup/wizard.py +++ b/tools/mercurial/hgsetup/wizard.py @@ -17,14 +17,10 @@ from configobj import ConfigObjError from StringIO import StringIO from mozversioncontrol import get_hg_version -from mozversioncontrol.repoupdate import ( - update_mercurial_repo, - update_git_repo, -) +from .update import MercurialUpdater from .config import ( HgIncludeException, - HOST_FINGERPRINTS, MercurialConfig, ) @@ -172,6 +168,7 @@ class MercurialSetupWizard(object): self.ext_dir = os.path.join(self.state_dir, 'mercurial', 'extensions') self.vcs_tools_dir = os.path.join(self.state_dir, 'version-control-tools') self.update_vcs_tools = False + self.updater = MercurialUpdater(state_dir) def run(self, config_paths): try: @@ -282,7 +279,7 @@ class MercurialSetupWizard(object): os.path.join(self.ext_dir, 'mqext')) if 'mqext' in c.extensions: - self.update_mercurial_repo( + self.updater.update_mercurial_repo( hg, 'https://bitbucket.org/sfink/mqext', os.path.join(self.ext_dir, 'mqext'), @@ -323,7 +320,7 @@ class MercurialSetupWizard(object): c.set_bugzilla_credentials(bzuser, bzpass) if self.update_vcs_tools: - self.update_mercurial_repo( + self.updater.update_mercurial_repo( hg, 'https://hg.mozilla.org/hgcustom/version-control-tools', self.vcs_tools_dir, @@ -402,25 +399,6 @@ class MercurialSetupWizard(object): self.update_vcs_tools = True c.activate_extension(name, path) - def update_mercurial_repo(self, hg, url, dest, branch, msg): - # We always pass the host fingerprints that we "know" to be canonical - # because the existing config may have outdated fingerprints and this - # may cause Mercurial to abort. - return self._update_repo(hg, url, dest, branch, msg, - update_mercurial_repo, hostfingerprints=HOST_FINGERPRINTS) - - def update_git_repo(self, git, url, dest, ref, msg): - return self._update_repo(git, url, dest, ref, msg, update_git_repo) - - def _update_repo(self, binary, url, dest, branch, msg, fn, *args, **kwargs): - print('=' * 80) - print(msg) - try: - fn(binary, url, dest, branch, *args, **kwargs) - finally: - print('=' * 80) - print('') - def _prompt(self, msg, allow_empty=False): print(msg) diff --git a/tools/mercurial/mach_commands.py b/tools/mercurial/mach_commands.py index 6c5e2a4d471f..9fbd00aa9927 100644 --- a/tools/mercurial/mach_commands.py +++ b/tools/mercurial/mach_commands.py @@ -9,6 +9,7 @@ import sys from mach.decorators import ( CommandProvider, + CommandArgument, Command, ) @@ -20,16 +21,25 @@ class VersionControlCommands(object): @Command('mercurial-setup', category='devenv', description='Help configure Mercurial for optimal development.') - def mercurial_bootstrap(self): + @CommandArgument('-u', '--update-only', action='store_true', + help='Only update recommended extensions, don\'t run the wizard.') + def mercurial_bootstrap(self, update_only=False): sys.path.append(os.path.dirname(__file__)) - from hgsetup.wizard import MercurialSetupWizard - wizard = MercurialSetupWizard(self._context.state_dir) config_paths = ['~/.hgrc'] if sys.platform in ('win32', 'cygwin'): - config_paths.insert(0, '~/mercurial.ini') - result = wizard.run(map(os.path.expanduser, config_paths)) + config_paths.insert(0, '~/mercurial.ini') + config_paths = map(os.path.expanduser, config_paths) + + if update_only: + from hgsetup.update import MercurialUpdater + updater = MercurialUpdater(self._context.state_dir) + result = updater.update_all(map(os.path.expanduser, config_paths)) + else: + from hgsetup.wizard import MercurialSetupWizard + wizard = MercurialSetupWizard(self._context.state_dir) + result = wizard.run(map(os.path.expanduser, config_paths)) # Touch a file so we can periodically prompt to update extensions. state_path = os.path.join(self._context.state_dir, From 4ff411c28defbeb7b960ecf5ab7929771429fe0c Mon Sep 17 00:00:00 2001 From: Rob Wood Date: Tue, 14 Oct 2014 18:46:34 -0400 Subject: [PATCH 17/88] Bug 984508 - Marionette should monitor listeners to ensure they're still alive; r=mdas --- .../marionette/client/marionette/errors.py | 1 + .../client/marionette/marionette.py | 10 ++ .../tests/unit/test_set_frame_timeout.py | 15 +++ .../marionette/tests/unit/unit-tests.ini | 1 + .../marionette/marionette-frame-manager.js | 34 ++++- testing/marionette/marionette-listener.js | 11 ++ testing/marionette/marionette-server.js | 117 ++++++++++++++++-- 7 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 testing/marionette/client/marionette/tests/unit/test_set_frame_timeout.py diff --git a/testing/marionette/client/marionette/errors.py b/testing/marionette/client/marionette/errors.py index aee6aa24c52f..cc9722c9e37e 100644 --- a/testing/marionette/client/marionette/errors.py +++ b/testing/marionette/client/marionette/errors.py @@ -31,6 +31,7 @@ class ErrorCodes(object): INVALID_RESPONSE = 53 FRAME_SEND_NOT_INITIALIZED_ERROR = 54 FRAME_SEND_FAILURE_ERROR = 55 + FRAME_NOT_RESPONDING = 56 UNSUPPORTED_OPERATION = 405 MARIONETTE_ERROR = 500 diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/client/marionette/marionette.py index 010d83e9c148..93099901631d 100644 --- a/testing/marionette/client/marionette/marionette.py +++ b/testing/marionette/client/marionette/marionette.py @@ -1584,3 +1584,13 @@ class Marionette(object): """ return self._send_message("maximizeWindow", "ok") + + def set_frame_timeout(self, timeout): + """ Set the OOP frame timeout value in ms. When focus is on a + remote frame, if the heartbeat pong is not received within this + specified value, the frame will timeout. + + :param timeout: The frame timeout value in ms. + """ + + return self._send_message("setFrameTimeout", "ok", ms=timeout) diff --git a/testing/marionette/client/marionette/tests/unit/test_set_frame_timeout.py b/testing/marionette/client/marionette/tests/unit/test_set_frame_timeout.py new file mode 100644 index 000000000000..c798508094a7 --- /dev/null +++ b/testing/marionette/client/marionette/tests/unit/test_set_frame_timeout.py @@ -0,0 +1,15 @@ +# 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/. + +from errors import MarionetteException +from marionette_test import MarionetteTestCase + +class TestSetFrameTimeout(MarionetteTestCase): + + def test_set_valid_frame_timeout(self): + self.marionette.set_frame_timeout(10000) + + def test_set_invalid_frame_timeout(self): + with self.assertRaisesRegexp(MarionetteException, "Not a number"): + self.marionette.set_frame_timeout("timeout") diff --git a/testing/marionette/client/marionette/tests/unit/unit-tests.ini b/testing/marionette/client/marionette/tests/unit/unit-tests.ini index fea2b46eae1f..c4655fc35cec 100644 --- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini +++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini @@ -132,5 +132,6 @@ browser = false b2g = false [test_set_window_size.py] b2g = false +[test_set_frame_timeout.py] skip-if = os == "linux" # Bug 1085717 [test_with_using_context.py] diff --git a/testing/marionette/marionette-frame-manager.js b/testing/marionette/marionette-frame-manager.js index 8243e92b7a10..6ba28ef35dc2 100644 --- a/testing/marionette/marionette-frame-manager.js +++ b/testing/marionette/marionette-frame-manager.js @@ -108,6 +108,16 @@ FrameManager.prototype = { let oopFrame = frameWindow.document.getElementsByTagName("iframe")[message.json.frame]; //find the OOP frame let mm = oopFrame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager; //get the OOP frame's mm + // Grab the app name + let appName = null; + try { + appName = oopFrame.getAttribute("mozapp"); + } + catch(e) { + appName = "mozapp name unavailable"; + logger.info("Error getting mozapp: " + e.result) + } + // See if this frame already has our frame script loaded in it; if so, // just wake it up. for (let i = 0; i < remoteFrames.length; i++) { @@ -133,7 +143,7 @@ FrameManager.prototype = { } mm.sendAsyncMessage("Marionette:restart", {}); - return oopFrame.id; + return [oopFrame.id, appName]; } } @@ -150,7 +160,7 @@ FrameManager.prototype = { aFrame.specialPowersObserver = new specialpowers.SpecialPowersObserver(); aFrame.specialPowersObserver.init(mm); - return oopFrame.id; + return [oopFrame.id, appName]; }, /* @@ -166,6 +176,22 @@ FrameManager.prototype = { this.handledModal = false; }, + /* + * Remove specified frame from the remote frames list + */ + removeRemoteFrame: function FM_removeRemoteFrame(frameId) { + logger.info("Deleting frame from remote frames list: " + frameId); + startLen = remoteFrames.length; + for (let i = 0; i < remoteFrames.length; i++) { + if (remoteFrames[i].frameId == frameId) { + remoteFrames.splice(i, 1); + } + } + if (remoteFrames.length == startLen) { + logger.info("Frame not found in remote frames list"); + } + }, + /** * This function removes any SpecialPowersObservers from OOP frames. */ @@ -205,9 +231,11 @@ FrameManager.prototype = { messageManager.addWeakMessageListener("Marionette:addCookie", this.server); messageManager.addWeakMessageListener("Marionette:getVisibleCookies", this.server); messageManager.addWeakMessageListener("Marionette:deleteCookie", this.server); + messageManager.addWeakMessageListener("Marionette:pong", this.server); messageManager.addWeakMessageListener("MarionetteFrame:handleModal", this); messageManager.addWeakMessageListener("MarionetteFrame:getCurrentFrameId", this); messageManager.addWeakMessageListener("MarionetteFrame:getInterruptedState", this); + messageManager.addWeakMessageListener("Marionette:startHeartbeat", this.server); }, /** @@ -236,8 +264,10 @@ FrameManager.prototype = { messageManager.removeWeakMessageListener("Marionette:addCookie", this.server); messageManager.removeWeakMessageListener("Marionette:getVisibleCookies", this.server); messageManager.removeWeakMessageListener("Marionette:deleteCookie", this.server); + messageManager.removeWeakMessageListener("Marionette:pong", this.server); messageManager.removeWeakMessageListener("MarionetteFrame:handleModal", this); messageManager.removeWeakMessageListener("MarionetteFrame:getCurrentFrameId", this); + messageManager.removeWeakMessageListener("Marionette:startHeartbeat", this.server); }, }; diff --git a/testing/marionette/marionette-listener.js b/testing/marionette/marionette-listener.js index c6f39a38565f..9be0c1d618d8 100644 --- a/testing/marionette/marionette-listener.js +++ b/testing/marionette/marionette-listener.js @@ -188,6 +188,7 @@ function startListeners() { addMessageListenerId("Marionette:getCookies", getCookies); addMessageListenerId("Marionette:deleteAllCookies", deleteAllCookies); addMessageListenerId("Marionette:deleteCookie", deleteCookie); + addMessageListenerId("Marionette:ping", ping); } /** @@ -290,6 +291,7 @@ function deleteSession(msg) { removeMessageListenerId("Marionette:getCookies", getCookies); removeMessageListenerId("Marionette:deleteAllCookies", deleteAllCookies); removeMessageListenerId("Marionette:deleteCookie", deleteCookie); + removeMessageListenerId("Marionette:ping", ping); if (isB2G) { content.removeEventListener("mozbrowsershowmodalprompt", modalHandler, false); } @@ -1287,6 +1289,8 @@ function get(msg) { if (curFrame.document.readyState == "complete") { removeEventListener("DOMContentLoaded", onDOMContentLoaded, false); sendOk(command_id); + // Restart the OOP frame heartbeat now that the URL is loaded + sendToServer("Marionette:startHeartbeat"); } else if (curFrame.document.readyState == "interactive" && errorRegex.exec(curFrame.document.baseURI)) { @@ -1918,6 +1922,13 @@ function getAppCacheStatus(msg) { msg.json.command_id); } +/** + * Received heartbeat ping + */ +function ping(msg) { + sendToServer("Marionette:pong", {}, msg.json.command_id); +} + // emulator callbacks let _emu_cb_id = 0; let _emu_cbs = {}; diff --git a/testing/marionette/marionette-server.js b/testing/marionette/marionette-server.js index 5ca1188335a5..4fe12e2456e4 100644 --- a/testing/marionette/marionette-server.js +++ b/testing/marionette/marionette-server.js @@ -98,18 +98,14 @@ function FrameSendNotInitializedError(frame) { this.code = 54; this.frame = frame; this.message = "Error sending message to frame (NS_ERROR_NOT_INITIALIZED)"; - this.toString = function() { - return this.message + " " + this.frame + "; frame has closed."; - } + this.errMsg = this.message + " " + this.frame + "; frame has closed."; } function FrameSendFailureError(frame) { this.code = 55; this.frame = frame; this.message = "Error sending message to frame (NS_ERROR_FAILURE)"; - this.toString = function() { - return this.message + " " + this.frame + "; frame not responding."; - } + this.errMsg = this.message + " " + this.frame + "; frame not responding."; } /** @@ -155,6 +151,11 @@ function MarionetteServerConnection(aPrefix, aTransport, aServer) this.currentFrameElement = null; this.testName = null; this.mozBrowserClose = null; + this.frameHeartbeatTimer = null; + this.frameHeartbeatLastPong = null; + this.frameHeartbeatLastApp = null; + this.frameHeartbeatExceptionPending = false; + this.frameTimeout = 5000; // default, set with setFrameTimeout this.oopFrameId = null; // frame ID of current remote frame, used for mozbrowserclose events this.sessionCapabilities = { // Mandated capabilities @@ -243,11 +244,21 @@ MarionetteServerConnection.prototype = { * @param object values * Object to send to the listener */ - sendAsync: function MDA_sendAsync(name, values, commandId, ignoreFailure) { + sendAsync: function MDA_sendAsync(name, values, commandId, ignoreFailure, throwError) { let success = true; if (commandId) { values.command_id = commandId; } + if (typeof(throwError) !== "boolean") { + throwError = false; + } + if (this.frameHeartbeatExceptionPending) { + // Previous frame was not responding; send exception indicating have switched to system frame + this.frameHeartbeatExceptionPending = false; + let errorTxt = "Frame not responding (" + this.frameHeartbeatLastApp + "), switching to root frame"; + this.sendError(errorTxt, 56, null, this.command_id); + return false; + } if (this.curBrowser.frameManager.currentRemoteFrame !== null) { try { this.messageManager.sendAsyncMessage( @@ -268,7 +279,12 @@ MarionetteServerConnection.prototype = { break; } let code = error.hasOwnProperty('code') ? e.code : 500; - this.sendError(error.toString(), code, error.stack, commandId); + if (throwError == false) { + this.sendError(error.toString(), code, error.stack, commandId); + } + else { + throw {message:"sendAsync failed: " + error.hasOwnProperty('type'), code, stack:null}; + } } } } @@ -724,6 +740,10 @@ MarionetteServerConnection.prototype = { else { this.context = context; this.sendOk(this.command_id); + // Stop the OOP frame heartbeat if switched into chrome + if (context == "chrome") { + this.stopHeartbeat(); + } } }, @@ -1179,6 +1199,8 @@ MarionetteServerConnection.prototype = { if (this.context != "chrome") { aRequest.command_id = command_id; aRequest.parameters.pageTimeout = this.pageTimeout; + // stop OOP frame heartbeat if it's running, so it won't timeout during URL load + this.stopHeartbeat(); this.sendAsync("get", aRequest.parameters, command_id); return; } @@ -1471,7 +1493,6 @@ MarionetteServerConnection.prototype = { this.sendError("Error loading page", 13, null, command_id); return; } - checkTimer.initWithCallback(checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT); } if (this.context == "chrome") { @@ -2327,6 +2348,7 @@ MarionetteServerConnection.prototype = { */ deleteSession: function MDA_deleteSession() { let command_id = this.command_id = this.getCommandId(); + this.stopHeartbeat(); try { this.sessionTearDown(); } @@ -2641,6 +2663,22 @@ MarionetteServerConnection.prototype = { this.sendOk(this.command_id); }, + /** + * Sets the OOP frame timeout value (ms) + */ + setFrameTimeout: function MDA_setFrameTimeout(aRequest) { + this.command_id = this.getCommandId(); + let timeout = parseInt(aRequest.parameters.ms); + if (isNaN(timeout)) { + this.sendError("Not a number", 500, null, this.command_id); + return; + } + else { + this.frameTimeout = timeout; + } + this.sendOk(this.command_id); + }, + /** * Helper function to convert an outerWindowID into a UID that Marionette * tracks. @@ -2650,6 +2688,54 @@ MarionetteServerConnection.prototype = { return uid; }, + /** + * Start the OOP frame heartbeat + */ + startHeartbeat: function MDA_startHeartbeat() { + this.frameHeartbeatLastPong = new Date().getTime(); + function pulse() { + let noResponse = false; + let now = new Date().getTime(); + let elapsed = now - this.frameHeartbeatLastPong; + try { + if (elapsed > this.frameTimeout) { + throw {message:null, code:56, stack:null}; + } + let result = this.sendAsync("ping", {}, this.command_id, false, true); + if (result == false) { + throw {message:null, code:56, stack:null}; + } + } + catch (e) { + let lastApp = this.frameHeartbeatLastApp ? this.frameHeartbeatLastApp : "undefined"; + this.stopHeartbeat(); + this.curBrowser.frameManager.removeRemoteFrame(this.curBrowser.frameManager.currentRemoteFrame.frameId); + this.switchToGlobalMessageManager(); + // If there is an active request, send back an exception now, otherwise wait until next request + if (this.command_id) { + let errorTxt = "Frame not responding (" + lastApp + "), switching to root frame"; + this.sendError(errorTxt, e.code, e.stack, this.command_id); + } + else { + this.frameHeartbeatExceptionPending = true; + } + return; + } + } + this.frameHeartbeatTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + this.frameHeartbeatTimer.initWithCallback(pulse.bind(this), 500, Ci.nsITimer.TYPE_REPEATING_PRECISE_CAN_SKIP); + }, + + /** + * Stop the OOP frame heartbeat + */ + stopHeartbeat: function MDA_stopHeartbeat() { + if (this.frameHeartbeatTimer !== null) { + this.frameHeartbeatTimer.cancel(); + this.frameHeartbeatTimer = null; + } + }, + /** * Receives all messages from content messageManager */ @@ -2686,7 +2772,7 @@ MarionetteServerConnection.prototype = { this.sendToClient(message.json, -1); break; case "Marionette:switchToFrame": - this.oopFrameId = this.curBrowser.frameManager.switchToFrame(message); + [this.oopFrameId, this.frameHeartbeatLastApp] = this.curBrowser.frameManager.switchToFrame(message); this.messageManager = this.curBrowser.frameManager.currentRemoteFrame.messageManager.get(); break; case "Marionette:switchToModalOrigin": @@ -2707,6 +2793,7 @@ MarionetteServerConnection.prototype = { } this.currentFrameElement = message.json.frameValue; } + this.stopHeartbeat(); break; case "Marionette:getVisibleCookies": let [currentPath, host] = message.json.value; @@ -2770,6 +2857,7 @@ MarionetteServerConnection.prototype = { // is from a remote frame. this.curBrowser.frameManager.currentRemoteFrame.targetFrameId = this.generateFrameId(message.json.value); this.sendOk(this.command_id); + this.startHeartbeat(); } let browserType; @@ -2820,6 +2908,12 @@ MarionetteServerConnection.prototype = { globalMessageManager.broadcastAsyncMessage( "MarionetteMainListener:emitTouchEvent", message.json); return; + case "Marionette:pong": + this.frameHeartbeatLastPong = new Date().getTime(); + break; + case "Marionette:startHeartbeat": + this.startHeartbeat(); + break; } } }; @@ -2903,7 +2997,8 @@ MarionetteServerConnection.prototype.requestTypes = { "setScreenOrientation": MarionetteServerConnection.prototype.setScreenOrientation, "getWindowSize": MarionetteServerConnection.prototype.getWindowSize, "setWindowSize": MarionetteServerConnection.prototype.setWindowSize, - "maximizeWindow": MarionetteServerConnection.prototype.maximizeWindow + "maximizeWindow": MarionetteServerConnection.prototype.maximizeWindow, + "setFrameTimeout": MarionetteServerConnection.prototype.setFrameTimeout }; /** From 4b9965e1edd8143d06adc44b4ec7465d83324c57 Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Mon, 24 Nov 2014 14:28:58 +0000 Subject: [PATCH 18/88] Bug 1099197 - Determine the bounds of unstroked polylines/polygons directly. r=jwatt --- dom/svg/nsSVGPolyElement.cpp | 35 +++++++++++++++++++++++++++++++++++ dom/svg/nsSVGPolyElement.h | 2 ++ gfx/2d/BaseRect.h | 17 +++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/dom/svg/nsSVGPolyElement.cpp b/dom/svg/nsSVGPolyElement.cpp index bd1aa99077ba..211d8015d89a 100644 --- a/dom/svg/nsSVGPolyElement.cpp +++ b/dom/svg/nsSVGPolyElement.cpp @@ -119,3 +119,38 @@ nsSVGPolyElement::GetMarkPoints(nsTArray *aMarks) aMarks->LastElement().angle = prevAngle; aMarks->LastElement().type = nsSVGMark::eEnd; } + +bool +nsSVGPolyElement::GetGeometryBounds(Rect* aBounds, Float aStrokeWidth, + const Matrix& aTransform) +{ + const SVGPointList &points = mPoints.GetAnimValue(); + + if (!points.Length()) { + // Rendering of the element is disabled + aBounds->SetEmpty(); + return true; + } + + if (aStrokeWidth > 0) { + // We don't handle stroke-miterlimit etc. yet + return false; + } + + if (aTransform.IsRectilinear()) { + // We can avoid transforming each point and just transform the result. + // Important for large point lists. + Rect bounds(points[0], Size()); + for (uint32_t i = 1; i < points.Length(); ++i) { + bounds.ExpandToEnclose(points[i]); + } + *aBounds = aTransform.TransformBounds(bounds); + } else { + *aBounds = Rect(aTransform * points[0], Size()); + for (uint32_t i = 1; i < points.Length(); ++i) { + aBounds->ExpandToEnclose(aTransform * points[i]); + } + } + return true; +} + diff --git a/dom/svg/nsSVGPolyElement.h b/dom/svg/nsSVGPolyElement.h index cee7047a9313..e3efca6f8e72 100644 --- a/dom/svg/nsSVGPolyElement.h +++ b/dom/svg/nsSVGPolyElement.h @@ -45,6 +45,8 @@ public: virtual bool AttributeDefinesGeometry(const nsIAtom *aName) MOZ_OVERRIDE; virtual bool IsMarkable() MOZ_OVERRIDE { return true; } virtual void GetMarkPoints(nsTArray *aMarks) MOZ_OVERRIDE; + virtual bool GetGeometryBounds(Rect* aBounds, Float aStrokeWidth, + const Matrix& aTransform) MOZ_OVERRIDE; // WebIDL already_AddRefed Points(); diff --git a/gfx/2d/BaseRect.h b/gfx/2d/BaseRect.h index 01c0bac0f38f..0b6810cfddd5 100644 --- a/gfx/2d/BaseRect.h +++ b/gfx/2d/BaseRect.h @@ -177,6 +177,23 @@ struct BaseRect { *static_cast(this) = aRect1.UnionEdges(aRect2); } + // Expands the rect to include the point + void ExpandToEnclose(const Point& aPoint) + { + if (aPoint.x < x) { + width = XMost() - aPoint.x; + x = aPoint.x; + } else if (aPoint.x > XMost()) { + width = aPoint.x - x; + } + if (aPoint.y < y) { + height = YMost() - aPoint.y; + y = aPoint.y; + } else if (aPoint.y > YMost()) { + height = aPoint.y - y; + } + } + void SetRect(T aX, T aY, T aWidth, T aHeight) { x = aX; y = aY; width = aWidth; height = aHeight; From 5cc08e7f895965b2547c1c76e265c014e5c6402c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 24 Nov 2014 16:07:43 +0100 Subject: [PATCH 19/88] Bug 1072368 - Implement the remaining SIMD integer compares in the interpreter and asm.js; a=sunfish,bbouvier, r=sunfish --HG-- extra : histedit_source : c9a772af119b0d8d01ba5ef01653bc3a356826dc --- js/src/builtin/SIMD.h | 11 ++++--- js/src/jit-test/tests/asm.js/testSIMD.js | 28 +++++++++++++----- .../jit/shared/CodeGenerator-x86-shared.cpp | 29 ++++++++++++++++--- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/js/src/builtin/SIMD.h b/js/src/builtin/SIMD.h index a398e0c61288..d3b557bdafe7 100644 --- a/js/src/builtin/SIMD.h +++ b/js/src/builtin/SIMD.h @@ -94,12 +94,15 @@ V(and, (BinaryFunc), 2, 0) \ V(equal, (CompareFunc), 2, 0) \ V(greaterThan, (CompareFunc), 2, 0) \ + V(greaterThanOrEqual, (CompareFunc), 2, 0) \ V(lessThan, (CompareFunc), 2, 0) \ + V(lessThanOrEqual, (CompareFunc), 2, 0) \ V(load, (Load), 2, 0) \ V(loadXYZ, (Load), 2, 0) \ V(loadXY, (Load), 2, 0) \ V(loadX, (Load), 2, 0) \ V(mul, (BinaryFunc), 2, 0) \ + V(notEqual, (CompareFunc), 2, 0) \ V(or, (BinaryFunc), 2, 0) \ V(sub, (BinaryFunc), 2, 0) \ V(shiftLeft, (Int32x4BinaryScalar), 2, 0) \ @@ -155,16 +158,16 @@ _(max) \ _(min) \ _(maxNum) \ - _(minNum) \ - _(lessThanOrEqual) \ - _(notEqual) \ - _(greaterThanOrEqual) + _(minNum) #define FOREACH_COMMONX4_SIMD_OP(_) \ _(add) \ _(sub) \ _(lessThan) \ + _(lessThanOrEqual) \ _(equal) \ + _(notEqual) \ _(greaterThan) \ + _(greaterThanOrEqual) \ _(and) \ _(or) \ _(xor) \ diff --git a/js/src/jit-test/tests/asm.js/testSIMD.js b/js/src/jit-test/tests/asm.js/testSIMD.js index e67a4d30f670..611f3893d6df 100644 --- a/js/src/jit-test/tests/asm.js/testSIMD.js +++ b/js/src/jit-test/tests/asm.js/testSIMD.js @@ -590,26 +590,38 @@ CheckI4(WWI, 'var x = i4(1,2,3,4); x = w(x, 42);', [1, 2, 3, 42]); // yields all bits set to 0 (i.e 0). const T = -1; const F = 0; -assertAsmTypeFail('glob', USE_ASM + I32 + "var lt=i4.lessThanOrEqual; function f() {} return f"); -assertAsmTypeFail('glob', USE_ASM + I32 + "var ge=i4.greaterThanOrEqual; function f() {} return f"); -assertAsmTypeFail('glob', USE_ASM + I32 + "var ne=i4.notEqual; function f() {} return f"); +const EQI32 = 'var eq = i4.equal'; +const NEI32 = 'var ne = i4.notEqual'; const LTI32 = 'var lt = i4.lessThan;'; +const LEI32 = 'var le = i4.lessThanOrEqual'; const GTI32 = 'var gt = i4.greaterThan;'; -const EQI32 = 'var eq = i4.equal;'; - -CheckI4(LTI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=lt(x,y)', [F, F, F, F]); -CheckI4(LTI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=lt(x,y)', [T, T, T, T]); -CheckI4(LTI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=lt(x,y)', [F, T, T, F]); +const GEI32 = 'var ge = i4.greaterThanOrEqual'; CheckI4(EQI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=eq(x,y)', [F, F, F, F]); CheckI4(EQI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=eq(x,y)', [F, F, F, F]); CheckI4(EQI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=eq(x,y)', [T, F, F, F]); +CheckI4(NEI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=ne(x,y)', [T, T, T, T]); +CheckI4(NEI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=ne(x,y)', [T, T, T, T]); +CheckI4(NEI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=ne(x,y)', [F, T, T, T]); + +CheckI4(LTI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=lt(x,y)', [F, F, F, F]); +CheckI4(LTI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=lt(x,y)', [T, T, T, T]); +CheckI4(LTI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=lt(x,y)', [F, T, T, F]); + +CheckI4(LEI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=le(x,y)', [F, F, F, F]); +CheckI4(LEI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=le(x,y)', [T, T, T, T]); +CheckI4(LEI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=le(x,y)', [T, T, T, F]); + CheckI4(GTI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=gt(x,y)', [T, T, T, T]); CheckI4(GTI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=gt(x,y)', [F, F, F, F]); CheckI4(GTI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=gt(x,y)', [F, F, F, T]); +CheckI4(GEI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=ge(x,y)', [T, T, T, T]); +CheckI4(GEI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=ge(x,y)', [F, F, F, F]); +CheckI4(GEI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=ge(x,y)', [T, F, F, T]); + const LTF32 = 'var lt=f4.lessThan;'; const LEF32 = 'var le=f4.lessThanOrEqual;'; const GTF32 = 'var gt=f4.greaterThan;'; diff --git a/js/src/jit/shared/CodeGenerator-x86-shared.cpp b/js/src/jit/shared/CodeGenerator-x86-shared.cpp index f28a9d6c81ac..c49015589f8c 100644 --- a/js/src/jit/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/jit/shared/CodeGenerator-x86-shared.cpp @@ -2677,6 +2677,8 @@ CodeGeneratorX86Shared::visitSimdShuffle(LSimdShuffle *ins) bool CodeGeneratorX86Shared::visitSimdBinaryCompIx4(LSimdBinaryCompIx4 *ins) { + static const SimdConstant allOnes = SimdConstant::SplatX4(-1); + FloatRegister lhs = ToFloatRegister(ins->lhs()); Operand rhs = ToOperand(ins->rhs()); MOZ_ASSERT(ToFloatRegister(ins->output()) == lhs); @@ -2690,22 +2692,41 @@ CodeGeneratorX86Shared::visitSimdBinaryCompIx4(LSimdBinaryCompIx4 *ins) masm.packedEqualInt32x4(rhs, lhs); return true; case MSimdBinaryComp::lessThan: - // scr := rhs + // src := rhs if (rhs.kind() == Operand::FPREG) masm.moveAlignedInt32x4(ToFloatRegister(ins->rhs()), ScratchSimdReg); else masm.loadAlignedInt32x4(rhs, ScratchSimdReg); - // scr := scr > lhs (i.e. lhs < rhs) + // src := src > lhs (i.e. lhs < rhs) // Improve by doing custom lowering (rhs is tied to the output register) masm.packedGreaterThanInt32x4(ToOperand(ins->lhs()), ScratchSimdReg); masm.moveAlignedInt32x4(ScratchSimdReg, lhs); return true; case MSimdBinaryComp::notEqual: + // Ideally for notEqual, greaterThanOrEqual, and lessThanOrEqual, we + // should invert the comparison by, e.g. swapping the arms of a select + // if that's what it's used in. + masm.loadConstantInt32x4(allOnes, ScratchSimdReg); + masm.packedEqualInt32x4(rhs, lhs); + masm.bitwiseXorX4(Operand(ScratchSimdReg), lhs); + return true; case MSimdBinaryComp::greaterThanOrEqual: + // src := rhs + if (rhs.kind() == Operand::FPREG) + masm.moveAlignedInt32x4(ToFloatRegister(ins->rhs()), ScratchSimdReg); + else + masm.loadAlignedInt32x4(rhs, ScratchSimdReg); + masm.packedGreaterThanInt32x4(ToOperand(ins->lhs()), ScratchSimdReg); + masm.loadConstantInt32x4(allOnes, lhs); + masm.bitwiseXorX4(Operand(ScratchSimdReg), lhs); + return true; case MSimdBinaryComp::lessThanOrEqual: - // These operations are not part of the spec. so are not implemented. - break; + // lhs <= rhs is equivalent to !(rhs < lhs), which we compute here. + masm.loadConstantInt32x4(allOnes, ScratchSimdReg); + masm.packedGreaterThanInt32x4(rhs, lhs); + masm.bitwiseXorX4(Operand(ScratchSimdReg), lhs); + return true; } MOZ_CRASH("unexpected SIMD op"); } From c3b8adcf02382b93b257dbb59dcaf1f3f46f5878 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 24 Nov 2014 16:09:29 +0100 Subject: [PATCH 20/88] Bug 1072368: Merge SIMD.js comparison tests in comparisons.js; r=till --- .../ecma_6/TypedObject/simd/comparisons.js | 102 ++++++++++++++++++ .../ecma_6/TypedObject/simd/float32x4equal.js | 34 ------ .../TypedObject/simd/float32x4greaterthan.js | 35 ------ .../simd/float32x4greaterthanorequal.js | 35 ------ .../TypedObject/simd/float32x4lessthan.js | 35 ------ .../simd/float32x4lessthanorequal.js | 35 ------ .../TypedObject/simd/float32x4notequal.js | 34 ------ .../ecma_6/TypedObject/simd/int32x4equal.js | 24 ----- .../TypedObject/simd/int32x4greaterthan.js | 24 ----- .../TypedObject/simd/int32x4lessthan.js | 24 ----- 10 files changed, 102 insertions(+), 280 deletions(-) create mode 100644 js/src/tests/ecma_6/TypedObject/simd/comparisons.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4equal.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthan.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthanorequal.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4lessthan.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4lessthanorequal.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4notequal.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/int32x4equal.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/int32x4greaterthan.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/int32x4lessthan.js diff --git a/js/src/tests/ecma_6/TypedObject/simd/comparisons.js b/js/src/tests/ecma_6/TypedObject/simd/comparisons.js new file mode 100644 index 000000000000..c97b5ec301ad --- /dev/null +++ b/js/src/tests/ecma_6/TypedObject/simd/comparisons.js @@ -0,0 +1,102 @@ +// |reftest| skip-if(!this.hasOwnProperty("SIMD")) + +/* + * Any copyright is dedicated to the Public Domain. + * https://creativecommons.org/publicdomain/zero/1.0/ + */ + +var float32x4 = SIMD.float32x4; +var int32x4 = SIMD.int32x4; + +var fround = Math.fround; + +function boolToSimdLogical(b) { + return b ? 0xFFFFFFFF | 0 : 0x0; +} + +function testEqualFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.equal, (x, y) => boolToSimdLogical(fround(x) == fround(y))); +} +function testNotEqualFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.notEqual, (x, y) => boolToSimdLogical(fround(x) != fround(y))); +} +function testLessThanFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.lessThan, (x, y) => boolToSimdLogical(fround(x) < fround(y))); +} +function testLessThanOrEqualFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.lessThanOrEqual, (x, y) => boolToSimdLogical(fround(x) <= fround(y))); +} +function testGreaterThanFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.greaterThan, (x, y) => boolToSimdLogical(fround(x) > fround(y))); +} +function testGreaterThanOrEqualFloat32x4(v, w) { + testBinaryFunc(v, w, float32x4.greaterThanOrEqual, (x, y) => boolToSimdLogical(fround(x) >= fround(y))); +} + +function testEqualInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.equal, (x, y) => boolToSimdLogical(x == y)); +} +function testNotEqualInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.notEqual, (x, y) => boolToSimdLogical(x != y)); +} +function testLessThanInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.lessThan, (x, y) => boolToSimdLogical(x < y)); +} +function testLessThanOrEqualInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.lessThanOrEqual, (x, y) => boolToSimdLogical(x <= y)); +} +function testGreaterThanInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.greaterThan, (x, y) => boolToSimdLogical(x > y)); +} +function testGreaterThanOrEqualInt32x4(v, w) { + testBinaryFunc(v, w, int32x4.greaterThanOrEqual, (x, y) => boolToSimdLogical(x >= y)); +} + +function test() { + var float32x4val = [ + float32x4(1, 20, 30, 4), + float32x4(10, 2, 3, 40), + float32x4(9.999, 2.1234, 30.4443, 4), + float32x4(10, 2.1233, 30.4444, 4.0001), + float32x4(NaN, -Infinity, +Infinity, -0), + float32x4(+Infinity, NaN, -0, -Infinity), + float32x4(13.37, 42.42, NaN, 0) + ]; + + var v, w; + for (v of float32x4val) { + for (w of float32x4val) { + testEqualFloat32x4(v, w); + testNotEqualFloat32x4(v, w); + testLessThanFloat32x4(v, w); + testLessThanOrEqualFloat32x4(v, w); + testGreaterThanFloat32x4(v, w); + testGreaterThanOrEqualFloat32x4(v, w); + } + } + + var int32x4val = [ + int32x4(1, 2, 3, 4), + int32x4(-1, -2, -3, -4), + int32x4(-1, 2, -3, 4), + int32x4(1, -2, 3, -4), + int32x4(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN), + int32x4(INT32_MAX, INT32_MIN, INT32_MAX, INT32_MIN) + ]; + + for (v of int32x4val) { + for (w of int32x4val) { + testEqualInt32x4(v, w); + testNotEqualInt32x4(v, w); + testLessThanInt32x4(v, w); + testLessThanOrEqualInt32x4(v, w); + testGreaterThanInt32x4(v, w); + testGreaterThanOrEqualInt32x4(v, w); + } + } + + if (typeof reportCompare === "function") + reportCompare(true, true); +} + +test(); diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4equal.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4equal.js deleted file mode 100644 index 9ad89e46adb3..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4equal.js +++ /dev/null @@ -1,34 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 equal'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of NaN/-0/Infinity/-Infinity border cases. - - var a = float32x4(1, 20, 30, 40); - var b = float32x4(10, 20, 30, 4); - var c = SIMD.float32x4.equal(a, b); - assertEq(c.x, 0); - assertEq(c.y, -1); - assertEq(c.z, -1); - assertEq(c.w, 0); - - var d = float32x4(1.89, 20.51, 30.46, 40.12); - var e = float32x4(10.89, 20.51, Math.fround(30.46), 4.12); - var f = SIMD.float32x4.equal(d, e); - assertEq(c.x, 0); - assertEq(c.y, -1); - assertEq(c.z, -1); - assertEq(c.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthan.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthan.js deleted file mode 100644 index 6fe4e243108b..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthan.js +++ /dev/null @@ -1,35 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 greaterThan'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of -0/Infinity/-Infinity border cases. - // FIXME -- Bug 1068028: Amend to check for correctness of NaN border cases once the semantics are defined. - - var a = float32x4(1, 20, 3, 40); - var b = float32x4(10, 2, 30, 4); - var c = SIMD.float32x4.greaterThan(b, a); - assertEq(c.x, -1); - assertEq(c.y, 0); - assertEq(c.z, -1); - assertEq(c.w, 0); - - var d = float32x4(10.8399, 20.37, 3.07, 4.6802); - var e = float32x4(10.8401, 20.367, 3.1, 4.6801); - var f = float32x4.greaterThan(e, d); - assertEq(f.x, -1); - assertEq(f.y, 0); - assertEq(f.z, -1); - assertEq(f.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthanorequal.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthanorequal.js deleted file mode 100644 index e1963c3a00c7..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4greaterthanorequal.js +++ /dev/null @@ -1,35 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 greaterThanOrEqual'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of -0/Infinity/-Infinity border cases. - // FIXME -- Bug 1068028: Amend to check for correctness of NaN border cases once the semantics are defined. - - var a = float32x4(1, 20, 30, 40); - var b = float32x4(10, 20, 30, 4); - var c = SIMD.float32x4.greaterThanOrEqual(b, a); - assertEq(c.x, -1); - assertEq(c.y, -1); - assertEq(c.z, -1); - assertEq(c.w, 0); - - var d = float32x4(10.029, 20.87, 30.56, 4.7); - var e = float32x4(10.03, 20.87, 30.56, 4.698); - var f = float32x4.greaterThanOrEqual(e, d); - assertEq(f.x, -1); - assertEq(f.y, -1); - assertEq(f.z, -1); - assertEq(f.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthan.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthan.js deleted file mode 100644 index 199babf0e669..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthan.js +++ /dev/null @@ -1,35 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 lessThan'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of -0/Infinity/-Infinity border cases. - // FIXME -- Bug 1068028: Amend to check for correctness of NaN border cases once the semantics are defined. - - var a = float32x4(1, 20, 3, 40); - var b = float32x4(10, 2, 30, 4); - var c = SIMD.float32x4.lessThan(a, b); - assertEq(c.x, -1); - assertEq(c.y, 0); - assertEq(c.z, -1); - assertEq(c.w, 0); - - var d = float32x4(1.5399, 20.001, 30.045, 4.74); - var e = float32x4(1.54, 19.999, 30.05, 4.72); - var f = float32x4.lessThan(a, b); - assertEq(f.x, -1); - assertEq(f.y, 0); - assertEq(f.z, -1); - assertEq(f.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthanorequal.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthanorequal.js deleted file mode 100644 index 7c9d9d3003ed..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4lessthanorequal.js +++ /dev/null @@ -1,35 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 lessThanOrEqual'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of -0/Infinity/-Infinity border cases. - // FIXME -- Bug 1068028: Amend to check for correctness of NaN border cases once the semantics are defined. - - var a = float32x4(1, 20, 30, 40); - var b = float32x4(10, 20, 30, 4); - var c = SIMD.float32x4.lessThanOrEqual(a, b); - assertEq(c.x, -1); - assertEq(c.y, -1); - assertEq(c.z, -1); - assertEq(c.w, 0); - - var d = float32x4(9.999, 20.78, 30.14, 40.1235); - var e = float32x4(10, 20.78, 30.14, 40.123); - var f = float32x4.lessThanOrEqual(d, e); - assertEq(f.x, -1); - assertEq(f.y, -1); - assertEq(f.z, -1); - assertEq(f.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4notequal.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4notequal.js deleted file mode 100644 index c46bcba524d3..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4notequal.js +++ /dev/null @@ -1,34 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 notEqual'; - -function test() { - print(BUGNUMBER + ": " + summary); - - // FIXME -- Bug 1081697: Amend to check for correctness of NaN/-0/Infinity/-Infinity border cases. - - var a = float32x4(1, 20, 30, 40); - var b = float32x4(10, 20, 30, 4); - var c = SIMD.float32x4.notEqual(a, b); - assertEq(c.x, -1); - assertEq(c.y, 0); - assertEq(c.z, 0); - assertEq(c.w, -1); - - var d = float32x4(9.98, 20.65, 30.14, 4.235); - var e = float32x4(9.99, 20.65, Math.fround(30.14), 4.23); - var f = SIMD.float32x4.notEqual(d, e); - assertEq(f.x, -1); - assertEq(f.y, 0); - assertEq(f.z, 0); - assertEq(f.w, -1); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4equal.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4equal.js deleted file mode 100644 index 693e7a2cbddd..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4equal.js +++ /dev/null @@ -1,24 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 996076; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'int32x4 equal'; - -function test() { - print(BUGNUMBER + ": " + summary); - - var a = int32x4(1, 20, 30, 40); - var b = int32x4(10, 20, 30, 4); - var c = SIMD.int32x4.equal(a, b); - assertEq(c.x, 0); - assertEq(c.y, -1); - assertEq(c.z, -1); - assertEq(c.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4greaterthan.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4greaterthan.js deleted file mode 100644 index 74c82a056a54..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4greaterthan.js +++ /dev/null @@ -1,24 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 996076; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'int32x4 greaterThan'; - -function test() { - print(BUGNUMBER + ": " + summary); - - var a = int32x4(1, 20, 3, 40); - var b = int32x4(10, 2, 30, 4); - var c = SIMD.int32x4.greaterThan(b,a); - assertEq(c.x, -1); - assertEq(c.y, 0); - assertEq(c.z, -1); - assertEq(c.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4lessthan.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4lessthan.js deleted file mode 100644 index 1f2a2a63f8de..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4lessthan.js +++ /dev/null @@ -1,24 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 996076; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'int32x4 lessThan'; - -function test() { - print(BUGNUMBER + ": " + summary); - - var a = int32x4(1, 20, 3, 40); - var b = int32x4(10, 2, 30, 4); - var c = SIMD.int32x4.lessThan(a, b); - assertEq(c.x, -1); - assertEq(c.y, 0); - assertEq(c.z, -1); - assertEq(c.w, 0); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - From 328c833702f4bd58bccb6fc9865d7f521c7362de Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 24 Nov 2014 16:09:34 +0100 Subject: [PATCH 21/88] Bug 1102893: Remove some SIMD.js outdated functions; r=till --- js/src/builtin/SIMD.cpp | 20 --------- js/src/builtin/SIMD.h | 13 ------ .../ecma_6/TypedObject/simd/float32x4scale.js | 41 ------------------- .../TypedObject/simd/int32x4withflag.js | 26 ------------ 4 files changed, 100 deletions(-) delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js delete mode 100644 js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js diff --git a/js/src/builtin/SIMD.cpp b/js/src/builtin/SIMD.cpp index 472831232e4a..f25678c34398 100644 --- a/js/src/builtin/SIMD.cpp +++ b/js/src/builtin/SIMD.cpp @@ -559,10 +559,6 @@ struct Or { static inline T apply(T l, T r) { return l | r; } }; template -struct Scale { - static inline T apply(int32_t lane, T scalar, T x) { return scalar * x; } -}; -template struct WithX { static inline T apply(int32_t lane, T scalar, T x) { return lane == 0 ? scalar : x; } }; @@ -578,22 +574,6 @@ template struct WithW { static inline T apply(int32_t lane, T scalar, T x) { return lane == 3 ? scalar : x; } }; -template -struct WithFlagX { - static inline T apply(T l, T f, T x) { return l == 0 ? (f ? 0xFFFFFFFF : 0x0) : x; } -}; -template -struct WithFlagY { - static inline T apply(T l, T f, T x) { return l == 1 ? (f ? 0xFFFFFFFF : 0x0) : x; } -}; -template -struct WithFlagZ { - static inline T apply(T l, T f, T x) { return l == 2 ? (f ? 0xFFFFFFFF : 0x0) : x; } -}; -template -struct WithFlagW { - static inline T apply(T l, T f, T x) { return l == 3 ? (f ? 0xFFFFFFFF : 0x0) : x; } -}; struct ShiftLeft { static inline int32_t apply(int32_t v, int32_t bits) { return v << bits; } }; diff --git a/js/src/builtin/SIMD.h b/js/src/builtin/SIMD.h index d3b557bdafe7..8e2fc7b2a47a 100644 --- a/js/src/builtin/SIMD.h +++ b/js/src/builtin/SIMD.h @@ -18,9 +18,6 @@ * https://github.com/johnmccutchan/ecmascript_simd/blob/master/src/ecmascript_simd.js */ -#define FLOAT32X4_NULLARY_FUNCTION_LIST(V) \ - V(zero, (FuncZero), 0, 0) - #define FLOAT32X4_UNARY_FUNCTION_LIST(V) \ V(abs, (UnaryFunc), 1, 0) \ V(fromInt32x4, (FuncConvert ), 1, 0) \ @@ -52,7 +49,6 @@ V(mul, (BinaryFunc), 2, 0) \ V(notEqual, (CompareFunc), 2, 0) \ V(or, (CoercedBinaryFunc), 2, 0) \ - V(scale, (FuncWith), 2, 0) \ V(store, (Store), 3, 0) \ V(storeXYZ, (Store), 3, 0) \ V(storeXY, (Store), 3, 0) \ @@ -73,15 +69,11 @@ V(shuffle, Shuffle, 3, 0) #define FLOAT32X4_FUNCTION_LIST(V) \ - FLOAT32X4_NULLARY_FUNCTION_LIST(V) \ FLOAT32X4_UNARY_FUNCTION_LIST(V) \ FLOAT32X4_BINARY_FUNCTION_LIST(V) \ FLOAT32X4_TERNARY_FUNCTION_LIST(V) \ FLOAT32X4_SHUFFLE_FUNCTION_LIST(V) -#define INT32X4_NULLARY_FUNCTION_LIST(V) \ - V(zero, (FuncZero), 0, 0) - #define INT32X4_UNARY_FUNCTION_LIST(V) \ V(fromFloat32x4, (FuncConvert), 1, 0) \ V(fromFloat32x4Bits, (FuncConvertBits), 1, 0) \ @@ -112,10 +104,6 @@ V(storeXYZ, (Store), 3, 0) \ V(storeXY, (Store), 3, 0) \ V(storeX, (Store), 3, 0) \ - V(withFlagX, (FuncWith), 2, 0) \ - V(withFlagY, (FuncWith), 2, 0) \ - V(withFlagZ, (FuncWith), 2, 0) \ - V(withFlagW, (FuncWith), 2, 0) \ V(withX, (FuncWith), 2, 0) \ V(withY, (FuncWith), 2, 0) \ V(withZ, (FuncWith), 2, 0) \ @@ -133,7 +121,6 @@ V(shuffle, Shuffle, 3, 0) #define INT32X4_FUNCTION_LIST(V) \ - INT32X4_NULLARY_FUNCTION_LIST(V) \ INT32X4_UNARY_FUNCTION_LIST(V) \ INT32X4_BINARY_FUNCTION_LIST(V) \ INT32X4_TERNARY_FUNCTION_LIST(V) \ diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js deleted file mode 100644 index 923c878f1d9d..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js +++ /dev/null @@ -1,41 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'float32x4 scale'; - -function mulf(a, b) { - return Math.fround(Math.fround(a) * Math.fround(b)); -} - -function test() { - print(BUGNUMBER + ": " + summary); - - var a = float32x4(1, 2, 3, 4); - var c = SIMD.float32x4.scale(a, 2); - assertEq(c.x, 2); - assertEq(c.y, 4); - assertEq(c.z, 6); - assertEq(c.w, 8); - - var d = float32x4(1.34, 2.76, 3.21, 4.09); - var f = float32x4.scale(d, 2.54); - assertEq(f.x, mulf(1.34, 2.54)); - assertEq(f.y, mulf(2.76, 2.54)); - assertEq(f.z, mulf(3.21, 2.54)); - assertEq(f.w, mulf(4.09, 2.54)); - - var g = float32x4(NaN, -0, Infinity, -Infinity); - var i = float32x4.scale(g, 2.54); - assertEq(i.x, NaN); - assertEq(i.y, -0); - assertEq(i.z, Infinity); - assertEq(i.w, -Infinity); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js deleted file mode 100644 index 7263dc5f7514..000000000000 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js +++ /dev/null @@ -1,26 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; -var int32x4 = SIMD.int32x4; - -var summary = 'int32x4 with'; - -function test() { - print(BUGNUMBER + ": " + summary); - - var a = int32x4(1, 2, 3, 4); - var x = SIMD.int32x4.withFlagX(a, true); - var y = SIMD.int32x4.withFlagY(a, false); - var z = SIMD.int32x4.withFlagZ(a, false); - var w = SIMD.int32x4.withFlagW(a, true); - assertEq(x.x, -1); - assertEq(y.y, 0); - assertEq(z.z, 0); - assertEq(w.w, -1); - - if (typeof reportCompare === "function") - reportCompare(true, true); -} - -test(); - From 77ad68103cc7b0332bbc599a2dd126bb8c0c16ec Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 24 Nov 2014 16:11:32 +0100 Subject: [PATCH 22/88] Bug 1093674 - IonMonkey: Add Sink for instruction which can be recovered on bailout. r=sunfish --- .../tests/ion/sink-in-recovered-object.js | 19 ++ js/src/jit/Ion.cpp | 12 ++ js/src/jit/IonAnalysis.cpp | 4 - js/src/jit/IonOptimizationLevels.cpp | 2 + js/src/jit/IonOptimizationLevels.h | 7 + js/src/jit/JitOptions.cpp | 3 + js/src/jit/JitOptions.h | 1 + js/src/jit/JitSpewer.cpp | 3 + js/src/jit/JitSpewer.h | 2 + js/src/jit/MIRGraph.cpp | 21 ++ js/src/jit/MIRGraph.h | 9 + js/src/jit/RangeAnalysis.cpp | 18 +- js/src/jit/Sink.cpp | 202 ++++++++++++++++++ js/src/jit/Sink.h | 23 ++ js/src/moz.build | 1 + js/src/shell/js.cpp | 11 + 16 files changed, 320 insertions(+), 18 deletions(-) create mode 100644 js/src/jit-test/tests/ion/sink-in-recovered-object.js create mode 100644 js/src/jit/Sink.cpp create mode 100644 js/src/jit/Sink.h diff --git a/js/src/jit-test/tests/ion/sink-in-recovered-object.js b/js/src/jit-test/tests/ion/sink-in-recovered-object.js new file mode 100644 index 000000000000..fd1b9791750b --- /dev/null +++ b/js/src/jit-test/tests/ion/sink-in-recovered-object.js @@ -0,0 +1,19 @@ +setJitCompilerOption("ion.warmup.trigger", 30); + +var arr = []; +function f (cond, a) { + var obj = { a: 0 }; + var x = 2 * a + 1; + if (cond) { + obj.a = x; + arr.push(obj.a); + obj.a = 1; + } else { + obj.a = 1; + } + return obj.a; +} + +for (var i = 0; i < 100; i++) { + assertEq(f(i % 2, i), 1); +} diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 502c6e8bc06e..7317cec40101 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -38,6 +38,7 @@ #include "jit/PerfSpewer.h" #include "jit/RangeAnalysis.h" #include "jit/ScalarReplacement.h" +#include "jit/Sink.h" #include "jit/StupidAllocator.h" #include "jit/ValueNumbering.h" #include "vm/ForkJoin.h" @@ -1562,6 +1563,17 @@ OptimizeMIR(MIRGenerator *mir) return false; } + if (mir->optimizationInfo().sinkEnabled()) { + AutoTraceLog log(logger, TraceLogger::EliminateDeadCode); + if (!Sink(mir, graph)) + return false; + IonSpewPass("Sink"); + AssertExtendedGraphCoherency(graph); + + if (mir->shouldCancel("Sink")) + return false; + } + // Make loops contiguous. We do this after GVN/UCE and range analysis, // which can remove CFG edges, exposing more blocks that can be moved. { diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index 9bf8ff4b2db5..461555fd662f 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -569,10 +569,6 @@ jit::EliminateDeadCode(MIRGenerator *mir, MIRGraph &graph) if (js::jit::IsDiscardable(inst)) { block->discard(inst); - } else if (!inst->isRecoveredOnBailout() && !inst->isGuard() && - !inst->hasLiveDefUses() && inst->canRecoverOnBailout()) - { - inst->setRecoveredOnBailout(); } } } diff --git a/js/src/jit/IonOptimizationLevels.cpp b/js/src/jit/IonOptimizationLevels.cpp index 6b55ba77e0f4..6d520988c985 100644 --- a/js/src/jit/IonOptimizationLevels.cpp +++ b/js/src/jit/IonOptimizationLevels.cpp @@ -33,6 +33,7 @@ OptimizationInfo::initNormalOptimizationInfo() rangeAnalysis_ = true; loopUnrolling_ = true; autoTruncate_ = true; + sink_ = true; registerAllocator_ = RegisterAllocator_LSRA; inlineMaxTotalBytecodeLength_ = 1000; @@ -58,6 +59,7 @@ OptimizationInfo::initAsmjsOptimizationInfo() edgeCaseAnalysis_ = false; eliminateRedundantChecks_ = false; autoTruncate_ = false; + sink_ = false; registerAllocator_ = RegisterAllocator_Backtracking; scalarReplacement_ = false; // AsmJS has no objects. } diff --git a/js/src/jit/IonOptimizationLevels.h b/js/src/jit/IonOptimizationLevels.h index 213dfe2ff034..46a4d38d607d 100644 --- a/js/src/jit/IonOptimizationLevels.h +++ b/js/src/jit/IonOptimizationLevels.h @@ -76,6 +76,9 @@ class OptimizationInfo // Toggles whether Truncation based on Range Analysis is used. bool autoTruncate_; + // Toggles whether sink is used. + bool sink_; + // Describes which register allocator to use. IonRegisterAllocator registerAllocator_; @@ -153,6 +156,10 @@ class OptimizationInfo return autoTruncate_ && rangeAnalysisEnabled(); } + bool sinkEnabled() const { + return sink_ && !js_JitOptions.disableSink; + } + bool eaaEnabled() const { return eaa_ && !js_JitOptions.disableEaa; } diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp index 1c3ce9870ad1..7c96b73be23a 100644 --- a/js/src/jit/JitOptions.cpp +++ b/js/src/jit/JitOptions.cpp @@ -81,6 +81,9 @@ JitOptions::JitOptions() // Toggles whether Range Analysis is globally disabled. SET_DEFAULT(disableRangeAnalysis, false); + // Toggles whether sink code motion is globally disabled. + SET_DEFAULT(disableSink, false); + // Toggles whether Loop Unrolling is globally disabled. SET_DEFAULT(disableLoopUnrolling, true); diff --git a/js/src/jit/JitOptions.h b/js/src/jit/JitOptions.h index 9158dab9b7d6..67a73cf4f880 100644 --- a/js/src/jit/JitOptions.h +++ b/js/src/jit/JitOptions.h @@ -38,6 +38,7 @@ struct JitOptions bool disableInlining; bool disableEdgeCaseAnalysis; bool disableRangeAnalysis; + bool disableSink; bool disableLoopUnrolling; bool disableEaa; bool eagerCompilation; diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp index 92195a33be51..6b9f0e747174 100644 --- a/js/src/jit/JitSpewer.cpp +++ b/js/src/jit/JitSpewer.cpp @@ -240,6 +240,7 @@ jit::CheckLogging() " alias Alias analysis\n" " gvn Global Value Numbering\n" " licm Loop invariant code motion\n" + " sink Sink transformation\n" " regalloc Register allocation\n" " inline Inlining\n" " snapshots Snapshot information\n" @@ -288,6 +289,8 @@ jit::CheckLogging() EnableChannel(JitSpew_Unrolling); if (ContainsFlag(env, "licm")) EnableChannel(JitSpew_LICM); + if (ContainsFlag(env, "sink")) + EnableChannel(JitSpew_Sink); if (ContainsFlag(env, "regalloc")) EnableChannel(JitSpew_RegAlloc); if (ContainsFlag(env, "inline")) diff --git a/js/src/jit/JitSpewer.h b/js/src/jit/JitSpewer.h index 584e7745c2f7..102273097a36 100644 --- a/js/src/jit/JitSpewer.h +++ b/js/src/jit/JitSpewer.h @@ -26,6 +26,8 @@ namespace jit { _(Alias) \ /* Information during GVN */ \ _(GVN) \ + /* Information during sinking */ \ + _(Sink) \ /* Information during Range analysis */ \ _(Range) \ /* Information during loop unrolling */ \ diff --git a/js/src/jit/MIRGraph.cpp b/js/src/jit/MIRGraph.cpp index 30a98310d0f1..6273d51843ee 100644 --- a/js/src/jit/MIRGraph.cpp +++ b/js/src/jit/MIRGraph.cpp @@ -795,6 +795,27 @@ MBasicBlock::moveBefore(MInstruction *at, MInstruction *ins) ins->setTrackedSite(at->trackedSite()); } +MInstruction * +MBasicBlock::safeInsertTop(MDefinition *ins, IgnoreTop ignore) +{ + // Beta nodes and interrupt checks are required to be located at the + // beginnings of basic blocks, so we must insert new instructions after any + // such instructions. + MInstructionIterator insertIter = !ins || ins->isPhi() + ? begin() + : begin(ins->toInstruction()); + while (insertIter->isBeta() || + insertIter->isInterruptCheck() || + insertIter->isInterruptCheckPar() || + insertIter->isConstant() || + (!(ignore & IgnoreRecover) && insertIter->isRecoveredOnBailout())) + { + insertIter++; + } + + return *insertIter; +} + void MBasicBlock::discardResumePoint(MResumePoint *rp, ReferencesType refType /* = RefType_Default */) { diff --git a/js/src/jit/MIRGraph.h b/js/src/jit/MIRGraph.h index 04f404cbf1dc..0a906fe75f15 100644 --- a/js/src/jit/MIRGraph.h +++ b/js/src/jit/MIRGraph.h @@ -286,6 +286,15 @@ class MBasicBlock : public TempObject, public InlineListNode // Move an instruction. Movement may cross block boundaries. void moveBefore(MInstruction *at, MInstruction *ins); + enum IgnoreTop { + IgnoreNone = 0, + IgnoreRecover = 1 << 0 + }; + + // Locate the top of the |block|, where it is safe to insert a new + // instruction. + MInstruction *safeInsertTop(MDefinition *ins = nullptr, IgnoreTop ignore = IgnoreNone); + // Removes an instruction with the intention to discard it. void discard(MInstruction *ins); void discardLastIns(); diff --git a/js/src/jit/RangeAnalysis.cpp b/js/src/jit/RangeAnalysis.cpp index fd8407bea3e7..253ba7bd34f0 100644 --- a/js/src/jit/RangeAnalysis.cpp +++ b/js/src/jit/RangeAnalysis.cpp @@ -2263,22 +2263,12 @@ RangeAnalysis::addRangeAssertions() // Beta nodes and interrupt checks are required to be located at the // beginnings of basic blocks, so we must insert range assertions // after any such instructions. - MInstructionIterator insertIter = ins->isPhi() - ? block->begin() - : block->begin(ins->toInstruction()); - while (insertIter->isBeta() || - insertIter->isInterruptCheck() || - insertIter->isInterruptCheckPar() || - insertIter->isConstant() || - insertIter->isRecoveredOnBailout()) - { - insertIter++; - } + MInstruction *insertAt = block->safeInsertTop(ins); - if (*insertIter == *iter) - block->insertAfter(*insertIter, guard); + if (insertAt == *iter) + block->insertAfter(insertAt, guard); else - block->insertBefore(*insertIter, guard); + block->insertBefore(insertAt, guard); } } diff --git a/js/src/jit/Sink.cpp b/js/src/jit/Sink.cpp new file mode 100644 index 000000000000..da4963803158 --- /dev/null +++ b/js/src/jit/Sink.cpp @@ -0,0 +1,202 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "jit/Sink.h" + +#include "mozilla/Vector.h" + +#include "jit/IonAnalysis.h" +#include "jit/JitSpewer.h" +#include "jit/MIR.h" +#include "jit/MIRGenerator.h" +#include "jit/MIRGraph.h" + +namespace js { +namespace jit { + +// Given the last found common dominator and a new definition to dominate, the +// CommonDominator function returns the basic block which dominate the last +// common dominator and the definition. If no such block exists, then this +// functions return null. +static MBasicBlock * +CommonDominator(MBasicBlock *commonDominator, MBasicBlock *defBlock) +{ + // This is the first instruction visited, record its basic block as being + // the only interesting one. + if (!commonDominator) + return defBlock; + + // Iterate on immediate dominators of the known common dominator to find a + // block which dominates all previous uses as well as this instruction. + while (!commonDominator->dominates(defBlock)) { + MBasicBlock *nextBlock = commonDominator->immediateDominator(); + // All uses are dominated, so, this cannot happen unless the graph + // coherency is not respected. + MOZ_ASSERT(commonDominator != nextBlock); + commonDominator = nextBlock; + } + + return commonDominator; +} + +bool +Sink(MIRGenerator *mir, MIRGraph &graph) +{ + TempAllocator &alloc = graph.alloc(); + + for (PostorderIterator block = graph.poBegin(); block != graph.poEnd(); block++) { + if (mir->shouldCancel("Sink")) + return false; + + for (MInstructionReverseIterator iter = block->rbegin(); iter != block->rend(); ) { + MInstruction *ins = *iter++; + + // Only instructions which can be recovered on bailout can be moved + // into the bailout paths. + if (ins->isGuard() || ins->isRecoveredOnBailout() || !ins->canRecoverOnBailout()) + continue; + + // Compute a common dominator for all uses of the current + // instruction. + bool hasLiveUses = false; + bool hasUses = false; + MBasicBlock *usesDominator = nullptr; + for (MUseIterator i(ins->usesBegin()), e(ins->usesEnd()); i != e; i++) { + hasUses = true; + MNode *consumerNode = (*i)->consumer(); + if (consumerNode->isResumePoint()) + continue; + + MDefinition *consumer = consumerNode->toDefinition(); + if (consumer->isRecoveredOnBailout()) + continue; + + hasLiveUses = true; + + // If the instruction is a Phi, then we should dominate the + // predecessor from which the value is coming from. + MBasicBlock *consumerBlock = consumer->block(); + if (consumer->isPhi()) + consumerBlock = consumerBlock->getPredecessor(consumer->indexOf(*i)); + + usesDominator = CommonDominator(usesDominator, consumerBlock); + if (usesDominator == *block) + break; + } + + // Leave this instruction for DCE. + if (!hasUses) + continue; + + // We have no uses, so sink this instruction in all the bailout + // paths. + if (!hasLiveUses) { + MOZ_ASSERT(!usesDominator); + ins->setRecoveredOnBailout(); + JitSpewDef(JitSpew_Sink, " No live uses, recover the instruction on bailout\n", ins); + continue; + } + + // If all the uses are under a loop, we might not want to work + // against LICM by moving everything back into the loop, but if the + // loop is it-self inside an if, then we still want to move the + // computation under this if statement. + while (block->loopDepth() < usesDominator->loopDepth()) { + MOZ_ASSERT(usesDominator != usesDominator->immediateDominator()); + usesDominator = usesDominator->immediateDominator(); + } + + // Only move instructions if there is a branch between the dominator + // of the uses and the original instruction. This prevent moving the + // computation of the arguments into an inline function if there is + // no major win. + MBasicBlock *lastJoin = usesDominator; + while (*block != lastJoin && lastJoin->numPredecessors() == 1) { + MOZ_ASSERT(lastJoin != lastJoin->immediateDominator()); + MBasicBlock *next = lastJoin->immediateDominator(); + if (next->numSuccessors() > 1) + break; + lastJoin = next; + } + if (*block == lastJoin) + continue; + + // Skip to the next instruction if we cannot find a common dominator + // for all the uses of this instruction, or if the common dominator + // correspond to the block of the current instruction. + if (!usesDominator || usesDominator == *block) + continue; + + // Only instruction which can be recovered on bailout and which are + // sinkable can be moved into blocks which are below while filling + // the resume points with a clone which is recovered on bailout. + + // If the instruction has live uses and if it is clonable, then we + // can clone the instruction for all non-dominated uses and move the + // instruction into the block which is dominating all live uses. + if (!ins->canClone()) + continue; + + JitSpewDef(JitSpew_Sink, " Can Clone & Recover, sink instruction\n", ins); + JitSpew(JitSpew_Sink, " into Block %u", usesDominator->id()); + + // Copy the arguments and clone the instruction. + MDefinitionVector operands(alloc); + for (size_t i = 0, end = ins->numOperands(); i < end; i++) { + if (!operands.append(ins->getOperand(i))) + return false; + } + + MInstruction *clone = ins->clone(alloc, operands); + ins->block()->insertBefore(ins, clone); + clone->setRecoveredOnBailout(); + + // We should not update the producer of the entry resume point, as + // it cannot refer to any instruction within the basic block excepts + // for Phi nodes. + MResumePoint *entry = usesDominator->entryResumePoint(); + + // Replace the instruction by its clone in all the resume points / + // recovered-on-bailout instructions which are not in blocks which + // are dominated by the usesDominator block. + for (MUseIterator i(ins->usesBegin()), e(ins->usesEnd()); i != e; ) { + MUse *use = *i++; + MNode *consumer = use->consumer(); + + // If the consumer is a Phi, then we look for the index of the + // use to find the corresponding predecessor block, which is + // then used as the consumer block. + MBasicBlock *consumerBlock = consumer->block(); + if (consumer->isDefinition() && consumer->toDefinition()->isPhi()) { + consumerBlock = consumerBlock->getPredecessor( + consumer->toDefinition()->toPhi()->indexOf(use)); + } + + // Keep the current instruction for all dominated uses, except + // for the entry resume point of the block in which the + // instruction would be moved into. + if (usesDominator->dominates(consumerBlock) && + (!consumer->isResumePoint() || consumer->toResumePoint() != entry)) + { + continue; + } + + use->replaceProducer(clone); + } + + // Now, that all uses which are not dominated by usesDominator are + // using the cloned instruction, we can safely move the instruction + // into the usesDominator block. + MInstruction *at = usesDominator->safeInsertTop(nullptr, MBasicBlock::IgnoreRecover); + block->moveBefore(at, ins); + } + } + + return true; +} + +} +} diff --git a/js/src/jit/Sink.h b/js/src/jit/Sink.h new file mode 100644 index 000000000000..ad74bb918088 --- /dev/null +++ b/js/src/jit/Sink.h @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + +// This file declares sink transformation. +#ifndef jit_Sink_h +#define jit_Sink_h + +namespace js { +namespace jit { + +class MIRGenerator; +class MIRGraph; + +bool +Sink(MIRGenerator *mir, MIRGraph &graph); + +} // namespace jit +} // namespace js + +#endif /* jit_Sink_h */ diff --git a/js/src/moz.build b/js/src/moz.build index bc3a2a39a88a..6956808d7f1e 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -190,6 +190,7 @@ UNIFIED_SOURCES += [ 'jit/shared/BaselineCompiler-shared.cpp', 'jit/shared/CodeGenerator-shared.cpp', 'jit/shared/Lowering-shared.cpp', + 'jit/Sink.cpp', 'jit/Snapshots.cpp', 'jit/StupidAllocator.cpp', 'jit/TypedObjectPrediction.cpp', diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 8240ae80206f..c220217f4ce9 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -5500,6 +5500,15 @@ SetRuntimeOptions(JSRuntime *rt, const OptionParser &op) return OptionFailure("ion-range-analysis", str); } + if (const char *str = op.getStringOption("ion-sink")) { + if (strcmp(str, "on") == 0) + jit::js_JitOptions.disableSink = false; + else if (strcmp(str, "off") == 0) + jit::js_JitOptions.disableSink = true; + else + return OptionFailure("ion-sink", str); + } + if (const char *str = op.getStringOption("ion-loop-unrolling")) { if (strcmp(str, "on") == 0) jit::js_JitOptions.disableLoopUnrolling = false; @@ -5797,6 +5806,8 @@ main(int argc, char **argv, char **envp) "Find edge cases where Ion can avoid bailouts (default: on, off to disable)") || !op.addStringOption('\0', "ion-range-analysis", "on/off", "Range analysis (default: on, off to disable)") + || !op.addStringOption('\0', "ion-sink", "on/off", + "Sink code motion (default: on, off to disable)") || !op.addStringOption('\0', "ion-loop-unrolling", "on/off", "Loop unrolling (default: off, on to enable)") || !op.addBoolOption('\0', "ion-check-range-analysis", From f8e9c4aaf68bca9d67709e63d85188f0f29645b3 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Mon, 24 Nov 2014 16:31:02 +0100 Subject: [PATCH 23/88] Bug 1104027 - Fix IonBuilder::jsop_setelem to not abort during arguments analysis. r=bhackett --- js/src/jit/IonBuilder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index c7ae27203981..7451ebf2b148 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -8204,8 +8204,12 @@ IonBuilder::jsop_setelem() if (!setElemTryArguments(&emitted, object, index, value) || emitted) return emitted; - if (script()->argumentsHasVarBinding() && object->mightBeType(MIRType_MagicOptimizedArguments)) + if (script()->argumentsHasVarBinding() && + object->mightBeType(MIRType_MagicOptimizedArguments) && + info().executionMode() != ArgumentsUsageAnalysis) + { return abort("Type is not definitely lazy arguments."); + } if (!setElemTryCache(&emitted, object, index, value) || emitted) return emitted; From a5cf3d5e4514f54ac4a8631a8b5987adf4015054 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 7 Nov 2014 16:26:46 -0500 Subject: [PATCH 24/88] Bug 1088255 - Collect telemetry on CAs that appear in valid cert chains r=keeler --- .../ssl/src/SSLServerCertVerification.cpp | 32 ++++++++++++++++++- security/manager/ssl/src/moz.build | 4 +++ toolkit/components/telemetry/Histograms.json | 6 ++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index 786941d1fde5..d4c86a5d479a 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -121,6 +121,7 @@ #include "nsComponentManagerUtils.h" #include "nsServiceManagerUtils.h" #include "PSMRunnable.h" +#include "RootCertificateTelemetryUtils.h" #include "SharedSSLState.h" #include "nsContentUtils.h" #include "nsURLHelper.h" @@ -959,6 +960,34 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList) commonNameInSubjectAltNames); } +// Gathers telemetry on which CA is the root of a given cert chain. +// If the root is a built-in root, then the telemetry makes a count +// by root. Roots that are not built-in are counted in one bin. +void +GatherRootCATelemetry(const ScopedCERTCertList& certList) +{ + CERTCertListNode* rootNode = CERT_LIST_TAIL(certList); + PR_ASSERT(rootNode); + if (!rootNode) { + return; + } + + // Only log telemetry if the certificate list is non-empty + if (!CERT_LIST_END(rootNode, certList)) { + AccumulateTelemetryForRootCA(Telemetry::CERT_VALIDATION_SUCCESS_BY_CA, + rootNode->cert); + } +} + +// There are various things that we want to measure about certificate +// chains that we accept. This is a single entry point for all of them. +void +GatherSuccessfulValidationTelemetry(const ScopedCERTCertList& certList) +{ + GatherBaselineRequirementsTelemetry(certList); + GatherRootCATelemetry(certList); +} + SECStatus AuthCertificate(CertVerifier& certVerifier, TransportSecurityInfo* infoObject, @@ -1003,7 +1032,8 @@ AuthCertificate(CertVerifier& certVerifier, } if (rv == SECSuccess) { - GatherBaselineRequirementsTelemetry(certList); + GatherSuccessfulValidationTelemetry(certList); + // The connection may get terminated, for example, if the server requires // a client cert. Let's provide a minimal SSLStatus // to the caller that contains at least the cert and its status. diff --git a/security/manager/ssl/src/moz.build b/security/manager/ssl/src/moz.build index cd8371d08fb2..ee3cfa139579 100644 --- a/security/manager/ssl/src/moz.build +++ b/security/manager/ssl/src/moz.build @@ -77,6 +77,10 @@ SOURCES += [ 'PSMContentListener.cpp', ] +LOCAL_INCLUDES += [ + '/security/manager/boot/src', +] + if not CONFIG['MOZ_NO_SMART_CARDS']: UNIFIED_SOURCES += [ 'nsSmartCardMonitor.cpp', diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index af51df0e199a..5fe5ab39fbac 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -6601,6 +6601,12 @@ "n_buckets": 10, "extended_statistics_ok": true }, + "CERT_VALIDATION_SUCCESS_BY_CA": { + "expires_in_version": "never", + "kind": "enumerated", + "n_values": 256, + "description": "Successful SSL server cert validations by CA (see RootHashes.inc for names of CAs)" + }, "CERT_PINNING_FAILURES_BY_CA": { "alert_emails": ["pinning@mozilla.org"], "expires_in_version": "never", From 45fb0025385ce289023b0735b69c3d4d7930f48f Mon Sep 17 00:00:00 2001 From: Marty Rosenberg Date: Mon, 24 Nov 2014 11:15:53 -0500 Subject: [PATCH 25/88] Bug 1088316: Emit "push lr" after calls, rather than "push pc" before (r=jandem) --- js/src/jit/BaselineCompiler.cpp | 8 ++- js/src/jit/BaselineIC.cpp | 58 ++++++++++--------- js/src/jit/CodeGenerator.cpp | 31 +++++++++- js/src/jit/VMFunctions.h | 34 +++++++++-- js/src/jit/arm/CodeGenerator-arm.cpp | 4 +- js/src/jit/arm/MacroAssembler-arm.cpp | 19 +++--- js/src/jit/arm/MacroAssembler-arm.h | 3 + js/src/jit/arm/Trampoline-arm.cpp | 11 +++- js/src/jit/shared/Assembler-shared.h | 4 ++ js/src/jit/shared/BaselineCompiler-shared.cpp | 2 +- 10 files changed, 123 insertions(+), 51 deletions(-) diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index 862954b80921..b89c0f6fa0ca 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -309,11 +309,15 @@ BaselineCompiler::emitInitializeLocals(size_t n, const Value &v) bool BaselineCompiler::emitPrologue() { +#ifdef JS_USE_LINK_REGISTER + // Push link register from generateEnterJIT()'s BLR. + masm.pushReturnAddress(); + masm.checkStackAlignment(); +#endif masm.push(BaselineFrameReg); masm.mov(BaselineStackReg, BaselineFrameReg); masm.subPtr(Imm32(BaselineFrame::Size()), BaselineStackReg); - masm.checkStackAlignment(); // Initialize BaselineFrame. For eval scripts, the scope chain // is passed in R1, so we have to be careful not to clobber @@ -3450,7 +3454,7 @@ typedef bool (*InterpretResumeFn)(JSContext *, HandleObject, HandleValue, Handle static const VMFunction InterpretResumeInfo = FunctionInfo(jit::InterpretResume); typedef bool (*GeneratorThrowFn)(JSContext *, BaselineFrame *, HandleObject, HandleValue, uint32_t); -static const VMFunction GeneratorThrowInfo = FunctionInfo(jit::GeneratorThrowOrClose); +static const VMFunction GeneratorThrowInfo = FunctionInfo(jit::GeneratorThrowOrClose, TailCall); bool BaselineCompiler::emit_JSOP_RESUME() diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index a113e98b755b..67f8559e2f8c 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -660,6 +660,7 @@ ICStubCompiler::tailCallVM(const VMFunction &fun, MacroAssembler &masm) if (!code) return false; + MOZ_ASSERT(fun.expectTailCall == TailCall); uint32_t argSize = fun.explicitStackSlots() * sizeof(void *); EmitTailCallVM(code, masm, argSize); return true; @@ -672,6 +673,7 @@ ICStubCompiler::callVM(const VMFunction &fun, MacroAssembler &masm) if (!code) return false; + MOZ_ASSERT(fun.expectTailCall == NonTailCall); EmitCallVM(code, masm); return true; } @@ -1120,7 +1122,7 @@ DoProfilerFallback(JSContext *cx, BaselineFrame *frame, ICProfiler_Fallback *stu typedef bool (*DoProfilerFallbackFn)(JSContext *, BaselineFrame *frame, ICProfiler_Fallback *); static const VMFunction DoProfilerFallbackInfo = - FunctionInfo(DoProfilerFallback); + FunctionInfo(DoProfilerFallback, TailCall); bool ICProfiler_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1322,7 +1324,7 @@ DoTypeMonitorFallback(JSContext *cx, BaselineFrame *frame, ICTypeMonitor_Fallbac typedef bool (*DoTypeMonitorFallbackFn)(JSContext *, BaselineFrame *, ICTypeMonitor_Fallback *, HandleValue, MutableHandleValue); static const VMFunction DoTypeMonitorFallbackInfo = - FunctionInfo(DoTypeMonitorFallback); + FunctionInfo(DoTypeMonitorFallback, TailCall); bool ICTypeMonitor_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1553,7 +1555,7 @@ DoTypeUpdateFallback(JSContext *cx, BaselineFrame *frame, ICUpdatedStub *stub, H typedef bool (*DoTypeUpdateFallbackFn)(JSContext *, BaselineFrame *, ICUpdatedStub *, HandleValue, HandleValue); const VMFunction DoTypeUpdateFallbackInfo = - FunctionInfo(DoTypeUpdateFallback); + FunctionInfo(DoTypeUpdateFallback, NonTailCall); bool ICTypeUpdate_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1696,7 +1698,7 @@ DoThisFallback(JSContext *cx, ICThis_Fallback *stub, HandleValue thisv, MutableH } typedef bool (*DoThisFallbackFn)(JSContext *, ICThis_Fallback *, HandleValue, MutableHandleValue); -static const VMFunction DoThisFallbackInfo = FunctionInfo(DoThisFallback); +static const VMFunction DoThisFallbackInfo = FunctionInfo(DoThisFallback, TailCall); bool ICThis_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1732,7 +1734,7 @@ DoNewArray(JSContext *cx, ICNewArray_Fallback *stub, uint32_t length, typedef bool(*DoNewArrayFn)(JSContext *, ICNewArray_Fallback *, uint32_t, HandleTypeObject, MutableHandleValue); -static const VMFunction DoNewArrayInfo = FunctionInfo(DoNewArray); +static const VMFunction DoNewArrayInfo = FunctionInfo(DoNewArray, TailCall); bool ICNewArray_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1765,7 +1767,7 @@ DoNewObject(JSContext *cx, ICNewObject_Fallback *stub, MutableHandleValue res) } typedef bool(*DoNewObjectFn)(JSContext *, ICNewObject_Fallback *, MutableHandleValue); -static const VMFunction DoNewObjectInfo = FunctionInfo(DoNewObject); +static const VMFunction DoNewObjectInfo = FunctionInfo(DoNewObject, TailCall); bool ICNewObject_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -1977,7 +1979,7 @@ DoCompareFallback(JSContext *cx, BaselineFrame *frame, ICCompare_Fallback *stub_ typedef bool (*DoCompareFallbackFn)(JSContext *, BaselineFrame *, ICCompare_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoCompareFallbackInfo = - FunctionInfo(DoCompareFallback, PopValues(2)); + FunctionInfo(DoCompareFallback, TailCall, PopValues(2)); bool ICCompare_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -2312,7 +2314,7 @@ DoToBoolFallback(JSContext *cx, BaselineFrame *frame, ICToBool_Fallback *stub, H typedef bool (*pf)(JSContext *, BaselineFrame *, ICToBool_Fallback *, HandleValue, MutableHandleValue); -static const VMFunction fun = FunctionInfo(DoToBoolFallback); +static const VMFunction fun = FunctionInfo(DoToBoolFallback, TailCall); bool ICToBool_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -2479,7 +2481,7 @@ DoToNumberFallback(JSContext *cx, ICToNumber_Fallback *stub, HandleValue arg, Mu typedef bool (*DoToNumberFallbackFn)(JSContext *, ICToNumber_Fallback *, HandleValue, MutableHandleValue); static const VMFunction DoToNumberFallbackInfo = - FunctionInfo(DoToNumberFallback, PopValues(1)); + FunctionInfo(DoToNumberFallback, TailCall, PopValues(1)); bool ICToNumber_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -2722,7 +2724,7 @@ DoBinaryArithFallback(JSContext *cx, BaselineFrame *frame, ICBinaryArith_Fallbac typedef bool (*DoBinaryArithFallbackFn)(JSContext *, BaselineFrame *, ICBinaryArith_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoBinaryArithFallbackInfo = - FunctionInfo(DoBinaryArithFallback, PopValues(2)); + FunctionInfo(DoBinaryArithFallback, TailCall, PopValues(2)); bool ICBinaryArith_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -2768,7 +2770,7 @@ DoConcatStrings(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleVa } typedef bool (*DoConcatStringsFn)(JSContext *, HandleValue, HandleValue, MutableHandleValue); -static const VMFunction DoConcatStringsInfo = FunctionInfo(DoConcatStrings); +static const VMFunction DoConcatStringsInfo = FunctionInfo(DoConcatStrings, TailCall); bool ICBinaryArith_StringConcat::Compiler::generateStubCode(MacroAssembler &masm) @@ -2845,7 +2847,7 @@ DoConcatStringObject(JSContext *cx, bool lhsIsString, HandleValue lhs, HandleVal typedef bool (*DoConcatStringObjectFn)(JSContext *, bool lhsIsString, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoConcatStringObjectInfo = - FunctionInfo(DoConcatStringObject, PopValues(2)); + FunctionInfo(DoConcatStringObject, TailCall, PopValues(2)); bool ICBinaryArith_StringObjectConcat::Compiler::generateStubCode(MacroAssembler &masm) @@ -3132,7 +3134,7 @@ DoUnaryArithFallback(JSContext *cx, BaselineFrame *frame, ICUnaryArith_Fallback typedef bool (*DoUnaryArithFallbackFn)(JSContext *, BaselineFrame *, ICUnaryArith_Fallback *, HandleValue, MutableHandleValue); static const VMFunction DoUnaryArithFallbackInfo = - FunctionInfo(DoUnaryArithFallback, PopValues(1)); + FunctionInfo(DoUnaryArithFallback, TailCall, PopValues(1)); bool ICUnaryArith_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -4087,7 +4089,7 @@ DoGetElemFallback(JSContext *cx, BaselineFrame *frame, ICGetElem_Fallback *stub_ typedef bool (*DoGetElemFallbackFn)(JSContext *, BaselineFrame *, ICGetElem_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoGetElemFallbackInfo = - FunctionInfo(DoGetElemFallback, PopValues(2)); + FunctionInfo(DoGetElemFallback, TailCall, PopValues(2)); bool ICGetElem_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -5150,7 +5152,7 @@ DoSetElemFallback(JSContext *cx, BaselineFrame *frame, ICSetElem_Fallback *stub_ typedef bool (*DoSetElemFallbackFn)(JSContext *, BaselineFrame *, ICSetElem_Fallback *, Value *, HandleValue, HandleValue, HandleValue); static const VMFunction DoSetElemFallbackInfo = - FunctionInfo(DoSetElemFallback, PopValues(2)); + FunctionInfo(DoSetElemFallback, TailCall, PopValues(2)); bool ICSetElem_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -5674,7 +5676,7 @@ DoInFallback(JSContext *cx, ICIn_Fallback *stub, HandleValue key, HandleValue ob typedef bool (*DoInFallbackFn)(JSContext *, ICIn_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoInFallbackInfo = - FunctionInfo(DoInFallback, PopValues(2)); + FunctionInfo(DoInFallback, TailCall, PopValues(2)); bool ICIn_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -6038,7 +6040,7 @@ DoGetNameFallback(JSContext *cx, BaselineFrame *frame, ICGetName_Fallback *stub_ typedef bool (*DoGetNameFallbackFn)(JSContext *, BaselineFrame *, ICGetName_Fallback *, HandleObject, MutableHandleValue); -static const VMFunction DoGetNameFallbackInfo = FunctionInfo(DoGetNameFallback); +static const VMFunction DoGetNameFallbackInfo = FunctionInfo(DoGetNameFallback, TailCall); bool ICGetName_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -6149,7 +6151,7 @@ DoBindNameFallback(JSContext *cx, BaselineFrame *frame, ICBindName_Fallback *stu typedef bool (*DoBindNameFallbackFn)(JSContext *, BaselineFrame *, ICBindName_Fallback *, HandleObject, MutableHandleValue); static const VMFunction DoBindNameFallbackInfo = - FunctionInfo(DoBindNameFallback); + FunctionInfo(DoBindNameFallback, TailCall); bool ICBindName_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -6209,7 +6211,7 @@ DoGetIntrinsicFallback(JSContext *cx, BaselineFrame *frame, ICGetIntrinsic_Fallb typedef bool (*DoGetIntrinsicFallbackFn)(JSContext *, BaselineFrame *, ICGetIntrinsic_Fallback *, MutableHandleValue); static const VMFunction DoGetIntrinsicFallbackInfo = - FunctionInfo(DoGetIntrinsicFallback); + FunctionInfo(DoGetIntrinsicFallback, TailCall); bool ICGetIntrinsic_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -6833,7 +6835,7 @@ DoGetPropFallback(JSContext *cx, BaselineFrame *frame, ICGetProp_Fallback *stub_ typedef bool (*DoGetPropFallbackFn)(JSContext *, BaselineFrame *, ICGetProp_Fallback *, MutableHandleValue, MutableHandleValue); static const VMFunction DoGetPropFallbackInfo = - FunctionInfo(DoGetPropFallback, PopValues(1)); + FunctionInfo(DoGetPropFallback, TailCall, PopValues(1)); bool ICGetProp_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -7985,7 +7987,7 @@ DoSetPropFallback(JSContext *cx, BaselineFrame *frame, ICSetProp_Fallback *stub_ typedef bool (*DoSetPropFallbackFn)(JSContext *, BaselineFrame *, ICSetProp_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoSetPropFallbackInfo = - FunctionInfo(DoSetPropFallback, PopValues(2)); + FunctionInfo(DoSetPropFallback, TailCall, PopValues(2)); bool ICSetProp_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10484,7 +10486,7 @@ DoIteratorNewFallback(JSContext *cx, BaselineFrame *frame, ICIteratorNew_Fallbac typedef bool (*DoIteratorNewFallbackFn)(JSContext *, BaselineFrame *, ICIteratorNew_Fallback *, HandleValue, MutableHandleValue); static const VMFunction DoIteratorNewFallbackInfo = - FunctionInfo(DoIteratorNewFallback, PopValues(1)); + FunctionInfo(DoIteratorNewFallback, TailCall, PopValues(1)); bool ICIteratorNew_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10540,7 +10542,7 @@ DoIteratorMoreFallback(JSContext *cx, BaselineFrame *frame, ICIteratorMore_Fallb typedef bool (*DoIteratorMoreFallbackFn)(JSContext *, BaselineFrame *, ICIteratorMore_Fallback *, HandleObject, MutableHandleValue); static const VMFunction DoIteratorMoreFallbackInfo = - FunctionInfo(DoIteratorMoreFallback); + FunctionInfo(DoIteratorMoreFallback, TailCall); bool ICIteratorMore_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10619,7 +10621,7 @@ DoIteratorCloseFallback(JSContext *cx, ICIteratorClose_Fallback *stub, HandleVal typedef bool (*DoIteratorCloseFallbackFn)(JSContext *, ICIteratorClose_Fallback *, HandleValue); static const VMFunction DoIteratorCloseFallbackInfo = - FunctionInfo(DoIteratorCloseFallback); + FunctionInfo(DoIteratorCloseFallback, TailCall); bool ICIteratorClose_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10666,7 +10668,7 @@ DoInstanceOfFallback(JSContext *cx, ICInstanceOf_Fallback *stub, typedef bool (*DoInstanceOfFallbackFn)(JSContext *, ICInstanceOf_Fallback *, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoInstanceOfFallbackInfo = - FunctionInfo(DoInstanceOfFallback, PopValues(2)); + FunctionInfo(DoInstanceOfFallback, TailCall, PopValues(2)); bool ICInstanceOf_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10715,7 +10717,7 @@ DoTypeOfFallback(JSContext *cx, BaselineFrame *frame, ICTypeOf_Fallback *stub, H typedef bool (*DoTypeOfFallbackFn)(JSContext *, BaselineFrame *frame, ICTypeOf_Fallback *, HandleValue, MutableHandleValue); static const VMFunction DoTypeOfFallbackInfo = - FunctionInfo(DoTypeOfFallback); + FunctionInfo(DoTypeOfFallback, TailCall); bool ICTypeOf_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -10806,7 +10808,7 @@ typedef bool(*DoRetSubFallbackFn)(JSContext *cx, BaselineFrame *, ICRetSub_Fallb static const VMFunction DoRetSubFallbackInfo = FunctionInfo(DoRetSubFallback); typedef bool (*ThrowFn)(JSContext *, HandleValue); -static const VMFunction ThrowInfoBaseline = FunctionInfo(js::Throw); +static const VMFunction ThrowInfoBaseline = FunctionInfo(js::Throw, TailCall); bool ICRetSub_Fallback::Compiler::generateStubCode(MacroAssembler &masm) @@ -11529,7 +11531,7 @@ static bool DoRestFallback(JSContext *cx, ICRest_Fallback *stub, typedef bool (*DoRestFallbackFn)(JSContext *, ICRest_Fallback *, BaselineFrame *, MutableHandleValue); static const VMFunction DoRestFallbackInfo = - FunctionInfo(DoRestFallback); + FunctionInfo(DoRestFallback, TailCall); bool ICRest_Fallback::Compiler::generateStubCode(MacroAssembler &masm) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index b014d2308418..79386df0ac17 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -1095,7 +1095,10 @@ PrepareAndExecuteRegExp(JSContext *cx, MacroAssembler &masm, Register regexp, Re RegExpStatics *res = cx->global()->getRegExpStatics(cx); if (!res) return false; - +#ifdef JS_USE_LINK_REGISTER + if (mode != RegExpShared::MatchOnly) + masm.pushReturnAddress(); +#endif if (mode == RegExpShared::Normal) { // First, fill in a skeletal MatchPairs instance on the stack. This will be // passed to the OOL stub in the caller if we aren't able to execute the @@ -1573,6 +1576,10 @@ JitCompartment::generateRegExpTestStub(JSContext *cx) MacroAssembler masm(cx); +#ifdef JS_USE_LINK_REGISTER + masm.pushReturnAddress(); +#endif + masm.reserveStack(sizeof(irregexp::InputOutputData)); Label notFound, oolEntry; @@ -6173,7 +6180,9 @@ JitCompartment::generateStringConcatStub(JSContext *cx, ExecutionMode mode) Register forkJoinContext = CallTempReg4; Label failure, failurePopTemps; - +#ifdef JS_USE_LINK_REGISTER + masm.pushReturnAddress(); +#endif // If lhs is empty, return rhs. Label leftEmpty; masm.loadStringLength(lhs, temp1); @@ -6284,6 +6293,9 @@ JitRuntime::generateMallocStub(JSContext *cx) MacroAssembler masm(cx); RegisterSet regs = RegisterSet::Volatile(); +#ifdef JS_USE_LINK_REGISTER + masm.pushReturnAddress(); +#endif regs.takeUnchecked(regNBytes); masm.PushRegsInMask(regs); @@ -6319,7 +6331,9 @@ JitRuntime::generateFreeStub(JSContext *cx) const Register regSlots = CallTempReg0; MacroAssembler masm(cx); - +#ifdef JS_USE_LINK_REGISTER + masm.pushReturnAddress(); +#endif RegisterSet regs = RegisterSet::Volatile(); regs.takeUnchecked(regSlots); masm.PushRegsInMask(regs); @@ -6352,15 +6366,26 @@ JitCode * JitRuntime::generateLazyLinkStub(JSContext *cx) { MacroAssembler masm(cx); +#ifdef JS_USE_LINK_REGISTER + masm.push(lr); +#endif Label call; GeneralRegisterSet regs = GeneralRegisterSet::Volatile(); Register temp0 = regs.takeAny(); masm.callWithExitFrame(&call); +#ifdef JS_USE_LINK_REGISTER + // sigh, this should probably attempt to bypass the push lr that starts off the block + // but oh well. + masm.pop(lr); +#endif masm.jump(ReturnReg); masm.bind(&call); +#ifdef JS_USE_LINK_REGISTER + masm.push(lr); +#endif masm.enterExitFrame(); masm.setupUnalignedABICall(1, temp0); masm.loadJSContext(temp0); diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index ee1fc4372692..92503b51be6c 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -41,6 +41,11 @@ struct PopValues { } }; +enum MaybeTailCall { + TailCall, + NonTailCall +}; + // Contains information about a virtual machine function that can be called // from JIT code. Functions described in this manner must conform to a simple // protocol: the return type must have a special "failure" value (for example, @@ -123,6 +128,11 @@ struct VMFunction // wrapper. uint32_t extraValuesToPop; + // On some architectures, called functions need to explicitly push their + // return address, for a tail call, there is nothing to push, so tail-callness + // needs to be known at compile time. + MaybeTailCall expectTailCall; + uint32_t argc() const { // JSContext * + args + (OutParam? *) return 1 + explicitArgc() + ((outParam == Type_Void) ? 0 : 1); @@ -227,7 +237,8 @@ struct VMFunction VMFunction(void *wrapped, uint32_t explicitArgs, uint32_t argumentProperties, uint32_t argumentPassedInFloatRegs, uint64_t argRootTypes, DataType outParam, RootType outParamRootType, DataType returnType, - ExecutionMode executionMode, uint32_t extraValuesToPop = 0) + ExecutionMode executionMode, uint32_t extraValuesToPop = 0, + MaybeTailCall expectTailCall = NonTailCall) : wrapped(wrapped), explicitArgs(explicitArgs), argumentProperties(argumentProperties), @@ -237,7 +248,8 @@ struct VMFunction argumentRootTypes(argRootTypes), outParamRootType(outParamRootType), executionMode(executionMode), - extraValuesToPop(extraValuesToPop) + extraValuesToPop(extraValuesToPop), + expectTailCall(expectTailCall) { // Check for valid failure/return type. MOZ_ASSERT_IF(outParam != Type_Void && executionMode == SequentialExecution, @@ -503,12 +515,20 @@ template <> struct MatchContext { static inline uint64_t argumentRootTypes() { \ return ForEachNb(COMPUTE_ARG_ROOT, SEP_OR, NOTHING); \ } \ + explicit FunctionInfo(pf fun, MaybeTailCall expectTailCall, \ + PopValues extraValuesToPop = PopValues(0)) \ + : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(), \ + argumentProperties(), argumentPassedInFloatRegs(), \ + argumentRootTypes(), outParam(), outParamRootType(), \ + returnType(), executionMode(), \ + extraValuesToPop.numValues, expectTailCall) \ + { } \ explicit FunctionInfo(pf fun, PopValues extraValuesToPop = PopValues(0)) \ : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(), \ argumentProperties(), argumentPassedInFloatRegs(), \ argumentRootTypes(), outParam(), outParamRootType(), \ returnType(), executionMode(), \ - extraValuesToPop.numValues) \ + extraValuesToPop.numValues, NonTailCall) \ { } template @@ -548,7 +568,13 @@ struct FunctionInfo : public VMFunction { : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(), argumentProperties(), argumentPassedInFloatRegs(), argumentRootTypes(), outParam(), outParamRootType(), - returnType(), executionMode()) + returnType(), executionMode(), 0, NonTailCall) + { } + explicit FunctionInfo(pf fun, MaybeTailCall expectTailCall) + : VMFunction(JS_FUNC_TO_DATA_PTR(void *, fun), explicitArgs(), + argumentProperties(), argumentPassedInFloatRegs(), + argumentRootTypes(), outParam(), outParamRootType(), + returnType(), executionMode(), 0, expectTailCall) { } }; diff --git a/js/src/jit/arm/CodeGenerator-arm.cpp b/js/src/jit/arm/CodeGenerator-arm.cpp index 13a8404e3f51..0e04cf390ef3 100644 --- a/js/src/jit/arm/CodeGenerator-arm.cpp +++ b/js/src/jit/arm/CodeGenerator-arm.cpp @@ -42,7 +42,9 @@ CodeGeneratorARM::generatePrologue() { MOZ_ASSERT(masm.framePushed() == 0); MOZ_ASSERT(!gen->compilingAsmJS()); - +#ifdef JS_USE_LINK_REGISTER + masm.pushReturnAddress(); +#endif // Note that this automatically sets MacroAssembler::framePushed(). masm.reserveStack(frameSize()); masm.checkStackAlignment(); diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index d53fe8f49eb0..c9b5d0e39b8e 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -3715,8 +3715,7 @@ MacroAssemblerARM::ma_callIon(const Register r) // When the stack is 8 byte aligned, we want to decrement sp by 8, and write // pc + 8 into the new sp. When we return from this call, sp will be its // present value minus 4. - AutoForbidPools afp(this, 2); - as_dtr(IsStore, 32, PreIndex, pc, DTRAddr(sp, DtrOffImm(-8))); + as_sub(sp, sp, Imm8(4)); as_blx(r); } void @@ -3724,8 +3723,9 @@ MacroAssemblerARM::ma_callIonNoPush(const Register r) { // Since we just write the return address into the stack, which is popped on // return, the net effect is removing 4 bytes from the stack. - AutoForbidPools afp(this, 2); - as_dtr(IsStore, 32, Offset, pc, DTRAddr(sp, DtrOffImm(0))); + + // Bug 1103108: remove this function, and refactor all uses. + as_add(sp, sp, Imm8(4)); as_blx(r); } @@ -3735,19 +3735,18 @@ MacroAssemblerARM::ma_callIonHalfPush(const Register r) // The stack is unaligned by 4 bytes. We push the pc to the stack to align // the stack before the call, when we return the pc is poped and the stack // is restored to its unaligned state. - AutoForbidPools afp(this, 2); - ma_push(pc); as_blx(r); } void MacroAssemblerARM::ma_callIonHalfPush(Label *label) { - // The stack is unaligned by 4 bytes. We push the pc to the stack to align - // the stack before the call, when we return the pc is poped and the stack + // The stack is unaligned by 4 bytes. The callee will push the lr to the stack to align + // the stack after the call, when we return the pc is poped and the stack // is restored to its unaligned state. - AutoForbidPools afp(this, 2); - ma_push(pc); + + // leave the stack as-is so the callee-side can push when necessary. + as_bl(label, Always); } diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index b7bbe165d3be..3646ae0d7b25 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -1833,6 +1833,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM void loadAsmJSHeapRegisterFromGlobalData() { loadPtr(Address(GlobalReg, AsmJSHeapGlobalDataOffset - AsmJSGlobalRegBias), HeapReg); } + void pushReturnAddress() { + push(lr); + } }; typedef MacroAssemblerARMCompat MacroAssemblerSpecific; diff --git a/js/src/jit/arm/Trampoline-arm.cpp b/js/src/jit/arm/Trampoline-arm.cpp index 8c2cb24fb516..2c3337e8e349 100644 --- a/js/src/jit/arm/Trampoline-arm.cpp +++ b/js/src/jit/arm/Trampoline-arm.cpp @@ -419,6 +419,8 @@ JitCode * JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut) { MacroAssembler masm(cx); + masm.pushReturnAddress(); + // ArgumentsRectifierReg contains the |nargs| pushed onto the current frame. // Including |this|, there are (|nargs| + 1) arguments to copy. MOZ_ASSERT(ArgumentsRectifierReg == r8); @@ -747,6 +749,10 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f) // +0 ExitFrame // // We're aligned to an exit frame, so link it up. + // If it isn't a tail call, then the return address needs to be saved + if (f.expectTailCall == NonTailCall) + masm.pushReturnAddress(); + masm.enterExitFrameAndLoadContext(&f, cxreg, regs.getAny(), f.executionMode); // Save the base of the argument set stored on the stack. @@ -914,6 +920,7 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type) save = RegisterSet(GeneralRegisterSet(Registers::VolatileMask), FloatRegisterSet()); } + save.add(lr); masm.PushRegsInMask(save); MOZ_ASSERT(PreBarrierReg == r1); @@ -923,9 +930,9 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type) masm.passABIArg(r0); masm.passABIArg(r1); masm.callWithABI(IonMarkFunction(type)); - + save.take(AnyRegister(lr)); + save.add(pc); masm.PopRegsInMask(save); - masm.ret(); Linker linker(masm); AutoFlushICache afc("PreBarrier"); diff --git a/js/src/jit/shared/Assembler-shared.h b/js/src/jit/shared/Assembler-shared.h index b470e32f77f1..ec66226e1685 100644 --- a/js/src/jit/shared/Assembler-shared.h +++ b/js/src/jit/shared/Assembler-shared.h @@ -18,6 +18,10 @@ #include "jit/RegisterSets.h" #include "vm/HelperThreads.h" +#if defined(JS_CODEGEN_ARM) +#define JS_USE_LINK_REGISTER +#endif + #if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_ARM) // JS_SMALL_BRANCH means the range on a branch instruction // is smaller than the whole address space diff --git a/js/src/jit/shared/BaselineCompiler-shared.cpp b/js/src/jit/shared/BaselineCompiler-shared.cpp index 77d8593263fc..2e5bba563f3b 100644 --- a/js/src/jit/shared/BaselineCompiler-shared.cpp +++ b/js/src/jit/shared/BaselineCompiler-shared.cpp @@ -90,7 +90,7 @@ BaselineCompilerShared::callVM(const VMFunction &fun, CallVMPhase phase) masm.makeFrameDescriptor(BaselineTailCallReg, JitFrame_BaselineJS); masm.push(BaselineTailCallReg); } - + MOZ_ASSERT(fun.expectTailCall == NonTailCall); // Perform the call. masm.call(code); uint32_t callOffset = masm.currentOffset(); From f310c47a663d306d8bcc790d13554c334737483d Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Mon, 24 Nov 2014 08:41:42 -0800 Subject: [PATCH 26/88] Remove testcase for bug 894137 because it causes assertions in other tests --- content/base/crashtests/894137.html | 46 ----------------------------- 1 file changed, 46 deletions(-) delete mode 100644 content/base/crashtests/894137.html diff --git a/content/base/crashtests/894137.html b/content/base/crashtests/894137.html deleted file mode 100644 index 41e7f98d9dd6..000000000000 --- a/content/base/crashtests/894137.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -
-
- - -
-
-

-

- - - - - - - - - - - - - - - - - - -
- -
- - -
- - - - - - From 98fa65732a6f36e7d3f5f897d6c55bdd4ad1340f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 24 Nov 2014 16:42:31 +0000 Subject: [PATCH 27/88] Bug 1102791 - Always return NS_FRAME_COMPLETE status from nsHTMLButtonControlFrame::Reflow. Don't create overflow container continuations unless the delegating frame has eCanContainOverflowContainers. r=roc --- layout/forms/crashtests/1102791.html | 33 ++++++++++++++++++++ layout/forms/crashtests/crashtests.list | 1 + layout/forms/nsHTMLButtonControlFrame.cpp | 5 +++ layout/generic/nsAbsoluteContainingBlock.cpp | 3 +- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 layout/forms/crashtests/1102791.html diff --git a/layout/forms/crashtests/1102791.html b/layout/forms/crashtests/1102791.html new file mode 100644 index 000000000000..5bcdd80a660a --- /dev/null +++ b/layout/forms/crashtests/1102791.html @@ -0,0 +1,33 @@ + + + + Testcase for bug 1102791 + + + + + + + + diff --git a/layout/forms/crashtests/crashtests.list b/layout/forms/crashtests/crashtests.list index 1a12f83e5320..87cfa6df53be 100644 --- a/layout/forms/crashtests/crashtests.list +++ b/layout/forms/crashtests/crashtests.list @@ -59,3 +59,4 @@ load 944198.html load 949891.xhtml load 959311.html load 960277-2.html +load 1102791.html diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 400ba73d317f..e0b3bcbdd0e9 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -203,6 +203,11 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext, FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus); + // We're always complete and we don't support overflow containers + // so we shouldn't have a next-in-flow ever. + aStatus = NS_FRAME_COMPLETE; + MOZ_ASSERT(!GetNextInFlow()); + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); } diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index 5f9ca5e8c066..316ed330960e 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -132,7 +132,8 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame, aConstrainHeight, kidFrame, kidStatus, aOverflowAreas); nsIFrame* nextFrame = kidFrame->GetNextInFlow(); - if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus)) { + if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) && + aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) { // Need a continuation if (!nextFrame) { nextFrame = From e952f7adebc1e3b267c273438e4476d418e5e199 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 7 Nov 2014 14:10:39 -0500 Subject: [PATCH 28/88] Bug 1094545. Expose the URLSearchParams API in system globals. r=bholley --- dom/bindings/Codegen.py | 1 + dom/webidl/URLSearchParams.webidl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 21dfc1e1cd10..d757c9bb12df 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -11882,6 +11882,7 @@ class CGResolveSystemBinding(CGAbstractMethod): def definition_body(self): descriptors = self.config.getDescriptors(hasInterfaceObject=True, isExposedInSystemGlobals=True, + workers=False, register=True, skipGen=False) diff --git a/dom/webidl/URLSearchParams.webidl b/dom/webidl/URLSearchParams.webidl index dceb277a5d8e..39aa200aadd7 100644 --- a/dom/webidl/URLSearchParams.webidl +++ b/dom/webidl/URLSearchParams.webidl @@ -15,7 +15,7 @@ [Constructor(optional USVString init = ""), Constructor(URLSearchParams init), - Exposed=(Window,Worker)] + Exposed=(Window,Worker,System)] interface URLSearchParams { void append(USVString name, USVString value); void delete(USVString name); From 6fc6f807e279d6dccffa38a24c4dbab178909837 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 24 Nov 2014 14:13:28 +0800 Subject: [PATCH 29/88] Bug 1099053 - Fix setEccListProperty. r=hsinyi --- dom/telephony/test/marionette/test_emergency_label.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/telephony/test/marionette/test_emergency_label.js b/dom/telephony/test/marionette/test_emergency_label.js index cb8d26d35dba..db262260786b 100644 --- a/dom/telephony/test/marionette/test_emergency_label.js +++ b/dom/telephony/test/marionette/test_emergency_label.js @@ -9,6 +9,12 @@ const DEFAULT_ECC_LIST = "112,911"; function setEccListProperty(list) { log("Set property ril.ecclist: " + list); + // We should wrap empty |list| by ''. Otherwise, the entire command will be + // "setprop ril.ecclist" which causus the command error. + if (!list) { + list = "''"; + } + let deferred = Promise.defer(); try { emulator.runShellCmd(["setprop","ril.ecclist", list]).then(function() { From dd8ed3dfb7655d8625d42ee858bd405a14f29991 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 23 Nov 2014 22:23:54 -0800 Subject: [PATCH 30/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/789c9a327287 Author: George Desc: Merge pull request #26381 from cctuan/1089951 Bug 1089951 - prevent orientation of homescreen is changed by background app ======== https://hg.mozilla.org/integration/gaia-central/rev/791750873221 Author: cctuan Desc: Bug 1089951 - [Midori 2.0][Homescreen]The main interface menus overlap when MS quits games --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index f5e4df839754..7d29d3a0ac59 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "8f61e7de9914bb7f66ac2faf0bc256dda628a679", + "revision": "789c9a327287652837430c916546dced3f16b527", "repo_path": "integration/gaia-central" } From 37c6ef9fce65038bb5b4d09b7e9ea2ac24ba2485 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 23 Nov 2014 22:24:09 -0800 Subject: [PATCH 31/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 58f83a0d8054..290ab624c1b7 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 6090a8563201..7120459489f3 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a29b1ea4d369..e7d19cf998b6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 2587007ba43c..db59bfb66139 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 6090a8563201..7120459489f3 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 06410db074b6..e7fee0530f87 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 3986d40c4088..428bb0ef0cc4 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 3e59a399d18d..c3d2aeccb8c5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index ea896768cfbe..224a402815ef 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 331f145b2768..e60838643184 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index dba2a18beef5..1908dc44752a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 0b7507c2907bb0bde11e1cff0f36df5f698d5908 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 23 Nov 2014 22:33:32 -0800 Subject: [PATCH 32/88] Bumping manifests a=b2g-bump --- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index e7d19cf998b6..0a50ef51ca0f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -134,7 +134,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e7fee0530f87..0f66c4e26ba1 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -153,7 +153,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 428bb0ef0cc4..5931ec881fce 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -145,7 +145,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e60838643184..c04aeb143887 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -129,7 +129,7 @@ - + From c0da861aa4812a76a2ada20bef2c5d33ce31b7e1 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Mon, 24 Nov 2014 15:21:52 +0800 Subject: [PATCH 33/88] Bug 970307: Part 1: Report status of each thread to find when all the threads are idle. r=nfroyd --- dom/indexedDB/TransactionThreadPool.cpp | 27 +++ dom/wifi/WifiProxyService.cpp | 3 + dom/workers/WorkerPrivate.cpp | 12 + .../base/src/nsSocketTransportService2.cpp | 1 + widget/gonk/GonkMemoryPressureMonitoring.cpp | 2 + xpcom/glue/nsThreadUtils.cpp | 8 + xpcom/glue/nsThreadUtils.h | 15 ++ xpcom/threads/TimerThread.cpp | 1 + xpcom/threads/nsThread.cpp | 49 +++- xpcom/threads/nsThread.h | 15 ++ xpcom/threads/nsThreadManager.cpp | 212 ++++++++++++++++++ xpcom/threads/nsThreadManager.h | 38 ++++ xpcom/threads/nsThreadPool.cpp | 7 +- xpcom/threads/nsTimerImpl.cpp | 7 + 14 files changed, 394 insertions(+), 3 deletions(-) diff --git a/dom/indexedDB/TransactionThreadPool.cpp b/dom/indexedDB/TransactionThreadPool.cpp index d0e68990e958..385f4dd50687 100644 --- a/dom/indexedDB/TransactionThreadPool.cpp +++ b/dom/indexedDB/TransactionThreadPool.cpp @@ -19,6 +19,7 @@ #include "nsServiceManagerUtils.h" #include "nsXPCOMCIDInternal.h" #include "ProfilerHelpers.h" +#include "nsThread.h" namespace mozilla { namespace dom { @@ -172,6 +173,10 @@ private: ~TransactionQueue() { } +#ifdef MOZ_NUWA_PROCESS + nsThread* mThread; +#endif + NS_DECL_NSIRUNNABLE }; @@ -791,6 +796,9 @@ TransactionQueue::TransactionQueue(TransactionThreadPool* aThreadPool, mObjectStoreNames(aObjectStoreNames), mMode(aMode), mShouldFinish(false) +#ifdef MOZ_NUWA_PROCESS +, mThread(nullptr) +#endif { MOZ_ASSERT(aThreadPool); aThreadPool->AssertIsOnOwningThread(); @@ -816,6 +824,12 @@ TransactionThreadPool::TransactionQueue::Dispatch(nsIRunnable* aRunnable) mQueue.AppendElement(aRunnable); +#ifdef MOZ_NUWA_PROCESS + if (mThread) { + mThread->SetWorking(); + } +#endif + mMonitor.Notify(); } @@ -849,6 +863,12 @@ TransactionThreadPool::TransactionQueue::Run() nsAutoTArray, 10> queue; nsRefPtr finishCallback; bool shouldFinish = false; +#ifdef MOZ_NUWA_PROCESS + mThread = static_cast(NS_GetCurrentThread()); + // Set ourself as working thread. We can reset later if we found + // our queue is empty. + mThread->SetWorking(); +#endif do { NS_ASSERTION(queue.IsEmpty(), "Should have cleared this!"); @@ -856,6 +876,9 @@ TransactionThreadPool::TransactionQueue::Run() { MonitorAutoLock lock(mMonitor); while (!mShouldFinish && mQueue.IsEmpty()) { +#ifdef MOZ_NUWA_PROCESS + mThread->SetIdle(); +#endif if (NS_FAILED(mMonitor.Wait())) { NS_ERROR("Failed to wait!"); } @@ -888,6 +911,10 @@ TransactionThreadPool::TransactionQueue::Run() } } while (!shouldFinish); +#ifdef MOZ_NUWA_PROCESS + mThread = nullptr; +#endif + #ifdef DEBUG if (kDEBUGThreadSleepMS) { MOZ_ALWAYS_TRUE( diff --git a/dom/wifi/WifiProxyService.cpp b/dom/wifi/WifiProxyService.cpp index 5770c96811da..7e026db2c604 100644 --- a/dom/wifi/WifiProxyService.cpp +++ b/dom/wifi/WifiProxyService.cpp @@ -65,6 +65,9 @@ public: NS_IMETHOD Run() { MOZ_ASSERT(!NS_IsMainThread()); +#ifdef MOZ_NUWA_PROCESS + NS_SetIgnoreStatusOfCurrentThread(); +#endif nsAutoString event; gWpaSupplicant->WaitForEvent(event, mInterface); if (!event.IsEmpty()) { diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 2ff28cebc1c8..45e4962b3125 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -65,6 +65,7 @@ #include "nsPrintfCString.h" #include "nsProxyRelease.h" #include "nsSandboxFlags.h" +#include "nsThread.h" #include "xpcpublic.h" #ifdef ANDROID @@ -4166,6 +4167,17 @@ WorkerPrivate::DoRunLoop(JSContext* aCx) { MutexAutoLock lock(mMutex); +#ifdef MOZ_NUWA_PROCESS + { + nsThread *thr = static_cast(NS_GetCurrentThread()); + ReentrantMonitorAutoEnter mon(thr->ThreadStatusMonitor()); + if (mControlQueue.IsEmpty() && + !(normalRunnablesPending = NS_HasPendingEvents(mThread))) { + thr->SetIdle(); + } + } +#endif // MOZ_NUWA_PROCESS + while (mControlQueue.IsEmpty() && !(normalRunnablesPending = NS_HasPendingEvents(mThread))) { WaitForWorkerEvents(); diff --git a/netwerk/base/src/nsSocketTransportService2.cpp b/netwerk/base/src/nsSocketTransportService2.cpp index c664bca538af..a17fc7cb3064 100644 --- a/netwerk/base/src/nsSocketTransportService2.cpp +++ b/netwerk/base/src/nsSocketTransportService2.cpp @@ -701,6 +701,7 @@ nsSocketTransportService::Run() "NuwaMarkCurrentThread is undefined!"); NuwaMarkCurrentThread(nullptr, nullptr); } + NS_SetIgnoreStatusOfCurrentThread(); #endif SOCKET_LOG(("STS thread init\n")); diff --git a/widget/gonk/GonkMemoryPressureMonitoring.cpp b/widget/gonk/GonkMemoryPressureMonitoring.cpp index 949f36c5bf16..ac018c046a70 100644 --- a/widget/gonk/GonkMemoryPressureMonitoring.cpp +++ b/widget/gonk/GonkMemoryPressureMonitoring.cpp @@ -127,6 +127,8 @@ public: } #endif + NS_SetIgnoreStatusOfCurrentThread(); + int lowMemFd = open("/sys/kernel/mm/lowmemkiller/notify_trigger_active", O_RDONLY | O_CLOEXEC); NS_ENSURE_STATE(lowMemFd != -1); diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp index c6d43dc09be8..ce914d7d15c7 100644 --- a/xpcom/glue/nsThreadUtils.cpp +++ b/xpcom/glue/nsThreadUtils.cpp @@ -375,3 +375,11 @@ nsAutoLowPriorityIO::~nsAutoLowPriorityIO() #endif } +#ifdef MOZ_NUWA_PROCESS +#ifdef MOZILLA_INTERNAL_API +void +NS_SetIgnoreStatusOfCurrentThread() { + nsThreadManager::get()->SetIgnoreThreadStatus(); +} +#endif // MOZILLA_INTERNAL_API +#endif // MOZ_NUWA_PROCESS diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index 47c7eaee4fe6..93c4b31ff220 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -565,4 +565,19 @@ private: void NS_SetMainThread(); +/** + * Helpers for thread to report their status when compiled with Nuwa. + */ +#ifdef MOZILLA_INTERNAL_API +#ifdef MOZ_NUWA_PROCESS +extern void +NS_SetIgnoreStatusOfCurrentThread(); +#else // MOZ_NUWA_PROCESS +inline void +NS_SetIgnoreStatusOfCurrentThread() +{ +} +#endif // MOZ_NUWA_PROCESS +#endif // MOZILLA_INTERNAL_API + #endif // nsThreadUtils_h__ diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 7689c80e3bfb..39281be80490 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -207,6 +207,7 @@ TimerThread::Run() } #endif + NS_SetIgnoreStatusOfCurrentThread(); MonitorAutoLock lock(mMonitor); // We need to know how many microseconds give a positive PRIntervalTime. This diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index d660d981887e..796d8cbe7cca 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -13,7 +13,6 @@ #undef LOG #endif -#include "mozilla/ReentrantMonitor.h" #include "nsMemoryPressure.h" #include "nsThreadManager.h" #include "nsIClassInfoImpl.h" @@ -329,6 +328,10 @@ nsThread::ThreadFunc(void* aArg) // Inform the ThreadManager nsThreadManager::get()->RegisterCurrentThread(self); +#ifdef MOZ_NUWA_PROCESS + self->mThreadStatusInfo = + static_cast(nsThreadManager::get()->GetCurrentThreadStatusInfo()); +#endif mozilla::IOInterposer::RegisterCurrentThread(); @@ -434,6 +437,10 @@ nsThread::nsThread(MainThreadFlag aMainThread, uint32_t aStackSize) , mShutdownRequired(false) , mEventsAreDoomed(false) , mIsMainThread(aMainThread) +#ifdef MOZ_NUWA_PROCESS + , mThreadStatusMonitor("nsThread.mThreadStatusLock") + , mThreadStatusInfo(nullptr) +#endif { } @@ -481,6 +488,11 @@ nsThread::InitCurrentThread() SetupCurrentThreadForChaosMode(); nsThreadManager::get()->RegisterCurrentThread(this); +#ifdef MOZ_NUWA_PROCESS + mThreadStatusInfo = + static_cast(nsThreadManager::get()->GetCurrentThreadStatusInfo()); +#endif + return NS_OK; } @@ -496,7 +508,15 @@ nsThread::PutEvent(nsIRunnable* aEvent, nsNestedEventTarget* aTarget) NS_WARNING("An event was posted to a thread that will never run it (rejected)"); return NS_ERROR_UNEXPECTED; } - queue->PutEvent(aEvent); +#ifdef MOZ_NUWA_PROCESS + { + ReentrantMonitorAutoEnter mon(mThreadStatusMonitor); + SetWorking(); +#endif // MOZ_NUWA_PROCESS + queue->PutEvent(aEvent); +#ifdef MOZ_NUWA_PROCESS + } +#endif // MOZ_NUWA_PROCESS // Make sure to grab the observer before dropping the lock, otherwise the // event that we just placed into the queue could run and eventually delete @@ -837,6 +857,15 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult) --mRunningEvent; +#ifdef MOZ_NUWA_PROCESS + { + ReentrantMonitorAutoEnter mon(mThreadStatusMonitor); + if ((!mEvents->GetEvent(false, nullptr)) && (mRunningEvent == 0)) { + SetIdle(); + } + } +#endif // MOZ_NUWA_PROCESS + NOTIFY_EVENT_OBSERVERS(AfterProcessNextEvent, (this, mRunningEvent, *aResult)); @@ -1046,6 +1075,22 @@ nsThread::SetMainThreadObserver(nsIThreadObserver* aObserver) return NS_OK; } +#ifdef MOZ_NUWA_PROCESS +void +nsThread::SetWorking() +{ + nsThreadManager::get()->SetThreadIsWorking( + static_cast(mThreadStatusInfo), true); +} + +void +nsThread::SetIdle() +{ + nsThreadManager::get()->SetThreadIsWorking( + static_cast(mThreadStatusInfo), false); +} +#endif + //----------------------------------------------------------------------------- NS_IMETHODIMP diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h index a9080972b89e..6ee9bac852c1 100644 --- a/xpcom/threads/nsThread.h +++ b/xpcom/threads/nsThread.h @@ -16,6 +16,7 @@ #include "nsTObserverArray.h" #include "mozilla/Attributes.h" #include "nsAutoPtr.h" +#include "mozilla/ReentrantMonitor.h" // A native thread class nsThread @@ -65,6 +66,14 @@ public: static nsresult SetMainThreadObserver(nsIThreadObserver* aObserver); +#ifdef MOZ_NUWA_PROCESS + void SetWorking(); + void SetIdle(); + mozilla::ReentrantMonitor& ThreadStatusMonitor() { + return mThreadStatusMonitor; + } +#endif + protected: static nsIThreadObserver* sMainThreadObserver; @@ -182,6 +191,12 @@ protected: // Set to true when events posted to this thread will never run. bool mEventsAreDoomed; MainThreadFlag mIsMainThread; +#ifdef MOZ_NUWA_PROCESS + mozilla::ReentrantMonitor mThreadStatusMonitor; + // The actual type is defined in nsThreadManager.h which is not exposed to + // file out of thread module. + void* mThreadStatusInfo; +#endif }; //----------------------------------------------------------------------------- diff --git a/xpcom/threads/nsThreadManager.cpp b/xpcom/threads/nsThreadManager.cpp index 9ba0ee7d3f11..35f6e9d83cc7 100644 --- a/xpcom/threads/nsThreadManager.cpp +++ b/xpcom/threads/nsThreadManager.cpp @@ -11,6 +11,7 @@ #include "nsTArray.h" #include "nsAutoPtr.h" #include "mozilla/ThreadLocal.h" +#include "mozilla/ReentrantMonitor.h" #ifdef MOZ_CANARY #include #include @@ -47,6 +48,54 @@ NS_SetMainThread() typedef nsTArray> nsThreadArray; +#ifdef MOZ_NUWA_PROCESS +class NotifyAllThreadsWereIdle: public nsRunnable +{ +public: + + NotifyAllThreadsWereIdle( + nsTArray>* aListeners) + : mListeners(aListeners) + { + } + + virtual NS_IMETHODIMP + Run() { + // Copy listener array, which may be modified during call back. + nsTArray> arr(*mListeners); + for (size_t i = 0; i < arr.Length(); i++) { + arr[i]->OnAllThreadsWereIdle(); + } + return NS_OK; + } + +private: + // Raw pointer, since it's pointing to a member of thread manager. + nsTArray>* mListeners; +}; + +struct nsThreadManager::ThreadStatusInfo { + Atomic mWorking; + Atomic mWillBeWorking; + bool mIgnored; + nsThreadManager *mMgr; + ThreadStatusInfo(nsThreadManager *aManager) + : mWorking(false) + , mWillBeWorking(false) + , mIgnored(false) + , mMgr(aManager) + { + ReentrantMonitorAutoEnter mon(*(mMgr->mMonitor)); + mMgr->mThreadStatusInfos.AppendElement(this); + } + ~ThreadStatusInfo() + { + ReentrantMonitorAutoEnter mon(*(mMgr->mMonitor)); + mMgr->mThreadStatusInfos.RemoveElement(this); + } +}; +#endif // MOZ_NUWA_PROCESS + //----------------------------------------------------------------------------- static void @@ -55,6 +104,14 @@ ReleaseObject(void* aData) static_cast(aData)->Release(); } +#ifdef MOZ_NUWA_PROCESS +static void +DeleteThreadStatusInfo(void* aData) +{ + delete static_cast(aData); +} +#endif + static PLDHashOperator AppendAndRemoveThread(PRThread* aKey, nsRefPtr& aThread, void* aArg) { @@ -96,7 +153,17 @@ nsThreadManager::Init() return NS_ERROR_FAILURE; } +#ifdef MOZ_NUWA_PROCESS + if (PR_NewThreadPrivateIndex(&mThreadStatusInfoIndex, + DeleteThreadStatusInfo) == PR_FAILURE) { + return NS_ERROR_FAILURE; + } +#endif // MOZ_NUWA_PROCESS + mLock = new Mutex("nsThreadManager.mLock"); +#ifdef MOZ_NUWA_PROCESS + mMonitor = MakeUnique("nsThreadManager.mMonitor"); +#endif // MOZ_NUWA_PROCESS #ifdef MOZ_CANARY const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NONBLOCK; @@ -194,6 +261,9 @@ nsThreadManager::Shutdown() // Remove the TLS entry for the main thread. PR_SetThreadPrivate(mCurThreadIndex, nullptr); +#ifdef MOZ_NUWA_PROCESS + PR_SetThreadPrivate(mThreadStatusInfoIndex, nullptr); +#endif } void @@ -226,6 +296,9 @@ nsThreadManager::UnregisterCurrentThread(nsThread* aThread) PR_SetThreadPrivate(mCurThreadIndex, nullptr); // Ref-count balanced via ReleaseObject +#ifdef MOZ_NUWA_PROCESS + PR_SetThreadPrivate(mThreadStatusInfoIndex, nullptr); +#endif } nsThread* @@ -250,6 +323,21 @@ nsThreadManager::GetCurrentThread() return thread.get(); // reference held in TLS } +#ifdef MOZ_NUWA_PROCESS +nsThreadManager::ThreadStatusInfo* +nsThreadManager::GetCurrentThreadStatusInfo() +{ + void* data = PR_GetThreadPrivate(mThreadStatusInfoIndex); + if (!data) { + ThreadStatusInfo *thrInfo = new ThreadStatusInfo(this); + PR_SetThreadPrivate(mThreadStatusInfoIndex, thrInfo); + data = thrInfo; + } + + return static_cast(data); +} +#endif + NS_IMETHODIMP nsThreadManager::NewThread(uint32_t aCreationFlags, uint32_t aStackSize, @@ -342,3 +430,127 @@ nsThreadManager::GetHighestNumberOfThreads() MutexAutoLock lock(*mLock); return mHighestNumberOfThreads; } + +#ifdef MOZ_NUWA_PROCESS +void +nsThreadManager::SetIgnoreThreadStatus() +{ + GetCurrentThreadStatusInfo()->mIgnored = true; +} + +void +nsThreadManager::SetThreadIdle() +{ + SetThreadIsWorking(GetCurrentThreadStatusInfo(), false); +} + +void +nsThreadManager::SetThreadWorking() +{ + SetThreadIsWorking(GetCurrentThreadStatusInfo(), true); +} + +void +nsThreadManager::SetThreadIsWorking(ThreadStatusInfo* aInfo, bool aIsWorking) +{ + aInfo->mWillBeWorking = aIsWorking; + if (mThreadsIdledListeners.Length() > 0) { + + // A race condition occurs since we don't want threads to try to enter the + // monitor (nsThreadManager::mMonitor) when no one cares about their status. + // And thus the race can happen when we put the first listener into + // |mThreadsIdledListeners|: + // + // (1) Thread A wants to dispatch a task to Thread B. + // (2) Thread A checks |mThreadsIdledListeners|, and nothing is in the + // list. So Thread A decides not to enter |mMonitor| when updating B's + // status. + // (3) Thread A is suspended just before it changed status of B. + // (4) A listener is added to |mThreadsIdledListeners| + // (5) Now is Thread C's turn to run. Thread C finds there's something in + // |mThreadsIdledListeners|, so it enters |mMonitor| and check all + // thread info structs in |mThreadStatusInfos| while A is in the middle + // of changing B's status. + // + // Then C may find Thread B is an idle thread (which is not correct, because + // A attempted to change B's status prior to C starting to walk throught + // |mThreadStatusInfo|), but the fact that thread A is working (thread A + // hasn't finished dispatching a task to thread B) can prevent thread C from + // firing a bogus notification. + // + // If the state transition that happens outside the monitor is in the other + // direction, the race condition could be: + // + // (1) Thread D has just finished its jobs and wants to set its status to idle. + // (2) Thread D checks |mThreadsIdledListeners|, and nothing is in the list. + // So Thread D decides not to enter |mMonitor|. + // (3) Thread D is is suspended before it updates its own status. + // (4) A listener is put into |mThreadsIdledListeners|. + // (5) Thread C wants to changes status of itself. It checks + // |mThreadsIdledListeners| and finds something inside the list. Thread C + // then enters |mMonitor|, updates its status and checks thread info in + // |mThreadStatusInfos| while D is changing status of itself out of monitor. + // + // Thread C will find that thread D is working (D actually wants to change its + // status to idle before C starting to check), then C returns without firing + // any notification. Finding that thread D is working can make our checking + // mechanism miss a chance to fire a notification: because thread D thought + // there's nothing in |mThreadsIdledListeners| and thus won't check the + // |mThreadStatusInfos| after changing the status of itself. + // + // |mWillBeWorking| can be used to address this problem. We require each + // thread to put the value that is going to be set to |mWorking| to + // |mWillBeWorking| before the thread decide whether it should enter + // |mMonitor| to change status or not. Thus C finds that D is working while + // D's |mWillBeWorking| is false, and C realizes that D is just updating and + // can treat D as an idle thread. + // + // It doesn't matter whether D will check thread status after changing its + // own status or not. If D checks, which means D will enter the monitor + // before updating status, thus D must be blocked until C has finished + // dispatching the notification task to main thread, and D will find that main + // thread is working and will not fire an additional event. On the other hand, + // if D doesn't check |mThreadStatusInfos|, it's still ok, because C has + // treated D as an idle thread already. + + bool hasWorkingThread = false; + ReentrantMonitorAutoEnter mon(*mMonitor); + // Get data structure of thread info. + aInfo->mWorking = aIsWorking; + for (size_t i = 0; i < mThreadStatusInfos.Length(); i++) { + ThreadStatusInfo *info = mThreadStatusInfos[i]; + if (!info->mIgnored) { + if (info->mWorking) { + if (info->mWillBeWorking) { + hasWorkingThread = true; + break; + } + } + } + } + if (!hasWorkingThread) { + nsRefPtr runnable = + new NotifyAllThreadsWereIdle(&mThreadsIdledListeners); + NS_DispatchToMainThread(runnable); + } + } else { + // Update thread info without holding any lock. + aInfo->mWorking = aIsWorking; + } +} + + +void +nsThreadManager::AddAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener) +{ + MOZ_ASSERT(GetCurrentThreadStatusInfo()->mWorking); + mThreadsIdledListeners.AppendElement(listener); +} + +void +nsThreadManager::RemoveAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener) +{ + mThreadsIdledListeners.RemoveElement(listener); +} + +#endif // MOZ_NUWA_PROCESS diff --git a/xpcom/threads/nsThreadManager.h b/xpcom/threads/nsThreadManager.h index 54d9c5d561f6..70eceb471749 100644 --- a/xpcom/threads/nsThreadManager.h +++ b/xpcom/threads/nsThreadManager.h @@ -14,9 +14,26 @@ class nsIRunnable; +namespace mozilla { +class ReentrantMonitor; +} + class nsThreadManager : public nsIThreadManager { public: +#ifdef MOZ_NUWA_PROCESS + struct ThreadStatusInfo; + class AllThreadsWereIdleListener { + public: + NS_INLINE_DECL_REFCOUNTING(AllThreadsWereIdleListener); + virtual void OnAllThreadsWereIdle() = 0; + protected: + virtual ~AllThreadsWereIdleListener() + { + } + }; +#endif // MOZ_NUWA_PROCESS + NS_DECL_ISUPPORTS NS_DECL_NSITHREADMANAGER @@ -54,6 +71,17 @@ public: { } +#ifdef MOZ_NUWA_PROCESS + void SetIgnoreThreadStatus(); + void SetThreadIdle(); + void SetThreadWorking(); + void SetThreadIsWorking(ThreadStatusInfo* aInfo, bool aIsWorking); + + void AddAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener); + void RemoveAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener); + ThreadStatusInfo* GetCurrentThreadStatusInfo(); +#endif // MOZ_NUWA_PROCESS + private: nsThreadManager() : mCurThreadIndex(0) @@ -62,6 +90,9 @@ private: , mInitialized(false) , mCurrentNumberOfThreads(1) , mHighestNumberOfThreads(1) +#ifdef MOZ_NUWA_PROCESS + , mMonitor(nullptr) +#endif { } @@ -78,6 +109,13 @@ private: uint32_t mCurrentNumberOfThreads; // The highest number of threads encountered so far during the session uint32_t mHighestNumberOfThreads; + +#ifdef MOZ_NUWA_PROCESS + unsigned mThreadStatusInfoIndex; + nsTArray> mThreadsIdledListeners; + nsTArray mThreadStatusInfos; + mozilla::UniquePtr mMonitor; +#endif // MOZ_NUWA_PROCESS }; #define NS_THREADMANAGER_CID \ diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 91c769438ef2..2cccc371158e 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -150,7 +150,6 @@ NS_IMETHODIMP nsThreadPool::Run() { LOG(("THRD-P(%p) enter\n", this)); - mThreadNaming.SetThreadPoolName(mName); nsCOMPtr current; @@ -208,6 +207,9 @@ nsThreadPool::Run() } else { PRIntervalTime delta = timeout - (now - idleSince); LOG(("THRD-P(%p) waiting [%d]\n", this, delta)); +#ifdef MOZ_NUWA_PROCESS + nsThreadManager::get()->SetThreadIdle(); +#endif // MOZ_NUWA_PROCESS mon.Wait(delta); } } else if (wasIdle) { @@ -217,6 +219,9 @@ nsThreadPool::Run() } if (event) { LOG(("THRD-P(%p) running [%p]\n", this, event.get())); +#ifdef MOZ_NUWA_PROCESS + nsThreadManager::get()->SetThreadWorking(); +#endif // MOZ_NUWA_PROCESS event->Run(); } } while (!exitThread); diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index 9803aacb0a86..7f1d6046a831 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -556,6 +556,13 @@ nsTimerImpl::Fire() return; } +#ifdef MOZ_NUWA_PROCESS + if (IsNuwaProcess() && IsNuwaReady()) { + // A timer event fired after Nuwa frozen can freeze main thread. + return; + } +#endif + PROFILER_LABEL("Timer", "Fire", js::ProfileEntry::Category::OTHER); From f7e202983d1d2cd377d788e15cbb588f02539bc4 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Mon, 24 Nov 2014 15:22:10 +0800 Subject: [PATCH 34/88] Bug 970307: Part 2: Let Nuwa wait for all tasks of preload slow things to finish. r=cyu --- dom/ipc/ContentChild.cpp | 69 +++++++++++++++------ dom/ipc/ContentChild.h | 2 + dom/ipc/ContentParent.cpp | 40 +++++++++++- dom/ipc/ContentParent.h | 8 ++- dom/ipc/PContent.ipdl | 4 ++ dom/ipc/tests/test_NuwaProcessCreation.html | 2 +- dom/ipc/tests/test_NuwaProcessDeadlock.html | 2 +- 7 files changed, 104 insertions(+), 23 deletions(-) diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 458fd3715398..1f5f586c4439 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -1238,7 +1238,6 @@ ContentChild::RecvPBrowserConstructor(PBrowserChild* aActor, { // This runs after AllocPBrowserChild() returns and the IPC machinery for this // PBrowserChild has been set up. - nsCOMPtr os = services::GetObserverService(); if (os) { nsITabChild* tc = @@ -1986,8 +1985,11 @@ bool ContentChild::RecvFlushMemory(const nsString& reason) { #ifdef MOZ_NUWA_PROCESS - if (IsNuwaProcess()) { + if (IsNuwaProcess() || ManagedPBrowserChild().Length() == 0) { // Don't flush memory in the nuwa process: the GC thread could be frozen. + // If there's no PBrowser child, don't flush memory, either. GC writes + // to copy-on-write pages and makes preallocated process take more memory + // before it actually becomes an app. return true; } #endif @@ -2075,12 +2077,25 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, // BrowserElementChild.js. if ((mIsForApp || mIsForBrowser) #ifdef MOZ_NUWA_PROCESS - && !IsNuwaProcess() + && IsNuwaProcess() #endif ) { PreloadSlowThings(); } +#ifdef MOZ_NUWA_PROCESS + // Some modules are initialized in preloading. We need to wait until the + // tasks they dispatched to chrome process are done. + if (IsNuwaProcess()) { + SendNuwaWaitForFreeze(); + } +#endif + return true; +} + +bool +ContentChild::RecvNuwaFreeze() +{ #ifdef MOZ_NUWA_PROCESS if (IsNuwaProcess()) { ContentChild::GetSingleton()->RecvGarbageCollect(); @@ -2088,7 +2103,6 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, FROM_HERE, NewRunnableFunction(OnFinishNuwaPreparation)); } #endif - return true; } @@ -2343,6 +2357,36 @@ RunNuwaFork() DoNuwaFork(); } } + +class NuwaForkCaller: public nsRunnable +{ +public: + NS_IMETHODIMP + Run() { + // We want to ensure that the PBackground actor gets cloned in the Nuwa + // process before we freeze. Also, we have to do this to avoid deadlock. + // Protocols that are "opened" (e.g. PBackground, PCompositor) block the + // main thread to wait for the IPC thread during the open operation. + // NuwaSpawnWait() blocks the IPC thread to wait for the main thread when + // the Nuwa process is forked. Unless we ensure that the two cannot happen + // at the same time then we risk deadlock. Spinning the event loop here + // guarantees the ordering is safe for PBackground. + if (!BackgroundChild::GetForCurrentThread()) { + // Dispatch ourself again. + NS_DispatchToMainThread(this, NS_DISPATCH_NORMAL); + } else { + MessageLoop* ioloop = XRE_GetIOMessageLoop(); + ioloop->PostTask(FROM_HERE, NewRunnableFunction(RunNuwaFork)); + } + return NS_OK; + } +private: + virtual + ~NuwaForkCaller() + { + } +}; + #endif bool @@ -2354,22 +2398,9 @@ ContentChild::RecvNuwaFork() } sNuwaForking = true; - // We want to ensure that the PBackground actor gets cloned in the Nuwa - // process before we freeze. Also, we have to do this to avoid deadlock. - // Protocols that are "opened" (e.g. PBackground, PCompositor) block the - // main thread to wait for the IPC thread during the open operation. - // NuwaSpawnWait() blocks the IPC thread to wait for the main thread when - // the Nuwa process is forked. Unless we ensure that the two cannot happen - // at the same time then we risk deadlock. Spinning the event loop here - // guarantees the ordering is safe for PBackground. - while (!BackgroundChild::GetForCurrentThread()) { - if (NS_WARN_IF(!NS_ProcessNextEvent())) { - return false; - } - } + nsRefPtr runnable = new NuwaForkCaller(); + NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL); - MessageLoop* ioloop = XRE_GetIOMessageLoop(); - ioloop->PostTask(FROM_HERE, NewRunnableFunction(RunNuwaFork)); return true; #else return false; // Makes the underlying IPC channel abort. diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index ef2617eefcf7..303142066cf2 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -350,6 +350,8 @@ public: virtual bool RecvNotifyPhoneStateChange(const nsString& state) MOZ_OVERRIDE; + virtual bool RecvNuwaFreeze() MOZ_OVERRIDE; + void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver, diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index a44825adaf4a..6679e4b50f79 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -122,6 +122,7 @@ #include "nsServiceManagerUtils.h" #include "nsStyleSheetService.h" #include "nsThreadUtils.h" +#include "nsThreadManager.h" #include "nsToolkitCompsCID.h" #include "nsWidgetsCID.h" #include "PreallocatedProcessManager.h" @@ -1370,6 +1371,28 @@ StaticAutoPtr > NS_IMPL_ISUPPORTS(SystemMessageHandledListener, nsITimerCallback) +#ifdef MOZ_NUWA_PROCESS +class NuwaFreezeListener : public nsThreadManager::AllThreadsWereIdleListener +{ +public: + NuwaFreezeListener(ContentParent* parent) + : mParent(parent) + { + } + + void OnAllThreadsWereIdle() + { + unused << mParent->SendNuwaFreeze(); + nsThreadManager::get()->RemoveAllThreadsWereIdleListener(this); + } +private: + nsRefPtr mParent; + virtual ~NuwaFreezeListener() + { + } +}; +#endif // MOZ_NUWA_PROCESS + } // anonymous namespace void @@ -2057,6 +2080,8 @@ ContentParent::ContentParent(ContentParent* aTemplate, priority = PROCESS_PRIORITY_FOREGROUND; } + mSendPermissionUpdates = aTemplate->mSendPermissionUpdates; + InitInternal(priority, false, /* Setup Off-main thread compositing */ false /* Send registered chrome */); @@ -2214,7 +2239,7 @@ ContentParent::IsForApp() #ifdef MOZ_NUWA_PROCESS bool -ContentParent::IsNuwaProcess() +ContentParent::IsNuwaProcess() const { return mIsNuwaProcess; } @@ -2563,6 +2588,19 @@ ContentParent::RecvNuwaReady() #endif } +bool +ContentParent::RecvNuwaWaitForFreeze() +{ +#ifdef MOZ_NUWA_PROCESS + nsRefPtr listener = new NuwaFreezeListener(this); + nsThreadManager::get()->AddAllThreadsWereIdleListener(listener); + return true; +#else // MOZ_NUWA_PROCESS + NS_ERROR("ContentParent::RecvNuwaWaitForFreeze() not implemented!"); + return false; +#endif // MOZ_NUWA_PROCESS +} + bool ContentParent::RecvAddNewProcess(const uint32_t& aPid, const InfallibleTArray& aFds) diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 53090e8ab846..d22f12052282 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -206,7 +206,7 @@ public: return mIsForBrowser; } #ifdef MOZ_NUWA_PROCESS - bool IsNuwaProcess(); + bool IsNuwaProcess() const; #endif GeckoChildProcessHost* Process() { @@ -220,7 +220,11 @@ public: } bool NeedsPermissionsUpdate() const { +#ifdef MOZ_NUWA_PROCESS + return !IsNuwaProcess() && mSendPermissionUpdates; +#else return mSendPermissionUpdates; +#endif } bool NeedsDataStoreInfos() const { @@ -679,6 +683,8 @@ private: virtual bool RecvNuwaReady() MOZ_OVERRIDE; + virtual bool RecvNuwaWaitForFreeze() MOZ_OVERRIDE; + virtual bool RecvAddNewProcess(const uint32_t& aPid, const InfallibleTArray& aFds) MOZ_OVERRIDE; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index ae946537801c..6e457aa2f6ff 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -518,6 +518,7 @@ child: intr GetProfile() returns (nsCString aProfile); + NuwaFreeze(); parent: /** * Tell the parent process a new accessible document has been created. @@ -728,6 +729,9 @@ parent: async SystemMessageHandled(); NuwaReady(); + // Sent when nuwa finished its initialization process and is waiting for + // parent's signal to make it freeze. + NuwaWaitForFreeze(); sync AddNewProcess(uint32_t pid, ProtocolFdMapping[] aFds); diff --git a/dom/ipc/tests/test_NuwaProcessCreation.html b/dom/ipc/tests/test_NuwaProcessCreation.html index 55c7e1636a05..698c5fa3f16c 100644 --- a/dom/ipc/tests/test_NuwaProcessCreation.html +++ b/dom/ipc/tests/test_NuwaProcessCreation.html @@ -76,7 +76,7 @@ function runTest() let timeout = setTimeout(function() { ok(false, "Nuwa process is not launched"); testEnd(); - }, 60000); + }, 240000); function testEnd() { cpmm.removeMessageListener("TEST-ONLY:nuwa-ready", msgHandler); diff --git a/dom/ipc/tests/test_NuwaProcessDeadlock.html b/dom/ipc/tests/test_NuwaProcessDeadlock.html index bb90b36e599f..9b54718fee80 100644 --- a/dom/ipc/tests/test_NuwaProcessDeadlock.html +++ b/dom/ipc/tests/test_NuwaProcessDeadlock.html @@ -77,7 +77,7 @@ function runTest() let timeout = setTimeout(function() { ok(false, "Nuwa process is not launched"); testEnd(); - }, 90000); + }, 240000); function testEnd() { cpmm.removeMessageListener("TEST-ONLY:nuwa-ready", msgHandler); From d70095812da5e24a8b5c46793be58f945ac25203 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Mon, 24 Nov 2014 15:22:31 +0800 Subject: [PATCH 35/88] Bug 970307: Part 3: Reinitialize modules after fork. r=fabrice --- dom/apps/AppsServiceChild.jsm | 9 +++++++-- dom/ipc/ContentChild.cpp | 10 ++++++++++ dom/ipc/TabChild.cpp | 15 +++++++++++++++ dom/ipc/TabChild.h | 1 + dom/ipc/jar.mn | 1 + dom/ipc/post-fork-preload.js | 20 ++++++++++++++++++++ dom/ipc/preload.js | 2 +- 7 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 dom/ipc/post-fork-preload.js diff --git a/dom/apps/AppsServiceChild.jsm b/dom/apps/AppsServiceChild.jsm index 8d5663607d24..7b5d3bd366ff 100644 --- a/dom/apps/AppsServiceChild.jsm +++ b/dom/apps/AppsServiceChild.jsm @@ -103,6 +103,12 @@ this.DOMApplicationRegistry = { this.cpmm.addMessageListener(aMsgName, this); }).bind(this)); + this.resetList(); + + Services.obs.addObserver(this, "xpcom-shutdown", false); + }, + + resetList: function() { this.cpmm.sendAsyncMessage("Webapps:RegisterForMessages", { messages: APPS_IPC_MSG_NAMES }); @@ -110,6 +116,7 @@ this.DOMApplicationRegistry = { // We need to prime the cache with the list of apps. let list = this.cpmm.sendSyncMessage("Webapps:GetList", { })[0]; this.webapps = list.webapps; + // We need a fast mapping from localId -> app, so we add an index. // We also add the manifest to the app object. this.localIdIndex = { }; @@ -118,8 +125,6 @@ this.DOMApplicationRegistry = { this.localIdIndex[app.localId] = app; app.manifest = list.manifests[id]; } - - Services.obs.addObserver(this, "xpcom-shutdown", false); }, observe: function(aSubject, aTopic, aData) { diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 1f5f586c4439..a87deb711574 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -507,6 +507,12 @@ NS_IMPL_ISUPPORTS(BackgroundChildPrimer, nsIIPCBackgroundChildCreateCallback) ContentChild* ContentChild::sSingleton; +static void +PostForkPreload() +{ + TabChild::PostForkPreload(); +} + // Performs initialization that is not fork-safe, i.e. that must be done after // forking from the Nuwa process. static void @@ -517,6 +523,7 @@ InitOnContentProcessCreated() if (IsNuwaProcess()) { return; } + PostForkPreload(); #endif // This will register cross-process observer. @@ -2081,6 +2088,9 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, #endif ) { PreloadSlowThings(); +#ifndef MOZ_NUWA_PROCESS + PostForkPreload(); +#endif } #ifdef MOZ_NUWA_PROCESS diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 43676e892649..42bf101655eb 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -832,6 +832,21 @@ TabChild::PreloadSlowThings() ClearOnShutdown(&sPreallocatedTab); } +/*static*/ void +TabChild::PostForkPreload() +{ + // Preallocated Tab can be null if we are forked directly from b2g. In such + // case we don't need to preload anything, just return. + if (!sPreallocatedTab) { + return; + } + + // Rebuild connections to parent. + sPreallocatedTab->RecvLoadRemoteScript( + NS_LITERAL_STRING("chrome://global/content/post-fork-preload.js"), + true); +} + /*static*/ already_AddRefed TabChild::Create(nsIContentChild* aManager, const TabId& aTabId, diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 732bdcc3fde5..b91d13a1ae23 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -268,6 +268,7 @@ public: * on the critical path. */ static void PreloadSlowThings(); + static void PostForkPreload(); /** Return a TabChild with the given attributes. */ static already_AddRefed diff --git a/dom/ipc/jar.mn b/dom/ipc/jar.mn index 7b2d19e2e25c..07297f4f69be 100644 --- a/dom/ipc/jar.mn +++ b/dom/ipc/jar.mn @@ -9,3 +9,4 @@ toolkit.jar: content/global/BrowserElementChildPreload.js (../browser-element/BrowserElementChildPreload.js) * content/global/BrowserElementPanning.js (../browser-element/BrowserElementPanning.js) content/global/preload.js (preload.js) + content/global/post-fork-preload.js (post-fork-preload.js) diff --git a/dom/ipc/post-fork-preload.js b/dom/ipc/post-fork-preload.js new file mode 100644 index 000000000000..f5238beb2cdb --- /dev/null +++ b/dom/ipc/post-fork-preload.js @@ -0,0 +1,20 @@ +/* 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/. */ + +// Preload some things, in an attempt to make app startup faster. +// +// This script is run when the preallocated process starts. It is injected as +// a frame script. +// If Nuwa process is enabled, this script will run in preallocated process +// forked by Nuwa. + +(function (global) { + "use strict"; + + Components.utils.import("resource://gre/modules/AppsServiceChild.jsm"); + Components.classes["@mozilla.org/network/protocol-proxy-service;1"]. + getService(Ci["nsIProtocolProxyService"]); + + DOMApplicationRegistry.resetList(); +})(this); diff --git a/dom/ipc/preload.js b/dom/ipc/preload.js index 891635e56e46..15ea804294ee 100644 --- a/dom/ipc/preload.js +++ b/dom/ipc/preload.js @@ -6,6 +6,7 @@ // // This script is run when the preallocated process starts. It is injected as // a frame script. +// If nuwa is enabled, this script will run in Nuwa process before frozen. const BrowserElementIsPreloaded = true; @@ -53,7 +54,6 @@ const BrowserElementIsPreloaded = true; Cc["@mozilla.org/network/idn-service;1"].getService(Ci["nsIIDNService"]); Cc["@mozilla.org/network/io-service;1"].getService(Ci["nsIIOService2"]); Cc["@mozilla.org/network/mime-hdrparam;1"].getService(Ci["nsIMIMEHeaderParam"]); - Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(Ci["nsIProtocolProxyService"]); Cc["@mozilla.org/network/socket-transport-service;1"].getService(Ci["nsISocketTransportService"]); Cc["@mozilla.org/network/stream-transport-service;1"].getService(Ci["nsIStreamTransportService"]); Cc["@mozilla.org/network/url-parser;1?auth=maybe"].getService(Ci["nsIURLParser"]); From 7fabf7976df1f516b1906644a4a5c1a4868a8f31 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Mon, 24 Nov 2014 15:22:49 +0800 Subject: [PATCH 36/88] Bug 970307: Part 4: Increas leak checking threshold. r=nfroyd --- testing/mochitest/mochitest_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index 5120c014dcdd..0f75b6ea3ad2 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -805,7 +805,7 @@ class B2GOptions(MochitestOptions): defaults["testPath"] = "" defaults["extensionsToExclude"] = ["specialpowers"] # See dependencies of bug 1038943. - defaults["defaultLeakThreshold"] = 5180 + defaults["defaultLeakThreshold"] = 5308 self.set_defaults(**defaults) def verifyRemoteOptions(self, options): From 79b6a50c36cc463fabfe83164dc3f8e4c4d2a64c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 23 Nov 2014 23:46:58 -0800 Subject: [PATCH 37/88] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/b58f8db1d1f4 Author: Min-Zhong "John" Lu Desc: Merge pull request #26104 from mnjul/bug_1097450_save_group_active_layout Bug 1097450 - Save (to settings) the activeLayout of groups supported by one layout, when we change to that layout. r=timdream, f=johnhu ======== https://hg.mozilla.org/integration/gaia-central/rev/83758711f51d Author: John Lu [:mnjul] Desc: Bug 1097450 - Save (to settings) the activeLayout of groups supported by one layout, when we change to that layout - The whole currentActiveLayout logics have been consolidated from KeyboardHelper to InputLayouts, as part of our goal to disentangle KeyboardHelper. - Also, properly define the undefiness of activeLayout in InputLayout's layouts. ======== https://hg.mozilla.org/integration/gaia-central/rev/91b89c3dc29a Author: RickyChien Desc: Merge pull request #26311 from gregarndt/bug_1101942_xulrunner_sdk_path Bug 1101942 - add search path found in nightly ftp package r=@RickyChien, r=@martinthomson ======== https://hg.mozilla.org/integration/gaia-central/rev/7687a62d90e1 Author: Greg Arndt Desc: Bug 1101942 - add search path found in nightly ftp package modified: Makefile ======== https://hg.mozilla.org/integration/gaia-central/rev/0a78a6b4217c Author: RickyChien Desc: Merge pull request #26390 from RickyChien/bug-1103819 Bug 1103819 - Enable parallel build by default r=@cctuan ======== https://hg.mozilla.org/integration/gaia-central/rev/56af39b1b397 Author: Ricky Chien Desc: Bug 1103819 - Enable parallel build by default --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7d29d3a0ac59..f4591cfd9a47 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "789c9a327287652837430c916546dced3f16b527", + "revision": "b58f8db1d1f454599353659923a9f9ae1053ab35", "repo_path": "integration/gaia-central" } From 0ec204800370e44d7ca188553be91ca77ddece54 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 23 Nov 2014 23:52:01 -0800 Subject: [PATCH 38/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 290ab624c1b7..2499dd376954 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7120459489f3..2a534a0a3c60 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0a50ef51ca0f..c4abffe79ccb 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index db59bfb66139..62515de293b6 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7120459489f3..2a534a0a3c60 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 0f66c4e26ba1..6c84c92fa3e6 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5931ec881fce..64f4701240a9 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c3d2aeccb8c5..0efa72af4910 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 224a402815ef..aa448636b592 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c04aeb143887..b7bc91314487 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 1908dc44752a..98d49eded2f2 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From e2f0365ce80ba4396a666f4a8bc72665daf1d9d8 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Nov 2014 09:02:03 +0100 Subject: [PATCH 39/88] Bug 1091588: Add helpers for Bluetooth daemon Handsfree support, r=shuang This patch adds helpers for packing, unpacking and converting Handsfree values to and from Bluetooth PDUs. --- .../bluedroid/BluetoothDaemonHelpers.cpp | 431 ++++++++++++++++++ .../bluedroid/BluetoothDaemonHelpers.h | 202 ++++++++ 2 files changed, 633 insertions(+) diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp index 36f2366c75ce..25dec96a4443 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp @@ -45,6 +45,18 @@ Convert(bool aIn, BluetoothScanMode& aOut) return NS_OK; } +nsresult +Convert(int aIn, uint8_t& aOut) +{ + if (NS_WARN_IF(aIn < std::numeric_limits::min()) || + NS_WARN_IF(aIn > std::numeric_limits::max())) { + aOut = 0; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = static_cast(aIn); + return NS_OK; +} + nsresult Convert(int aIn, int16_t& aOut) { @@ -71,6 +83,20 @@ Convert(uint8_t aIn, bool& aOut) return NS_OK; } +nsresult +Convert(uint8_t aIn, char& aOut) +{ + aOut = static_cast(aIn); + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, int& aOut) +{ + aOut = static_cast(aIn); + return NS_OK; +} + nsresult Convert(uint8_t aIn, BluetoothAclState& aOut) { @@ -100,6 +126,97 @@ Convert(uint8_t aIn, BluetoothBondState& aOut) return NS_OK; } +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeAudioState& aOut) +{ + static const BluetoothHandsfreeAudioState sAudioState[] = { + CONVERT(0x00, HFP_AUDIO_STATE_DISCONNECTED), + CONVERT(0x01, HFP_AUDIO_STATE_CONNECTING), + CONVERT(0x02, HFP_AUDIO_STATE_CONNECTED), + CONVERT(0x03, HFP_AUDIO_STATE_DISCONNECTING) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAudioState))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sAudioState[aIn]; + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeCallHoldType& aOut) +{ + static const BluetoothHandsfreeCallHoldType sCallHoldType[] = { + CONVERT(0x00, HFP_CALL_HOLD_RELEASEHELD), + CONVERT(0x01, HFP_CALL_HOLD_RELEASEACTIVE_ACCEPTHELD), + CONVERT(0x02, HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD), + CONVERT(0x03, HFP_CALL_HOLD_ADDHELDTOCONF) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallHoldType))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallHoldType[aIn]; + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeConnectionState& aOut) +{ + static const BluetoothHandsfreeConnectionState sConnectionState[] = { + CONVERT(0x00, HFP_CONNECTION_STATE_DISCONNECTED), + CONVERT(0x01, HFP_CONNECTION_STATE_CONNECTING), + CONVERT(0x02, HFP_CONNECTION_STATE_CONNECTED), + CONVERT(0x03, HFP_CONNECTION_STATE_SLC_CONNECTED), + CONVERT(0x04, HFP_CONNECTION_STATE_DISCONNECTING) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sConnectionState))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sConnectionState[aIn]; + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeNRECState& aOut) +{ + static const BluetoothHandsfreeNRECState sNRECState[] = { + CONVERT(0x00, HFP_NREC_STOPPED), + CONVERT(0x01, HFP_NREC_STARTED) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNRECState))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sNRECState[aIn]; + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeVoiceRecognitionState& aOut) +{ + static const BluetoothHandsfreeVoiceRecognitionState sState[] = { + CONVERT(0x00, HFP_VOICE_RECOGNITION_STOPPED), + CONVERT(0x01, HFP_VOICE_RECOGNITION_STOPPED) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sState))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sState[aIn]; + return NS_OK; +} + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeVolumeType& aOut) +{ + static const BluetoothHandsfreeVolumeType sVolumeType[] = { + CONVERT(0x00, HFP_VOLUME_TYPE_SPEAKER), + CONVERT(0x01, HFP_VOLUME_TYPE_MICROPHONE) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) { + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sVolumeType[aIn]; + return NS_OK; +} + nsresult Convert(int32_t aIn, BluetoothDeviceType& aOut) { @@ -373,6 +490,147 @@ Convert(const BluetoothAddress& aIn, nsAString& aOut) return NS_OK; } +nsresult +Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut) +{ + static const uint8_t sAtResponse[] = { + CONVERT(HFP_AT_RESPONSE_ERROR, 0x00), + CONVERT(HFP_AT_RESPONSE_OK, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAtResponse))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sAtResponse[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeCallAddressType aIn, uint8_t& aOut) +{ + static const uint8_t sCallAddressType[] = { + CONVERT(HFP_CALL_ADDRESS_TYPE_UNKNOWN, 0x81), + CONVERT(HFP_CALL_ADDRESS_TYPE_INTERNATIONAL, 0x91) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallAddressType))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallAddressType[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeCallDirection aIn, uint8_t& aOut) +{ + static const uint8_t sCallDirection[] = { + CONVERT(HFP_CALL_DIRECTION_OUTGOING, 0x00), + CONVERT(HFP_CALL_DIRECTION_INCOMING, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallDirection))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallDirection[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeCallState aIn, uint8_t& aOut) +{ + static const uint8_t sCallState[] = { + CONVERT(HFP_CALL_STATE_ACTIVE, 0x00), + CONVERT(HFP_CALL_STATE_HELD, 0x01), + CONVERT(HFP_CALL_STATE_DIALING, 0x02), + CONVERT(HFP_CALL_STATE_ALERTING, 0x03), + CONVERT(HFP_CALL_STATE_INCOMING, 0x04), + CONVERT(HFP_CALL_STATE_WAITING, 0x05), + CONVERT(HFP_CALL_STATE_IDLE, 0x06) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallState))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallState[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeCallMode aIn, uint8_t& aOut) +{ + static const uint8_t sCallMode[] = { + CONVERT(HFP_CALL_MODE_VOICE, 0x00), + CONVERT(HFP_CALL_MODE_DATA, 0x01), + CONVERT(HFP_CALL_MODE_FAX, 0x02) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMode))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallMode[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeCallMptyType aIn, uint8_t& aOut) +{ + static const uint8_t sCallMptyType[] = { + CONVERT(HFP_CALL_MPTY_TYPE_SINGLE, 0x00), + CONVERT(HFP_CALL_MPTY_TYPE_MULTI, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMptyType))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sCallMptyType[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeNetworkState aIn, uint8_t& aOut) +{ + static const uint8_t sNetworkState[] = { + CONVERT(HFP_NETWORK_STATE_NOT_AVAILABLE, 0x00), + CONVERT(HFP_NETWORK_STATE_AVAILABLE, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNetworkState))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sNetworkState[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeServiceType aIn, uint8_t& aOut) +{ + static const uint8_t sServiceType[] = { + CONVERT(HFP_SERVICE_TYPE_HOME, 0x00), + CONVERT(HFP_SERVICE_TYPE_ROAMING, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sServiceType))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sServiceType[aIn]; + return NS_OK; +} + +nsresult +Convert(BluetoothHandsfreeVolumeType aIn, uint8_t& aOut) +{ + static const uint8_t sVolumeType[] = { + CONVERT(HFP_VOLUME_TYPE_SPEAKER, 0x00), + CONVERT(HFP_VOLUME_TYPE_MICROPHONE, 0x01) + }; + if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) { + aOut = 0x00; // silences compiler warning + return NS_ERROR_ILLEGAL_VALUE; + } + aOut = sVolumeType[aIn]; + return NS_OK; +} + nsresult Convert(BluetoothPropertyType aIn, uint8_t& aOut) { @@ -522,6 +780,69 @@ PackPDU(const BluetoothDaemonPDUHeader& aIn, BluetoothDaemonPDU& aPDU) return PackPDU(aIn.mService, aIn.mOpcode, aIn.mLength, aPDU); } +nsresult +PackPDU(const BluetoothHandsfreeAtResponse& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeCallAddressType& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeCallDirection& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeCallMode& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeCallMptyType& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeCallState& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeNetworkState& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeServiceType& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + +nsresult +PackPDU(const BluetoothHandsfreeVolumeType& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackConversion(aIn), aPDU); +} + nsresult PackPDU(const BluetoothNamedValue& aIn, BluetoothDaemonPDU& aPDU) { @@ -607,6 +928,12 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, bool& aOut) return UnpackPDU(aPDU, UnpackConversion(aOut)); } +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, char& aOut) +{ + return UnpackPDU(aPDU, UnpackConversion(aOut)); +} + nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAclState& aOut) { @@ -626,6 +953,50 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDeviceType& aOut) aPDU, UnpackConversion(aOut)); } +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeAudioState& aOut) +{ + return UnpackPDU( + aPDU, UnpackConversion(aOut)); +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut) +{ + return UnpackPDU( + aPDU, UnpackConversion(aOut)); +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeConnectionState& aOut) +{ + return UnpackPDU( + aPDU, UnpackConversion(aOut)); +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeNRECState& aOut) +{ + return UnpackPDU( + aPDU, UnpackConversion(aOut)); +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeVoiceRecognitionState& aOut) +{ + return UnpackPDU( + aPDU, + UnpackConversion(aOut)); +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeVolumeType& aOut) +{ + return UnpackPDU( + aPDU, UnpackConversion(aOut)); +} + nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothProperty& aOut) { @@ -769,4 +1140,64 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut) return UnpackPDU(aPDU, UnpackConversion(aOut)); } +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, nsDependentCString& aOut) +{ + // We get a pointer to the first character in the PDU, a length + // of 1 ensures we consume the \0 byte. With 'str' pointing to + // the string in the PDU, we can copy the actual bytes. + + const char* str = reinterpret_cast(aPDU.Consume(1)); + if (NS_WARN_IF(!str)) { + return NS_ERROR_ILLEGAL_VALUE; // end of PDU + } + + const char* end = static_cast(memchr(str, '\0', aPDU.GetSize())); + if (NS_WARN_IF(!end)) { + return NS_ERROR_ILLEGAL_VALUE; // no string terminator + } + + ptrdiff_t len = end - str; + + const uint8_t* rest = aPDU.Consume(len); + if (NS_WARN_IF(!rest)) { + // We couldn't consume bytes that should have been there. + return NS_ERROR_ILLEGAL_VALUE; + } + + aOut.Rebind(str, len); + + return NS_OK; +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackCString0& aOut) +{ + nsDependentCString cstring; + + nsresult rv = UnpackPDU(aPDU, cstring); + if (NS_FAILED(rv)) { + return NS_ERROR_ILLEGAL_VALUE; + } + + aOut.mString->AssignASCII(cstring.get(), cstring.Length()); + + return NS_OK; +} + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackString0& aOut) +{ + nsDependentCString cstring; + + nsresult rv = UnpackPDU(aPDU, cstring); + if (NS_FAILED(rv)) { + return NS_ERROR_ILLEGAL_VALUE; + } + + *aOut.mString = NS_ConvertUTF8toUTF16(cstring); + + return NS_OK; +} + END_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h index e3e896019b4d..aa3dc1116fe9 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h @@ -103,15 +103,42 @@ Convert(bool aIn, uint8_t& aOut); nsresult Convert(bool aIn, BluetoothScanMode& aOut); +nsresult +Convert(int aIn, uint8_t& aOut); + nsresult Convert(int aIn, int16_t& aOut); nsresult Convert(uint8_t aIn, bool& aOut); +nsresult +Convert(uint8_t aIn, char& aOut); + +nsresult +Convert(uint8_t aIn, int& aOut); + nsresult Convert(uint8_t aIn, BluetoothAclState& aOut); +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeAudioState& aOut); + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeCallHoldType& aOut); + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeConnectionState& aOut); + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeNRECState& aOut); + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeVoiceRecognitionState& aOut); + +nsresult +Convert(uint8_t aIn, BluetoothHandsfreeVolumeType& aOut); + nsresult Convert(uint8_t aIn, BluetoothBondState& aOut); @@ -157,6 +184,33 @@ Convert(BluetoothAclState aIn, bool& aOut); nsresult Convert(const BluetoothAddress& aIn, nsAString& aOut); +nsresult +Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeCallAddressType aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeCallDirection aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeCallState aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeCallMode aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeCallMptyType aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeNetworkState aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeServiceType aIn, uint8_t& aOut); + +nsresult +Convert(BluetoothHandsfreeVolumeType aIn, uint8_t& aOut); + nsresult Convert(BluetoothPropertyType aIn, uint8_t& aOut); @@ -215,6 +269,33 @@ PackPDU(const BluetoothConfigurationParameter& aIn, BluetoothDaemonPDU& aPDU); nsresult PackPDU(const BluetoothDaemonPDUHeader& aIn, BluetoothDaemonPDU& aPDU); +nsresult +PackPDU(const BluetoothHandsfreeAtResponse& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeCallAddressType& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeCallDirection& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeCallMode& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeCallMptyType& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeCallState& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeNetworkState& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeServiceType& aIn, BluetoothDaemonPDU& aPDU); + +nsresult +PackPDU(const BluetoothHandsfreeVolumeType& aIn, BluetoothDaemonPDU& aPDU); + nsresult PackPDU(const BluetoothNamedValue& aIn, BluetoothDaemonPDU& aPDU); @@ -302,6 +383,29 @@ PackPDU(const PackArray& aIn, BluetoothDaemonPDU& aPDU) return aPDU.Write(aIn.mData, aIn.mLength); } +/* |PackCString0| is a helper for packing 0-terminated C string, + * including the \0 character. Pass an instance of this structure + * as the first argument to |PackPDU| to pack a string. + */ +struct PackCString0 +{ + PackCString0(const nsCString& aString) + : mString(aString) + { } + + const nsCString& mString; +}; + +/* This implementation of |PackPDU| packs a 0-terminated C string. + */ +inline nsresult +PackPDU(const PackCString0& aIn, BluetoothDaemonPDU& aPDU) +{ + return PackPDU( + PackArray(reinterpret_cast(aIn.mString.get()), + aIn.mString.Length() + 1), aPDU); +} + template inline nsresult PackPDU(const T1& aIn1, const T2& aIn2, BluetoothDaemonPDU& aPDU) @@ -375,6 +479,41 @@ PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3, return PackPDU(aIn5, aPDU); } +template +inline nsresult +PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3, + const T4& aIn4, const T5& aIn5, const T6& aIn6, + const T7& aIn7, BluetoothDaemonPDU& aPDU) +{ + nsresult rv = PackPDU(aIn1, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + rv = PackPDU(aIn2, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + rv = PackPDU(aIn3, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + rv = PackPDU(aIn4, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + rv = PackPDU(aIn5, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + rv = PackPDU(aIn6, aPDU); + if (NS_FAILED(rv)) { + return rv; + } + return PackPDU(aIn7, aPDU); +} + // // Unpacking // @@ -412,6 +551,9 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, uint32_t& aOut) nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, bool& aOut); +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, char& aOut); + nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAclState& aOut); @@ -441,6 +583,25 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDaemonPDUHeader& aOut) nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDeviceType& aOut); +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeAudioState& aOut); + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut); + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeConnectionState& aOut); + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeNRECState& aOut); + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeVoiceRecognitionState& aOut); + +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeVolumeType& aOut); + nsresult UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothRemoteInfo& aOut); @@ -474,6 +635,9 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothUuid& aOut) return aPDU.Read(aOut.mUuid, sizeof(aOut.mUuid)); } +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, nsDependentCString& aOut); + /* |UnpackConversion| is a helper for convering unpacked values. Pass * an instance of this structure to |UnpackPDU| to read a value from * the PDU in the input type and convert it to the output type. @@ -565,6 +729,44 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, nsTArray& aOut) return NS_OK; } +/* |UnpackCString0| is a helper for unpacking 0-terminated C string, + * including the \0 character. Pass an instance of this structure + * as the first argument to |UnpackPDU| to unpack a string. + */ +struct UnpackCString0 +{ + UnpackCString0(nsCString& aString) + : mString(&aString) + { } + + nsCString* mString; // non-null by construction +}; + +/* This implementation of |UnpackPDU| unpacks a 0-terminated C string. + */ +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackCString0& aOut); + +/* |UnpackString0| is a helper for unpacking 0-terminated C string, + * including the \0 character. Pass an instance of this structure + * as the first argument to |UnpackPDU| to unpack a C string and convert + * it to wide-character encoding. + */ +struct UnpackString0 +{ + UnpackString0(nsString& aString) + : mString(&aString) + { } + + nsString* mString; // non-null by construction +}; + +/* This implementation of |UnpackPDU| unpacks a 0-terminated C string + * and converts it to wide-character encoding. + */ +nsresult +UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackString0& aOut); + // // Init operators // From 3a9db14062724d774afe1424facce98940346a2f Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Nov 2014 09:02:31 +0100 Subject: [PATCH 40/88] Bug 1091588: Add Handsfree module for Bluetooth daemon, r=shuang --- .../BluetoothDaemonHandsfreeInterface.cpp | 956 ++++++++++++++++++ .../BluetoothDaemonHandsfreeInterface.h | 328 ++++++ dom/bluetooth/moz.build | 1 + 3 files changed, 1285 insertions(+) create mode 100644 dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp create mode 100644 dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp new file mode 100644 index 000000000000..8e8889cc0060 --- /dev/null +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp @@ -0,0 +1,956 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "BluetoothDaemonHandsfreeInterface.h" +#include "mozilla/unused.h" + +BEGIN_BLUETOOTH_NAMESPACE + +// +// Handsfree module +// + +BluetoothHandsfreeNotificationHandler* + BluetoothDaemonHandsfreeModule::sNotificationHandler; + +void +BluetoothDaemonHandsfreeModule::SetNotificationHandler( + BluetoothHandsfreeNotificationHandler* aNotificationHandler) +{ + sNotificationHandler = aNotificationHandler; +} + +nsresult +BluetoothDaemonHandsfreeModule::Send(BluetoothDaemonPDU* aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + aRes->AddRef(); // Keep reference for response + return Send(aPDU, static_cast(aRes)); +} + +void +BluetoothDaemonHandsfreeModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, void* aUserData) +{ + static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])( + const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = { + INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::HandleRsp), + INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::HandleNtf), + }; + + MOZ_ASSERT(!NS_IsMainThread()); + + // Negate twice to map bit to 0/1 + unsigned long isNtf = !!(aHeader.mOpcode & 0x80); + + (this->*(HandleOp[isNtf]))(aHeader, aPDU, aUserData); +} + +// Commands +// + +nsresult +BluetoothDaemonHandsfreeModule::ConnectCmd( + const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CONNECT, + 6)); // Address + + nsresult rv = PackPDU( + PackConversion(aRemoteAddr), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::DisconnectCmd( + const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DISCONNECT, + 6)); // Address + + nsresult rv = PackPDU( + PackConversion(aRemoteAddr), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::ConnectAudioCmd( + const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CONNECT_AUDIO, + 6)); // Address + + nsresult rv = PackPDU( + PackConversion(aRemoteAddr), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::DisconnectAudioCmd( + const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DISCONNECT_AUDIO, + 6)); // Address + + nsresult rv = PackPDU( + PackConversion(aRemoteAddr), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::StartVoiceRecognitionCmd( + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_START_VOICE_RECOGNITION, + 0)); // No payload + + nsresult rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::StopVoiceRecognitionCmd( + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_STOP_VOICE_RECOGNITION, + 0)); // No payload + + nsresult rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::VolumeControlCmd( + BluetoothHandsfreeVolumeType aType, int aVolume, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_VOLUME_CONTROL, + 1 + // Volume type + 1)); // Volume + + nsresult rv = PackPDU(aType, PackConversion(aVolume), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::DeviceStatusNotificationCmd( + BluetoothHandsfreeNetworkState aNtkState, + BluetoothHandsfreeServiceType aSvcType, int aSignal, int aBattChg, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DEVICE_STATUS_NOTIFICATION, + 1 + // Network state + 1 + // Service type + 1 + // Signal strength + 1)); // Battery level + + nsresult rv = PackPDU(aNtkState, aSvcType, + PackConversion(aSignal), + PackConversion(aBattChg), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::CopsResponseCmd( + const char* aCops, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_COPS_RESPONSE, + 0)); // Dynamically allocated + + nsresult rv = PackPDU(PackCString0(nsDependentCString(aCops)), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::CindResponseCmd( + int aSvc, int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + int aSignal, int aRoam, int aBattChg, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CIND_RESPONSE, + 1 + // Service + 1 + // # Active + 1 + // # Held + 1 + // Call state + 1 + // Signal strength + 1 + // Roaming + 1)); // Battery level + + nsresult rv = PackPDU(PackConversion(aSvc), + PackConversion(aNumActive), + PackConversion(aNumHeld), + aCallSetupState, + PackConversion(aSignal), + PackConversion(aRoam), + PackConversion(aBattChg), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::FormattedAtResponseCmd( + const char* aRsp, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_FORMATTED_AT_RESPONSE, + 0)); // Dynamically allocated + + nsresult rv = PackPDU(PackCString0(nsDependentCString(aRsp)), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::AtResponseCmd( + BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_AT_RESPONSE, + 1 + // AT Response code + 1)); // Error code + + nsresult rv = PackPDU(aResponseCode, + PackConversion(aErrorCode), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::ClccResponseCmd( + int aIndex, + BluetoothHandsfreeCallDirection aDir, BluetoothHandsfreeCallState aState, + BluetoothHandsfreeCallMode aMode, BluetoothHandsfreeCallMptyType aMpty, + const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + NS_ConvertUTF16toUTF8 number(aNumber); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLCC_RESPONSE, + 1 + // Call index + 1 + // Call direction + 1 + // Call state + 1 + // Call mode + 1 + // Call MPTY + 1 + // Address type + number.Length() + 1)); // Number string + \0 + + nsresult rv = PackPDU(PackConversion(aIndex), + aDir, aState, aMode, aMpty, aType, + PackCString0(number), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +nsresult +BluetoothDaemonHandsfreeModule::PhoneStateChangeCmd( + int aNumActive, int aNumHeld, BluetoothHandsfreeCallState aCallSetupState, + const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(NS_IsMainThread()); + + NS_ConvertUTF16toUTF8 number(aNumber); + + nsAutoPtr pdu( + new BluetoothDaemonPDU(SERVICE_ID, OPCODE_PHONE_STATE_CHANGE, + 1 + // # Active + 1 + // # Held + 1 + // Call state + 1 + // Address type + number.Length() + 1)); // Number string + \0 + + nsresult rv = PackPDU(PackConversion(aNumActive), + PackConversion(aNumHeld), + aCallSetupState, aType, + PackCString0(NS_ConvertUTF16toUTF8(aNumber)), *pdu); + if (NS_FAILED(rv)) { + return rv; + } + rv = Send(pdu, aRes); + if (NS_FAILED(rv)) { + return rv; + } + unused << pdu.forget(); + return NS_OK; +} + +// Responses +// + +void +BluetoothDaemonHandsfreeModule::ErrorRsp( + const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, BluetoothHandsfreeResultHandler* aRes) +{ + ErrorRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::OnError, UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::ConnectRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::Connect, UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::DisconnectRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::Disconnect, UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::ConnectAudioRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::ConnectAudio, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::DisconnectAudioRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::DisconnectAudio, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::StartVoiceRecognitionRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::StartVoiceRecognition, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::StopVoiceRecognitionRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::StopVoiceRecognition, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::VolumeControlRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::VolumeControl, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::DeviceStatusNotificationRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::DeviceStatusNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CopsResponseRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::CopsResponse, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CindResponseRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::CindResponse, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::FormattedAtResponseRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::FormattedAtResponse, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::AtResponseRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::AtResponse, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::ClccResponseRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::ClccResponse, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::PhoneStateChangeRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes) +{ + ResultRunnable::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::PhoneStateChange, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::HandleRsp( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + void* aUserData) +{ + static void (BluetoothDaemonHandsfreeModule::* const HandleRsp[])( + const BluetoothDaemonPDUHeader&, + BluetoothDaemonPDU&, + BluetoothHandsfreeResultHandler*) = { + INIT_ARRAY_AT(OPCODE_ERROR, + &BluetoothDaemonHandsfreeModule::ErrorRsp), + INIT_ARRAY_AT(OPCODE_CONNECT, + &BluetoothDaemonHandsfreeModule::ConnectRsp), + INIT_ARRAY_AT(OPCODE_DISCONNECT, + &BluetoothDaemonHandsfreeModule::DisconnectRsp), + INIT_ARRAY_AT(OPCODE_CONNECT_AUDIO, + &BluetoothDaemonHandsfreeModule::ConnectAudioRsp), + INIT_ARRAY_AT(OPCODE_DISCONNECT_AUDIO, + &BluetoothDaemonHandsfreeModule::DisconnectAudioRsp), + INIT_ARRAY_AT(OPCODE_START_VOICE_RECOGNITION, + &BluetoothDaemonHandsfreeModule::StartVoiceRecognitionRsp), + INIT_ARRAY_AT(OPCODE_STOP_VOICE_RECOGNITION, + &BluetoothDaemonHandsfreeModule::StopVoiceRecognitionRsp), + INIT_ARRAY_AT(OPCODE_VOLUME_CONTROL, + &BluetoothDaemonHandsfreeModule::VolumeControlRsp), + INIT_ARRAY_AT(OPCODE_DEVICE_STATUS_NOTIFICATION, + &BluetoothDaemonHandsfreeModule::DeviceStatusNotificationRsp), + INIT_ARRAY_AT(OPCODE_COPS_RESPONSE, + &BluetoothDaemonHandsfreeModule::CopsResponseRsp), + INIT_ARRAY_AT(OPCODE_CIND_RESPONSE, + &BluetoothDaemonHandsfreeModule::CindResponseRsp), + INIT_ARRAY_AT(OPCODE_FORMATTED_AT_RESPONSE, + &BluetoothDaemonHandsfreeModule::FormattedAtResponseRsp), + INIT_ARRAY_AT(OPCODE_AT_RESPONSE, + &BluetoothDaemonHandsfreeModule::AtResponseRsp), + INIT_ARRAY_AT(OPCODE_CLCC_RESPONSE, + &BluetoothDaemonHandsfreeModule::ClccResponseRsp), + INIT_ARRAY_AT(OPCODE_PHONE_STATE_CHANGE, + &BluetoothDaemonHandsfreeModule::PhoneStateChangeRsp) + }; + + MOZ_ASSERT(!NS_IsMainThread()); // I/O thread + + if (NS_WARN_IF(!(aHeader.mOpcode < MOZ_ARRAY_LENGTH(HandleRsp))) || + NS_WARN_IF(!HandleRsp[aHeader.mOpcode])) { + return; + } + + nsRefPtr res = + already_AddRefed( + static_cast(aUserData)); + + if (!res) { + return; // Return early if no result handler has been set for response + } + + (this->*(HandleRsp[aHeader.mOpcode]))(aHeader, aPDU, res); +} + +// Notifications +// + +// Returns the current notification handler to a notification runnable +class BluetoothDaemonHandsfreeModule::NotificationHandlerWrapper MOZ_FINAL +{ +public: + typedef BluetoothHandsfreeNotificationHandler ObjectType; + + static ObjectType* GetInstance() + { + MOZ_ASSERT(NS_IsMainThread()); + + return sNotificationHandler; + } +}; + +// Init operator class for ConnectionStateNotification +class BluetoothDaemonHandsfreeModule::ConnectionStateInitOp MOZ_FINAL + : private PDUInitOp +{ +public: + ConnectionStateInitOp(BluetoothDaemonPDU& aPDU) + : PDUInitOp(aPDU) + { } + + nsresult + operator () (BluetoothHandsfreeConnectionState& aArg1, + nsString& aArg2) const + { + BluetoothDaemonPDU& pdu = GetPDU(); + + /* Read state */ + nsresult rv = UnpackPDU(pdu, aArg1); + if (NS_FAILED(rv)) { + return rv; + } + + /* Read address */ + rv = UnpackPDU( + pdu, UnpackConversion(aArg2)); + if (NS_FAILED(rv)) { + return rv; + } + WarnAboutTrailingData(); + return NS_OK; + } +}; + +void +BluetoothDaemonHandsfreeModule::ConnectionStateNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + ConnectionStateNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::ConnectionStateNotification, + ConnectionStateInitOp(aPDU)); +} + +// Init operator class for AudioStateNotification +class BluetoothDaemonHandsfreeModule::AudioStateInitOp MOZ_FINAL + : private PDUInitOp +{ +public: + AudioStateInitOp(BluetoothDaemonPDU& aPDU) + : PDUInitOp(aPDU) + { } + + nsresult + operator () (BluetoothHandsfreeAudioState& aArg1, + nsString& aArg2) const + { + BluetoothDaemonPDU& pdu = GetPDU(); + + /* Read state */ + nsresult rv = UnpackPDU(pdu, aArg1); + if (NS_FAILED(rv)) { + return rv; + } + + /* Read address */ + rv = UnpackPDU( + pdu, UnpackConversion(aArg2)); + if (NS_FAILED(rv)) { + return rv; + } + WarnAboutTrailingData(); + return NS_OK; + } +}; + +void +BluetoothDaemonHandsfreeModule::AudioStateNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + AudioStateNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::AudioStateNotification, + AudioStateInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + VoiceRecognitionNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::AnswerCallNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + AnswerCallNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::AnswerCallNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::HangupCallNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + HangupCallNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::HangupCallNotification, + UnpackPDUInitOp(aPDU)); +} + +// Init operator class for VolumeNotification +class BluetoothDaemonHandsfreeModule::VolumeInitOp MOZ_FINAL + : private PDUInitOp +{ +public: + VolumeInitOp(BluetoothDaemonPDU& aPDU) + : PDUInitOp(aPDU) + { } + + nsresult + operator () (BluetoothHandsfreeVolumeType& aArg1, int& aArg2) const + { + BluetoothDaemonPDU& pdu = GetPDU(); + + /* Read volume type */ + nsresult rv = UnpackPDU(pdu, aArg1); + if (NS_FAILED(rv)) { + return rv; + } + + /* Read volume */ + rv = UnpackPDU(pdu, UnpackConversion(aArg2)); + if (NS_FAILED(rv)) { + return rv; + } + WarnAboutTrailingData(); + return NS_OK; + } +}; + +void +BluetoothDaemonHandsfreeModule::VolumeNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + VolumeNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::VolumeNotification, + VolumeInitOp(aPDU)); +} + +// Init operator class for DialCallNotification +class BluetoothDaemonHandsfreeModule::DialCallInitOp MOZ_FINAL + : private PDUInitOp +{ +public: + DialCallInitOp(BluetoothDaemonPDU& aPDU) + : PDUInitOp(aPDU) + { } + + nsresult + operator () (nsString& aArg1) const + { + /* Read number */ + nsresult rv = UnpackPDU(GetPDU(), UnpackString0(aArg1)); + if (NS_FAILED(rv)) { + return rv; + } + WarnAboutTrailingData(); + return NS_OK; + } +}; + +void +BluetoothDaemonHandsfreeModule::DialCallNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + DialCallNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::DialCallNotification, + DialCallInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::DtmfNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + DtmfNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::DtmfNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::NRECNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + NRECNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::NRECNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CallHoldNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + CallHoldNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::CallHoldNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CnumNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + CnumNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::CnumNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CindNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + CindNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::CindNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::CopsNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + CopsNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::CopsNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::ClccNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + ClccNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::ClccNotification, + UnpackPDUInitOp(aPDU)); +} + +// Init operator class for UnknownAtNotification +class BluetoothDaemonHandsfreeModule::UnknownAtInitOp MOZ_FINAL + : private PDUInitOp +{ +public: + UnknownAtInitOp(BluetoothDaemonPDU& aPDU) + : PDUInitOp(aPDU) + { } + + nsresult + operator () (nsCString& aArg1) const + { + /* Read string */ + nsresult rv = UnpackPDU(GetPDU(), UnpackCString0(aArg1)); + if (NS_FAILED(rv)) { + return rv; + } + WarnAboutTrailingData(); + return NS_OK; + } +}; + +void +BluetoothDaemonHandsfreeModule::UnknownAtNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + UnknownAtNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::UnknownAtNotification, + UnknownAtInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::KeyPressedNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU) +{ + KeyPressedNotification::Dispatch( + &BluetoothHandsfreeNotificationHandler::KeyPressedNotification, + UnpackPDUInitOp(aPDU)); +} + +void +BluetoothDaemonHandsfreeModule::HandleNtf( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + void* aUserData) +{ + static void (BluetoothDaemonHandsfreeModule::* const HandleNtf[])( + const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = { + INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::ConnectionStateNtf), + INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::AudioStateNtf), + INIT_ARRAY_AT(2, &BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf), + INIT_ARRAY_AT(3, &BluetoothDaemonHandsfreeModule::AnswerCallNtf), + INIT_ARRAY_AT(4, &BluetoothDaemonHandsfreeModule::HangupCallNtf), + INIT_ARRAY_AT(5, &BluetoothDaemonHandsfreeModule::VolumeNtf), + INIT_ARRAY_AT(6, &BluetoothDaemonHandsfreeModule::DialCallNtf), + INIT_ARRAY_AT(7, &BluetoothDaemonHandsfreeModule::DtmfNtf), + INIT_ARRAY_AT(8, &BluetoothDaemonHandsfreeModule::NRECNtf), + INIT_ARRAY_AT(9, &BluetoothDaemonHandsfreeModule::CallHoldNtf), + INIT_ARRAY_AT(10, &BluetoothDaemonHandsfreeModule::CnumNtf), + INIT_ARRAY_AT(11, &BluetoothDaemonHandsfreeModule::CindNtf), + INIT_ARRAY_AT(12, &BluetoothDaemonHandsfreeModule::CopsNtf), + INIT_ARRAY_AT(13, &BluetoothDaemonHandsfreeModule::ClccNtf), + INIT_ARRAY_AT(14, &BluetoothDaemonHandsfreeModule::UnknownAtNtf), + INIT_ARRAY_AT(15, &BluetoothDaemonHandsfreeModule::KeyPressedNtf) + }; + + MOZ_ASSERT(!NS_IsMainThread()); + + uint8_t index = aHeader.mOpcode - 0x81; + + if (NS_WARN_IF(!(index < MOZ_ARRAY_LENGTH(HandleNtf))) || + NS_WARN_IF(!HandleNtf[index])) { + return; + } + + (this->*(HandleNtf[index]))(aHeader, aPDU); +} + +END_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h new file mode 100644 index 000000000000..2bd10eb48001 --- /dev/null +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h @@ -0,0 +1,328 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_bluetooth_bluetoothdaemonhandsfreeinterface_h +#define mozilla_dom_bluetooth_bluetoothdaemonhandsfreeinterface_h + +#include "BluetoothDaemonHelpers.h" +#include "BluetoothInterface.h" +#include "BluetoothInterfaceHelpers.h" + +BEGIN_BLUETOOTH_NAMESPACE + +class BluetoothSetupResultHandler; + +class BluetoothDaemonHandsfreeModule +{ +public: + enum { + SERVICE_ID = 0x05 + }; + + enum { + OPCODE_ERROR = 0x00, + OPCODE_CONNECT = 0x01, + OPCODE_DISCONNECT = 0x02, + OPCODE_CONNECT_AUDIO = 0x03, + OPCODE_DISCONNECT_AUDIO = 0x04, + OPCODE_START_VOICE_RECOGNITION = 0x05, + OPCODE_STOP_VOICE_RECOGNITION =0x06, + OPCODE_VOLUME_CONTROL = 0x07, + OPCODE_DEVICE_STATUS_NOTIFICATION = 0x08, + OPCODE_COPS_RESPONSE = 0x09, + OPCODE_CIND_RESPONSE = 0x0a, + OPCODE_FORMATTED_AT_RESPONSE = 0x0b, + OPCODE_AT_RESPONSE = 0x0c, + OPCODE_CLCC_RESPONSE = 0x0d, + OPCODE_PHONE_STATE_CHANGE = 0x0e + }; + + virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0; + + virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode, + BluetoothSetupResultHandler* aRes) = 0; + + virtual nsresult UnregisterModule(uint8_t aId, + BluetoothSetupResultHandler* aRes) = 0; + + void SetNotificationHandler( + BluetoothHandsfreeNotificationHandler* aNotificationHandler); + + // + // Commands + // + + nsresult ConnectCmd(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + nsresult DisconnectCmd(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + nsresult ConnectAudioCmd(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + nsresult DisconnectAudioCmd(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + + /* Voice Recognition */ + + nsresult StartVoiceRecognitionCmd(BluetoothHandsfreeResultHandler* aRes); + nsresult StopVoiceRecognitionCmd(BluetoothHandsfreeResultHandler* aRes); + + /* Volume */ + + nsresult VolumeControlCmd(BluetoothHandsfreeVolumeType aType, int aVolume, + BluetoothHandsfreeResultHandler* aRes); + + /* Device status */ + + nsresult DeviceStatusNotificationCmd( + BluetoothHandsfreeNetworkState aNtkState, + BluetoothHandsfreeServiceType aSvcType, + int aSignal, int aBattChg, + BluetoothHandsfreeResultHandler* aRes); + + /* Responses */ + + nsresult CopsResponseCmd(const char* aCops, + BluetoothHandsfreeResultHandler* aRes); + nsresult CindResponseCmd(int aSvc, int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + int aSignal, int aRoam, int aBattChg, + BluetoothHandsfreeResultHandler* aRes); + nsresult FormattedAtResponseCmd(const char* aRsp, + BluetoothHandsfreeResultHandler* aRes); + nsresult AtResponseCmd(BluetoothHandsfreeAtResponse aResponseCode, + int aErrorCode, + BluetoothHandsfreeResultHandler* aRes); + nsresult ClccResponseCmd(int aIndex, BluetoothHandsfreeCallDirection aDir, + BluetoothHandsfreeCallState aState, + BluetoothHandsfreeCallMode aMode, + BluetoothHandsfreeCallMptyType aMpty, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes); + + /* Phone State */ + + nsresult PhoneStateChangeCmd(int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes); + +protected: + nsresult Send(BluetoothDaemonPDU* aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void HandleSvc(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, void* aUserData); + + // + // Responses + // + + typedef BluetoothResultRunnable0 + ResultRunnable; + + typedef BluetoothResultRunnable1 + ErrorRunnable; + + void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void ConnectRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void DisconnectRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void ConnectAudioRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void DisconnectAudioRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void StartVoiceRecognitionRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void StopVoiceRecognitionRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void VolumeControlRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void DeviceStatusNotificationRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void CopsResponseRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void CindResponseRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void FormattedAtResponseRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void AtResponseRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void ClccResponseRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void PhoneStateChangeRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + BluetoothHandsfreeResultHandler* aRes); + + void HandleRsp(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + void* aUserData); + + // + // Notifications + // + + class NotificationHandlerWrapper; + + typedef BluetoothNotificationRunnable2 + ConnectionStateNotification; + + typedef BluetoothNotificationRunnable2 + AudioStateNotification; + + typedef BluetoothNotificationRunnable1 + VoiceRecognitionNotification; + + typedef BluetoothNotificationRunnable0 + AnswerCallNotification; + + typedef BluetoothNotificationRunnable0 + HangupCallNotification; + + typedef BluetoothNotificationRunnable2 + VolumeNotification; + + typedef BluetoothNotificationRunnable1 + DialCallNotification; + + typedef BluetoothNotificationRunnable1 + DtmfNotification; + + typedef BluetoothNotificationRunnable1 + NRECNotification; + + typedef BluetoothNotificationRunnable1 + CallHoldNotification; + + typedef BluetoothNotificationRunnable0 + CnumNotification; + + typedef BluetoothNotificationRunnable0 + CindNotification; + + typedef BluetoothNotificationRunnable0 + CopsNotification; + + typedef BluetoothNotificationRunnable0 + ClccNotification; + + typedef BluetoothNotificationRunnable1 + UnknownAtNotification; + + typedef BluetoothNotificationRunnable0 + KeyPressedNotification; + + class AudioStateInitOp; + class ConnectionStateInitOp; + class DialCallInitOp; + class VolumeInitOp; + class UnknownAtInitOp; + + void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void VoiceRecognitionNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void AnswerCallNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void HangupCallNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void VolumeNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void DialCallNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void DtmfNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void NRECNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void CallHoldNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void CnumNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void CindNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void CopsNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void ClccNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void UnknownAtNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void KeyPressedNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU); + + void HandleNtf(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, + void* aUserData); + + static BluetoothHandsfreeNotificationHandler* sNotificationHandler; +}; + +END_BLUETOOTH_NAMESPACE + +#endif diff --git a/dom/bluetooth/moz.build b/dom/bluetooth/moz.build index b053b1e9fe4d..585be1865c67 100644 --- a/dom/bluetooth/moz.build +++ b/dom/bluetooth/moz.build @@ -48,6 +48,7 @@ if CONFIG['MOZ_B2G_BT']: 'bluedroid/BluetoothA2dpHALInterface.cpp', 'bluedroid/BluetoothA2dpManager.cpp', 'bluedroid/BluetoothAvrcpHALInterface.cpp', + 'bluedroid/BluetoothDaemonHandsfreeInterface.cpp', 'bluedroid/BluetoothDaemonHelpers.cpp', 'bluedroid/BluetoothDaemonInterface.cpp', 'bluedroid/BluetoothDaemonSetupInterface.cpp', From 4f25f4670c62916cada842a918bb90a1443c39d0 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Nov 2014 09:02:42 +0100 Subject: [PATCH 41/88] Bug 1091588: Add Handsfree interface for Bluetooth daemon, r=shuang --- .../BluetoothDaemonHandsfreeInterface.cpp | 284 ++++++++++++++++++ .../BluetoothDaemonHandsfreeInterface.h | 84 ++++++ 2 files changed, 368 insertions(+) diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp index 8e8889cc0060..506c776c11d1 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp @@ -5,6 +5,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "BluetoothDaemonHandsfreeInterface.h" +#include "BluetoothDaemonSetupInterface.h" #include "mozilla/unused.h" BEGIN_BLUETOOTH_NAMESPACE @@ -953,4 +954,287 @@ BluetoothDaemonHandsfreeModule::HandleNtf( (this->*(HandleNtf[index]))(aHeader, aPDU); } +// +// Handsfree interface +// + +BluetoothDaemonHandsfreeInterface::BluetoothDaemonHandsfreeInterface( + BluetoothDaemonHandsfreeModule* aModule) + : mModule(aModule) +{ } + +BluetoothDaemonHandsfreeInterface::~BluetoothDaemonHandsfreeInterface() +{ } + +class BluetoothDaemonHandsfreeInterface::InitResultHandler MOZ_FINAL + : public BluetoothSetupResultHandler +{ +public: + InitResultHandler(BluetoothHandsfreeResultHandler* aRes) + : mRes(aRes) + { + MOZ_ASSERT(mRes); + } + + void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE + { + MOZ_ASSERT(NS_IsMainThread()); + + mRes->OnError(aStatus); + } + + void RegisterModule() MOZ_OVERRIDE + { + MOZ_ASSERT(NS_IsMainThread()); + + mRes->Init(); + } + +private: + nsRefPtr mRes; +}; + +void +BluetoothDaemonHandsfreeInterface::Init( + BluetoothHandsfreeNotificationHandler* aNotificationHandler, + BluetoothHandsfreeResultHandler* aRes) +{ + // Set notification handler _before_ registering the module. It could + // happen that we receive notifications, before the result handler runs. + mModule->SetNotificationHandler(aNotificationHandler); + + InitResultHandler* res; + + if (aRes) { + res = new InitResultHandler(aRes); + } else { + // We don't need a result handler if the caller is not interested. + res = nullptr; + } + + nsresult rv = mModule->RegisterModule( + BluetoothDaemonHandsfreeModule::SERVICE_ID, MODE_NARROWBAND_SPEECH, res); + + if (NS_FAILED(rv) && aRes) { + DispatchError(aRes, STATUS_FAIL); + } +} + +class BluetoothDaemonHandsfreeInterface::CleanupResultHandler MOZ_FINAL + : public BluetoothSetupResultHandler +{ +public: + CleanupResultHandler(BluetoothDaemonHandsfreeModule* aModule, + BluetoothHandsfreeResultHandler* aRes) + : mModule(aModule) + , mRes(aRes) + { + MOZ_ASSERT(mModule); + } + + void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE + { + MOZ_ASSERT(NS_IsMainThread()); + + if (mRes) { + mRes->OnError(aStatus); + } + } + + void UnregisterModule() MOZ_OVERRIDE + { + MOZ_ASSERT(NS_IsMainThread()); + + // Clear notification handler _after_ module has been + // unregistered. While unregistering the module, we might + // still receive notifications. + mModule->SetNotificationHandler(nullptr); + + if (mRes) { + mRes->Cleanup(); + } + } + +private: + BluetoothDaemonHandsfreeModule* mModule; + nsRefPtr mRes; +}; + +void +BluetoothDaemonHandsfreeInterface::Cleanup( + BluetoothHandsfreeResultHandler* aRes) +{ + mModule->UnregisterModule(BluetoothDaemonHandsfreeModule::SERVICE_ID, + new CleanupResultHandler(mModule, aRes)); +} + +/* Connect / Disconnect */ + +void +BluetoothDaemonHandsfreeInterface::Connect( + const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->ConnectCmd(aBdAddr, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::Disconnect( + const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->DisconnectCmd(aBdAddr, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::ConnectAudio( + const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->ConnectAudioCmd(aBdAddr, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::DisconnectAudio( + const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->DisconnectAudioCmd(aBdAddr, aRes); +} + +/* Voice Recognition */ + +void +BluetoothDaemonHandsfreeInterface::StartVoiceRecognition( + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->StartVoiceRecognitionCmd(aRes); +} + +void +BluetoothDaemonHandsfreeInterface::StopVoiceRecognition( + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->StopVoiceRecognitionCmd(aRes); +} + +/* Volume */ + +void +BluetoothDaemonHandsfreeInterface::VolumeControl( + BluetoothHandsfreeVolumeType aType, int aVolume, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->VolumeControlCmd(aType, aVolume, aRes); +} + +/* Device status */ + +void +BluetoothDaemonHandsfreeInterface::DeviceStatusNotification( + BluetoothHandsfreeNetworkState aNtkState, + BluetoothHandsfreeServiceType aSvcType, int aSignal, int aBattChg, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->DeviceStatusNotificationCmd(aNtkState, aSvcType, aSignal, + aBattChg, aRes); +} + +/* Responses */ + +void +BluetoothDaemonHandsfreeInterface::CopsResponse( + const char* aCops, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->CopsResponseCmd(aCops, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::CindResponse( + int aSvc, int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + int aSignal, int aRoam, int aBattChg, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->CindResponseCmd(aSvc, aNumActive, aNumHeld, aCallSetupState, + aSignal, aRoam, aBattChg, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::FormattedAtResponse( + const char* aRsp, BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->FormattedAtResponseCmd(aRsp, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::AtResponse( + BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->AtResponseCmd(aResponseCode, aErrorCode, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::ClccResponse( + int aIndex, BluetoothHandsfreeCallDirection aDir, + BluetoothHandsfreeCallState aState, + BluetoothHandsfreeCallMode aMode, + BluetoothHandsfreeCallMptyType aMpty, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->ClccResponseCmd(aIndex, aDir, aState, aMode, aMpty, aNumber, + aType, aRes); +} + +/* Phone State */ + +void +BluetoothDaemonHandsfreeInterface::PhoneStateChange( + int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes) +{ + MOZ_ASSERT(mModule); + + mModule->PhoneStateChangeCmd(aNumActive, aNumHeld, aCallSetupState, aNumber, + aType, aRes); +} + +void +BluetoothDaemonHandsfreeInterface::DispatchError( + BluetoothHandsfreeResultHandler* aRes, BluetoothStatus aStatus) +{ + BluetoothResultRunnable1::Dispatch( + aRes, &BluetoothHandsfreeResultHandler::OnError, + ConstantInitOp1(aStatus)); +} + END_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h index 2bd10eb48001..71a233d7b237 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h @@ -323,6 +323,90 @@ protected: static BluetoothHandsfreeNotificationHandler* sNotificationHandler; }; +class BluetoothDaemonHandsfreeInterface MOZ_FINAL + : public BluetoothHandsfreeInterface +{ + class CleanupResultHandler; + class InitResultHandler; + + enum { + MODE_HEADSET = 0x00, + MODE_NARROWBAND_SPEECH = 0x01, + MODE_NARRAWBAND_WIDEBAND_SPEECH = 0x02 + }; + +public: + BluetoothDaemonHandsfreeInterface(BluetoothDaemonHandsfreeModule* aModule); + ~BluetoothDaemonHandsfreeInterface(); + + void Init( + BluetoothHandsfreeNotificationHandler* aNotificationHandler, + BluetoothHandsfreeResultHandler* aRes); + void Cleanup(BluetoothHandsfreeResultHandler* aRes); + + /* Connect / Disconnect */ + + void Connect(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + void Disconnect(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + void ConnectAudio(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + void DisconnectAudio(const nsAString& aBdAddr, + BluetoothHandsfreeResultHandler* aRes); + + /* Voice Recognition */ + + void StartVoiceRecognition(BluetoothHandsfreeResultHandler* aRes); + void StopVoiceRecognition(BluetoothHandsfreeResultHandler* aRes); + + /* Volume */ + + void VolumeControl(BluetoothHandsfreeVolumeType aType, int aVolume, + BluetoothHandsfreeResultHandler* aRes); + + /* Device status */ + + void DeviceStatusNotification(BluetoothHandsfreeNetworkState aNtkState, + BluetoothHandsfreeServiceType aSvcType, + int aSignal, int aBattChg, + BluetoothHandsfreeResultHandler* aRes); + + /* Responses */ + + void CopsResponse(const char* aCops, + BluetoothHandsfreeResultHandler* aRes); + void CindResponse(int aSvc, int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + int aSignal, int aRoam, int aBattChg, + BluetoothHandsfreeResultHandler* aRes); + void FormattedAtResponse(const char* aRsp, + BluetoothHandsfreeResultHandler* aRes); + void AtResponse(BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode, + BluetoothHandsfreeResultHandler* aRes); + void ClccResponse(int aIndex, BluetoothHandsfreeCallDirection aDir, + BluetoothHandsfreeCallState aState, + BluetoothHandsfreeCallMode aMode, + BluetoothHandsfreeCallMptyType aMpty, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes); + + /* Phone State */ + + void PhoneStateChange(int aNumActive, int aNumHeld, + BluetoothHandsfreeCallState aCallSetupState, + const nsAString& aNumber, + BluetoothHandsfreeCallAddressType aType, + BluetoothHandsfreeResultHandler* aRes); + +private: + void DispatchError(BluetoothHandsfreeResultHandler* aRes, + BluetoothStatus aStatus); + + BluetoothDaemonHandsfreeModule* mModule; +}; + END_BLUETOOTH_NAMESPACE #endif From d0139ae5857ca1264a884199975786b4982edae3 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 24 Nov 2014 09:02:52 +0100 Subject: [PATCH 42/88] Bug 1091588: Support Handsfree profile when using Bluetooth daemon, r=shuang --- .../bluedroid/BluetoothDaemonInterface.cpp | 50 ++++++++++++++++--- .../bluedroid/BluetoothDaemonInterface.h | 2 + 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp index dd9a9b197077..a0b5d13137ae 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp @@ -5,6 +5,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "BluetoothDaemonInterface.h" +#include "BluetoothDaemonHandsfreeInterface.h" #include "BluetoothDaemonHelpers.h" #include "BluetoothDaemonSetupInterface.h" #include "BluetoothDaemonSocketInterface.h" @@ -15,10 +16,6 @@ using namespace mozilla::ipc; BEGIN_BLUETOOTH_NAMESPACE -template -struct interface_traits -{ }; - // // Protocol initialization and setup // @@ -1363,10 +1360,17 @@ class BluetoothDaemonProtocol MOZ_FINAL , public BluetoothDaemonSetupModule , public BluetoothDaemonCoreModule , public BluetoothDaemonSocketModule + , public BluetoothDaemonHandsfreeModule { public: BluetoothDaemonProtocol(BluetoothDaemonConnection* aConnection); + nsresult RegisterModule(uint8_t aId, uint8_t aMode, + BluetoothSetupResultHandler* aRes) MOZ_OVERRIDE; + + nsresult UnregisterModule(uint8_t aId, + BluetoothSetupResultHandler* aRes) MOZ_OVERRIDE; + // Outgoing PDUs // @@ -1388,6 +1392,8 @@ private: BluetoothDaemonPDU& aPDU, void* aUserData); void HandleSocketSvc(const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, void* aUserData); + void HandleHandsfreeSvc(const BluetoothDaemonPDUHeader& aHeader, + BluetoothDaemonPDU& aPDU, void* aUserData); BluetoothDaemonConnection* mConnection; nsTArray mUserDataQ; @@ -1400,6 +1406,20 @@ BluetoothDaemonProtocol::BluetoothDaemonProtocol( MOZ_ASSERT(mConnection); } +nsresult +BluetoothDaemonProtocol::RegisterModule(uint8_t aId, uint8_t aMode, + BluetoothSetupResultHandler* aRes) +{ + return BluetoothDaemonSetupModule::RegisterModuleCmd(aId, aMode, aRes); +} + +nsresult +BluetoothDaemonProtocol::UnregisterModule(uint8_t aId, + BluetoothSetupResultHandler* aRes) +{ + return BluetoothDaemonSetupModule::UnregisterModuleCmd(aId, aRes); +} + nsresult BluetoothDaemonProtocol::Send(BluetoothDaemonPDU* aPDU, void* aUserData) { @@ -1434,6 +1454,14 @@ BluetoothDaemonProtocol::HandleSocketSvc( BluetoothDaemonSocketModule::HandleSvc(aHeader, aPDU, aUserData); } +void +BluetoothDaemonProtocol::HandleHandsfreeSvc( + const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU, + void* aUserData) +{ + BluetoothDaemonHandsfreeModule::HandleSvc(aHeader, aPDU, aUserData); +} + void BluetoothDaemonProtocol::Handle(BluetoothDaemonPDU& aPDU) { @@ -1441,7 +1469,11 @@ BluetoothDaemonProtocol::Handle(BluetoothDaemonPDU& aPDU) const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = { INIT_ARRAY_AT(0x00, &BluetoothDaemonProtocol::HandleSetupSvc), INIT_ARRAY_AT(0x01, &BluetoothDaemonProtocol::HandleCoreSvc), - INIT_ARRAY_AT(0x02, &BluetoothDaemonProtocol::HandleSocketSvc) + INIT_ARRAY_AT(0x02, &BluetoothDaemonProtocol::HandleSocketSvc), + INIT_ARRAY_AT(0x03, nullptr), // HID host + INIT_ARRAY_AT(0x04, nullptr), // PAN + INIT_ARRAY_AT(BluetoothDaemonHandsfreeModule::SERVICE_ID, + &BluetoothDaemonProtocol::HandleHandsfreeSvc) }; BluetoothDaemonPDUHeader header; @@ -2009,7 +2041,13 @@ BluetoothDaemonInterface::GetBluetoothSocketInterface() BluetoothHandsfreeInterface* BluetoothDaemonInterface::GetBluetoothHandsfreeInterface() { - return nullptr; + if (mHandsfreeInterface) { + return mHandsfreeInterface; + } + + mHandsfreeInterface = new BluetoothDaemonHandsfreeInterface(mProtocol); + + return mHandsfreeInterface; } BluetoothA2dpInterface* diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h index e08dc2bd0645..4c621b47d1b1 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h +++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h @@ -12,6 +12,7 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothDaemonChannel; +class BluetoothDaemonHandsfreeInterface; class BluetoothDaemonProtocol; class BluetoothDaemonSocketInterface; @@ -125,6 +126,7 @@ private: nsTArray > mResultHandlerQ; nsAutoPtr mSocketInterface; + nsAutoPtr mHandsfreeInterface; }; END_BLUETOOTH_NAMESPACE From 624e45003cdb58a48b6841d71edc9f8f3283aa9d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 00:08:55 -0800 Subject: [PATCH 43/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/80e3e5fffa15 Author: Arthur Chen Desc: Merge pull request #26321 from crh0716/1058781 Bug 1058781 - Fix rtl layout r=eragonj ======== https://hg.mozilla.org/integration/gaia-central/rev/8823aad7f16e Author: Arthur Chen Desc: Bug 1058781 - Fix rtl layout in app permission panel and homescreen panel --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index f4591cfd9a47..0c4f01804204 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "b58f8db1d1f454599353659923a9f9ae1053ab35", + "revision": "80e3e5fffa1587ce223fd31625aee4ab9ebd28b3", "repo_path": "integration/gaia-central" } From 328d7f6275cf44063ed80b11bc6fe4f477b1895c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 00:09:10 -0800 Subject: [PATCH 44/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 2499dd376954..ec8a953f944b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 2a534a0a3c60..00033b05d87b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index c4abffe79ccb..8a4fbd5b630b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 62515de293b6..e182a03bf01f 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 2a534a0a3c60..00033b05d87b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 6c84c92fa3e6..f8678a94effc 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 64f4701240a9..db70494a78c1 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 0efa72af4910..d9dde2865695 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index aa448636b592..e12c25437927 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index b7bc91314487..107d1bfd799a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 98d49eded2f2..7b066114d332 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 19f6d563c5e4b97e201c7037313093bf39bbba98 Mon Sep 17 00:00:00 2001 From: "Patrick Wang (Chih-Kai Wang)" Date: Mon, 24 Nov 2014 16:36:35 +0800 Subject: [PATCH 45/88] Bug 970307: fix non-unified build bustage. r=me --- xpcom/threads/nsTimerImpl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index 7f1d6046a831..f601152bb425 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -13,6 +13,9 @@ #include "pratom.h" #include "GeckoProfiler.h" #include "mozilla/Atomics.h" +#ifdef MOZ_NUWA_PROCESS +#include "ipc/Nuwa.h" +#endif using mozilla::Atomic; using mozilla::TimeDuration; From 3bf4e144d9b267f8f6b34c19a2f626e008521dc8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 00:46:58 -0800 Subject: [PATCH 46/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/ae606dcb11bd Author: Germán Toro del Valle Desc: Merge pull request #26055 from gtorodelvalle/callscreen-bug-1094878-on-hold-memory Bug 1094878 - Call is not on hold anymore after hanging up another call even though the icon says it is ======== https://hg.mozilla.org/integration/gaia-central/rev/86cc63d5aa09 Author: German Toro del Valle Desc: Bug 1094878 - Call is not on hold anymore after hanging up another call even though the icon says it is --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0c4f01804204..89e75264b845 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "80e3e5fffa1587ce223fd31625aee4ab9ebd28b3", + "revision": "ae606dcb11bde076bdfc07a9faf3f95982e46ba7", "repo_path": "integration/gaia-central" } From 323accdbc73c2c5b0a7e660c0652f9b5d3579114 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 00:57:02 -0800 Subject: [PATCH 47/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ec8a953f944b..641ddaf32a7b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 00033b05d87b..c5e3b8d8b3fe 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8a4fbd5b630b..3f70d49cbf79 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index e182a03bf01f..8ee558cbc6c1 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 00033b05d87b..c5e3b8d8b3fe 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index f8678a94effc..4720e809f171 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index db70494a78c1..30e33bf33bf1 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d9dde2865695..2dc24080561b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e12c25437927..e2ed00c1c427 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 107d1bfd799a..3553a598ac58 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7b066114d332..d26bf32c0cac 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ba43063683f41a0aed35f2d5a06dac0c478ea1ad Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 01:16:58 -0800 Subject: [PATCH 48/88] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/228e6da2c8b5 Author: Carsten Book Desc: Merge pull request #26181 from mancas/bug1100250 Bug 1100250 - [Follow-up] Keyboard is hidden when user try to write in a.... r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/fb4b75f9f28a Author: mancas Desc: Bug 1100250 - [Follow-up] Keyboard is hidden when user try to write in a STK message or the device is locked.r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/1632d5c564f1 Author: Carsten Book Desc: Merge pull request #26147 from mancas/bug1097296 Bug 1097296 - [Window Management] Battery, Signal and time on the status.... r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/136656a1695f Author: Manuel Casas Desc: Bug 1097296 - [Window Management] Battery, Signal and time on the status bar will appear behind download update overlay. r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/829337cc6011 Author: Arthur Chen Desc: Merge pull request #26393 from crh0716/1102160 Bug 1102160 - Switch to use gaia header button r=eragonj ======== https://hg.mozilla.org/integration/gaia-central/rev/4f699f5f2131 Author: Arthur Chen Desc: Bug 1102160 - Switch to use gaia header button --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 89e75264b845..7be656010ac7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ae606dcb11bde076bdfc07a9faf3f95982e46ba7", + "revision": "228e6da2c8b5938075c97af8baa6ff5bd06134fd", "repo_path": "integration/gaia-central" } From f5a544825ff94994c0d7e4215340c01db5417b3d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 01:26:33 -0800 Subject: [PATCH 49/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 641ddaf32a7b..ffc9c5106e9b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c5e3b8d8b3fe..0949c391717c 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 3f70d49cbf79..3886ec93ffdd 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 8ee558cbc6c1..95bcf0c6e880 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c5e3b8d8b3fe..0949c391717c 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 4720e809f171..910a72b993e3 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 30e33bf33bf1..72c3aec135ab 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2dc24080561b..e6b85b036762 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e2ed00c1c427..fbc9d9a2644e 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 3553a598ac58..4c22217d4c84 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d26bf32c0cac..ad5daff446aa 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 803c3a37a61743be0bd67d5d692002daf10abb4a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 01:51:53 -0800 Subject: [PATCH 50/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c34601037649 Author: EragonJ (E.J.) Desc: Merge pull request #23056 from EragonJ/bug-1055897 Bug 1055897 - [settings] add settings panel support ======== https://hg.mozilla.org/integration/gaia-central/rev/b2ccbe69b04f Author: EragonJ Desc: Bug 1055897 - [settings] add settings dialog support --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7be656010ac7..775c82ef6a36 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "228e6da2c8b5938075c97af8baa6ff5bd06134fd", + "revision": "c34601037649c39aa233c245cb67f15e85382b41", "repo_path": "integration/gaia-central" } From 57fa7bd4cbe252cbcd146bb810f6eb81b89a194a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 01:56:57 -0800 Subject: [PATCH 51/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ffc9c5106e9b..3d4876d8ca7b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 0949c391717c..28d74ec5eb55 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 3886ec93ffdd..819ac90f2558 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 95bcf0c6e880..b5ccdb56fcde 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 0949c391717c..28d74ec5eb55 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 910a72b993e3..b3c32db6811a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 72c3aec135ab..656217de930c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e6b85b036762..9cd7a5c5e61d 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index fbc9d9a2644e..87821d6f3b96 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 4c22217d4c84..a3d4e6633f10 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index ad5daff446aa..a4fb6c707cbd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From dba506b8b6f0c5d56540c60471f10a11ea4aebdd Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:06:53 -0800 Subject: [PATCH 52/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d6417001bd48 Author: Timothy Guan-tin Chien Desc: Merge pull request #26397 from timdream/keyboard-audio-api Bug 1103574 - Use Web Audio API to play keyboard clicker sounds, r=mnjul ======== https://hg.mozilla.org/integration/gaia-central/rev/ca754ced6002 Author: Timothy Guan-tin Chien Desc: Bug 1103574 - Use Web Audio API to play keyboard clicker sounds --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 775c82ef6a36..46fab2dadc0e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c34601037649c39aa233c245cb67f15e85382b41", + "revision": "d6417001bd48498600328defb79d24f8a4818efc", "repo_path": "integration/gaia-central" } From 00c04e16fea241b1881ca96efeaf5b1287257647 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:11:56 -0800 Subject: [PATCH 53/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 3d4876d8ca7b..7dac0b664f18 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 28d74ec5eb55..b4ee75434c19 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 819ac90f2558..1aaf0d68107e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b5ccdb56fcde..b805d86d32e2 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 28d74ec5eb55..b4ee75434c19 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index b3c32db6811a..ab59067e38d5 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 656217de930c..aaa6f5199b26 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 9cd7a5c5e61d..5e6eb65024ce 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 87821d6f3b96..7681a140fe51 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a3d4e6633f10..6799baa35e19 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a4fb6c707cbd..62d855e22d94 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From dba0b0816c9a4addddbff20550550551d657d047 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:21:53 -0800 Subject: [PATCH 54/88] Bumping gaia.json for 5 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/30d3f3f914b1 Author: viorelaioia Desc: Merge pull request #23036 from viorelaioia/bug-968741 Bug 968741 - Update test_create_new_alarm to wait for the alarm to trigg... ======== https://hg.mozilla.org/integration/gaia-central/rev/c37b7e3f7a7a Author: Viorela Ioia Desc: Bug 968741 - Update test_create_new_alarm to wait for the alarm to trigger ======== https://hg.mozilla.org/integration/gaia-central/rev/ee7857419f4a Author: BavarianTomcat Desc: Revert "Bug 1101942 - add search path found in nightly ftp package" for bustage This reverts commit a5f473dd54ea32d040eee99d2d7fa4d72bb02cf5. ======== https://hg.mozilla.org/integration/gaia-central/rev/45b817d55d50 Author: EragonJ (E.J.) Desc: Merge pull request #26398 from EragonJ/bug-1102158 Bug 1102158 - [Settings][RTL] Internet sharing security text format is i... ======== https://hg.mozilla.org/integration/gaia-central/rev/46f2c3b7dafd Author: EragonJ Desc: Bug 1102158 - [Settings][RTL] Internet sharing security text format is incorrect --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 46fab2dadc0e..a5c010b9ffb3 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d6417001bd48498600328defb79d24f8a4818efc", + "revision": "30d3f3f914b1e679afa7bda9db967c92c874698e", "repo_path": "integration/gaia-central" } From a1b49939127d075640d671ea81f15640eab04d4c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:26:56 -0800 Subject: [PATCH 55/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 7dac0b664f18..8854ad704f29 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index b4ee75434c19..d78db2d2d61a 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1aaf0d68107e..5f67671c4642 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b805d86d32e2..dd39193bed95 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index b4ee75434c19..d78db2d2d61a 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index ab59067e38d5..50cec29c3f13 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index aaa6f5199b26..db927564611e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 5e6eb65024ce..44aa4018e817 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 7681a140fe51..9899ad8a50ff 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6799baa35e19..8e095ecc5990 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 62d855e22d94..c1a8acf5d7bd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From a5bd2949f1d40d5727b4002bb1ccc45e5e088aaa Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:36:54 -0800 Subject: [PATCH 56/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/27b42f98665c Author: EragonJ (E.J.) Desc: Merge pull request #25869 from EragonJ/bug-1073520 Bug 1073520 - Loading Wifi panel is ridiculously slow ======== https://hg.mozilla.org/integration/gaia-central/rev/c42813421078 Author: EragonJ Desc: Bug 1073520 - Loading Wifi panel is ridiculously slow --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index a5c010b9ffb3..dc3641c604c6 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "30d3f3f914b1e679afa7bda9db967c92c874698e", + "revision": "27b42f98665ce4fe54f098aae9dbb6baf79c8be0", "repo_path": "integration/gaia-central" } From deb56382754b21408b8ca647a78470e0b0a5ce1d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:41:57 -0800 Subject: [PATCH 57/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 8854ad704f29..2c1c04eabbe4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d78db2d2d61a..5d12176c1440 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 5f67671c4642..247395c12838 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index dd39193bed95..1771bd21b965 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d78db2d2d61a..5d12176c1440 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 50cec29c3f13..e37301f738c7 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index db927564611e..2886084044c8 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 44aa4018e817..b96a9d800807 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9899ad8a50ff..5f51902a8f57 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 8e095ecc5990..7e01480dc6ff 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index c1a8acf5d7bd..2b1d427b1f88 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From c3948fcc1e1a9ea0981d88d7cddbd524685af3cf Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:51:54 -0800 Subject: [PATCH 58/88] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7022736d7c1b Author: Alive.Kuo Desc: Merge pull request #26277 from alivedise/bugzilla/1100406/prevent-default-on-mousedown-of-sim-lock-button Bug 1100406 - Prevent default to keep keyboard open and get click event, r=rlu ======== https://hg.mozilla.org/integration/gaia-central/rev/a778ee56e2d7 Author: Alive Kuo Desc: Bug 1100406 - Prevent default to keep keyboard open and get click event ======== https://hg.mozilla.org/integration/gaia-central/rev/0ef9dacbabc8 Author: Florin Strugariu Desc: Merge pull request #26400 from viorelaioia/bug_1103910 Bug 1103910 - Xfail test_settings_bluetooth.py because of Bug 1102885 ======== https://hg.mozilla.org/integration/gaia-central/rev/f3238cdc3556 Author: Viorela Ioia Desc: Bug 1103910 - Xfail test_settings_bluetooth.py because of Bug 1102885 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index dc3641c604c6..c8bee4d92847 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "27b42f98665ce4fe54f098aae9dbb6baf79c8be0", + "revision": "7022736d7c1b7b83a20f55c05a262b9475fd114f", "repo_path": "integration/gaia-central" } From e6707726e6173af9e96dc64dabf994ae8fa482fc Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 02:56:57 -0800 Subject: [PATCH 59/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 2c1c04eabbe4..ee4b64e15531 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5d12176c1440..209182d8a760 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 247395c12838..4b8bdf0c6ac6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 1771bd21b965..34a86f8fd585 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5d12176c1440..209182d8a760 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e37301f738c7..2f54091e0b9a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 2886084044c8..3e56f885ae6a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b96a9d800807..1d5032482f31 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5f51902a8f57..53ef28829513 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 7e01480dc6ff..2f2117521832 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2b1d427b1f88..0a0d0e3596a4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 3a6c707d4fc18692e2cafbf47c6f406798cc9b8c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 03:06:55 -0800 Subject: [PATCH 60/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/49747f365043 Author: Florin Strugariu Desc: Merge pull request #25894 from viorelaioia/bug_1090281_1 Bug 1090281 - Investigate failure in test_setup_and_send_imap_email.py ======== https://hg.mozilla.org/integration/gaia-central/rev/1153e3a9a97e Author: Viorela Ioia Desc: Bug 1090281 - Investigate failure in test_setup_and_send_imap_email.py --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c8bee4d92847..7027fc2e078b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "7022736d7c1b7b83a20f55c05a262b9475fd114f", + "revision": "49747f36504394d2654188eb755d2d385d84f4df", "repo_path": "integration/gaia-central" } From 7f3c3186e598dbffd6a0ad6daa782f2049eed535 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 03:11:59 -0800 Subject: [PATCH 61/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ee4b64e15531..243e716e7e63 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 209182d8a760..8985074e55c7 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 4b8bdf0c6ac6..224979b9437f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 34a86f8fd585..21c169dc9d41 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 209182d8a760..8985074e55c7 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 2f54091e0b9a..86089a2e9354 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 3e56f885ae6a..23b6c25a8f28 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1d5032482f31..b166a3202039 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 53ef28829513..9c4d35dff764 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2f2117521832..3ca6229b5540 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 0a0d0e3596a4..767969a23892 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 6fad3c51211236f2209d29a4a5669fa6e1b0ec48 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 04:06:54 -0800 Subject: [PATCH 62/88] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/75d97d4b116e Author: BavarianTomcat Desc: Revert "Bug 1097296 - [Window Management] Battery, Signal and time on the status bar will appear behind download update overlay. r=etienne" for test failures This reverts commit b5516bece85f6588fe1cabc7738d48c031774f7c. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7027fc2e078b..6f697ce5cec6 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "49747f36504394d2654188eb755d2d385d84f4df", + "revision": "75d97d4b116ea128f9aa5bdb1dc3aba58a071a31", "repo_path": "integration/gaia-central" } From e95932562c296d01f716dfbbf51769574fb5c9f8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 04:17:05 -0800 Subject: [PATCH 63/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 243e716e7e63..17113f41b7db 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8985074e55c7..f846ad45a6ba 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 224979b9437f..a9970c939844 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 21c169dc9d41..6113979d7b38 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8985074e55c7..f846ad45a6ba 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 86089a2e9354..f864856dc9d4 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 23b6c25a8f28..e8128339d6c3 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b166a3202039..960fa307f02b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9c4d35dff764..41356b728397 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 3ca6229b5540..9f77e6a121ba 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 767969a23892..975dde25d800 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ae3b12e6e5dfa2cd576271f1a4faed05cdec9a01 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 04:21:54 -0800 Subject: [PATCH 64/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/44740bcc51d4 Author: Jose M. Cantera Desc: Merge pull request #26067 from jmcanterafonseca/fix_ice_merge Bug 1094730 - [Flame][v2.1][Contacts] after merging a new contact with I... ======== https://hg.mozilla.org/integration/gaia-central/rev/fe8f0d2b4371 Author: Jose M. Cantera Desc: Bug 1094730 - [Flame][v2.1][Contacts] after merging a new contact with ICE contacts, the setting of ICE contacts will be cleared. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6f697ce5cec6..ed7825144c6c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "75d97d4b116ea128f9aa5bdb1dc3aba58a071a31", + "revision": "44740bcc51d47ebdc054b05cace631ebaa8517a2", "repo_path": "integration/gaia-central" } From 48395487722b217551cbfbbeda65b0f1f431b39a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 04:23:26 -0800 Subject: [PATCH 65/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 17113f41b7db..8da66691442b 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index f846ad45a6ba..acdafb9a7e3b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a9970c939844..d5ee4ff0d591 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6113979d7b38..1ad3fe34c151 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index f846ad45a6ba..acdafb9a7e3b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index f864856dc9d4..d93f56f31d19 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e8128339d6c3..a737e54d6804 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 960fa307f02b..8e6de73f1d47 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 41356b728397..2a595df3cead 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 9f77e6a121ba..9392619c5c5b 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 975dde25d800..57ef04dea058 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From daba070c554aed38d2832082edebeaa9e3d56c4a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 04:51:55 -0800 Subject: [PATCH 66/88] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/4ad09c7b3e0b Author: Pavel Ivanov Desc: Merge pull request #26374 from pivanov/bug-1091719 Bug 1091719 - When setting a new alarm the header text is not centered ======== https://hg.mozilla.org/integration/gaia-central/rev/f45d9a2370be Author: Pavel Ivanov Desc: Bug 1091719 - When setting a new alarm the header text is not centered ======== https://hg.mozilla.org/integration/gaia-central/rev/b827de8ca1e7 Author: BavarianTomcat Desc: Revert "Bug 1103819 - Enable parallel build by default" for bustage This reverts commit d36ff5979bb25dca0f7fbe9d952efc6b34ea6e43. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ed7825144c6c..d67dc6439953 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "44740bcc51d47ebdc054b05cace631ebaa8517a2", + "revision": "4ad09c7b3e0b7a3f5a8b0bc08828c1d5351362d8", "repo_path": "integration/gaia-central" } From 0203213000d40cc861fd5faa9acd272a268f80fc Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 05:02:00 -0800 Subject: [PATCH 67/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 8da66691442b..31ed86541475 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index acdafb9a7e3b..edec52d47dc9 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d5ee4ff0d591..0c25b52b688b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 1ad3fe34c151..bdfdb29a312c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index acdafb9a7e3b..edec52d47dc9 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d93f56f31d19..793b2cccc7f6 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index a737e54d6804..e1b774bdea23 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 8e6de73f1d47..14c3933a60e2 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 2a595df3cead..140db236106d 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 9392619c5c5b..e9c6cd966723 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 57ef04dea058..7d8ce0092ad8 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 96a76cebe6e109be4ca54055269ed64c3a005393 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 05:56:55 -0800 Subject: [PATCH 68/88] Bumping gaia.json for 5 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/40771a5e6982 Author: BavarianTomcat Desc: Revert "Bug 1091719 - When setting a new alarm the header text is not centered" for test failures This reverts commit 9e7fb692195d7fdf820eaa99f6e76c57830b34eb. ======== https://hg.mozilla.org/integration/gaia-central/rev/7e406a7c016a Author: Kevin Grandon Desc: Merge pull request #26364 from KevinGrandon/bug_1102889_remove_unnecessary_apz Bug 1102889 - Remove unnecessary mozasyncpanzoom attribute from remote iframes ======== https://hg.mozilla.org/integration/gaia-central/rev/4e0202ef5e57 Author: Kevin Grandon Desc: Bug 1102889 - Remove unnecessary mozasyncpanzoom attribute from remote iframes r=crdlc r=johnhu ======== https://hg.mozilla.org/integration/gaia-central/rev/51dfa425227e Author: viorelaioia Desc: Merge pull request #26407 from viorelaioia/revert_commit Revert "Bug 1103910 - Xfail test_settings_bluetooth.py because of Bug 11... ======== https://hg.mozilla.org/integration/gaia-central/rev/5c6fa3a36021 Author: Viorela Ioia Desc: Revert "Bug 1103910 - Xfail test_settings_bluetooth.py because of Bug 1102885" This reverts commit 23b9233724c0f9a29ca658f0f9462812dea5e4a6. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d67dc6439953..c4436043f266 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "4ad09c7b3e0b7a3f5a8b0bc08828c1d5351362d8", + "revision": "40771a5e69823c94172a58b3518209fec9af7fdb", "repo_path": "integration/gaia-central" } From 7c307617e2347c29eab560d0d3d673db44429434 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 06:01:58 -0800 Subject: [PATCH 69/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 31ed86541475..375dd0ae59fa 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index edec52d47dc9..e0ad31c059fc 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0c25b52b688b..fee12f5dc9e4 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index bdfdb29a312c..83bc02570e91 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index edec52d47dc9..e0ad31c059fc 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 793b2cccc7f6..812365cd939a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e1b774bdea23..36da027bbc12 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 14c3933a60e2..a4fe83948737 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 140db236106d..643e7e977a3c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e9c6cd966723..c396f2da39ca 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7d8ce0092ad8..03494e9cd9f9 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 4c3d3eea0715aa0d93c6b0d1a00273e02ab6880c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 06:26:54 -0800 Subject: [PATCH 70/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2cbbf8fbe5ac Author: gasolin Desc: Merge pull request #26408 from gasolin/master Revert "Merge pull request #25791 from gasolin/issue-1089511-3" ======== https://hg.mozilla.org/integration/gaia-central/rev/79f818a4dce5 Author: gasolin Desc: Revert "Merge pull request #25791 from gasolin/issue-1089511-3" This reverts commit 60d2ad46dcd3c608b1ebbc885f17216c507a204c, reversing changes made to 929a3e9be64ec0d685ae75efbd4aaa4d7fd7cc08. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c4436043f266..031b49cadfa6 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "40771a5e69823c94172a58b3518209fec9af7fdb", + "revision": "2cbbf8fbe5ac449bfd470df2029720b58caaa7a7", "repo_path": "integration/gaia-central" } From 184eae909b8d296cde108b7b23f39db2e1980046 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 06:28:26 -0800 Subject: [PATCH 71/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 375dd0ae59fa..ec314ac404e3 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index e0ad31c059fc..703e2b1af623 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index fee12f5dc9e4..69546298fefd 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 83bc02570e91..c368922e3e30 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index e0ad31c059fc..703e2b1af623 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 812365cd939a..e17ca10e46b0 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 36da027bbc12..89b6d736c9cd 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index a4fe83948737..754df26af9fe 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 643e7e977a3c..56a1cdbad378 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c396f2da39ca..2596ea1455df 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 03494e9cd9f9..dfd74a10dd37 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From bd560dd4f3e57c039ecdd89a29348c4a8287e900 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 07:12:05 -0800 Subject: [PATCH 72/88] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/2bc0835fa473 Author: Johan Lorenzo Desc: Merge pull request #26073 from bebef1987/auto_on Bug 1097088 - Write test Battery Turn on Automatically options ======== https://hg.mozilla.org/integration/gaia-central/rev/fcb2aedab6d6 Author: bebef1987 Desc: Bug 1097088 - Write test Battery Turn on Automatically options ======== https://hg.mozilla.org/integration/gaia-central/rev/40ae98e858d2 Author: viorelaioia Desc: Merge pull request #26291 from chirarobert/bug_1096920 Bug 1096920 - Add test to delete entire call log when it has several cal... ======== https://hg.mozilla.org/integration/gaia-central/rev/8a87bf40a887 Author: Robert Chira Desc: Bug 1096920 - Add test to delete entire call log when it has several calls, All tab --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 031b49cadfa6..c9ef74eeee93 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "2cbbf8fbe5ac449bfd470df2029720b58caaa7a7", + "revision": "2bc0835fa473e5873989fd7f7a7fc4c519de8591", "repo_path": "integration/gaia-central" } From 8125711e6d8ea7c9236d6704c073e1092ae55af8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 07:21:43 -0800 Subject: [PATCH 73/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ec314ac404e3..7b8cdd5d10b2 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 703e2b1af623..c5ac7bc5cd3d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 69546298fefd..075997a2ed4b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index c368922e3e30..85f97dc4161f 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 703e2b1af623..c5ac7bc5cd3d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e17ca10e46b0..a199de4abd68 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 89b6d736c9cd..6b39444b67fc 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 754df26af9fe..69afd1b599ed 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 56a1cdbad378..4939c4ee3680 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 2596ea1455df..b8a6f9e6e678 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index dfd74a10dd37..e6de8377047e 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From bd2c664394fd39bd3fcd98d677adb3947c2f5c66 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 07:32:01 -0800 Subject: [PATCH 74/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/b77cf5f403df Author: viorelaioia Desc: Merge pull request #26295 from bebef1987/test_ring Bug 1097085 - Write test Verify that the Ringer Tone can be changed ======== https://hg.mozilla.org/integration/gaia-central/rev/71cd2652126c Author: bebef1987 Desc: Bug 1097085 - Write test Verify that the Ringer Tone can be changed --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c9ef74eeee93..275bd77bcf29 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "2bc0835fa473e5873989fd7f7a7fc4c519de8591", + "revision": "b77cf5f403df2597ae93e414a4d4c8b790f78f55", "repo_path": "integration/gaia-central" } From dea1b4b70771714c1a334953a6842e9b1e57208b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 07:33:39 -0800 Subject: [PATCH 75/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 7b8cdd5d10b2..6b40c4ce5e25 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c5ac7bc5cd3d..c05bf41adc96 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 075997a2ed4b..e59d92ae4bea 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 85f97dc4161f..9aa0841b02bc 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c5ac7bc5cd3d..c05bf41adc96 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index a199de4abd68..354eeff7f6e4 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6b39444b67fc..b68395f4202a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 69afd1b599ed..f5bcd4393f60 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 4939c4ee3680..7d7a583c0bd5 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index b8a6f9e6e678..e5a4af9108d9 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e6de8377047e..e74a245d40da 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 7fabbb42c0ea309977e89de69edf5461b70b46ef Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 24 Nov 2014 11:57:49 -0500 Subject: [PATCH 76/88] Bug 1093112. Make sure that our + +
From 6c81adc0d38dd2f1fda78e23ff8b8cc8c022e089 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 24 Nov 2014 11:57:49 -0500 Subject: [PATCH 77/88] Bug 1067541. Image preloads should not keep going once the actual image has started and gotten canceled. r=peterv --- dom/base/nsDocument.cpp | 17 ++++++++++++++++- dom/base/nsDocument.h | 8 ++++++-- dom/base/nsIDocument.h | 10 ++++++++-- dom/base/nsImageLoadingContent.cpp | 5 +++++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 20b5a8580798..1e1d1387c9b2 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -9593,7 +9593,22 @@ nsDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr, // the "real" load occurs. Unpinned in DispatchContentLoadedEvents and // unlink if (NS_SUCCEEDED(rv)) { - mPreloadingImages.AppendObject(request); + mPreloadingImages.Put(uri, request.forget()); + } +} + +void +nsDocument::ForgetImagePreload(nsIURI* aURI) +{ + // Checking count is faster than hashing the URI in the common + // case of empty table. + if (mPreloadingImages.Count() != 0) { + nsCOMPtr req; + mPreloadingImages.Remove(aURI, getter_AddRefs(req)); + if (req) { + // Make sure to cancel the request so imagelib knows it's gone. + req->CancelAndForgetObserver(NS_BINDING_ABORTED); + } } } diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index acb45155faea..93ce1d255f5d 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -1094,6 +1094,7 @@ public: virtual void MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr, ReferrerPolicy aReferrerPolicy) MOZ_OVERRIDE; + virtual void ForgetImagePreload(nsIURI* aURI) MOZ_OVERRIDE; virtual void PreloadStyle(nsIURI* uri, const nsAString& charset, const nsAString& aCrossOriginAttr, @@ -1742,8 +1743,11 @@ private: nsExternalResourceMap mExternalResourceMap; - // All images in process of being preloaded - nsCOMArray mPreloadingImages; + // All images in process of being preloaded. This is a hashtable so + // we can remove them as the real image loads start; that way we + // make sure to not keep the image load going when no one cares + // about it anymore. + nsRefPtrHashtable mPreloadingImages; nsRefPtr mDOMImplementation; diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index c737f1235caa..83fad42fdaf7 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -146,8 +146,8 @@ struct FullScreenOptions { } // namespace mozilla #define NS_IDOCUMENT_IID \ -{ 0x1f343423, 0x957c, 0x4da3, \ - { 0xaa, 0xa3, 0x07, 0x37, 0x54, 0x3e, 0x79, 0x2a } } +{ 0xf63d2f6e, 0xd1c1, 0x49b9, \ + { 0x88, 0x26, 0xd5, 0x9e, 0x5d, 0x72, 0x2a, 0x42 } } // Enum for requesting a particular type of document when creating a doc enum DocumentFlavor { @@ -1922,6 +1922,12 @@ public: const nsAString& aCrossOriginAttr, ReferrerPolicy aReferrerPolicy) = 0; + /** + * Called by images to forget an image preload when they start doing + * the real load. + */ + virtual void ForgetImagePreload(nsIURI* aURI) = 0; + /** * Called by nsParser to preload style sheets. Can also be merged into the * parser if and when the parser is merged with libgklayout. aCrossOriginAttr diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index b59e0f44f341..f053616725ca 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -893,6 +893,11 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI, getter_AddRefs(req), policyType); + // Tell the document to forget about the image preload, if any, for + // this URI, now that we might have another imgRequestProxy for it. + // That way if we get canceled later the image load won't continue. + aDocument->ForgetImagePreload(aNewURI); + if (NS_SUCCEEDED(rv)) { TrackImage(req); ResetAnimationIfNeeded(); From e86d3b52043aee3b24d46e26ff1b0b0cbdb1d139 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 24 Nov 2014 11:57:49 -0500 Subject: [PATCH 78/88] Bug 1096011. Warning when failing to create a JS implemntation for a Web IDL binding should include the implementation contract. r=peterv --- dom/bindings/BindingUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 7a4606890bd3..2a52a7a46f3b 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -2089,7 +2089,9 @@ ConstructJSImplementation(JSContext* aCx, const char* aContractId, nsresult rv; nsCOMPtr implISupports = do_CreateInstance(aContractId, &rv); if (!implISupports) { - NS_WARNING("Failed to get JS implementation for contract"); + nsPrintfCString msg("Failed to get JS implementation for contract \"%s\"", + aContractId); + NS_WARNING(msg.get()); aRv.Throw(rv); return; } From ccbf275bfda335e1494132617a7de7076d908f92 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 09:03:36 -0800 Subject: [PATCH 79/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 6b40c4ce5e25..e698f3dfe44a 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -17,7 +17,7 @@
- + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c05bf41adc96..c71c3b702a0a 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index e59d92ae4bea..1ff92d1920c1 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -18,7 +18,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 9aa0841b02bc..84f9c30cac4a 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c05bf41adc96..c71c3b702a0a 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 354eeff7f6e4..4c6b02e9633a 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index b68395f4202a..106007c3ac02 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -18,7 +18,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index f5bcd4393f60..8551caa82026 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -18,7 +18,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 7d7a583c0bd5..e0e9aa6fd0a8 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -16,7 +16,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e5a4af9108d9..dede5207b273 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -18,7 +18,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e74a245d40da..99a67cebfebe 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -18,7 +18,7 @@ - + From 0bf0833a43df89f847ada596c1ec8f5da2ba1624 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 09:47:01 -0800 Subject: [PATCH 80/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/4f37233ad65c Author: Jose M. Cantera Desc: Merge pull request #26335 from ADLR-es/highlight-accented Bug 1088706 - Accented characters like ñ are not highlighted after doing... ======== https://hg.mozilla.org/integration/gaia-central/rev/a95c571b0a95 Author: Adrián de la Rosa Desc: Bug 1088706 - Accented characters like ñ are not highlighted after doing a search with them --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 275bd77bcf29..ed8b7083d0d1 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "b77cf5f403df2597ae93e414a4d4c8b790f78f55", + "revision": "4f37233ad65c45d0f237d809ca1aad07a54f887a", "repo_path": "integration/gaia-central" } From 79f8105a40269a1349924c6eb96f6f3d0c92aad1 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 09:56:39 -0800 Subject: [PATCH 81/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index e698f3dfe44a..fa82fe25024f 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c71c3b702a0a..3aa256f2ea47 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1ff92d1920c1..69915b6b9d3c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 84f9c30cac4a..82df36eab435 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c71c3b702a0a..3aa256f2ea47 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 4c6b02e9633a..79170b830333 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 106007c3ac02..6cdaa4986918 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 8551caa82026..1554d6ba1003 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e0e9aa6fd0a8..10348aab5877 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index dede5207b273..7326a608f9ea 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 99a67cebfebe..09d77463390e 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From da1d7035e5c027487c147ae81699bf02f86555e0 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 24 Nov 2014 13:23:57 -0500 Subject: [PATCH 82/88] Bug 1056388 - Add assertions as per TODO. r=botond --- gfx/layers/apz/testutil/APZTestData.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gfx/layers/apz/testutil/APZTestData.h b/gfx/layers/apz/testutil/APZTestData.h index f547717e4c5a..e31d73017949 100644 --- a/gfx/layers/apz/testutil/APZTestData.h +++ b/gfx/layers/apz/testutil/APZTestData.h @@ -42,10 +42,9 @@ class APZTestData { friend struct APZTestDataToJSConverter; public: void StartNewPaint(SequenceNumber aSequenceNumber) { + // We should never get more than one paint with the same sequence number. + MOZ_ASSERT(mPaints.find(aSequenceNumber) == mPaints.end()); mPaints.insert(DataStore::value_type(aSequenceNumber, Bucket())); - // TODO(botond): MOZ_ASSERT() that we didn't already have a paint with this - // sequence number once we get rid ofAPZCTreeManager::UpdatePanZoomControllerTree() - // calls for repeat transactions (bug 1007728). } void LogTestDataForPaint(SequenceNumber aSequenceNumber, ViewID aScrollId, @@ -93,10 +92,9 @@ private: } Bucket& bucket = bucketIterator->second; ScrollFrameData& scrollFrameData = bucket[aScrollId]; // create if doesn't exist + MOZ_ASSERT(scrollFrameData.find(aKey) == scrollFrameData.end() + || scrollFrameData[aKey] == aValue); scrollFrameData.insert(ScrollFrameData::value_type(aKey, aValue)); - // TODO(botond): MOZ_ASSERT() that we don't already have this key once we - // get rid of APZCTreeManager::UpdatePanZoomControllerTree() calls for - // repeat transactions (bug 1007728). } }; From c9bcfc36557cc53a4976e8784b37c333cb55ce9e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 10:30:18 -0800 Subject: [PATCH 83/88] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ac3824a2f55d Author: Francisco Jordano Desc: Merge pull request #26113 from arcturus/bug-1093002 Bug 1093002 - [Flame][v2.1][Contact]The title name of contact list changes after you lock and unlock the screen. r=jmcf ======== https://hg.mozilla.org/integration/gaia-central/rev/43f6a8a364cd Author: Francisco Jordano Desc: Bug 1093002 - [Flame][v2.1][Contact]The title name of contact list changes after you lock and unlock the screen. r=jmcf ======== https://hg.mozilla.org/integration/gaia-central/rev/7b458731fa66 Author: Etienne Segonzac Desc: Merge pull request #26248 from etiennesegonzac/bug-1096704 Bug 1096704 - Prevent rocketbar trigger during an edge gesture. r=alive, aus ======== https://hg.mozilla.org/integration/gaia-central/rev/ca637d80bbbd Author: Etienne Segonzac Desc: Bug 1096704 - Prevent rocketbar trigger during an edge gesture. (cherry picked from commit 4d4f7b91c958f6cee8a13a4fe43c25840c142911) ======== https://hg.mozilla.org/integration/gaia-central/rev/379d4f97e650 Author: Aleh Zasypkin Desc: Merge pull request #26255 from azasypkin/bug-1100915-usage-lazy-loader Bug 1100915 - [Usage][Refactoring] Use LazyLoader to load views. r=salva ======== https://hg.mozilla.org/integration/gaia-central/rev/20ab4fa32430 Author: Aleh Zasypkin Desc: Bug 1100915 - [Usage][Refactoring] Use LazyLoader to load views. r=salva --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ed8b7083d0d1..28865f85871f 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "4f37233ad65c45d0f237d809ca1aad07a54f887a", + "revision": "ac3824a2f55d30132f2fd2206d42c893ba09fcd1", "repo_path": "integration/gaia-central" } From b99053a88c0be620b1f84f90f4b41689de03babe Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 10:30:33 -0800 Subject: [PATCH 84/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index fa82fe25024f..3d1eee87b7f4 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3aa256f2ea47..7236f580be14 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 69915b6b9d3c..c7967522a47c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 82df36eab435..ae5a5817d630 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3aa256f2ea47..7236f580be14 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 79170b830333..83d8ec646e3c 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6cdaa4986918..e9ef47e5cacb 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1554d6ba1003..2b5ad9f58c8c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 10348aab5877..1fb7f71dc1e7 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 7326a608f9ea..cca6b7558ad8 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 09d77463390e..4f94063e6f2b 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 3ca9495f5b45d200043d022ea1c8e692fe46052d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 11:51:53 -0800 Subject: [PATCH 85/88] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/8879d60a0cc3 Author: albertopq Desc: Merge pull request #26402 from albertopq/1100157-ambient-pointer Bug 1100157 - Utility tray is hard to pull with ambient indicator r=etienne_s ======== https://hg.mozilla.org/integration/gaia-central/rev/3703e3467c4f Author: albertopq Desc: Bug 1100157 - Utility tray is hard to pull with ambient indicator --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 28865f85871f..8a4fb5faf48b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ac3824a2f55d30132f2fd2206d42c893ba09fcd1", + "revision": "8879d60a0cc3d69720c7335370d29d5a44523d0c", "repo_path": "integration/gaia-central" } From 5168639c83aa87a697cd10ffae4ae920793ae7e6 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 24 Nov 2014 11:56:57 -0800 Subject: [PATCH 86/88] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 3d1eee87b7f4..959603fa0fb8 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7236f580be14..4444d8c6c83d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index c7967522a47c..d72a154c7a2a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ae5a5817d630..07a2918b9eb9 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7236f580be14..4444d8c6c83d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 83d8ec646e3c..87ce1904c873 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e9ef47e5cacb..3793c04ed54f 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2b5ad9f58c8c..be1d71fb60ce 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 1fb7f71dc1e7..4d00190bd4dd 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index cca6b7558ad8..1dc874697e84 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 4f94063e6f2b..403d2dffeb58 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From fb8d05cd59c2f2845255d8a2ca7e9bfc00972680 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 24 Nov 2014 17:18:27 -0500 Subject: [PATCH 87/88] Backed out changesets 9beb53e53951, 4420bb4e5e7c, de1da65301a8, and cd9c2aaf1343 (bug 970307) for causing frequent B2G debug mochitest-11 crashes. --- dom/apps/AppsServiceChild.jsm | 9 +- dom/indexedDB/TransactionThreadPool.cpp | 27 --- dom/ipc/ContentChild.cpp | 79 ++----- dom/ipc/ContentChild.h | 2 - dom/ipc/ContentParent.cpp | 40 +--- dom/ipc/ContentParent.h | 8 +- dom/ipc/PContent.ipdl | 4 - dom/ipc/TabChild.cpp | 15 -- dom/ipc/TabChild.h | 1 - dom/ipc/jar.mn | 1 - dom/ipc/post-fork-preload.js | 20 -- dom/ipc/preload.js | 2 +- dom/ipc/tests/test_NuwaProcessCreation.html | 2 +- dom/ipc/tests/test_NuwaProcessDeadlock.html | 2 +- dom/wifi/WifiProxyService.cpp | 3 - dom/workers/WorkerPrivate.cpp | 12 - .../base/src/nsSocketTransportService2.cpp | 1 - testing/mochitest/mochitest_options.py | 2 +- widget/gonk/GonkMemoryPressureMonitoring.cpp | 2 - xpcom/glue/nsThreadUtils.cpp | 8 - xpcom/glue/nsThreadUtils.h | 15 -- xpcom/threads/TimerThread.cpp | 1 - xpcom/threads/nsThread.cpp | 49 +--- xpcom/threads/nsThread.h | 15 -- xpcom/threads/nsThreadManager.cpp | 212 ------------------ xpcom/threads/nsThreadManager.h | 38 ---- xpcom/threads/nsThreadPool.cpp | 7 +- xpcom/threads/nsTimerImpl.cpp | 7 - 28 files changed, 30 insertions(+), 554 deletions(-) delete mode 100644 dom/ipc/post-fork-preload.js diff --git a/dom/apps/AppsServiceChild.jsm b/dom/apps/AppsServiceChild.jsm index 7b5d3bd366ff..8d5663607d24 100644 --- a/dom/apps/AppsServiceChild.jsm +++ b/dom/apps/AppsServiceChild.jsm @@ -103,12 +103,6 @@ this.DOMApplicationRegistry = { this.cpmm.addMessageListener(aMsgName, this); }).bind(this)); - this.resetList(); - - Services.obs.addObserver(this, "xpcom-shutdown", false); - }, - - resetList: function() { this.cpmm.sendAsyncMessage("Webapps:RegisterForMessages", { messages: APPS_IPC_MSG_NAMES }); @@ -116,7 +110,6 @@ this.DOMApplicationRegistry = { // We need to prime the cache with the list of apps. let list = this.cpmm.sendSyncMessage("Webapps:GetList", { })[0]; this.webapps = list.webapps; - // We need a fast mapping from localId -> app, so we add an index. // We also add the manifest to the app object. this.localIdIndex = { }; @@ -125,6 +118,8 @@ this.DOMApplicationRegistry = { this.localIdIndex[app.localId] = app; app.manifest = list.manifests[id]; } + + Services.obs.addObserver(this, "xpcom-shutdown", false); }, observe: function(aSubject, aTopic, aData) { diff --git a/dom/indexedDB/TransactionThreadPool.cpp b/dom/indexedDB/TransactionThreadPool.cpp index 385f4dd50687..d0e68990e958 100644 --- a/dom/indexedDB/TransactionThreadPool.cpp +++ b/dom/indexedDB/TransactionThreadPool.cpp @@ -19,7 +19,6 @@ #include "nsServiceManagerUtils.h" #include "nsXPCOMCIDInternal.h" #include "ProfilerHelpers.h" -#include "nsThread.h" namespace mozilla { namespace dom { @@ -173,10 +172,6 @@ private: ~TransactionQueue() { } -#ifdef MOZ_NUWA_PROCESS - nsThread* mThread; -#endif - NS_DECL_NSIRUNNABLE }; @@ -796,9 +791,6 @@ TransactionQueue::TransactionQueue(TransactionThreadPool* aThreadPool, mObjectStoreNames(aObjectStoreNames), mMode(aMode), mShouldFinish(false) -#ifdef MOZ_NUWA_PROCESS -, mThread(nullptr) -#endif { MOZ_ASSERT(aThreadPool); aThreadPool->AssertIsOnOwningThread(); @@ -824,12 +816,6 @@ TransactionThreadPool::TransactionQueue::Dispatch(nsIRunnable* aRunnable) mQueue.AppendElement(aRunnable); -#ifdef MOZ_NUWA_PROCESS - if (mThread) { - mThread->SetWorking(); - } -#endif - mMonitor.Notify(); } @@ -863,12 +849,6 @@ TransactionThreadPool::TransactionQueue::Run() nsAutoTArray, 10> queue; nsRefPtr finishCallback; bool shouldFinish = false; -#ifdef MOZ_NUWA_PROCESS - mThread = static_cast(NS_GetCurrentThread()); - // Set ourself as working thread. We can reset later if we found - // our queue is empty. - mThread->SetWorking(); -#endif do { NS_ASSERTION(queue.IsEmpty(), "Should have cleared this!"); @@ -876,9 +856,6 @@ TransactionThreadPool::TransactionQueue::Run() { MonitorAutoLock lock(mMonitor); while (!mShouldFinish && mQueue.IsEmpty()) { -#ifdef MOZ_NUWA_PROCESS - mThread->SetIdle(); -#endif if (NS_FAILED(mMonitor.Wait())) { NS_ERROR("Failed to wait!"); } @@ -911,10 +888,6 @@ TransactionThreadPool::TransactionQueue::Run() } } while (!shouldFinish); -#ifdef MOZ_NUWA_PROCESS - mThread = nullptr; -#endif - #ifdef DEBUG if (kDEBUGThreadSleepMS) { MOZ_ALWAYS_TRUE( diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index a87deb711574..458fd3715398 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -507,12 +507,6 @@ NS_IMPL_ISUPPORTS(BackgroundChildPrimer, nsIIPCBackgroundChildCreateCallback) ContentChild* ContentChild::sSingleton; -static void -PostForkPreload() -{ - TabChild::PostForkPreload(); -} - // Performs initialization that is not fork-safe, i.e. that must be done after // forking from the Nuwa process. static void @@ -523,7 +517,6 @@ InitOnContentProcessCreated() if (IsNuwaProcess()) { return; } - PostForkPreload(); #endif // This will register cross-process observer. @@ -1245,6 +1238,7 @@ ContentChild::RecvPBrowserConstructor(PBrowserChild* aActor, { // This runs after AllocPBrowserChild() returns and the IPC machinery for this // PBrowserChild has been set up. + nsCOMPtr os = services::GetObserverService(); if (os) { nsITabChild* tc = @@ -1992,11 +1986,8 @@ bool ContentChild::RecvFlushMemory(const nsString& reason) { #ifdef MOZ_NUWA_PROCESS - if (IsNuwaProcess() || ManagedPBrowserChild().Length() == 0) { + if (IsNuwaProcess()) { // Don't flush memory in the nuwa process: the GC thread could be frozen. - // If there's no PBrowser child, don't flush memory, either. GC writes - // to copy-on-write pages and makes preallocated process take more memory - // before it actually becomes an app. return true; } #endif @@ -2084,28 +2075,12 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID, // BrowserElementChild.js. if ((mIsForApp || mIsForBrowser) #ifdef MOZ_NUWA_PROCESS - && IsNuwaProcess() + && !IsNuwaProcess() #endif ) { PreloadSlowThings(); -#ifndef MOZ_NUWA_PROCESS - PostForkPreload(); -#endif } -#ifdef MOZ_NUWA_PROCESS - // Some modules are initialized in preloading. We need to wait until the - // tasks they dispatched to chrome process are done. - if (IsNuwaProcess()) { - SendNuwaWaitForFreeze(); - } -#endif - return true; -} - -bool -ContentChild::RecvNuwaFreeze() -{ #ifdef MOZ_NUWA_PROCESS if (IsNuwaProcess()) { ContentChild::GetSingleton()->RecvGarbageCollect(); @@ -2113,6 +2088,7 @@ ContentChild::RecvNuwaFreeze() FROM_HERE, NewRunnableFunction(OnFinishNuwaPreparation)); } #endif + return true; } @@ -2367,36 +2343,6 @@ RunNuwaFork() DoNuwaFork(); } } - -class NuwaForkCaller: public nsRunnable -{ -public: - NS_IMETHODIMP - Run() { - // We want to ensure that the PBackground actor gets cloned in the Nuwa - // process before we freeze. Also, we have to do this to avoid deadlock. - // Protocols that are "opened" (e.g. PBackground, PCompositor) block the - // main thread to wait for the IPC thread during the open operation. - // NuwaSpawnWait() blocks the IPC thread to wait for the main thread when - // the Nuwa process is forked. Unless we ensure that the two cannot happen - // at the same time then we risk deadlock. Spinning the event loop here - // guarantees the ordering is safe for PBackground. - if (!BackgroundChild::GetForCurrentThread()) { - // Dispatch ourself again. - NS_DispatchToMainThread(this, NS_DISPATCH_NORMAL); - } else { - MessageLoop* ioloop = XRE_GetIOMessageLoop(); - ioloop->PostTask(FROM_HERE, NewRunnableFunction(RunNuwaFork)); - } - return NS_OK; - } -private: - virtual - ~NuwaForkCaller() - { - } -}; - #endif bool @@ -2408,9 +2354,22 @@ ContentChild::RecvNuwaFork() } sNuwaForking = true; - nsRefPtr runnable = new NuwaForkCaller(); - NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL); + // We want to ensure that the PBackground actor gets cloned in the Nuwa + // process before we freeze. Also, we have to do this to avoid deadlock. + // Protocols that are "opened" (e.g. PBackground, PCompositor) block the + // main thread to wait for the IPC thread during the open operation. + // NuwaSpawnWait() blocks the IPC thread to wait for the main thread when + // the Nuwa process is forked. Unless we ensure that the two cannot happen + // at the same time then we risk deadlock. Spinning the event loop here + // guarantees the ordering is safe for PBackground. + while (!BackgroundChild::GetForCurrentThread()) { + if (NS_WARN_IF(!NS_ProcessNextEvent())) { + return false; + } + } + MessageLoop* ioloop = XRE_GetIOMessageLoop(); + ioloop->PostTask(FROM_HERE, NewRunnableFunction(RunNuwaFork)); return true; #else return false; // Makes the underlying IPC channel abort. diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 303142066cf2..ef2617eefcf7 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -350,8 +350,6 @@ public: virtual bool RecvNotifyPhoneStateChange(const nsString& state) MOZ_OVERRIDE; - virtual bool RecvNuwaFreeze() MOZ_OVERRIDE; - void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS); virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver, diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 6679e4b50f79..a44825adaf4a 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -122,7 +122,6 @@ #include "nsServiceManagerUtils.h" #include "nsStyleSheetService.h" #include "nsThreadUtils.h" -#include "nsThreadManager.h" #include "nsToolkitCompsCID.h" #include "nsWidgetsCID.h" #include "PreallocatedProcessManager.h" @@ -1371,28 +1370,6 @@ StaticAutoPtr > NS_IMPL_ISUPPORTS(SystemMessageHandledListener, nsITimerCallback) -#ifdef MOZ_NUWA_PROCESS -class NuwaFreezeListener : public nsThreadManager::AllThreadsWereIdleListener -{ -public: - NuwaFreezeListener(ContentParent* parent) - : mParent(parent) - { - } - - void OnAllThreadsWereIdle() - { - unused << mParent->SendNuwaFreeze(); - nsThreadManager::get()->RemoveAllThreadsWereIdleListener(this); - } -private: - nsRefPtr mParent; - virtual ~NuwaFreezeListener() - { - } -}; -#endif // MOZ_NUWA_PROCESS - } // anonymous namespace void @@ -2080,8 +2057,6 @@ ContentParent::ContentParent(ContentParent* aTemplate, priority = PROCESS_PRIORITY_FOREGROUND; } - mSendPermissionUpdates = aTemplate->mSendPermissionUpdates; - InitInternal(priority, false, /* Setup Off-main thread compositing */ false /* Send registered chrome */); @@ -2239,7 +2214,7 @@ ContentParent::IsForApp() #ifdef MOZ_NUWA_PROCESS bool -ContentParent::IsNuwaProcess() const +ContentParent::IsNuwaProcess() { return mIsNuwaProcess; } @@ -2588,19 +2563,6 @@ ContentParent::RecvNuwaReady() #endif } -bool -ContentParent::RecvNuwaWaitForFreeze() -{ -#ifdef MOZ_NUWA_PROCESS - nsRefPtr listener = new NuwaFreezeListener(this); - nsThreadManager::get()->AddAllThreadsWereIdleListener(listener); - return true; -#else // MOZ_NUWA_PROCESS - NS_ERROR("ContentParent::RecvNuwaWaitForFreeze() not implemented!"); - return false; -#endif // MOZ_NUWA_PROCESS -} - bool ContentParent::RecvAddNewProcess(const uint32_t& aPid, const InfallibleTArray& aFds) diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index d22f12052282..53090e8ab846 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -206,7 +206,7 @@ public: return mIsForBrowser; } #ifdef MOZ_NUWA_PROCESS - bool IsNuwaProcess() const; + bool IsNuwaProcess(); #endif GeckoChildProcessHost* Process() { @@ -220,11 +220,7 @@ public: } bool NeedsPermissionsUpdate() const { -#ifdef MOZ_NUWA_PROCESS - return !IsNuwaProcess() && mSendPermissionUpdates; -#else return mSendPermissionUpdates; -#endif } bool NeedsDataStoreInfos() const { @@ -683,8 +679,6 @@ private: virtual bool RecvNuwaReady() MOZ_OVERRIDE; - virtual bool RecvNuwaWaitForFreeze() MOZ_OVERRIDE; - virtual bool RecvAddNewProcess(const uint32_t& aPid, const InfallibleTArray& aFds) MOZ_OVERRIDE; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 6e457aa2f6ff..ae946537801c 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -518,7 +518,6 @@ child: intr GetProfile() returns (nsCString aProfile); - NuwaFreeze(); parent: /** * Tell the parent process a new accessible document has been created. @@ -729,9 +728,6 @@ parent: async SystemMessageHandled(); NuwaReady(); - // Sent when nuwa finished its initialization process and is waiting for - // parent's signal to make it freeze. - NuwaWaitForFreeze(); sync AddNewProcess(uint32_t pid, ProtocolFdMapping[] aFds); diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 4429487389e9..af12d02de2cd 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -833,21 +833,6 @@ TabChild::PreloadSlowThings() ClearOnShutdown(&sPreallocatedTab); } -/*static*/ void -TabChild::PostForkPreload() -{ - // Preallocated Tab can be null if we are forked directly from b2g. In such - // case we don't need to preload anything, just return. - if (!sPreallocatedTab) { - return; - } - - // Rebuild connections to parent. - sPreallocatedTab->RecvLoadRemoteScript( - NS_LITERAL_STRING("chrome://global/content/post-fork-preload.js"), - true); -} - /*static*/ already_AddRefed TabChild::Create(nsIContentChild* aManager, const TabId& aTabId, diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 387715a0cde7..198c54f8fcfa 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -268,7 +268,6 @@ public: * on the critical path. */ static void PreloadSlowThings(); - static void PostForkPreload(); /** Return a TabChild with the given attributes. */ static already_AddRefed diff --git a/dom/ipc/jar.mn b/dom/ipc/jar.mn index 07297f4f69be..7b2d19e2e25c 100644 --- a/dom/ipc/jar.mn +++ b/dom/ipc/jar.mn @@ -9,4 +9,3 @@ toolkit.jar: content/global/BrowserElementChildPreload.js (../browser-element/BrowserElementChildPreload.js) * content/global/BrowserElementPanning.js (../browser-element/BrowserElementPanning.js) content/global/preload.js (preload.js) - content/global/post-fork-preload.js (post-fork-preload.js) diff --git a/dom/ipc/post-fork-preload.js b/dom/ipc/post-fork-preload.js deleted file mode 100644 index f5238beb2cdb..000000000000 --- a/dom/ipc/post-fork-preload.js +++ /dev/null @@ -1,20 +0,0 @@ -/* 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/. */ - -// Preload some things, in an attempt to make app startup faster. -// -// This script is run when the preallocated process starts. It is injected as -// a frame script. -// If Nuwa process is enabled, this script will run in preallocated process -// forked by Nuwa. - -(function (global) { - "use strict"; - - Components.utils.import("resource://gre/modules/AppsServiceChild.jsm"); - Components.classes["@mozilla.org/network/protocol-proxy-service;1"]. - getService(Ci["nsIProtocolProxyService"]); - - DOMApplicationRegistry.resetList(); -})(this); diff --git a/dom/ipc/preload.js b/dom/ipc/preload.js index 15ea804294ee..891635e56e46 100644 --- a/dom/ipc/preload.js +++ b/dom/ipc/preload.js @@ -6,7 +6,6 @@ // // This script is run when the preallocated process starts. It is injected as // a frame script. -// If nuwa is enabled, this script will run in Nuwa process before frozen. const BrowserElementIsPreloaded = true; @@ -54,6 +53,7 @@ const BrowserElementIsPreloaded = true; Cc["@mozilla.org/network/idn-service;1"].getService(Ci["nsIIDNService"]); Cc["@mozilla.org/network/io-service;1"].getService(Ci["nsIIOService2"]); Cc["@mozilla.org/network/mime-hdrparam;1"].getService(Ci["nsIMIMEHeaderParam"]); + Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(Ci["nsIProtocolProxyService"]); Cc["@mozilla.org/network/socket-transport-service;1"].getService(Ci["nsISocketTransportService"]); Cc["@mozilla.org/network/stream-transport-service;1"].getService(Ci["nsIStreamTransportService"]); Cc["@mozilla.org/network/url-parser;1?auth=maybe"].getService(Ci["nsIURLParser"]); diff --git a/dom/ipc/tests/test_NuwaProcessCreation.html b/dom/ipc/tests/test_NuwaProcessCreation.html index 698c5fa3f16c..55c7e1636a05 100644 --- a/dom/ipc/tests/test_NuwaProcessCreation.html +++ b/dom/ipc/tests/test_NuwaProcessCreation.html @@ -76,7 +76,7 @@ function runTest() let timeout = setTimeout(function() { ok(false, "Nuwa process is not launched"); testEnd(); - }, 240000); + }, 60000); function testEnd() { cpmm.removeMessageListener("TEST-ONLY:nuwa-ready", msgHandler); diff --git a/dom/ipc/tests/test_NuwaProcessDeadlock.html b/dom/ipc/tests/test_NuwaProcessDeadlock.html index 9b54718fee80..bb90b36e599f 100644 --- a/dom/ipc/tests/test_NuwaProcessDeadlock.html +++ b/dom/ipc/tests/test_NuwaProcessDeadlock.html @@ -77,7 +77,7 @@ function runTest() let timeout = setTimeout(function() { ok(false, "Nuwa process is not launched"); testEnd(); - }, 240000); + }, 90000); function testEnd() { cpmm.removeMessageListener("TEST-ONLY:nuwa-ready", msgHandler); diff --git a/dom/wifi/WifiProxyService.cpp b/dom/wifi/WifiProxyService.cpp index 9f42ad11362b..878ac5b6956c 100644 --- a/dom/wifi/WifiProxyService.cpp +++ b/dom/wifi/WifiProxyService.cpp @@ -65,9 +65,6 @@ public: NS_IMETHOD Run() { MOZ_ASSERT(!NS_IsMainThread()); -#ifdef MOZ_NUWA_PROCESS - NS_SetIgnoreStatusOfCurrentThread(); -#endif nsAutoString event; gWpaSupplicant->WaitForEvent(event, mInterface); if (!event.IsEmpty()) { diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 45e4962b3125..2ff28cebc1c8 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -65,7 +65,6 @@ #include "nsPrintfCString.h" #include "nsProxyRelease.h" #include "nsSandboxFlags.h" -#include "nsThread.h" #include "xpcpublic.h" #ifdef ANDROID @@ -4167,17 +4166,6 @@ WorkerPrivate::DoRunLoop(JSContext* aCx) { MutexAutoLock lock(mMutex); -#ifdef MOZ_NUWA_PROCESS - { - nsThread *thr = static_cast(NS_GetCurrentThread()); - ReentrantMonitorAutoEnter mon(thr->ThreadStatusMonitor()); - if (mControlQueue.IsEmpty() && - !(normalRunnablesPending = NS_HasPendingEvents(mThread))) { - thr->SetIdle(); - } - } -#endif // MOZ_NUWA_PROCESS - while (mControlQueue.IsEmpty() && !(normalRunnablesPending = NS_HasPendingEvents(mThread))) { WaitForWorkerEvents(); diff --git a/netwerk/base/src/nsSocketTransportService2.cpp b/netwerk/base/src/nsSocketTransportService2.cpp index a17fc7cb3064..c664bca538af 100644 --- a/netwerk/base/src/nsSocketTransportService2.cpp +++ b/netwerk/base/src/nsSocketTransportService2.cpp @@ -701,7 +701,6 @@ nsSocketTransportService::Run() "NuwaMarkCurrentThread is undefined!"); NuwaMarkCurrentThread(nullptr, nullptr); } - NS_SetIgnoreStatusOfCurrentThread(); #endif SOCKET_LOG(("STS thread init\n")); diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index 0f75b6ea3ad2..5120c014dcdd 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -805,7 +805,7 @@ class B2GOptions(MochitestOptions): defaults["testPath"] = "" defaults["extensionsToExclude"] = ["specialpowers"] # See dependencies of bug 1038943. - defaults["defaultLeakThreshold"] = 5308 + defaults["defaultLeakThreshold"] = 5180 self.set_defaults(**defaults) def verifyRemoteOptions(self, options): diff --git a/widget/gonk/GonkMemoryPressureMonitoring.cpp b/widget/gonk/GonkMemoryPressureMonitoring.cpp index ac018c046a70..949f36c5bf16 100644 --- a/widget/gonk/GonkMemoryPressureMonitoring.cpp +++ b/widget/gonk/GonkMemoryPressureMonitoring.cpp @@ -127,8 +127,6 @@ public: } #endif - NS_SetIgnoreStatusOfCurrentThread(); - int lowMemFd = open("/sys/kernel/mm/lowmemkiller/notify_trigger_active", O_RDONLY | O_CLOEXEC); NS_ENSURE_STATE(lowMemFd != -1); diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp index ce914d7d15c7..c6d43dc09be8 100644 --- a/xpcom/glue/nsThreadUtils.cpp +++ b/xpcom/glue/nsThreadUtils.cpp @@ -375,11 +375,3 @@ nsAutoLowPriorityIO::~nsAutoLowPriorityIO() #endif } -#ifdef MOZ_NUWA_PROCESS -#ifdef MOZILLA_INTERNAL_API -void -NS_SetIgnoreStatusOfCurrentThread() { - nsThreadManager::get()->SetIgnoreThreadStatus(); -} -#endif // MOZILLA_INTERNAL_API -#endif // MOZ_NUWA_PROCESS diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index 93c4b31ff220..47c7eaee4fe6 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -565,19 +565,4 @@ private: void NS_SetMainThread(); -/** - * Helpers for thread to report their status when compiled with Nuwa. - */ -#ifdef MOZILLA_INTERNAL_API -#ifdef MOZ_NUWA_PROCESS -extern void -NS_SetIgnoreStatusOfCurrentThread(); -#else // MOZ_NUWA_PROCESS -inline void -NS_SetIgnoreStatusOfCurrentThread() -{ -} -#endif // MOZ_NUWA_PROCESS -#endif // MOZILLA_INTERNAL_API - #endif // nsThreadUtils_h__ diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index 39281be80490..7689c80e3bfb 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -207,7 +207,6 @@ TimerThread::Run() } #endif - NS_SetIgnoreStatusOfCurrentThread(); MonitorAutoLock lock(mMonitor); // We need to know how many microseconds give a positive PRIntervalTime. This diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 796d8cbe7cca..d660d981887e 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -13,6 +13,7 @@ #undef LOG #endif +#include "mozilla/ReentrantMonitor.h" #include "nsMemoryPressure.h" #include "nsThreadManager.h" #include "nsIClassInfoImpl.h" @@ -328,10 +329,6 @@ nsThread::ThreadFunc(void* aArg) // Inform the ThreadManager nsThreadManager::get()->RegisterCurrentThread(self); -#ifdef MOZ_NUWA_PROCESS - self->mThreadStatusInfo = - static_cast(nsThreadManager::get()->GetCurrentThreadStatusInfo()); -#endif mozilla::IOInterposer::RegisterCurrentThread(); @@ -437,10 +434,6 @@ nsThread::nsThread(MainThreadFlag aMainThread, uint32_t aStackSize) , mShutdownRequired(false) , mEventsAreDoomed(false) , mIsMainThread(aMainThread) -#ifdef MOZ_NUWA_PROCESS - , mThreadStatusMonitor("nsThread.mThreadStatusLock") - , mThreadStatusInfo(nullptr) -#endif { } @@ -488,11 +481,6 @@ nsThread::InitCurrentThread() SetupCurrentThreadForChaosMode(); nsThreadManager::get()->RegisterCurrentThread(this); -#ifdef MOZ_NUWA_PROCESS - mThreadStatusInfo = - static_cast(nsThreadManager::get()->GetCurrentThreadStatusInfo()); -#endif - return NS_OK; } @@ -508,15 +496,7 @@ nsThread::PutEvent(nsIRunnable* aEvent, nsNestedEventTarget* aTarget) NS_WARNING("An event was posted to a thread that will never run it (rejected)"); return NS_ERROR_UNEXPECTED; } -#ifdef MOZ_NUWA_PROCESS - { - ReentrantMonitorAutoEnter mon(mThreadStatusMonitor); - SetWorking(); -#endif // MOZ_NUWA_PROCESS - queue->PutEvent(aEvent); -#ifdef MOZ_NUWA_PROCESS - } -#endif // MOZ_NUWA_PROCESS + queue->PutEvent(aEvent); // Make sure to grab the observer before dropping the lock, otherwise the // event that we just placed into the queue could run and eventually delete @@ -857,15 +837,6 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult) --mRunningEvent; -#ifdef MOZ_NUWA_PROCESS - { - ReentrantMonitorAutoEnter mon(mThreadStatusMonitor); - if ((!mEvents->GetEvent(false, nullptr)) && (mRunningEvent == 0)) { - SetIdle(); - } - } -#endif // MOZ_NUWA_PROCESS - NOTIFY_EVENT_OBSERVERS(AfterProcessNextEvent, (this, mRunningEvent, *aResult)); @@ -1075,22 +1046,6 @@ nsThread::SetMainThreadObserver(nsIThreadObserver* aObserver) return NS_OK; } -#ifdef MOZ_NUWA_PROCESS -void -nsThread::SetWorking() -{ - nsThreadManager::get()->SetThreadIsWorking( - static_cast(mThreadStatusInfo), true); -} - -void -nsThread::SetIdle() -{ - nsThreadManager::get()->SetThreadIsWorking( - static_cast(mThreadStatusInfo), false); -} -#endif - //----------------------------------------------------------------------------- NS_IMETHODIMP diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h index 6ee9bac852c1..a9080972b89e 100644 --- a/xpcom/threads/nsThread.h +++ b/xpcom/threads/nsThread.h @@ -16,7 +16,6 @@ #include "nsTObserverArray.h" #include "mozilla/Attributes.h" #include "nsAutoPtr.h" -#include "mozilla/ReentrantMonitor.h" // A native thread class nsThread @@ -66,14 +65,6 @@ public: static nsresult SetMainThreadObserver(nsIThreadObserver* aObserver); -#ifdef MOZ_NUWA_PROCESS - void SetWorking(); - void SetIdle(); - mozilla::ReentrantMonitor& ThreadStatusMonitor() { - return mThreadStatusMonitor; - } -#endif - protected: static nsIThreadObserver* sMainThreadObserver; @@ -191,12 +182,6 @@ protected: // Set to true when events posted to this thread will never run. bool mEventsAreDoomed; MainThreadFlag mIsMainThread; -#ifdef MOZ_NUWA_PROCESS - mozilla::ReentrantMonitor mThreadStatusMonitor; - // The actual type is defined in nsThreadManager.h which is not exposed to - // file out of thread module. - void* mThreadStatusInfo; -#endif }; //----------------------------------------------------------------------------- diff --git a/xpcom/threads/nsThreadManager.cpp b/xpcom/threads/nsThreadManager.cpp index 35f6e9d83cc7..9ba0ee7d3f11 100644 --- a/xpcom/threads/nsThreadManager.cpp +++ b/xpcom/threads/nsThreadManager.cpp @@ -11,7 +11,6 @@ #include "nsTArray.h" #include "nsAutoPtr.h" #include "mozilla/ThreadLocal.h" -#include "mozilla/ReentrantMonitor.h" #ifdef MOZ_CANARY #include #include @@ -48,54 +47,6 @@ NS_SetMainThread() typedef nsTArray> nsThreadArray; -#ifdef MOZ_NUWA_PROCESS -class NotifyAllThreadsWereIdle: public nsRunnable -{ -public: - - NotifyAllThreadsWereIdle( - nsTArray>* aListeners) - : mListeners(aListeners) - { - } - - virtual NS_IMETHODIMP - Run() { - // Copy listener array, which may be modified during call back. - nsTArray> arr(*mListeners); - for (size_t i = 0; i < arr.Length(); i++) { - arr[i]->OnAllThreadsWereIdle(); - } - return NS_OK; - } - -private: - // Raw pointer, since it's pointing to a member of thread manager. - nsTArray>* mListeners; -}; - -struct nsThreadManager::ThreadStatusInfo { - Atomic mWorking; - Atomic mWillBeWorking; - bool mIgnored; - nsThreadManager *mMgr; - ThreadStatusInfo(nsThreadManager *aManager) - : mWorking(false) - , mWillBeWorking(false) - , mIgnored(false) - , mMgr(aManager) - { - ReentrantMonitorAutoEnter mon(*(mMgr->mMonitor)); - mMgr->mThreadStatusInfos.AppendElement(this); - } - ~ThreadStatusInfo() - { - ReentrantMonitorAutoEnter mon(*(mMgr->mMonitor)); - mMgr->mThreadStatusInfos.RemoveElement(this); - } -}; -#endif // MOZ_NUWA_PROCESS - //----------------------------------------------------------------------------- static void @@ -104,14 +55,6 @@ ReleaseObject(void* aData) static_cast(aData)->Release(); } -#ifdef MOZ_NUWA_PROCESS -static void -DeleteThreadStatusInfo(void* aData) -{ - delete static_cast(aData); -} -#endif - static PLDHashOperator AppendAndRemoveThread(PRThread* aKey, nsRefPtr& aThread, void* aArg) { @@ -153,17 +96,7 @@ nsThreadManager::Init() return NS_ERROR_FAILURE; } -#ifdef MOZ_NUWA_PROCESS - if (PR_NewThreadPrivateIndex(&mThreadStatusInfoIndex, - DeleteThreadStatusInfo) == PR_FAILURE) { - return NS_ERROR_FAILURE; - } -#endif // MOZ_NUWA_PROCESS - mLock = new Mutex("nsThreadManager.mLock"); -#ifdef MOZ_NUWA_PROCESS - mMonitor = MakeUnique("nsThreadManager.mMonitor"); -#endif // MOZ_NUWA_PROCESS #ifdef MOZ_CANARY const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NONBLOCK; @@ -261,9 +194,6 @@ nsThreadManager::Shutdown() // Remove the TLS entry for the main thread. PR_SetThreadPrivate(mCurThreadIndex, nullptr); -#ifdef MOZ_NUWA_PROCESS - PR_SetThreadPrivate(mThreadStatusInfoIndex, nullptr); -#endif } void @@ -296,9 +226,6 @@ nsThreadManager::UnregisterCurrentThread(nsThread* aThread) PR_SetThreadPrivate(mCurThreadIndex, nullptr); // Ref-count balanced via ReleaseObject -#ifdef MOZ_NUWA_PROCESS - PR_SetThreadPrivate(mThreadStatusInfoIndex, nullptr); -#endif } nsThread* @@ -323,21 +250,6 @@ nsThreadManager::GetCurrentThread() return thread.get(); // reference held in TLS } -#ifdef MOZ_NUWA_PROCESS -nsThreadManager::ThreadStatusInfo* -nsThreadManager::GetCurrentThreadStatusInfo() -{ - void* data = PR_GetThreadPrivate(mThreadStatusInfoIndex); - if (!data) { - ThreadStatusInfo *thrInfo = new ThreadStatusInfo(this); - PR_SetThreadPrivate(mThreadStatusInfoIndex, thrInfo); - data = thrInfo; - } - - return static_cast(data); -} -#endif - NS_IMETHODIMP nsThreadManager::NewThread(uint32_t aCreationFlags, uint32_t aStackSize, @@ -430,127 +342,3 @@ nsThreadManager::GetHighestNumberOfThreads() MutexAutoLock lock(*mLock); return mHighestNumberOfThreads; } - -#ifdef MOZ_NUWA_PROCESS -void -nsThreadManager::SetIgnoreThreadStatus() -{ - GetCurrentThreadStatusInfo()->mIgnored = true; -} - -void -nsThreadManager::SetThreadIdle() -{ - SetThreadIsWorking(GetCurrentThreadStatusInfo(), false); -} - -void -nsThreadManager::SetThreadWorking() -{ - SetThreadIsWorking(GetCurrentThreadStatusInfo(), true); -} - -void -nsThreadManager::SetThreadIsWorking(ThreadStatusInfo* aInfo, bool aIsWorking) -{ - aInfo->mWillBeWorking = aIsWorking; - if (mThreadsIdledListeners.Length() > 0) { - - // A race condition occurs since we don't want threads to try to enter the - // monitor (nsThreadManager::mMonitor) when no one cares about their status. - // And thus the race can happen when we put the first listener into - // |mThreadsIdledListeners|: - // - // (1) Thread A wants to dispatch a task to Thread B. - // (2) Thread A checks |mThreadsIdledListeners|, and nothing is in the - // list. So Thread A decides not to enter |mMonitor| when updating B's - // status. - // (3) Thread A is suspended just before it changed status of B. - // (4) A listener is added to |mThreadsIdledListeners| - // (5) Now is Thread C's turn to run. Thread C finds there's something in - // |mThreadsIdledListeners|, so it enters |mMonitor| and check all - // thread info structs in |mThreadStatusInfos| while A is in the middle - // of changing B's status. - // - // Then C may find Thread B is an idle thread (which is not correct, because - // A attempted to change B's status prior to C starting to walk throught - // |mThreadStatusInfo|), but the fact that thread A is working (thread A - // hasn't finished dispatching a task to thread B) can prevent thread C from - // firing a bogus notification. - // - // If the state transition that happens outside the monitor is in the other - // direction, the race condition could be: - // - // (1) Thread D has just finished its jobs and wants to set its status to idle. - // (2) Thread D checks |mThreadsIdledListeners|, and nothing is in the list. - // So Thread D decides not to enter |mMonitor|. - // (3) Thread D is is suspended before it updates its own status. - // (4) A listener is put into |mThreadsIdledListeners|. - // (5) Thread C wants to changes status of itself. It checks - // |mThreadsIdledListeners| and finds something inside the list. Thread C - // then enters |mMonitor|, updates its status and checks thread info in - // |mThreadStatusInfos| while D is changing status of itself out of monitor. - // - // Thread C will find that thread D is working (D actually wants to change its - // status to idle before C starting to check), then C returns without firing - // any notification. Finding that thread D is working can make our checking - // mechanism miss a chance to fire a notification: because thread D thought - // there's nothing in |mThreadsIdledListeners| and thus won't check the - // |mThreadStatusInfos| after changing the status of itself. - // - // |mWillBeWorking| can be used to address this problem. We require each - // thread to put the value that is going to be set to |mWorking| to - // |mWillBeWorking| before the thread decide whether it should enter - // |mMonitor| to change status or not. Thus C finds that D is working while - // D's |mWillBeWorking| is false, and C realizes that D is just updating and - // can treat D as an idle thread. - // - // It doesn't matter whether D will check thread status after changing its - // own status or not. If D checks, which means D will enter the monitor - // before updating status, thus D must be blocked until C has finished - // dispatching the notification task to main thread, and D will find that main - // thread is working and will not fire an additional event. On the other hand, - // if D doesn't check |mThreadStatusInfos|, it's still ok, because C has - // treated D as an idle thread already. - - bool hasWorkingThread = false; - ReentrantMonitorAutoEnter mon(*mMonitor); - // Get data structure of thread info. - aInfo->mWorking = aIsWorking; - for (size_t i = 0; i < mThreadStatusInfos.Length(); i++) { - ThreadStatusInfo *info = mThreadStatusInfos[i]; - if (!info->mIgnored) { - if (info->mWorking) { - if (info->mWillBeWorking) { - hasWorkingThread = true; - break; - } - } - } - } - if (!hasWorkingThread) { - nsRefPtr runnable = - new NotifyAllThreadsWereIdle(&mThreadsIdledListeners); - NS_DispatchToMainThread(runnable); - } - } else { - // Update thread info without holding any lock. - aInfo->mWorking = aIsWorking; - } -} - - -void -nsThreadManager::AddAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener) -{ - MOZ_ASSERT(GetCurrentThreadStatusInfo()->mWorking); - mThreadsIdledListeners.AppendElement(listener); -} - -void -nsThreadManager::RemoveAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener) -{ - mThreadsIdledListeners.RemoveElement(listener); -} - -#endif // MOZ_NUWA_PROCESS diff --git a/xpcom/threads/nsThreadManager.h b/xpcom/threads/nsThreadManager.h index 70eceb471749..54d9c5d561f6 100644 --- a/xpcom/threads/nsThreadManager.h +++ b/xpcom/threads/nsThreadManager.h @@ -14,26 +14,9 @@ class nsIRunnable; -namespace mozilla { -class ReentrantMonitor; -} - class nsThreadManager : public nsIThreadManager { public: -#ifdef MOZ_NUWA_PROCESS - struct ThreadStatusInfo; - class AllThreadsWereIdleListener { - public: - NS_INLINE_DECL_REFCOUNTING(AllThreadsWereIdleListener); - virtual void OnAllThreadsWereIdle() = 0; - protected: - virtual ~AllThreadsWereIdleListener() - { - } - }; -#endif // MOZ_NUWA_PROCESS - NS_DECL_ISUPPORTS NS_DECL_NSITHREADMANAGER @@ -71,17 +54,6 @@ public: { } -#ifdef MOZ_NUWA_PROCESS - void SetIgnoreThreadStatus(); - void SetThreadIdle(); - void SetThreadWorking(); - void SetThreadIsWorking(ThreadStatusInfo* aInfo, bool aIsWorking); - - void AddAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener); - void RemoveAllThreadsWereIdleListener(AllThreadsWereIdleListener *listener); - ThreadStatusInfo* GetCurrentThreadStatusInfo(); -#endif // MOZ_NUWA_PROCESS - private: nsThreadManager() : mCurThreadIndex(0) @@ -90,9 +62,6 @@ private: , mInitialized(false) , mCurrentNumberOfThreads(1) , mHighestNumberOfThreads(1) -#ifdef MOZ_NUWA_PROCESS - , mMonitor(nullptr) -#endif { } @@ -109,13 +78,6 @@ private: uint32_t mCurrentNumberOfThreads; // The highest number of threads encountered so far during the session uint32_t mHighestNumberOfThreads; - -#ifdef MOZ_NUWA_PROCESS - unsigned mThreadStatusInfoIndex; - nsTArray> mThreadsIdledListeners; - nsTArray mThreadStatusInfos; - mozilla::UniquePtr mMonitor; -#endif // MOZ_NUWA_PROCESS }; #define NS_THREADMANAGER_CID \ diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index 2cccc371158e..91c769438ef2 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -150,6 +150,7 @@ NS_IMETHODIMP nsThreadPool::Run() { LOG(("THRD-P(%p) enter\n", this)); + mThreadNaming.SetThreadPoolName(mName); nsCOMPtr current; @@ -207,9 +208,6 @@ nsThreadPool::Run() } else { PRIntervalTime delta = timeout - (now - idleSince); LOG(("THRD-P(%p) waiting [%d]\n", this, delta)); -#ifdef MOZ_NUWA_PROCESS - nsThreadManager::get()->SetThreadIdle(); -#endif // MOZ_NUWA_PROCESS mon.Wait(delta); } } else if (wasIdle) { @@ -219,9 +217,6 @@ nsThreadPool::Run() } if (event) { LOG(("THRD-P(%p) running [%p]\n", this, event.get())); -#ifdef MOZ_NUWA_PROCESS - nsThreadManager::get()->SetThreadWorking(); -#endif // MOZ_NUWA_PROCESS event->Run(); } } while (!exitThread); diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index f601152bb425..1616eb9f88e9 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -559,13 +559,6 @@ nsTimerImpl::Fire() return; } -#ifdef MOZ_NUWA_PROCESS - if (IsNuwaProcess() && IsNuwaReady()) { - // A timer event fired after Nuwa frozen can freeze main thread. - return; - } -#endif - PROFILER_LABEL("Timer", "Fire", js::ProfileEntry::Category::OTHER); From d8aa973126d6a42e808911079f3ec064abe2a208 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 24 Nov 2014 16:23:51 -0800 Subject: [PATCH 88/88] Bug 1104301 - Re-disable this test on linux after an accidental reenabling. r=me a=merge --- testing/marionette/client/marionette/tests/unit/unit-tests.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/marionette/client/marionette/tests/unit/unit-tests.ini b/testing/marionette/client/marionette/tests/unit/unit-tests.ini index c4655fc35cec..5f18c92a7e51 100644 --- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini +++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini @@ -132,6 +132,6 @@ browser = false b2g = false [test_set_window_size.py] b2g = false -[test_set_frame_timeout.py] skip-if = os == "linux" # Bug 1085717 +[test_set_frame_timeout.py] [test_with_using_context.py]