From 1987682c019e2913cd6f3f926939bab28175f2fe Mon Sep 17 00:00:00 2001 From: Cristina Coroiu Date: Thu, 14 Jun 2018 21:44:00 +0300 Subject: [PATCH 01/22] Bug 1468201 - Removed old references in manifests to win8 and win10. r=jmaher --- .../drawFocusIfNeeded_004.html.ini | 1 - .../2d.gradient.interpolate.overlap.html.ini | 8 -------- .../2d.pattern.image.broken.html.ini | 5 ----- .../path-objects/2d.path.arc.selfintersect.1.html.ini | 7 ------- .../2dcontext/path-objects/2d.path.arc.shape.3.html.ini | 5 ----- .../2dcontext/path-objects/2d.path.rect.zero.3.html.ini | 8 -------- .../2dcontext/path-objects/2d.path.stroke.scale2.html.ini | 8 -------- 7 files changed, 42 deletions(-) delete mode 100644 testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini diff --git a/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini b/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini index 2cfcc1602734..ed5b2a6b1040 100644 --- a/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini +++ b/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini @@ -3,7 +3,6 @@ if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1092458 [drawFocusIfNeeded does draw a focus ring if the element is in focus.] expected: - if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL if not debug and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): FAIL if not debug and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL diff --git a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini deleted file mode 100644 index aabd83da2bd8..000000000000 --- a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[2d.gradient.interpolate.overlap.html] - [Canvas test: 2d.gradient.interpolate.overlap] - expected: - if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - diff --git a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini deleted file mode 100644 index 279a1bafdb21..000000000000 --- a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.pattern.image.broken.html] - [Canvas test: 2d.pattern.image.broken] - disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1016482 - expected: - if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini deleted file mode 100644 index 2b320583adde..000000000000 --- a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[2d.path.arc.selfintersect.1.html] - [arc() with lineWidth > 2*radius is drawn sensibly] - expected: - if (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini deleted file mode 100644 index df668ca6ec84..000000000000 --- a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[2d.path.arc.shape.3.html] - [arc() from 0 to -pi/2 does not draw anything in the wrong quadrant] - expected: - if (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini deleted file mode 100644 index 95d4ee294b41..000000000000 --- a/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[2d.path.rect.zero.3.html] - [Canvas test: 2d.path.rect.zero.3] - expected: - if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini deleted file mode 100644 index 66517ca52b90..000000000000 --- a/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[2d.path.stroke.scale2.html] - [Stroke line widths are scaled by the current transformation matrix] - expected: - if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL - From 232bed73902e7fe0c0a7b70e078af49795fd18f2 Mon Sep 17 00:00:00 2001 From: Margareta Eliza Balazs Date: Fri, 15 Jun 2018 12:16:49 +0300 Subject: [PATCH 02/22] Backed out changeset 20ab1c225917 (bug 1468201) for perma failures in /2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html --- .../drawFocusIfNeeded_004.html.ini | 1 + .../2d.gradient.interpolate.overlap.html.ini | 8 ++++++++ .../2d.pattern.image.broken.html.ini | 5 +++++ .../path-objects/2d.path.arc.selfintersect.1.html.ini | 7 +++++++ .../2dcontext/path-objects/2d.path.arc.shape.3.html.ini | 5 +++++ .../2dcontext/path-objects/2d.path.rect.zero.3.html.ini | 8 ++++++++ .../2dcontext/path-objects/2d.path.stroke.scale2.html.ini | 8 ++++++++ 7 files changed, 42 insertions(+) create mode 100644 testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini create mode 100644 testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini create mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini create mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini create mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini create mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini diff --git a/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini b/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini index ed5b2a6b1040..2cfcc1602734 100644 --- a/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini +++ b/testing/web-platform/meta/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_004.html.ini @@ -3,6 +3,7 @@ if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1092458 [drawFocusIfNeeded does draw a focus ring if the element is in focus.] expected: + if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL if not debug and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): FAIL if not debug and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL diff --git a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini new file mode 100644 index 000000000000..aabd83da2bd8 --- /dev/null +++ b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html.ini @@ -0,0 +1,8 @@ +[2d.gradient.interpolate.overlap.html] + [Canvas test: 2d.gradient.interpolate.overlap] + expected: + if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + diff --git a/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini new file mode 100644 index 000000000000..279a1bafdb21 --- /dev/null +++ b/testing/web-platform/meta/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini @@ -0,0 +1,5 @@ +[2d.pattern.image.broken.html] + [Canvas test: 2d.pattern.image.broken] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1016482 + expected: + if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini new file mode 100644 index 000000000000..2b320583adde --- /dev/null +++ b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.selfintersect.1.html.ini @@ -0,0 +1,7 @@ +[2d.path.arc.selfintersect.1.html] + [arc() with lineWidth > 2*radius is drawn sensibly] + expected: + if (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini new file mode 100644 index 000000000000..df668ca6ec84 --- /dev/null +++ b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.3.html.ini @@ -0,0 +1,5 @@ +[2d.path.arc.shape.3.html] + [arc() from 0 to -pi/2 does not draw anything in the wrong quadrant] + expected: + if (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini new file mode 100644 index 000000000000..95d4ee294b41 --- /dev/null +++ b/testing/web-platform/meta/2dcontext/path-objects/2d.path.rect.zero.3.html.ini @@ -0,0 +1,8 @@ +[2d.path.rect.zero.3.html] + [Canvas test: 2d.path.rect.zero.3] + expected: + if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini new file mode 100644 index 000000000000..66517ca52b90 --- /dev/null +++ b/testing/web-platform/meta/2dcontext/path-objects/2d.path.stroke.scale2.html.ini @@ -0,0 +1,8 @@ +[2d.path.stroke.scale2.html] + [Stroke line widths are scaled by the current transformation matrix] + expected: + if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + if not debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): FAIL + From 1f044802958021cec67a3d2e0b196c0e420a5d2d Mon Sep 17 00:00:00 2001 From: Joel Maher Date: Fri, 15 Jun 2018 09:32:22 -0400 Subject: [PATCH 03/22] Bug 1405428 - annotate crashtest files. r=gbrown --- dom/media/test/crashtests/crashtests.list | 39 ++++++++++++++++++++++ dom/media/tests/crashtests/crashtests.list | 1 + layout/generic/crashtests/crashtests.list | 1 + 3 files changed, 41 insertions(+) diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list index 9f5c3cff7d50..f17570f542cb 100644 --- a/dom/media/test/crashtests/crashtests.list +++ b/dom/media/test/crashtests/crashtests.list @@ -17,29 +17,43 @@ skip-if(Android&&AndroidVersion=='22') HTTP load 795892-1.html # bug 1358718 load 844563.html load 846612.html load 852838.html +skip-if = (verify && debug && (os == 'linux')) load 865537-1.html load 868504.html +skip-if = (verify && debug && (os == 'linux')) load 874869.html +skip-if = (verify && debug && (os == 'linux')) load 874915.html +skip-if = (verify && debug && (os == 'linux')) load 874934.html +skip-if = (verify && debug && (os == 'linux')) load 874952.html +skip-if = (verify && debug && (os == 'linux')) load 875144.html +skip-if = (verify && debug && (os == 'linux')) load 875596.html +skip-if = (verify && debug && (os == 'linux')) load 875911.html load 876024-1.html load 876024-2.html +skip-if = (verify && debug && (os == 'linux')) load 876118.html +skip-if = (verify && debug && (os == 'linux')) load 876207.html load 876215.html load 876249.html +skip-if = (verify && debug && (os == 'linux')) load 876252.html +skip-if = (verify && debug && (os == 'linux')) load 876834.html load 877527.html load 877820.html load 878014.html load 878328.html load 878407.html +skip-if = (verify && debug && (os == 'linux')) load 878478.html +skip-if = (verify && debug && (os == 'linux')) load 880129.html load 880202.html load 880342-1.html @@ -47,11 +61,13 @@ load 880342-2.html load 880384.html load 880404.html load 880724.html +skip-if = (verify && debug && (os == 'linux')) load 881775.html load 882549.html load 882956.html load 884459.html load 889042.html +skip-if = (verify && debug && (os == 'linux')) load 894104.html load 907986-1.html load 907986-2.html @@ -59,31 +75,47 @@ load 907986-3.html load 907986-4.html load 910171-1.html load 920987.html +skip-if = (verify && debug && (os == 'linux')) load 925619-1.html load 925619-2.html load 926619.html +skip-if = (verify && debug && (os == 'linux')) load 933151.html +skip-if = (verify && debug && (os == 'linux')) load 933156.html +skip-if = (verify && debug && (os == 'linux')) load 944851.html load 952756.html +skip-if = (verify && debug && (os == 'linux')) load 966636.html +skip-if = (verify && debug && (os == 'linux')) load 986901.html +skip-if = (verify && debug && (os == 'linux')) load 990794.html +skip-if = (verify && debug && (os == 'linux')) load 995289.html +skip-if = (verify && debug && (os == 'linux')) load 1012609.html +skip-if = (verify && debug && (os == 'linux')) load 1015662.html load 1020205.html +skip-if = (verify && debug && (os == 'linux')) skip-if(Android) test-pref(media.navigator.permission.disabled,true) load 1028458.html # bug 1048863 load 1041466.html +skip-if = (verify && debug && (os == 'linux')) load 1045650.html +skip-if = (verify && debug && (os == 'linux')) load 1080986.html skip-if(Android&&AndroidVersion=='21') load 1180881.html # bug 1409365 load 1197935.html load 1122218.html +skip-if = (verify && debug && (os == 'linux')) load 1127188.html load 1157994.html +skip-if = (verify && debug && (os == 'linux')) load 1158427.html load 1185176.html +skip-if = (verify && debug && (os == 'linux')) load 1185192.html load 1257700.html load 1267263.html @@ -91,7 +123,9 @@ load 1270303.html load 1304948.html load 1319486.html load 1368490.html +skip-if = (verify && debug && (os == 'linux')) load 1291702.html +skip-if = (verify && debug && (os == 'linux')) load 1378826.html load 1384248.html load 1389304.html @@ -100,13 +134,18 @@ load 1411322.html load disconnect-wrong-destination.html load analyser-channels-1.html load audiocontext-double-suspend.html +skip-if = (verify && debug && (os == 'linux')) load buffer-source-duration-1.html load buffer-source-ended-1.html +skip-if = (verify && debug && (os == 'linux')) load buffer-source-resampling-start-1.html load buffer-source-slow-resampling-1.html load doppler-1.html +skip-if = (verify && debug && (os == 'linux')) HTTP load media-element-source-seek-1.html +skip-if = (verify && debug && (os == 'linux')) load offline-buffer-source-ended-1.html +skip-if = (verify && debug && (os == 'linux')) load oscillator-ended-1.html load oscillator-ended-2.html skip-if(Android&&AndroidVersion=='22') load video-replay-after-audio-end.html # bug 1315125, bug 1358876 diff --git a/dom/media/tests/crashtests/crashtests.list b/dom/media/tests/crashtests/crashtests.list index bb74cee48bde..8f7356658ab6 100644 --- a/dom/media/tests/crashtests/crashtests.list +++ b/dom/media/tests/crashtests/crashtests.list @@ -15,6 +15,7 @@ load 860143.html load 861958.html load 863929.html load 1185191.html +skip-if = (verify && debug && (os == 'linux')) load 1281695.html load 1306476.html load 1348381.html diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 05c8146131f2..253ddcb29b11 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -587,6 +587,7 @@ load 1042489.html load 1054010-1.html load 1058954-1.html pref(dom.webcomponents.shadowdom.enabled,true) pref(dom.webcomponents.customelements.enabled,true) load 1059138-1.html +skip-if = (verify && debug && (os == 'mac' || os == 'linux')) load 1134531.html load 1134667.html load 1137723-1.html From 3f933a8020040217936866c8af46fe5a733995e7 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Fri, 15 Jun 2018 10:42:19 +0300 Subject: [PATCH 04/22] Bug 1453795 - Storage - Initialize member fields in classes/ structures. r=mak77 --HG-- extra : rebase_source : c0b1ffeea46aff5e800bbb3d62ff76c24fb2ce43 --- storage/StorageBaseStatementInternal.cpp | 3 ++- storage/mozStorageStatement.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/StorageBaseStatementInternal.cpp b/storage/StorageBaseStatementInternal.cpp index 1f586f61c6c8..819d3371bd0f 100644 --- a/storage/StorageBaseStatementInternal.cpp +++ b/storage/StorageBaseStatementInternal.cpp @@ -111,7 +111,8 @@ private: //// StorageBaseStatementInternal StorageBaseStatementInternal::StorageBaseStatementInternal() -: mAsyncStatement(nullptr) +: mNativeConnection(nullptr) +, mAsyncStatement(nullptr) { } diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp index 02d583c18027..078791b79fd4 100644 --- a/storage/mozStorageStatement.cpp +++ b/storage/mozStorageStatement.cpp @@ -111,6 +111,8 @@ static StatementClassInfo sStatementClassInfo; Statement::Statement() : StorageBaseStatementInternal() , mDBStatement(nullptr) +, mParamCount(0) +, mResultColumnCount(0) , mColumnNames() , mExecuting(false) { From ac210735e9ac1403f8e4a3407c16074cf093b3e3 Mon Sep 17 00:00:00 2001 From: Margareta Eliza Balazs Date: Fri, 15 Jun 2018 17:23:10 +0300 Subject: [PATCH 05/22] Backed out changeset b1fa2cf6ccae (bug 1405428) for frequent failures in tests/dom/media/test/crashtests/crashtests.list on a CLOSED TREE --- dom/media/test/crashtests/crashtests.list | 39 ---------------------- dom/media/tests/crashtests/crashtests.list | 1 - layout/generic/crashtests/crashtests.list | 1 - 3 files changed, 41 deletions(-) diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list index f17570f542cb..9f5c3cff7d50 100644 --- a/dom/media/test/crashtests/crashtests.list +++ b/dom/media/test/crashtests/crashtests.list @@ -17,43 +17,29 @@ skip-if(Android&&AndroidVersion=='22') HTTP load 795892-1.html # bug 1358718 load 844563.html load 846612.html load 852838.html -skip-if = (verify && debug && (os == 'linux')) load 865537-1.html load 868504.html -skip-if = (verify && debug && (os == 'linux')) load 874869.html -skip-if = (verify && debug && (os == 'linux')) load 874915.html -skip-if = (verify && debug && (os == 'linux')) load 874934.html -skip-if = (verify && debug && (os == 'linux')) load 874952.html -skip-if = (verify && debug && (os == 'linux')) load 875144.html -skip-if = (verify && debug && (os == 'linux')) load 875596.html -skip-if = (verify && debug && (os == 'linux')) load 875911.html load 876024-1.html load 876024-2.html -skip-if = (verify && debug && (os == 'linux')) load 876118.html -skip-if = (verify && debug && (os == 'linux')) load 876207.html load 876215.html load 876249.html -skip-if = (verify && debug && (os == 'linux')) load 876252.html -skip-if = (verify && debug && (os == 'linux')) load 876834.html load 877527.html load 877820.html load 878014.html load 878328.html load 878407.html -skip-if = (verify && debug && (os == 'linux')) load 878478.html -skip-if = (verify && debug && (os == 'linux')) load 880129.html load 880202.html load 880342-1.html @@ -61,13 +47,11 @@ load 880342-2.html load 880384.html load 880404.html load 880724.html -skip-if = (verify && debug && (os == 'linux')) load 881775.html load 882549.html load 882956.html load 884459.html load 889042.html -skip-if = (verify && debug && (os == 'linux')) load 894104.html load 907986-1.html load 907986-2.html @@ -75,47 +59,31 @@ load 907986-3.html load 907986-4.html load 910171-1.html load 920987.html -skip-if = (verify && debug && (os == 'linux')) load 925619-1.html load 925619-2.html load 926619.html -skip-if = (verify && debug && (os == 'linux')) load 933151.html -skip-if = (verify && debug && (os == 'linux')) load 933156.html -skip-if = (verify && debug && (os == 'linux')) load 944851.html load 952756.html -skip-if = (verify && debug && (os == 'linux')) load 966636.html -skip-if = (verify && debug && (os == 'linux')) load 986901.html -skip-if = (verify && debug && (os == 'linux')) load 990794.html -skip-if = (verify && debug && (os == 'linux')) load 995289.html -skip-if = (verify && debug && (os == 'linux')) load 1012609.html -skip-if = (verify && debug && (os == 'linux')) load 1015662.html load 1020205.html -skip-if = (verify && debug && (os == 'linux')) skip-if(Android) test-pref(media.navigator.permission.disabled,true) load 1028458.html # bug 1048863 load 1041466.html -skip-if = (verify && debug && (os == 'linux')) load 1045650.html -skip-if = (verify && debug && (os == 'linux')) load 1080986.html skip-if(Android&&AndroidVersion=='21') load 1180881.html # bug 1409365 load 1197935.html load 1122218.html -skip-if = (verify && debug && (os == 'linux')) load 1127188.html load 1157994.html -skip-if = (verify && debug && (os == 'linux')) load 1158427.html load 1185176.html -skip-if = (verify && debug && (os == 'linux')) load 1185192.html load 1257700.html load 1267263.html @@ -123,9 +91,7 @@ load 1270303.html load 1304948.html load 1319486.html load 1368490.html -skip-if = (verify && debug && (os == 'linux')) load 1291702.html -skip-if = (verify && debug && (os == 'linux')) load 1378826.html load 1384248.html load 1389304.html @@ -134,18 +100,13 @@ load 1411322.html load disconnect-wrong-destination.html load analyser-channels-1.html load audiocontext-double-suspend.html -skip-if = (verify && debug && (os == 'linux')) load buffer-source-duration-1.html load buffer-source-ended-1.html -skip-if = (verify && debug && (os == 'linux')) load buffer-source-resampling-start-1.html load buffer-source-slow-resampling-1.html load doppler-1.html -skip-if = (verify && debug && (os == 'linux')) HTTP load media-element-source-seek-1.html -skip-if = (verify && debug && (os == 'linux')) load offline-buffer-source-ended-1.html -skip-if = (verify && debug && (os == 'linux')) load oscillator-ended-1.html load oscillator-ended-2.html skip-if(Android&&AndroidVersion=='22') load video-replay-after-audio-end.html # bug 1315125, bug 1358876 diff --git a/dom/media/tests/crashtests/crashtests.list b/dom/media/tests/crashtests/crashtests.list index 8f7356658ab6..bb74cee48bde 100644 --- a/dom/media/tests/crashtests/crashtests.list +++ b/dom/media/tests/crashtests/crashtests.list @@ -15,7 +15,6 @@ load 860143.html load 861958.html load 863929.html load 1185191.html -skip-if = (verify && debug && (os == 'linux')) load 1281695.html load 1306476.html load 1348381.html diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 253ddcb29b11..05c8146131f2 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -587,7 +587,6 @@ load 1042489.html load 1054010-1.html load 1058954-1.html pref(dom.webcomponents.shadowdom.enabled,true) pref(dom.webcomponents.customelements.enabled,true) load 1059138-1.html -skip-if = (verify && debug && (os == 'mac' || os == 'linux')) load 1134531.html load 1134667.html load 1137723-1.html From a5011c3494a6a32426f87a63c56f5777ff41ff30 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Fri, 15 Jun 2018 11:18:05 -0400 Subject: [PATCH 06/22] No bug - Fix copypasta in error message. r=me and DONTBUILD --- gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp index b3800e23454c..1b2b16d231f9 100644 --- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp @@ -206,7 +206,7 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::Pipeli LayersId layersId = wr::AsLayersId(aPipelineId); // Check to see if this child process has access to this layer tree. if (!LayerTreeOwnerTracker::Get()->IsMapped(layersId, OtherPid())) { - NS_ERROR("Unexpected layers id in AllocPAPZCTreeManagerParent; dropping message..."); + NS_ERROR("Unexpected layers id in AllocPWebRenderBridgeParent; dropping message..."); return nullptr; } From 624b54e8cfc772c4928fbb3393f0d88c6be1be16 Mon Sep 17 00:00:00 2001 From: Simon Fraser Date: Fri, 15 Jun 2018 08:29:54 -0700 Subject: [PATCH 07/22] Bug 1468386 Clean up unused funsize-balrog-submitter image r=mtabara Reviewers: mtabara Reviewed By: mtabara Subscribers: sfraser, mtabara Bug #: 1468386 Differential Revision: https://phabricator.services.mozilla.com/D1648 --HG-- extra : rebase_source : 0dd07397c7b27bcfa06f24a831d50b8f863a91e8 --- .../funsize-balrog-submitter/Dockerfile | 35 --- .../docker/funsize-balrog-submitter/Makefile | 17 -- .../funsize-balrog-submitter/dep.pubkey | 9 - .../nightly_sha1.pubkey | 9 - .../nightly_sha384.pubkey | 14 -- .../release_sha1.pubkey | 9 - .../release_sha384.pubkey | 14 -- .../funsize-balrog-submitter/requirements.txt | 1 - .../docker/funsize-balrog-submitter/runme.sh | 27 --- .../funsize-balrog-submitter-complete.py | 66 ----- .../scripts/funsize-balrog-submitter.py | 229 ------------------ .../submit_complete.sh | 23 -- 12 files changed, 453 deletions(-) delete mode 100644 taskcluster/docker/funsize-balrog-submitter/Dockerfile delete mode 100644 taskcluster/docker/funsize-balrog-submitter/Makefile delete mode 100644 taskcluster/docker/funsize-balrog-submitter/dep.pubkey delete mode 100644 taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey delete mode 100644 taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey delete mode 100644 taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey delete mode 100644 taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey delete mode 100644 taskcluster/docker/funsize-balrog-submitter/requirements.txt delete mode 100644 taskcluster/docker/funsize-balrog-submitter/runme.sh delete mode 100644 taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py delete mode 100644 taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py delete mode 100644 taskcluster/docker/funsize-balrog-submitter/submit_complete.sh diff --git a/taskcluster/docker/funsize-balrog-submitter/Dockerfile b/taskcluster/docker/funsize-balrog-submitter/Dockerfile deleted file mode 100644 index 2077f9ce6ea0..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:xenial -MAINTAINER Rail Aliiev - -# Required software -ENV DEBIAN_FRONTEND noninteractive -# Chain apt-get commands with apt-get clean in a single docker RUN -# to make sure that files are removed within a single docker layer -RUN apt-get update -q && \ - apt-get install -yyq --no-install-recommends \ - python mercurial curl python-boto python-setuptools python-cryptography \ - python-dev gcc liblzma-dev && \ - apt-get clean - -COPY requirements.txt /tmp/ -# python-pip installs a lot of dependencies increasing the size of an image -# drastically. -RUN easy_install pip -RUN pip install -r /tmp/requirements.txt - -RUN hg clone https://hg.mozilla.org/build/tools /home/worker/tools - -RUN useradd -d /home/worker -s /bin/bash -m worker - -RUN mkdir /home/worker/bin -COPY scripts/* /home/worker/bin/ -RUN mkdir /home/worker/keys -COPY *.pubkey /home/worker/keys/ -COPY runme.sh /runme.sh -COPY submit_complete.sh /submit_complete.sh -RUN chmod 755 /home/worker/bin/* /runme.sh /submit_complete.sh - -ENV HOME /home/worker -ENV SHELL /bin/bash -ENV USER worker -ENV LOGNAME worker diff --git a/taskcluster/docker/funsize-balrog-submitter/Makefile b/taskcluster/docker/funsize-balrog-submitter/Makefile deleted file mode 100644 index 2e46ee49342c..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -DOCKERIO_USERNAME =$(error DOCKERIO_USERNAME should be set) -IMAGE_NAME = funsize-balrog-submitter -FULL_IMAGE_NAME = $(DOCKERIO_USERNAME)/$(IMAGE_NAME) - -build: - docker build -t $(FULL_IMAGE_NAME) --no-cache --rm . - -push: - docker push $(FULL_IMAGE_NAME):latest - -pull: - docker pull $(FULL_IMAGE_NAME):latest - -update_pubkeys: - curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/nightly_aurora_level3_primary.der | openssl x509 -inform DER -pubkey -noout > nightly.pubkey - curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/dep1.der | openssl x509 -inform DER -pubkey -noout > dep.pubkey - curl https://hg.mozilla.org/mozilla-central/raw-file/default/toolkit/mozapps/update/updater/release_primary.der | openssl x509 -inform DER -pubkey -noout > release.pubkey diff --git a/taskcluster/docker/funsize-balrog-submitter/dep.pubkey b/taskcluster/docker/funsize-balrog-submitter/dep.pubkey deleted file mode 100644 index a1213a57ec8d..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/dep.pubkey +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzjHSobdeiQ3JHP/cCIOp -WaX9y12rL5mIo9OR9bpqEZdD0yXJJJeZA887Mv8slqsM+qObMUpKvfEE6zyYPIZJ -ANib31neI5BBYHhfhf2f5EnkilSYlmU3Gx+uRsmsdt58PpYe124tOAGgca/8bUy3 -eb6kUUTwvMI0oWQuPkGUaoHVQyj/bBMTrIkyF3UbfFtiX/SfOPvIoabNUe+pQHUe -pqC2+RxzDGj+shTq/hYhtXlptFzsEEb2+0foLy0MY8C30dP2QqbM2iavvr/P8OcS -Gm3H0TQcRzIEBzvPcIjiZi1nQj/r/3TlYRNCjuYT/HsNLXrB/U5Tc990jjAUJxdH -0wIDAQAB ------END PUBLIC KEY----- diff --git a/taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey b/taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey deleted file mode 100644 index 93c0904d55a7..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/nightly_sha1.pubkey +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4j/IS3gWbyVVnWn4ZRnC -Fuzb6VAaHa0I+4E504ekhVAhbKlSfBstkLbXajdjUVAJpn02zWnOaTl5KAdpDpIp -SkdA4mK20ej3/Ij7gIt8IwaX+ArXL8mP84pxDn5BgaNADm3206Z6YQzc/TDYu529 -qkDFmLqNUVRJAhPO+qqhKHIcVGh8HUHXN6XV1qOFip+UU0M474jAGgurVmAv8Rh7 -VvM0v5KmB6V6WHwM5gwjg2yRY/o+xYIsNeSes9rpp+MOs/RnUA6LI4WZGY4YahvX -VclIXBDgbWPYtojexIJkmYj8JIIRsh3eCsrRRe14fq7cBurp3CxBYMlDHf0RUoaq -hQIDAQAB ------END PUBLIC KEY----- diff --git a/taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey b/taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey deleted file mode 100644 index e51049844c1d..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/nightly_sha384.pubkey +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAth151NGY8PBzn0bii9Yc -AjYHZDwP9Lj1c3owG0zLqW2kPcdp86QTAcoYunHGYFFakNG3tooZhzwkMjZ1OrXc -ERjD6AuVSGIBdsKtKP4vLtMjDUteFN4K2+rveozcnYFZuTWEajGu8uoYsv4QgdEA -nTBC39j0J33xlfUR+XKuxzhxNrFX+fRFWuLDJrPziMcVA/mzf0gXlhtEsfV0HYyg -yWpHdIWww+llysD1QOQAHk94Ss8c/4BFXFxlwlLeNlB1ZqLm1LsNy0jUy9EHeO3C -H6eqmiFEbpdjlrkJdgR1NcTzeY/Qf/nhWH6BAZrSapQycF7OSLU+rFWMQUElSPLc -NVl7oNAAfSYLTvRjPGi+mJK3wGFQw1EpwQl+elE1oj4+sHvIVpDrLb6btpxfr1cZ -pR4Di/hkOIymxEDWvtUhOxUXnYbDKQSDcAHKM/xR3sdIAiVtVuL4hyBwlAqkQc2j -H+SmnCbazgnq5+dN4y5DjoOgbZQ/koE3s3bUzzMeIxaul9v4gMtGROw3PQ3OZcP0 -lgjPRhY+NeTnWMo2nGb4/eS6Cn2qFLfbEQjsj6pJJBNKfvK/gm1jXb3PgXXdf8+d -2xTPOX8QNpSK7C0w4vYlvSpYZlsx2cznEOV6LDqP0QHUnmd/k1xWRRGiQ7gtT+BV -Fn0h7JyTGmEdFu6l4OhS8hMCAwEAAQ== ------END PUBLIC KEY----- diff --git a/taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey b/taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey deleted file mode 100644 index 20df959461b4..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/release_sha1.pubkey +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvH4r94FpQ0gvr1hhTfV9 -NUeWPJ5CN6TZRq7v/Dc4nkJ1J4IP1B3UEii34tcNKpy1nKupiZuTT6T1zQYT+z5x -3UkDF9qQboQ8RNb/BEz/cN3on/LTEnZ7YSraRL11M6cEB8mvmJxddCEquwqccRbs -Usp8WUB7uRv1w6Anley7N9F/LE1iLPwJasZypRnzWb3aYsJy0cMFOYy+OXVdpktn -qYqlNIjnt84u4Nil6UXnBbIJNUVOCY8wOFClNvVpubjPkWK1gtdWy3x/hJU5RpAO -K9cnHxq4M/I4SUWTWO3r7yweQiHG4Jyoc7sP1jkwjBkSG93sDEycfwOdOoZft3wN -sQIDAQAB ------END PUBLIC KEY----- diff --git a/taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey b/taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey deleted file mode 100644 index ec1103d82847..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/release_sha384.pubkey +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxCHbY+fP3dvaP9XVbmK6 -i4rbqo72INEWgDSYbr/DIYfCSzHC9H8pU8dyjt+Nd8OtoUZtBD1N9fP7SlrvPZSI -ZSW4k0e9Ky5aV3Uy+ivamSvYszkhqdeP2y7MBu73XHKYONR9PnKa+ovmREwSEI+h -1e0ebm8zvF7Ndwx0mOeZkDu9SDkDGg4aj2xrJyBBOuGVjuctMZ6l1davANI5xiJ0 -GBEU3tR1gJs1T4vLBis5mEFn9y4kgyw/HrxmRYGnZL4fLb2fTI+pNW0Twu3KWwwi -LgLkkVrNWiHSk7YWqxjcg5IA3pQETQ17paTHoB5Mnkvuh6MkDXvRG5VgAHZAigr6 -fJMsasOUaBeos/cD1LDQEIObpetlxc0Fiu/lvUts0755otkhI+yv35+wUa6GJrsE -CsT7c/LaFtQXg06aGXbMLDn0bE/e+nw9KWT/rE1iYXMFkzrqoTeYJ+v7/fD/ywU8 -m8l4CZmXxzd/RogMrM3xl+j4ucAAltDQyL4yLySaIT05w5U8z2zJDEXFvpFDSRfF -K3kjLwGub7wNwaQDuh/msIUdavu4g+GNikCXAJ8AssLuYatyHoltd2tf+EIIDW3U -zzLpymnLo3cAz3IPfXyqVB+mcLcpqbHjl3hWms6l1wGtz6S4WqdrWs/KfzS5EyDK -r63xn1Rg/XFmR57EsFEXAZ8CAwEAAQ== ------END PUBLIC KEY----- diff --git a/taskcluster/docker/funsize-balrog-submitter/requirements.txt b/taskcluster/docker/funsize-balrog-submitter/requirements.txt deleted file mode 100644 index 0a6a33212a6e..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -mar==2.1.2 diff --git a/taskcluster/docker/funsize-balrog-submitter/runme.sh b/taskcluster/docker/funsize-balrog-submitter/runme.sh deleted file mode 100644 index 11b2fa34b309..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/runme.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -xe - -test "$PARENT_TASK_ARTIFACTS_URL_PREFIX" -test "$BALROG_API_ROOT" -test "$SHA1_SIGNING_CERT" -test "$SHA384_SIGNING_CERT" - - -ARTIFACTS_DIR="/home/worker/artifacts" -mkdir -p "$ARTIFACTS_DIR" - -curl --location --retry 10 --retry-delay 10 -o "$ARTIFACTS_DIR/manifest.json" \ - "$PARENT_TASK_ARTIFACTS_URL_PREFIX/manifest.json" - -cat "$ARTIFACTS_DIR/manifest.json" -# EXTRA_BALROG_SUBMITTER_PARAMS is optional -# shellcheck disable=SC2086 -python /home/worker/bin/funsize-balrog-submitter.py \ - --artifacts-url-prefix "$PARENT_TASK_ARTIFACTS_URL_PREFIX" \ - --manifest "$ARTIFACTS_DIR/manifest.json" \ - -a "$BALROG_API_ROOT" \ - --sha1-signing-cert "/home/worker/keys/${SHA1_SIGNING_CERT}.pubkey" \ - --sha384-signing-cert "/home/worker/keys/${SHA384_SIGNING_CERT}.pubkey" \ - --verbose \ - "$EXTRA_BALROG_SUBMITTER_PARAMS" diff --git a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py b/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py deleted file mode 100644 index c30fb1468fb0..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter-complete.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -from __future__ import absolute_import, print_function - -import site -import os -import logging -import argparse -import json - -site.addsitedir("/home/worker/tools/lib/python") - -from balrog.submitter.cli import ReleaseSubmitterV4 -from util.retry import retry - -log = logging.getLogger(__name__) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--manifest", required=True) - parser.add_argument("-a", "--api-root", required=True, - help="Balrog API root") - parser.add_argument("-v", "--verbose", action="store_const", - dest="loglevel", const=logging.DEBUG, - default=logging.INFO) - parser.add_argument("--product", help="Override product name from application.ini") - args = parser.parse_args() - logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s", - level=args.loglevel) - logging.getLogger("requests").setLevel(logging.WARNING) - logging.getLogger("boto").setLevel(logging.WARNING) - - balrog_username = os.environ.get("BALROG_USERNAME") - balrog_password = os.environ.get("BALROG_PASSWORD") - suffix = os.environ.get("BALROG_BLOB_SUFFIX") - if not balrog_username and not balrog_password: - raise RuntimeError("BALROG_USERNAME and BALROG_PASSWORD environment " - "variables should be set") - if not suffix: - raise RuntimeError("BALROG_BLOB_SUFFIX environment variable should be set") - - manifest = json.load(open(args.manifest)) - auth = (balrog_username, balrog_password) - - for e in manifest: - complete_info = [{ - "hash": e["hash"], - "size": e["size"], - }] - - submitter = ReleaseSubmitterV4(api_root=args.api_root, auth=auth, - suffix=suffix) - productName = args.product or e["appName"] - retry(lambda: submitter.run( - platform=e["platform"], productName=productName, - version=e["toVersion"], - build_number=e["toBuildNumber"], - appVersion=e["version"], extVersion=e["version"], - buildID=e["to_buildid"], locale=e["locale"], - hashFunction='sha512', completeInfo=complete_info), - attempts=30, sleeptime=10, max_sleeptime=60, jitter=3, - ) - - -if __name__ == '__main__': - main() diff --git a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py b/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py deleted file mode 100644 index 7eecaf0db8c5..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/scripts/funsize-balrog-submitter.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/env python -from __future__ import absolute_import, print_function - -import site -import os -import logging -import argparse -import json -import hashlib -import requests -import tempfile -from boto.s3.connection import S3Connection -from mardor.reader import MarReader -from mardor.signing import get_keysize - -site.addsitedir("/home/worker/tools/lib/python") - -from balrog.submitter.cli import NightlySubmitterV4, ReleaseSubmitterV4 -from util.retry import retry, retriable - -log = logging.getLogger(__name__) - - -def get_hash(content, hash_type="md5"): - h = hashlib.new(hash_type) - h.update(content) - return h.hexdigest() - - -@retriable() -def download(url, dest, mode=None): - log.debug("Downloading %s to %s", url, dest) - r = requests.get(url) - r.raise_for_status() - - bytes_downloaded = 0 - with open(dest, 'wb') as fd: - for chunk in r.iter_content(4096): - fd.write(chunk) - bytes_downloaded += len(chunk) - - log.debug('Downloaded %s bytes', bytes_downloaded) - if 'content-length' in r.headers: - log.debug('Content-Length: %s bytes', r.headers['content-length']) - if bytes_downloaded != int(r.headers['content-length']): - raise IOError('Unexpected number of bytes downloaded') - - if mode: - log.debug("chmod %o %s", mode, dest) - os.chmod(dest, mode) - - -def verify_signature(mar, certs): - log.info("Checking %s signature", mar) - with open(mar, 'rb') as mar_fh: - m = MarReader(mar_fh) - m.verify(verify_key=certs.get(m.signature_type)) - - -def verify_copy_to_s3(bucket_name, aws_access_key_id, aws_secret_access_key, - mar_url, mar_dest, signing_certs): - conn = S3Connection(aws_access_key_id, aws_secret_access_key) - bucket = conn.get_bucket(bucket_name) - _, dest = tempfile.mkstemp() - log.info("Downloading %s to %s...", mar_url, dest) - download(mar_url, dest) - log.info("Verifying the signature...") - if not os.getenv("MOZ_DISABLE_MAR_CERT_VERIFICATION"): - verify_signature(dest, signing_certs) - for name in possible_names(mar_dest, 10): - log.info("Checking if %s already exists", name) - key = bucket.get_key(name) - if not key: - log.info("Uploading to %s...", name) - key = bucket.new_key(name) - # There is a chance for race condition here. To avoid it we check - # the return value with replace=False. It should be not None. - length = key.set_contents_from_filename(dest, replace=False) - if length is None: - log.warn("Name race condition using %s, trying again...", name) - continue - else: - # key.make_public() may lead to race conditions, because - # it doesn't pass version_id, so it may not set permissions - bucket.set_canned_acl(acl_str='public-read', key_name=name, - version_id=key.version_id) - # Use explicit version_id to avoid using "latest" version - return key.generate_url(expires_in=0, query_auth=False, - version_id=key.version_id) - else: - if get_hash(retry(key.get_contents_as_string)) == \ - get_hash(open(dest).read()): - log.info("%s has the same MD5 checksum, not uploading...", - name) - return key.generate_url(expires_in=0, query_auth=False, - version_id=key.version_id) - log.info("%s already exists with different checksum, " - "trying another one...", name) - - raise RuntimeError("Cannot generate a unique name for %s", mar_dest) - - -def possible_names(initial_name, amount): - """Generate names appending counter before extension""" - prefix, ext = os.path.splitext(initial_name) - return [initial_name] + ["{}-{}{}".format(prefix, n, ext) for n in - range(1, amount + 1)] - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--artifacts-url-prefix", required=True, - help="URL prefix for MAR") - parser.add_argument("--manifest", required=True) - parser.add_argument("-a", "--api-root", required=True, - help="Balrog API root") - parser.add_argument("-d", "--dummy", action="store_true", - help="Add '-dummy' suffix to branch name") - parser.add_argument("--sha1-signing-cert", required=True) - parser.add_argument("--sha384-signing-cert", required=True) - parser.add_argument("-v", "--verbose", action="store_const", - dest="loglevel", const=logging.DEBUG, - default=logging.INFO) - parser.add_argument("--product", help="Override product name from application.ini") - args = parser.parse_args() - logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s", - level=args.loglevel) - logging.getLogger("requests").setLevel(logging.WARNING) - logging.getLogger("boto").setLevel(logging.WARNING) - - balrog_username = os.environ.get("BALROG_USERNAME") - balrog_password = os.environ.get("BALROG_PASSWORD") - if not balrog_username and not balrog_password: - raise RuntimeError("BALROG_USERNAME and BALROG_PASSWORD environment " - "variables should be set") - # blob suffix used for releases only - suffix = os.environ.get("BALROG_BLOB_SUFFIX") - - s3_bucket = os.environ.get("S3_BUCKET") - aws_access_key_id = os.environ.get("AWS_ACCESS_KEY_ID") - aws_secret_access_key = os.environ.get("AWS_SECRET_ACCESS_KEY") - if not (s3_bucket and aws_access_key_id and aws_secret_access_key): - log.warn("Skipping S3 uploads...") - uploads_enabled = False - else: - uploads_enabled = True - - manifest = json.load(open(args.manifest)) - auth = (balrog_username, balrog_password) - - signing_certs = { - 'sha1': open(args.sha1_signing_cert, 'rb').read(), - 'sha384': open(args.sha384_signing_cert, 'rb').read(), - } - - assert(get_keysize(signing_certs['sha1']) == 2048) - assert(get_keysize(signing_certs['sha384']) == 4096) - - for e in manifest: - complete_info = [{ - "hash": e["to_hash"], - "size": e["to_size"], - }] - partial_info = [{ - "hash": e["hash"], - "size": e["size"], - }] - - if "previousVersion" in e and "previousBuildNumber" in e: - log.info("Release style balrog submission") - partial_info[0]["previousVersion"] = e["previousVersion"] - partial_info[0]["previousBuildNumber"] = e["previousBuildNumber"] - submitter = ReleaseSubmitterV4(api_root=args.api_root, auth=auth, - dummy=args.dummy, suffix=suffix) - productName = args.product or e["appName"] - if suffix: - log.warning("Not submitting complete info") - complete_info = None - retry(lambda: submitter.run( - platform=e["platform"], productName=productName, - version=e["toVersion"], - build_number=e["toBuildNumber"], - appVersion=e["version"], extVersion=e["version"], - buildID=e["to_buildid"], locale=e["locale"], - hashFunction='sha512', - partialInfo=partial_info, completeInfo=complete_info), - attempts=30, sleeptime=10, max_sleeptime=60, jitter=3, - ) - elif "from_buildid" in e and uploads_enabled: - log.info("Nightly style balrog submission") - partial_mar_url = "{}/{}".format(args.artifacts_url_prefix, - e["mar"]) - complete_mar_url = e["to_mar"] - dest_prefix = "{branch}/{buildid}".format( - branch=e["branch"], buildid=e["to_buildid"]) - partial_mar_dest = "{}/{}".format(dest_prefix, e["mar"]) - complete_mar_filename = "{appName}-{branch}-{version}-" \ - "{platform}-{locale}.complete.mar" - complete_mar_filename = complete_mar_filename.format( - appName=e["appName"], branch=e["branch"], - version=e["version"], platform=e["platform"], - locale=e["locale"] - ) - complete_mar_dest = "{}/{}".format(dest_prefix, - complete_mar_filename) - partial_info[0]["url"] = verify_copy_to_s3( - s3_bucket, aws_access_key_id, aws_secret_access_key, - partial_mar_url, partial_mar_dest, signing_certs) - complete_info[0]["url"] = verify_copy_to_s3( - s3_bucket, aws_access_key_id, aws_secret_access_key, - complete_mar_url, complete_mar_dest, signing_certs) - partial_info[0]["from_buildid"] = e["from_buildid"] - submitter = NightlySubmitterV4(api_root=args.api_root, auth=auth, - dummy=args.dummy) - productName = args.product or e["appName"] - retry(lambda: submitter.run( - platform=e["platform"], buildID=e["to_buildid"], - productName=productName, branch=e["branch"], - appVersion=e["version"], locale=e["locale"], - hashFunction='sha512', extVersion=e["version"], - partialInfo=partial_info, completeInfo=complete_info), - attempts=30, sleeptime=10, max_sleeptime=60, jitter=3, - ) - else: - raise RuntimeError("Cannot determine Balrog submission style") - - -if __name__ == '__main__': - main() diff --git a/taskcluster/docker/funsize-balrog-submitter/submit_complete.sh b/taskcluster/docker/funsize-balrog-submitter/submit_complete.sh deleted file mode 100644 index a97e68f33757..000000000000 --- a/taskcluster/docker/funsize-balrog-submitter/submit_complete.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -xe - -test "$PARENT_TASK_ARTIFACTS_URL_PREFIX" -test "$BALROG_API_ROOT" -# BALROG_BLOB_SUFFIX is used by the script implicitly to avoid possible CLI -# issues with suffixes starting with "-" -test "$BALROG_BLOB_SUFFIX" - - -ARTIFACTS_DIR="/home/worker/artifacts" -mkdir -p "$ARTIFACTS_DIR" - -curl --location --retry 10 --retry-delay 10 -o "$ARTIFACTS_DIR/manifest.json" \ - "$PARENT_TASK_ARTIFACTS_URL_PREFIX/manifest.json" - -cat "$ARTIFACTS_DIR/manifest.json" -python /home/worker/bin/funsize-balrog-submitter-complete.py \ - --manifest "$ARTIFACTS_DIR/manifest.json" \ - -a "$BALROG_API_ROOT" \ - --verbose \ - "$EXTRA_BALROG_SUBMITTER_PARAMS" From 8d06ff94c2f860f38f65969dd3bd4e50afa41adc Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Thu, 14 Jun 2018 11:05:05 -0700 Subject: [PATCH 08/22] Bug 1467882 - Update cubeb from upstream to 0677b30. r=kinetik --- media/libcubeb/README_MOZILLA | 2 +- media/libcubeb/src/cubeb_sndio.c | 35 +++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/media/libcubeb/README_MOZILLA b/media/libcubeb/README_MOZILLA index a5e5a34c9259..14102c8ce9a5 100644 --- a/media/libcubeb/README_MOZILLA +++ b/media/libcubeb/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The cubeb git repository is: git://github.com/kinetiknz/cubeb.git -The git commit ID used was abf6ae235b0f15a2656f2d8692ac13708188165e (2018-06-01 13:02:45 +1200) +The git commit ID used was 0677b3027b78c629586b099b5155aa6ac7422674 (2018-06-12 08:48:55 -0700) diff --git a/media/libcubeb/src/cubeb_sndio.c b/media/libcubeb/src/cubeb_sndio.c index 5a4334316f83..9e99b2c5cbc7 100644 --- a/media/libcubeb/src/cubeb_sndio.c +++ b/media/libcubeb/src/cubeb_sndio.c @@ -51,17 +51,33 @@ struct cubeb_stream { uint64_t swpos; /* number of frames produced/consumed */ cubeb_data_callback data_cb; /* cb to preapare data */ cubeb_state_callback state_cb; /* cb to notify about state changes */ + float volume; /* current volume */ }; static void -float_to_s16(void *ptr, long nsamp) +s16_setvol(void *ptr, long nsamp, float volume) +{ + int16_t *dst = ptr; + int32_t mult = volume * 32768; + int32_t s; + + while (nsamp-- > 0) { + s = *dst; + s = (s * mult) >> 15; + *(dst++) = s; + } +} + +static void +float_to_s16(void *ptr, long nsamp, float volume) { int16_t *dst = ptr; float *src = ptr; + float mult = volume * 32768; int s; while (nsamp-- > 0) { - s = lrintf(*(src++) * 32768); + s = lrintf(*(src++) * mult); if (s < -32768) s = -32768; else if (s > 32767) @@ -169,8 +185,12 @@ sndio_mainloop(void *arg) if (prime > 0) prime--; - if ((s->mode & SIO_PLAY) && s->conv) - float_to_s16(s->pbuf, nfr * s->pchan); + if (s->mode & SIO_PLAY) { + if (s->conv) + float_to_s16(s->pbuf, nfr * s->pchan, s->volume); + else + s16_setvol(s->pbuf, nfr * s->pchan, s->volume); + } if (s->mode & SIO_REC) rstart = 0; @@ -372,6 +392,7 @@ sndio_stream_init(cubeb * context, if (s->rbuf == NULL) goto err; } + s->volume = 1.; *stream = s; DPR("sndio_stream_init() end, ok\n"); (void)context; @@ -476,7 +497,11 @@ sndio_stream_set_volume(cubeb_stream *s, float volume) { DPR("sndio_stream_set_volume(%f)\n", volume); pthread_mutex_lock(&s->mtx); - sio_setvol(s->hdl, SIO_MAXVOL * volume); + if (volume < 0.) + volume = 0.; + else if (volume > 1.0) + volume = 1.; + s->volume = volume; pthread_mutex_unlock(&s->mtx); return CUBEB_OK; } From 74030f5083074fb7339f67b7ecd85bc540550040 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 15 Jun 2018 12:24:14 -0400 Subject: [PATCH 09/22] Bug 1468991 - Update pdf.js to version 2.0.581. r=bdahl --HG-- extra : rebase_source : 40b8d336d3902abbb7d83888a8d1379c541a073a --- browser/extensions/pdfjs/README.mozilla | 4 ++-- browser/extensions/pdfjs/content/build/pdf.js | 10 +++++----- browser/extensions/pdfjs/content/build/pdf.worker.js | 6 +++--- browser/extensions/pdfjs/content/web/viewer.css | 7 ++++--- browser/extensions/pdfjs/content/web/viewer.js | 7 ------- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index abb78ec0dd22..23ef5613696b 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.0.575 +Current extension version is: 2.0.581 -Taken from upstream commit: 2030d171 +Taken from upstream commit: 790e2124 diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index c6e144b942e0..1c9379560bb6 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.0.575'; -var pdfjsBuild = '2030d171'; +var pdfjsVersion = '2.0.581'; +var pdfjsBuild = '790e2124'; var pdfjsSharedUtil = __w_pdfjs_require__(1); var pdfjsDisplayAPI = __w_pdfjs_require__(6); var pdfjsDisplayTextLayer = __w_pdfjs_require__(18); @@ -4228,7 +4228,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { } return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.0.575', + apiVersion: '2.0.581', source: { data: source.data, url: source.url, @@ -5562,8 +5562,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { }(); var version, build; { - exports.version = version = '2.0.575'; - exports.build = build = '2030d171'; + exports.version = version = '2.0.581'; + exports.build = build = '790e2124'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index 2937f0519d1d..00da68ca247d 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.0.575'; -var pdfjsBuild = '2030d171'; +var pdfjsVersion = '2.0.581'; +var pdfjsBuild = '790e2124'; var pdfjsCoreWorker = __w_pdfjs_require__(1); exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; @@ -327,7 +327,7 @@ var WorkerMessageHandler = { var cancelXHRs = null; var WorkerTasks = []; let apiVersion = docParams.apiVersion; - let workerVersion = '2.0.575'; + let workerVersion = '2.0.581'; if (apiVersion !== null && apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); } diff --git a/browser/extensions/pdfjs/content/web/viewer.css b/browser/extensions/pdfjs/content/web/viewer.css index a95657b95d18..3a3bf2e8c85e 100644 --- a/browser/extensions/pdfjs/content/web/viewer.css +++ b/browser/extensions/pdfjs/content/web/viewer.css @@ -546,7 +546,8 @@ html[dir='rtl'] #sidebarContent { bottom: 0; left: 0; outline: none; - +} +#viewerContainer:not(.pdfPresentationMode) { transition-duration: 200ms; transition-timing-function: ease; } @@ -562,12 +563,12 @@ html[dir='rtl'] #viewerContainer { transition-duration: 0s; } -html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer { +html[dir='ltr'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { transition-property: left; left: 200px; left: var(--sidebar-width); } -html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer { +html[dir='rtl'] #outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { transition-property: right; right: 200px; right: var(--sidebar-width); diff --git a/browser/extensions/pdfjs/content/web/viewer.js b/browser/extensions/pdfjs/content/web/viewer.js index c62bed0b6ada..7c2c66f5e4f8 100644 --- a/browser/extensions/pdfjs/content/web/viewer.js +++ b/browser/extensions/pdfjs/content/web/viewer.js @@ -669,9 +669,6 @@ let PDFViewerApplication = { get supportsFullscreen() { let support; support = document.fullscreenEnabled === true || document.mozFullScreenEnabled === true; - if (support && _app_options.AppOptions.get('disableFullscreen') === true) { - support = false; - } return (0, _pdfjsLib.shadow)(this, 'supportsFullscreen', support); }, get supportsIntegratedFind() { @@ -3177,10 +3174,6 @@ const defaultOptions = { value: '', kind: OptionKind.VIEWER }, - disableFullscreen: { - value: _viewer_compatibility.viewerCompatibilityParams.disableFullscreen || false, - kind: OptionKind.VIEWER - }, disableHistory: { value: false, kind: OptionKind.VIEWER From 74f9fbc8b16b2842634986882f23cf3f6a76e5c7 Mon Sep 17 00:00:00 2001 From: Christoph Diehl Date: Thu, 14 Jun 2018 19:20:49 +0200 Subject: [PATCH 10/22] Bug 1467468 - Faulty: Run ReadFile() for IsMessageNameBlacklisted() on the main thread. r=valentin, sr=froydnj --- tools/fuzzing/faulty/Faulty.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tools/fuzzing/faulty/Faulty.cpp b/tools/fuzzing/faulty/Faulty.cpp index 0964eda27cc9..28da0e3cddc7 100644 --- a/tools/fuzzing/faulty/Faulty.cpp +++ b/tools/fuzzing/faulty/Faulty.cpp @@ -19,10 +19,14 @@ #include "mozilla/ipc/Faulty.h" #include "mozilla/TypeTraits.h" #include "nsNetCID.h" +#include "nsIEventTarget.h" #include "nsIFile.h" #include "nsIFileStreams.h" #include "nsILineInputStream.h" +#include "nsIRunnable.h" +#include "nsThreadUtils.h" #include "nsLocalFile.h" +#include "nsNetCID.h" #include "nsPrintfCString.h" #include "nsTArray.h" #include "nsXULAppAPI.h" @@ -758,10 +762,23 @@ Faulty::IsMessageNameBlacklisted(const char *aMessageName) { static nsTArray sMessageBlacklist; if (!sFileLoaded && mBlacklistPath) { - if (ReadFile(mBlacklistPath, sMessageBlacklist) != NS_OK) { - return false; - } - sFileLoaded = true; + /* Run ReadFile() on the main thread to prevent + MOZ_ASSERT(NS_IsMainThread()) in nsStandardURL via nsNetStartup(). */ + nsCOMPtr r = NS_NewRunnableFunction( + "Fuzzer::ReadBlacklistOnMainThread", + [&]() { + if (Faulty::ReadFile(mBlacklistPath, sMessageBlacklist) != NS_OK) { + sFileLoaded = false; + } else { + sFileLoaded = true; + } + } + ); + NS_DispatchToMainThread(r.forget(), NS_DISPATCH_SYNC); + } + + if (!sFileLoaded) { + return false; } if (sMessageBlacklist.Length() == 0) { From f9f2b9b6e4c296d453d94e9585c643d0225e791b Mon Sep 17 00:00:00 2001 From: "Nils Ohlmeier [:drno]" Date: Wed, 13 Jun 2018 14:29:20 -0700 Subject: [PATCH 11/22] Bug 1464063 - Remove sdp_getchoosetok. r=bwc --- .../signaling/src/sdp/sipcc/sdp_private.h | 2 - .../signaling/src/sdp/sipcc/sdp_token.c | 16 ++--- .../signaling/src/sdp/sipcc/sdp_utils.c | 63 ------------------- 3 files changed, 5 insertions(+), 76 deletions(-) diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h index a98f4b119f69..3459b0c0eb48 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h @@ -347,8 +347,6 @@ extern uint32_t sdp_getnextnumtok(const char *str, const char **str_end, extern uint32_t sdp_getnextnumtok_or_null(const char *str, const char **str_end, const char *delim, tinybool *null_ind, sdp_result_e *result); -extern tinybool sdp_getchoosetok(const char *str, const char **str_end, - const char *delim, sdp_result_e *result); extern tinybool verify_sdescriptions_mki(char *buf, char *mkiVal, uint16_t *mkiLen); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c index b4ad1beee3f7..54c38f08cdac 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c @@ -1162,15 +1162,11 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, uint16_t level, const char *ptr) } port_ptr = port; for (i=0; i < SDP_MAX_PORT_PARAMS; i++) { - if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result) == TRUE) { - num[i] = SDP_CHOOSE_PARAM; - } else { - num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, - "/ \t", &result); - if (result != SDP_SUCCESS) { - break; - } - } + num[i] = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, + "/ \t", &result); + if (result != SDP_SUCCESS) { + break; + } num_port_params++; } @@ -1401,8 +1397,6 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, uint16_t level, const char *ptr) return (SDP_INVALID_PARAMETER); } mca_p->sctp_fmt = SDP_SCTP_MEDIA_FMT_WEBRTC_DATACHANNEL; - } else if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result)) { - sctp_port = SDP_CHOOSE_PARAM; } else { sctp_port = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, "/ \t", &result); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c index e4f1b2eaf0c7..4d46115574dc 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c @@ -432,69 +432,6 @@ uint32_t sdp_getnextnumtok (const char *str, const char **str_end, } -/* See if the next token in a string is the choose character. The delim - * characters are passed in as a param. The check also will not go past - * a new line char or the end of the string. Skip any delimiters before - * the token. - */ -tinybool sdp_getchoosetok (const char *str, const char **str_end, - const char *delim, sdp_result_e *result) -{ - const char *b; - int flag2moveon; - - if ((str == NULL) || (str_end == NULL)) { - *result = SDP_FAILURE; - return(FALSE); - } - - /* Locate front of token, skipping any delimiters */ - for ( ; ((*str != '\0') && (*str != '\n') && (*str != '\r')); str++) { - flag2moveon = 1; /* Default to move on unless we find a delimiter */ - for (b=delim; *b; b++) { - if (*str == *b) { - flag2moveon = 0; - break; - } - } - if( flag2moveon ) { - break; /* We're at the beginning of the token */ - } - } - - /* Make sure there's really a token present. */ - if ((*str == '\0') || (*str == '\n') || (*str == '\r')) { - *result = SDP_FAILURE; - *str_end = (char *)str; - return(FALSE); - } - - /* See if the token is '$' followed by a delimiter char or end of str. */ - if (*str == '$') { - str++; - if ((*str == '\0') || (*str == '\n') || (*str == '\r')) { - *result = SDP_SUCCESS; - /* skip the choose char in the string. */ - *str_end = (char *)(str+1); - return(TRUE); - } - for (b=delim; *b; b++) { - if (*str == *b) { - *result = SDP_SUCCESS; - /* skip the choose char in the string. */ - *str_end = (char *)(str+1); - return(TRUE); - } - } - } - - /* If the token was not '$' followed by a delim, token is not choose */ - *result = SDP_SUCCESS; - *str_end = (char *)str; - return(FALSE); - -} - /* * SDP Crypto Utility Functions. * From 8a8ae803a19ec33c4fda7908369d86c6323a8f85 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Fri, 15 Jun 2018 18:36:21 +0300 Subject: [PATCH 12/22] Bug 1453795 - WebRTC/Signaling - Initialize member fields in classes/ structures. r=jesup --HG-- extra : rebase_source : 40725f05d2085edca36f1566f649855d8f547b3b extra : amend_source : fe6b442fc1d94a559722304f93fb26ece61b93dd --- media/webrtc/signaling/gtest/sdp_unittests.cpp | 7 +++++-- .../signaling/src/jsep/JsepCodecDescription.h | 6 +++++- media/webrtc/signaling/src/jsep/JsepSessionImpl.h | 3 ++- .../src/media-conduit/RtpSourceObserver.cpp | 1 + .../signaling/src/media-conduit/RunningStat.h | 9 ++++++++- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 14 ++++++++++++++ .../media-conduit/WebrtcMediaDataDecoderCodec.cpp | 1 + .../signaling/src/mediapipeline/MediaPipeline.cpp | 2 ++ .../src/peerconnection/PeerConnectionImpl.cpp | 6 +++++- .../signaling/src/sdp/SipccSdpMediaSection.h | 7 ++++++- 10 files changed, 49 insertions(+), 7 deletions(-) diff --git a/media/webrtc/signaling/gtest/sdp_unittests.cpp b/media/webrtc/signaling/gtest/sdp_unittests.cpp index 1b2fe62846e1..7c9e135d0f9b 100644 --- a/media/webrtc/signaling/gtest/sdp_unittests.cpp +++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp @@ -41,7 +41,9 @@ namespace test { class SdpTest : public ::testing::Test { public: - SdpTest() : sdp_ptr_(nullptr) { + SdpTest() + : final_level_(0) + , sdp_ptr_(nullptr) { } ~SdpTest() { @@ -1506,7 +1508,8 @@ class NewSdpTest : public ::testing::Test, public ::testing::WithParamInterface< ::testing::tuple > { public: - NewSdpTest() {} + NewSdpTest() : mSdpErrorHolder(nullptr) { + } void ParseSdp(const std::string &sdp, bool expectSuccess = true) { if (::testing::get<1>(GetParam())) { diff --git a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h index 24ce56863ebb..6dd927122822 100644 --- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h +++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h @@ -236,6 +236,9 @@ class JsepVideoCodecDescription : public JsepCodecDescription { mTmmbrEnabled(false), mRembEnabled(false), mFECEnabled(false), + mREDPayloadType(0), + mULPFECPayloadType(0), + mProfileLevelId(0), mPacketizationMode(0) { // Add supported rtcp-fb types @@ -763,7 +766,8 @@ class JsepApplicationCodecDescription : public JsepCodecDescription { mLocalPort(localPort), mLocalMaxMessageSize(localMaxMessageSize), mRemotePort(0), - mRemoteMaxMessageSize(0) + mRemoteMaxMessageSize(0), + mRemoteMMSSet(false) { } diff --git a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h index ba134cc7be4b..05fc768c75b7 100644 --- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h +++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h @@ -43,7 +43,8 @@ public: mSessionId(0), mSessionVersion(0), mUuidGen(std::move(uuidgen)), - mSdpHelper(&mLastError) + mSdpHelper(&mLastError), + mRunRustParser(false) { } diff --git a/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp b/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp index 1606800ec7f8..fc1a280abfa8 100644 --- a/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp +++ b/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp @@ -19,6 +19,7 @@ RtpSourceObserver::RtpSourceEntry::ToLinearAudioLevel() const } RtpSourceObserver::RtpSourceObserver() : + mMaxJitterWindow(0), mLevelGuard("RtpSourceObserver::mLevelGuard") {} void diff --git a/media/webrtc/signaling/src/media-conduit/RunningStat.h b/media/webrtc/signaling/src/media-conduit/RunningStat.h index 1d0cdbecaafc..888355b8414e 100644 --- a/media/webrtc/signaling/src/media-conduit/RunningStat.h +++ b/media/webrtc/signaling/src/media-conduit/RunningStat.h @@ -12,7 +12,14 @@ namespace mozilla { class RunningStat { public: - RunningStat() : mN(0) {} + RunningStat() + : mN(0) + , mOldM(0.0) + , mNewM(0.0) + , mOldS(0.0) + , mNewS(0.0) + { + } void Clear() { diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp index 3aac3fe14a97..d61ce978a520 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp @@ -80,6 +80,20 @@ WebrtcGmpVideoEncoder::WebrtcGmpVideoEncoder() , mCallback(nullptr) , mCachedPluginId(0) { + mCodecParams.mGMPApiVersion = 0; + mCodecParams.mCodecType = kGMPVideoCodecInvalid; + mCodecParams.mPLType = 0; + mCodecParams.mWidth = 0; + mCodecParams.mHeight = 0; + mCodecParams.mStartBitrate = 0; + mCodecParams.mMaxBitrate = 0; + mCodecParams.mMinBitrate = 0; + mCodecParams.mMaxFramerate = 0; + mCodecParams.mFrameDroppingOn = false; + mCodecParams.mKeyFrameInterval = 0; + mCodecParams.mQPMax = 0; + mCodecParams.mNumberOfSimulcastStreams = 0; + mCodecParams.mMode = kGMPCodecModeInvalid; if (mPCHandle.empty()) { mPCHandle = WebrtcGmpPCHandleSetter::GetCurrentHandle(); } diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp index cc77ba11a469..461075f70a30 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp @@ -20,6 +20,7 @@ WebrtcMediaDataDecoder::WebrtcMediaDataDecoder() , mImageContainer(layers::LayerManager::CreateImageContainer( layers::ImageContainer::ASYNCHRONOUS)) , mFactory(new PDMFactory()) + , mTrackType(TrackInfo::kUndefinedTrack) { } diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index ddf6a1b0f2aa..d88d2c21430c 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -2175,6 +2175,8 @@ class MediaPipelineReceiveVideo::PipelineListener public: explicit PipelineListener(dom::MediaStreamTrack* aTrack) : GenericReceiveListener(aTrack) + , mWidth(0) + , mHeight(0) , mImageContainer( LayerManager::CreateImageContainer(ImageContainer::ASYNCHRONOUS)) , mMutex("Video PipelineListener") diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index 650ef5fa6c2a..40742b3f97e0 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -236,7 +236,8 @@ namespace mozilla { RTCStatsQuery::RTCStatsQuery(bool internal) : failed(false), internalStats(internal), - grabAllLevels(false) { + grabAllLevels(false), + now(0.0) { } RTCStatsQuery::~RTCStatsQuery() { @@ -339,6 +340,9 @@ PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal) , mActiveOnWindow(false) , mPacketDumpEnabled(false) , mPacketDumpFlagsMutex("Packet dump flags mutex") + , listenPort(0) + , connectPort(0) + , connectStr(nullptr) { MOZ_ASSERT(NS_IsMainThread()); auto log = RLogConnector::CreateInstance(); diff --git a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h index 82ef7ebba25e..ecc19ee0e573 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h +++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h @@ -68,7 +68,12 @@ public: private: SipccSdpMediaSection(size_t level, const SipccSdpAttributeList* sessionLevel) - : SdpMediaSection(level), mAttributeList(sessionLevel) + : SdpMediaSection(level), + mMediaType(static_cast(0)), + mPort(0), + mPortCount(0), + mProtocol(static_cast(0)), + mAttributeList(sessionLevel) { } From 7b56b88b06f5c768c95e72798b26fdce2af1494a Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Fri, 15 Jun 2018 18:47:33 +0300 Subject: [PATCH 13/22] Bug 1453795 - WebRTC Media - Initialize member fields in classes/ structures. r=rjesup --HG-- extra : amend_source : d9882d97fd52f082cccf2470cb16fdc8f8fc0d43 --- dom/media/systemservices/CamerasChild.cpp | 6 +++++- dom/media/systemservices/CamerasParent.cpp | 4 +++- .../systemservices/MediaSystemResourceManagerChild.cpp | 1 + dom/media/systemservices/VideoEngine.cpp | 1 + dom/media/systemservices/VideoEngine.h | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dom/media/systemservices/CamerasChild.cpp b/dom/media/systemservices/CamerasChild.cpp index 5fe37e975152..9a8845934f15 100644 --- a/dom/media/systemservices/CamerasChild.cpp +++ b/dom/media/systemservices/CamerasChild.cpp @@ -728,7 +728,11 @@ CamerasChild::CamerasChild() mIPCIsAlive(true), mRequestMutex("mozilla::cameras::CamerasChild::mRequestMutex"), mReplyMonitor("mozilla::cameras::CamerasChild::mReplyMonitor"), - mZero(0) + mReceivedReply(false), + mReplySuccess(false), + mZero(0), + mReplyInteger(0), + mReplyScary(false) { LOG(("CamerasChild: %p", this)); diff --git a/dom/media/systemservices/CamerasParent.cpp b/dom/media/systemservices/CamerasParent.cpp index 4f8a4c7af9f3..1d5efef82480 100644 --- a/dom/media/systemservices/CamerasParent.cpp +++ b/dom/media/systemservices/CamerasParent.cpp @@ -133,6 +133,7 @@ public: , mCapEngine(aEngine) , mStreamId(aStreamId) , mProperties(aProperties) + , mResult(0) { // No ShmemBuffer (of the right size) was available, so make an // extra buffer here. We have no idea when we are going to run and @@ -155,7 +156,8 @@ public: , mCapEngine(aEngine) , mStreamId(aStreamId) , mBuffer(std::move(aBuffer)) - , mProperties(aProperties){}; + , mProperties(aProperties) + , mResult(0) {}; NS_IMETHOD Run() override { if (mParent->IsShuttingDown()) { diff --git a/dom/media/systemservices/MediaSystemResourceManagerChild.cpp b/dom/media/systemservices/MediaSystemResourceManagerChild.cpp index cb8ed60b3c5a..5ffa951f646a 100644 --- a/dom/media/systemservices/MediaSystemResourceManagerChild.cpp +++ b/dom/media/systemservices/MediaSystemResourceManagerChild.cpp @@ -12,6 +12,7 @@ namespace media { MediaSystemResourceManagerChild::MediaSystemResourceManagerChild() : mDestroyed(false) + , mManager(nullptr) { } diff --git a/dom/media/systemservices/VideoEngine.cpp b/dom/media/systemservices/VideoEngine.cpp index 2ca5a340fcbe..5b140c233892 100644 --- a/dom/media/systemservices/VideoEngine.cpp +++ b/dom/media/systemservices/VideoEngine.cpp @@ -240,6 +240,7 @@ VideoEngine::GenerateId() { } VideoEngine::VideoEngine(UniquePtr&& aConfig): + mId(0), mCaptureDevInfo(aConfig->Get()), mDeviceInfo(nullptr), mConfig(std::move(aConfig)) diff --git a/dom/media/systemservices/VideoEngine.h b/dom/media/systemservices/VideoEngine.h index cc13812554d0..f3424723c747 100644 --- a/dom/media/systemservices/VideoEngine.h +++ b/dom/media/systemservices/VideoEngine.h @@ -32,7 +32,7 @@ private: static const int64_t kCacheExpiryPeriodMs = 2000; public: - VideoEngine (){}; + VideoEngine() : mId(0) {}; NS_INLINE_DECL_REFCOUNTING(VideoEngine) static already_AddRefed Create(UniquePtr&& aConfig); From d9e98a1219d5f7489286e8607a89f15e43202d47 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Fri, 15 Jun 2018 18:55:03 +0300 Subject: [PATCH 14/22] Bug 1453795 - WebRTC - Initialize member fields in classes/ structures. r=rjesup --HG-- extra : amend_source : f4d5cf1f53793ddb457e81fdf9220ce43fbd4ff7 --- netwerk/sctp/datachannel/DataChannel.cpp | 5 +++++ netwerk/sctp/datachannel/DataChannel.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index 2fa7b6f77271..0cafc8ac3564 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -307,6 +307,11 @@ DataChannelConnection::DataChannelConnection(DataConnectionListener *listener, nsIEventTarget *aTarget) : NeckoTargetHolder(aTarget) , mLock("netwerk::sctp::DataChannelConnection") + , mSendInterleaved(false) + , mPpidFragmentation(false) + , mMaxMessageSizeSet(false) + , mMaxMessageSize(0) + , mAllocateEven(false) { mCurrentStream = 0; mState = CLOSED; diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index c44e49be3517..6552252e0d46 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -67,7 +67,12 @@ public: const uint8_t *GetData() { return (const uint8_t *)(mData + mPos); }; protected: - OutgoingMsg() = default;; // Use this for inheritance only + OutgoingMsg() // Use this for inheritance only + : mLength(0) + , mData(nullptr) + , mInfo(nullptr) + , mPos(0) + {}; size_t mLength; const uint8_t *mData; struct sctp_sendv_spa *mInfo; @@ -382,6 +387,7 @@ public: , mPrPolicy(policy) , mPrValue(value) , mFlags(flags) + , mId(0) , mIsRecvBinary(false) , mBufferedThreshold(0) // default from spec , mMainThreadEventTarget(connection->GetNeckoTarget()) From 80b1014efb4a3a1c95622c8ecbf6d54d640f90b5 Mon Sep 17 00:00:00 2001 From: Stephen A Pohl Date: Fri, 15 Jun 2018 10:46:33 -0700 Subject: [PATCH 15/22] Bug 1461459: Add nightly-only MOZ_CRASH statements in base::LaunchApp on macOS to investigate failures to asynchronously launch content processes. r=jld --- ipc/chromium/src/base/process_util_mac.mm | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ipc/chromium/src/base/process_util_mac.mm b/ipc/chromium/src/base/process_util_mac.mm index 575ac798b505..56e91ac4e9e4 100644 --- a/ipc/chromium/src/base/process_util_mac.mm +++ b/ipc/chromium/src/base/process_util_mac.mm @@ -40,6 +40,9 @@ bool LaunchApp(const std::vector& argv, posix_spawn_file_actions_t file_actions; if (posix_spawn_file_actions_init(&file_actions) != 0) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_init failed"); +#endif return false; } auto file_actions_guard = mozilla::MakeScopeExit([&file_actions] { @@ -58,6 +61,9 @@ bool LaunchApp(const std::vector& argv, } } else { if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_adddup2 failed"); +#endif return false; } } @@ -66,6 +72,9 @@ bool LaunchApp(const std::vector& argv, // Initialize spawn attributes. posix_spawnattr_t spawnattr; if (posix_spawnattr_init(&spawnattr) != 0) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + MOZ_CRASH("base::LaunchApp: posix_spawnattr_init failed"); +#endif return false; } auto spawnattr_guard = mozilla::MakeScopeExit([&spawnattr] { @@ -76,12 +85,19 @@ bool LaunchApp(const std::vector& argv, // that aren't named in `file_actions`. (This is an Apple-specific // extension to posix_spawn.) if (posix_spawnattr_setflags(&spawnattr, POSIX_SPAWN_CLOEXEC_DEFAULT) != 0) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + MOZ_CRASH("base::LaunchApp: posix_spawnattr_setflags failed"); +#endif return false; } // Exempt std{in,out,err} from being closed by POSIX_SPAWN_CLOEXEC_DEFAULT. for (int fd = 0; fd <= STDERR_FILENO; ++fd) { if (posix_spawn_file_actions_addinherit_np(&file_actions, fd) != 0) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + MOZ_CRASH("base::LaunchApp: posix_spawn_file_actions_addinherit_np " + "failed"); +#endif return false; } } @@ -96,6 +112,16 @@ bool LaunchApp(const std::vector& argv, bool process_handle_valid = pid > 0; if (!spawn_succeeded || !process_handle_valid) { +#ifdef ASYNC_CONTENTPROC_LAUNCH + if (!spawn_succeeded && !process_handle_valid) { + MOZ_CRASH("base::LaunchApp: spawn_succeeded is false and " + "process_handle_valid is false"); + } else if (!spawn_succeeded) { + MOZ_CRASH("base::LaunchApp: spawn_succeeded is false"); + } else { + MOZ_CRASH("base::LaunchApp: process_handle_valid is false"); + } +#endif retval = false; } else { gProcessLog.print("==> process %d launched child process %d\n", From de9afa69309f2ea041212e123b38c2441cb3fa4a Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Fri, 15 Jun 2018 18:16:15 +0300 Subject: [PATCH 16/22] Bug 1453795 - WebVR - Initialize member fields in classes/ structures. r=kip --HG-- extra : rebase_source : e74859026aa9f35df953c98812591500f54efb75 extra : amend_source : c2fad0ffaa313aadbc1e8b7e01654bd28feea971 --- dom/vr/VRDisplay.cpp | 6 ++++++ gfx/vr/gfxVR.h | 3 ++- gfx/vr/gfxVROpenVR.cpp | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dom/vr/VRDisplay.cpp b/dom/vr/VRDisplay.cpp index 91bbd39c09e2..d5e5a141b13e 100644 --- a/dom/vr/VRDisplay.cpp +++ b/dom/vr/VRDisplay.cpp @@ -270,6 +270,9 @@ VRPose::VRPose(nsISupports* aParent, const gfx::VRHMDSensorState& aState) VRPose::VRPose(nsISupports* aParent) : Pose(aParent) { + mVRState.inputFrameID = 0; + mVRState.timestamp = 0.0; + mVRState.flags = gfx::VRDisplayCapabilityFlags::Cap_None; mFrameId = 0; mozilla::HoldJSObjects(this); } @@ -925,6 +928,9 @@ VRFrameInfo::Update(const gfx::VRDisplayInfo& aInfo, VRFrameInfo::VRFrameInfo() : mTimeStampOffset(0.0f) { + mVRState.inputFrameID = 0; + mVRState.timestamp = 0.0; + mVRState.flags = gfx::VRDisplayCapabilityFlags::Cap_None; } bool diff --git a/gfx/vr/gfxVR.h b/gfx/vr/gfxVR.h index cb7b1b46f1fe..659a9f7b2aad 100644 --- a/gfx/vr/gfxVR.h +++ b/gfx/vr/gfxVR.h @@ -106,7 +106,8 @@ struct VRDisplayInfo struct VRSubmitFrameResultInfo { VRSubmitFrameResultInfo() - : mFrameNum(0), + : mFormat(SurfaceFormat::UNKNOWN), + mFrameNum(0), mWidth(0), mHeight(0) {} diff --git a/gfx/vr/gfxVROpenVR.cpp b/gfx/vr/gfxVROpenVR.cpp index 15063b4a345c..5fa586c58f1a 100644 --- a/gfx/vr/gfxVROpenVR.cpp +++ b/gfx/vr/gfxVROpenVR.cpp @@ -431,6 +431,7 @@ VRControllerOpenVR::VRControllerOpenVR(dom::GamepadHand aHand, uint32_t aDisplay uint32_t aNumButtons, uint32_t aNumTriggers, uint32_t aNumAxes, const nsCString& aId) : VRControllerHost(VRDeviceType::OpenVR, aHand, aDisplayID) + , mTrackedIndex(0) , mVibrateThread(nullptr) , mIsVibrateStopped(false) { From 639857f6400330829bdb406f6f8c1b2072508ca4 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:32 -0700 Subject: [PATCH 17/22] Bug 1466681 P1 Make ServiceWorkerContainer::Inner::Register() use callbacks instead of MozPromise. r=asuth --- dom/serviceworkers/ServiceWorkerContainer.cpp | 19 +++--- dom/serviceworkers/ServiceWorkerContainer.h | 12 +++- .../ServiceWorkerContainerImpl.cpp | 61 ++++++++++++++++--- .../ServiceWorkerContainerImpl.h | 18 ++++-- dom/serviceworkers/ServiceWorkerUtils.h | 6 ++ 5 files changed, 92 insertions(+), 24 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp index 0d8b47841fa8..c4fdad92b80e 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.cpp +++ b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -77,6 +77,7 @@ ServiceWorkerContainer::ServiceWorkerContainer(nsIGlobalObject* aGlobal, : DOMEventTargetHelper(aGlobal) , mInner(aInner) { + mInner->AddContainer(this); Maybe controller = aGlobal->GetController(); if (controller.isSome()) { mControllerWorker = aGlobal->GetOrCreateServiceWorker(controller.ref()); @@ -85,6 +86,7 @@ ServiceWorkerContainer::ServiceWorkerContainer(nsIGlobalObject* aGlobal, ServiceWorkerContainer::~ServiceWorkerContainer() { + mInner->RemoveContainer(this); } void @@ -358,14 +360,10 @@ ServiceWorkerContainer::Register(const nsAString& aScriptURL, } RefPtr self = this; - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - mInner->Register(clientInfo.ref(), cleanedScopeURL, cleanedScriptURL, - aOptions.mUpdateViaCache)->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDesc) { - holder->Complete(); + mInner->Register( + clientInfo.ref(), cleanedScopeURL, cleanedScriptURL, aOptions.mUpdateViaCache, + [self, outer] (const ServiceWorkerRegistrationDescriptor& aDesc) { ErrorResult rv; nsIGlobalObject* global = self->GetGlobalIfValid(rv); if (rv.Failed()) { @@ -375,10 +373,9 @@ ServiceWorkerContainer::Register(const nsAString& aScriptURL, RefPtr reg = global->GetOrCreateServiceWorkerRegistration(aDesc); outer->MaybeResolve(reg); - }, [self, outer, holder] (const CopyableErrorResult& aRv) { - holder->Complete(); - outer->MaybeReject(CopyableErrorResult(aRv)); - })->Track(*holder); + }, [outer] (ErrorResult& aRv) { + outer->MaybeReject(aRv); + }); return outer.forget(); } diff --git a/dom/serviceworkers/ServiceWorkerContainer.h b/dom/serviceworkers/ServiceWorkerContainer.h index 90144587e39e..e8714127c3f4 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.h +++ b/dom/serviceworkers/ServiceWorkerContainer.h @@ -26,11 +26,19 @@ public: class Inner { public: - virtual RefPtr + virtual void + AddContainer(ServiceWorkerContainer* aOuter) = 0; + + virtual void + RemoveContainer(ServiceWorkerContainer* aOuter) = 0; + + virtual void Register(const ClientInfo& aClientInfo, const nsACString& aScopeURL, const nsACString& aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) const = 0; + ServiceWorkerUpdateViaCache aUpdateViaCache, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const = 0; virtual RefPtr GetRegistration(const ClientInfo& aClientInfo, diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp index 5467084e116d..89d4c0f7f5af 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp @@ -9,19 +9,66 @@ namespace mozilla { namespace dom { -RefPtr +ServiceWorkerContainerImpl::~ServiceWorkerContainerImpl() +{ + MOZ_DIAGNOSTIC_ASSERT(!mOuter); +} + +ServiceWorkerContainerImpl::ServiceWorkerContainerImpl() + : mOuter(nullptr) +{ +} + +void +ServiceWorkerContainerImpl::AddContainer(ServiceWorkerContainer* aOuter) +{ + MOZ_DIAGNOSTIC_ASSERT(aOuter); + MOZ_DIAGNOSTIC_ASSERT(!mOuter); + mOuter = aOuter; +} + +void +ServiceWorkerContainerImpl::RemoveContainer(ServiceWorkerContainer* aOuter) +{ + MOZ_DIAGNOSTIC_ASSERT(aOuter); + MOZ_DIAGNOSTIC_ASSERT(mOuter == aOuter); + mOuter = nullptr; +} + +void ServiceWorkerContainerImpl::Register(const ClientInfo& aClientInfo, const nsACString& aScopeURL, const nsACString& aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) const + ServiceWorkerUpdateViaCache aUpdateViaCache, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const { - RefPtr swm = ServiceWorkerManager::GetInstance(); - if (NS_WARN_IF(!swm)) { - return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + MOZ_DIAGNOSTIC_ASSERT(mOuter); + + nsIGlobalObject* global = mOuter->GetParentObject(); + if (NS_WARN_IF(!global)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } - return swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache); + RefPtr swm = ServiceWorkerManager::GetInstance(); + if (NS_WARN_IF(!swm)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + auto holder = + MakeRefPtr>(global); + + swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache)->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { + holder->Complete(); + successCB(aDescriptor); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) { + holder->Complete(); + failureCB(CopyableErrorResult(aResult)); + })->Track(*holder); } RefPtr diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.h b/dom/serviceworkers/ServiceWorkerContainerImpl.h index 62f2117be93a..7ebc34323f8b 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.h +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.h @@ -15,16 +15,26 @@ namespace dom { // Lightweight serviceWorker APIs collection. class ServiceWorkerContainerImpl final : public ServiceWorkerContainer::Inner { - ~ServiceWorkerContainerImpl() = default; + ServiceWorkerContainer* mOuter; + + ~ServiceWorkerContainerImpl(); public: - ServiceWorkerContainerImpl() = default; + ServiceWorkerContainerImpl(); - RefPtr + void + AddContainer(ServiceWorkerContainer* aOuter) override; + + void + RemoveContainer(ServiceWorkerContainer* aOuter) override; + + void Register(const ClientInfo& aClientInfo, const nsACString& aScopeURL, const nsACString& aScriptURL, - ServiceWorkerUpdateViaCache aUpdateViaCache) const override; + ServiceWorkerUpdateViaCache aUpdateViaCache, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const override; RefPtr GetRegistration(const ClientInfo& aClientInfo, diff --git a/dom/serviceworkers/ServiceWorkerUtils.h b/dom/serviceworkers/ServiceWorkerUtils.h index 259856de0d5b..5417243e3eab 100644 --- a/dom/serviceworkers/ServiceWorkerUtils.h +++ b/dom/serviceworkers/ServiceWorkerUtils.h @@ -25,6 +25,12 @@ typedef MozPromise, CopyableErrorResult, false> ServiceWorkerRegistrationListPromise; +typedef std::function + ServiceWorkerRegistrationCallback; + +typedef std::function + ServiceWorkerFailureCallback; + bool ServiceWorkerParentInterceptEnabled(); From a65f650d112ae6c7bf7a6bb9318a23f2d939238c Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:33 -0700 Subject: [PATCH 18/22] Bug 1466681 P2 Make ServiceWorkerContainer::Inner::GetRegistration() use callbacks instead of MozPromise. r=asuth --- dom/serviceworkers/ServiceWorkerContainer.cpp | 26 ++++++-------- dom/serviceworkers/ServiceWorkerContainer.h | 6 ++-- .../ServiceWorkerContainerImpl.cpp | 35 +++++++++++++++---- .../ServiceWorkerContainerImpl.h | 6 ++-- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp index c4fdad92b80e..797a4e321e00 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.cpp +++ b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -485,13 +485,9 @@ ServiceWorkerContainer::GetRegistration(const nsAString& aURL, } RefPtr self = this; - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - mInner->GetRegistration(clientInfo.ref(), spec)->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { - holder->Complete(); + mInner->GetRegistration(clientInfo.ref(), spec, + [self, outer] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { ErrorResult rv; nsIGlobalObject* global = self->GetGlobalIfValid(rv); if (rv.Failed()) { @@ -501,16 +497,16 @@ ServiceWorkerContainer::GetRegistration(const nsAString& aURL, RefPtr reg = global->GetOrCreateServiceWorkerRegistration(aDescriptor); outer->MaybeResolve(reg); - }, [self, outer, holder] (const CopyableErrorResult& aRv) { - holder->Complete(); - ErrorResult rv; - Unused << self->GetGlobalIfValid(rv); - if (!rv.Failed() && !aRv.Failed()) { - outer->MaybeResolveWithUndefined(); - return; + }, [self, outer] (ErrorResult& aRv) { + if (!aRv.Failed()) { + Unused << self->GetGlobalIfValid(aRv); + if (!aRv.Failed()) { + outer->MaybeResolveWithUndefined(); + return; + } } - outer->MaybeReject(CopyableErrorResult(aRv)); - })->Track(*holder); + outer->MaybeReject(aRv); + }); return outer.forget(); } diff --git a/dom/serviceworkers/ServiceWorkerContainer.h b/dom/serviceworkers/ServiceWorkerContainer.h index e8714127c3f4..423d883984e6 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.h +++ b/dom/serviceworkers/ServiceWorkerContainer.h @@ -40,9 +40,11 @@ public: ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) const = 0; - virtual RefPtr + virtual void GetRegistration(const ClientInfo& aClientInfo, - const nsACString& aURL) const = 0; + const nsACString& aURL, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const = 0; virtual RefPtr GetRegistrations(const ClientInfo& aClientInfo) const = 0; diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp index 89d4c0f7f5af..955e47c0dcc2 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp @@ -71,17 +71,38 @@ ServiceWorkerContainerImpl::Register(const ClientInfo& aClientInfo, })->Track(*holder); } -RefPtr +void ServiceWorkerContainerImpl::GetRegistration(const ClientInfo& aClientInfo, - const nsACString& aURL) const + const nsACString& aURL, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const { - RefPtr swm = ServiceWorkerManager::GetInstance(); - if (NS_WARN_IF(!swm)) { - return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + MOZ_DIAGNOSTIC_ASSERT(mOuter); + + nsIGlobalObject* global = mOuter->GetParentObject(); + if (NS_WARN_IF(!global)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } - return swm->GetRegistration(aClientInfo, aURL); + RefPtr swm = ServiceWorkerManager::GetInstance(); + if (NS_WARN_IF(!swm)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + auto holder = + MakeRefPtr>(global); + + swm->GetRegistration(aClientInfo, aURL)->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { + holder->Complete(); + successCB(aDescriptor); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) { + holder->Complete(); + failureCB(CopyableErrorResult(aResult)); + })->Track(*holder); } RefPtr diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.h b/dom/serviceworkers/ServiceWorkerContainerImpl.h index 7ebc34323f8b..f7d7689d5856 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.h +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.h @@ -36,9 +36,11 @@ public: ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) const override; - RefPtr + void GetRegistration(const ClientInfo& aClientInfo, - const nsACString& aURL) const override; + const nsACString& aURL, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const override; RefPtr GetRegistrations(const ClientInfo& aClientInfo) const override; From 285d32a9aa32b8d2feccdb14e049eba6e6e1d124 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:33 -0700 Subject: [PATCH 19/22] Bug 1466681 P3 Make ServiceWorkerContainer::Inner::GetReady() use callbacks instead of MozPromise. r=asuth --- dom/serviceworkers/ServiceWorkerContainer.cpp | 15 +++----- dom/serviceworkers/ServiceWorkerContainer.h | 6 ++-- .../ServiceWorkerContainerImpl.cpp | 35 +++++++++++++++---- .../ServiceWorkerContainerImpl.h | 6 ++-- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp index 797a4e321e00..b227c04ca7a2 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.cpp +++ b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -537,13 +537,9 @@ ServiceWorkerContainer::GetReady(ErrorResult& aRv) RefPtr self = this; RefPtr outer = mReadyPromise; - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - mInner->GetReady(clientInfo.ref())->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [self, outer, holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { - holder->Complete(); + mInner->GetReady(clientInfo.ref(), + [self, outer] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { ErrorResult rv; nsIGlobalObject* global = self->GetGlobalIfValid(rv); if (rv.Failed()) { @@ -554,10 +550,9 @@ ServiceWorkerContainer::GetReady(ErrorResult& aRv) global->GetOrCreateServiceWorkerRegistration(aDescriptor); NS_ENSURE_TRUE_VOID(reg); outer->MaybeResolve(reg); - }, [self, outer, holder] (const CopyableErrorResult& aRv) { - holder->Complete(); - outer->MaybeReject(CopyableErrorResult(aRv)); - })->Track(*holder); + }, [self, outer] (ErrorResult& aRv) { + outer->MaybeReject(aRv); + }); return mReadyPromise; } diff --git a/dom/serviceworkers/ServiceWorkerContainer.h b/dom/serviceworkers/ServiceWorkerContainer.h index 423d883984e6..c6d1ad5ec206 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.h +++ b/dom/serviceworkers/ServiceWorkerContainer.h @@ -49,8 +49,10 @@ public: virtual RefPtr GetRegistrations(const ClientInfo& aClientInfo) const = 0; - virtual RefPtr - GetReady(const ClientInfo& aClientInfo) const = 0; + virtual void + GetReady(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const = 0; NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING }; diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp index 955e47c0dcc2..421a5af68531 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp @@ -117,16 +117,37 @@ ServiceWorkerContainerImpl::GetRegistrations(const ClientInfo& aClientInfo) cons return swm->GetRegistrations(aClientInfo); } -RefPtr -ServiceWorkerContainerImpl::GetReady(const ClientInfo& aClientInfo) const +void +ServiceWorkerContainerImpl::GetReady(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const { - RefPtr swm = ServiceWorkerManager::GetInstance(); - if (NS_WARN_IF(!swm)) { - return ServiceWorkerRegistrationPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + MOZ_DIAGNOSTIC_ASSERT(mOuter); + + nsIGlobalObject* global = mOuter->GetParentObject(); + if (NS_WARN_IF(!global)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } - return swm->WhenReady(aClientInfo); + RefPtr swm = ServiceWorkerManager::GetInstance(); + if (NS_WARN_IF(!swm)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + auto holder = + MakeRefPtr>(global); + + swm->WhenReady(aClientInfo)->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { + holder->Complete(); + successCB(aDescriptor); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) { + holder->Complete(); + failureCB(CopyableErrorResult(aResult)); + })->Track(*holder); } } // namespace dom diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.h b/dom/serviceworkers/ServiceWorkerContainerImpl.h index f7d7689d5856..d15182d91173 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.h +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.h @@ -45,8 +45,10 @@ public: RefPtr GetRegistrations(const ClientInfo& aClientInfo) const override; - RefPtr - GetReady(const ClientInfo& aClientInfo) const override; + void + GetReady(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const override; NS_INLINE_DECL_REFCOUNTING(ServiceWorkerContainerImpl, override) }; From 0fed96cd14d636d8a4d5362bf248a8489098f388 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:33 -0700 Subject: [PATCH 20/22] Bug 1466681 P4 Make ServiceWorkerContainer::Inner::GetRegistrations() use callbacks instead of MozPromise. r=asuth --- dom/serviceworkers/ServiceWorkerContainer.cpp | 15 +++----- dom/serviceworkers/ServiceWorkerContainer.h | 6 ++-- .../ServiceWorkerContainerImpl.cpp | 35 +++++++++++++++---- .../ServiceWorkerContainerImpl.h | 6 ++-- dom/serviceworkers/ServiceWorkerUtils.h | 3 ++ 5 files changed, 44 insertions(+), 21 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp index b227c04ca7a2..cd67b2da8190 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.cpp +++ b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -412,13 +412,9 @@ ServiceWorkerContainer::GetRegistrations(ErrorResult& aRv) } RefPtr self = this; - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - mInner->GetRegistrations(clientInfo.ref())->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [self, outer, holder] (const nsTArray& aDescList) { - holder->Complete(); + mInner->GetRegistrations(clientInfo.ref(), + [self, outer] (const nsTArray& aDescList) { ErrorResult rv; nsIGlobalObject* global = self->GetGlobalIfValid(rv); if (rv.Failed()) { @@ -434,10 +430,9 @@ ServiceWorkerContainer::GetRegistrations(ErrorResult& aRv) } } outer->MaybeResolve(regList); - }, [self, outer, holder] (const CopyableErrorResult& aRv) { - holder->Complete(); - outer->MaybeReject(CopyableErrorResult(aRv)); - })->Track(*holder); + }, [self, outer] (ErrorResult& aRv) { + outer->MaybeReject(aRv); + }); return outer.forget(); } diff --git a/dom/serviceworkers/ServiceWorkerContainer.h b/dom/serviceworkers/ServiceWorkerContainer.h index c6d1ad5ec206..b0e5f571b371 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.h +++ b/dom/serviceworkers/ServiceWorkerContainer.h @@ -46,8 +46,10 @@ public: ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) const = 0; - virtual RefPtr - GetRegistrations(const ClientInfo& aClientInfo) const = 0; + virtual void + GetRegistrations(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationListCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const = 0; virtual void GetReady(const ClientInfo& aClientInfo, diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp index 421a5af68531..e40cff60b371 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp @@ -105,16 +105,37 @@ ServiceWorkerContainerImpl::GetRegistration(const ClientInfo& aClientInfo, })->Track(*holder); } -RefPtr -ServiceWorkerContainerImpl::GetRegistrations(const ClientInfo& aClientInfo) const +void +ServiceWorkerContainerImpl::GetRegistrations(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationListCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const { - RefPtr swm = ServiceWorkerManager::GetInstance(); - if (NS_WARN_IF(!swm)) { - return ServiceWorkerRegistrationListPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + MOZ_DIAGNOSTIC_ASSERT(mOuter); + + nsIGlobalObject* global = mOuter->GetParentObject(); + if (NS_WARN_IF(!global)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } - return swm->GetRegistrations(aClientInfo); + RefPtr swm = ServiceWorkerManager::GetInstance(); + if (NS_WARN_IF(!swm)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + auto holder = + MakeRefPtr>(global); + + swm->GetRegistrations(aClientInfo)->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const nsTArray& aList) { + holder->Complete(); + successCB(aList); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aResult) { + holder->Complete(); + failureCB(CopyableErrorResult(aResult)); + })->Track(*holder); } void diff --git a/dom/serviceworkers/ServiceWorkerContainerImpl.h b/dom/serviceworkers/ServiceWorkerContainerImpl.h index d15182d91173..59dc59cfc6e6 100644 --- a/dom/serviceworkers/ServiceWorkerContainerImpl.h +++ b/dom/serviceworkers/ServiceWorkerContainerImpl.h @@ -42,8 +42,10 @@ public: ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) const override; - RefPtr - GetRegistrations(const ClientInfo& aClientInfo) const override; + void + GetRegistrations(const ClientInfo& aClientInfo, + ServiceWorkerRegistrationListCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) const override; void GetReady(const ClientInfo& aClientInfo, diff --git a/dom/serviceworkers/ServiceWorkerUtils.h b/dom/serviceworkers/ServiceWorkerUtils.h index 5417243e3eab..857c044c87d0 100644 --- a/dom/serviceworkers/ServiceWorkerUtils.h +++ b/dom/serviceworkers/ServiceWorkerUtils.h @@ -28,6 +28,9 @@ typedef MozPromise, CopyableErrorR typedef std::function ServiceWorkerRegistrationCallback; +typedef std::function&)> + ServiceWorkerRegistrationListCallback; + typedef std::function ServiceWorkerFailureCallback; From d9f9837869156c92fb1aee4315db2f37aee60875 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:33 -0700 Subject: [PATCH 21/22] Bug 1466681 P5 Make ServiceWorkerRegistration::Inner::Update() use callbacks instead of MozPromise. r=asuth --- .../ServiceWorkerRegistration.cpp | 15 ++-- .../ServiceWorkerRegistration.h | 5 +- .../ServiceWorkerRegistrationImpl.cpp | 86 +++++++++++++------ .../ServiceWorkerRegistrationImpl.h | 10 ++- 4 files changed, 74 insertions(+), 42 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerRegistration.cpp b/dom/serviceworkers/ServiceWorkerRegistration.cpp index 0fa1824de799..82dfcbf1cbc7 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistration.cpp @@ -213,13 +213,9 @@ ServiceWorkerRegistration::Update(ErrorResult& aRv) } RefPtr self = this; - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - mInner->Update()->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [outer, self, holder](const ServiceWorkerRegistrationDescriptor& aDesc) { - holder->Complete(); + mInner->Update( + [outer, self](const ServiceWorkerRegistrationDescriptor& aDesc) { nsIGlobalObject* global = self->GetParentObject(); MOZ_DIAGNOSTIC_ASSERT(global); RefPtr ref = @@ -229,10 +225,9 @@ ServiceWorkerRegistration::Update(ErrorResult& aRv) return; } outer->MaybeResolve(ref); - }, [outer, holder] (const CopyableErrorResult& aRv) { - holder->Complete(); - outer->MaybeReject(CopyableErrorResult(aRv)); - })->Track(*holder); + }, [outer] (ErrorResult& aRv) { + outer->MaybeReject(aRv); + }); return outer.forget(); } diff --git a/dom/serviceworkers/ServiceWorkerRegistration.h b/dom/serviceworkers/ServiceWorkerRegistration.h index 6b9834d4f5b0..83a4d1995351 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.h +++ b/dom/serviceworkers/ServiceWorkerRegistration.h @@ -44,8 +44,9 @@ public: virtual void ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) = 0; - virtual RefPtr - Update() = 0; + virtual void + Update(ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) = 0; virtual RefPtr Unregister() = 0; diff --git a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp index 710b8a2476ed..4258e7960e62 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp @@ -523,22 +523,40 @@ public: } // namespace -RefPtr -ServiceWorkerRegistrationMainThread::Update() +void +ServiceWorkerRegistrationMainThread::Update(ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) { MOZ_ASSERT(NS_IsMainThread()); MOZ_DIAGNOSTIC_ASSERT(mOuter); + nsIGlobalObject* global = mOuter->GetParentObject(); + if (!global) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + nsCOMPtr principal = mDescriptor.GetPrincipal(); if (!principal) { - return ServiceWorkerRegistrationPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } RefPtr cb = new MainThreadUpdateCallback(); UpdateInternal(principal, NS_ConvertUTF16toUTF8(mScope), cb); - return cb->Promise(); + auto holder = + MakeRefPtr>(global); + + cb->Promise()->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { + holder->Complete(); + successCB(aDescriptor); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aRv) { + holder->Complete(); + failureCB(CopyableErrorResult(aRv)); + })->Track(*holder); } RefPtr @@ -712,52 +730,68 @@ ServiceWorkerRegistrationWorkerThread::ClearServiceWorkerRegistration(ServiceWor mOuter = nullptr; } -RefPtr -ServiceWorkerRegistrationWorkerThread::Update() +void +ServiceWorkerRegistrationWorkerThread::Update(ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) { if (NS_WARN_IF(!mWorkerRef->GetPrivate())) { - return ServiceWorkerRegistrationPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } RefPtr workerRef = StrongWorkerRef::Create(mWorkerRef->GetPrivate(), "ServiceWorkerRegistration::Update"); if (NS_WARN_IF(!workerRef)) { - return ServiceWorkerRegistrationPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + nsIGlobalObject* global = workerRef->Private()->GlobalScope(); + if (NS_WARN_IF(!global)) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + // Eventually we need to support all workers, but for right now this + // code assumes we're on a service worker global as self.registration. + if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } // Avoid infinite update loops by ignoring update() calls during top // level script evaluation. See: // https://github.com/slightlyoff/ServiceWorker/issues/800 if (workerRef->Private()->IsLoadingWorkerScript()) { - return ServiceWorkerRegistrationPromise::CreateAndResolve(mDescriptor, - __func__); + aSuccessCB(mDescriptor); + return; } - // Eventually we need to support all workers, but for right now this - // code assumes we're on a service worker global as self.registration. - if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) { - return ServiceWorkerRegistrationPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); - } + auto promise = MakeRefPtr(__func__); + auto holder = + MakeRefPtr>(global); - RefPtr outer = - new ServiceWorkerRegistrationPromise::Private(__func__); + promise->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (const ServiceWorkerRegistrationDescriptor& aDescriptor) { + holder->Complete(); + successCB(aDescriptor); + }, [failureCB = std::move(aFailureCB), holder] (const CopyableErrorResult& aRv) { + holder->Complete(); + failureCB(CopyableErrorResult(aRv)); + })->Track(*holder); RefPtr r = new SWRUpdateRunnable(workerRef, - outer, + promise, workerRef->Private()->GetServiceWorkerDescriptor()); nsresult rv = workerRef->Private()->DispatchToMainThread(r.forget()); if (NS_FAILED(rv)) { - outer->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__); - return outer.forget(); + promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + return; } - - return outer.forget(); } RefPtr diff --git a/dom/serviceworkers/ServiceWorkerRegistrationImpl.h b/dom/serviceworkers/ServiceWorkerRegistrationImpl.h index dc9eca1a3f8d..98b43f71cd2d 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.h +++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.h @@ -42,8 +42,9 @@ public: void ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override; - RefPtr - Update() override; + void + Update(ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) override; RefPtr Unregister() override; @@ -109,8 +110,9 @@ public: void ClearServiceWorkerRegistration(ServiceWorkerRegistration* aReg) override; - RefPtr - Update() override; + void + Update(ServiceWorkerRegistrationCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) override; RefPtr Unregister() override; From cf73683dcfc8cbb42f3a12cbabe83db273e1ce74 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Fri, 15 Jun 2018 12:21:33 -0700 Subject: [PATCH 22/22] Bug 1466681 P6 Make ServiceWorkerRegistration::Inner::Unregister() use callbacks instead of MozPromise. r=asuth --- .../ServiceWorkerRegistration.cpp | 14 +--- .../ServiceWorkerRegistration.h | 5 +- .../ServiceWorkerRegistrationImpl.cpp | 78 +++++++++++++------ .../ServiceWorkerRegistrationImpl.h | 10 ++- dom/serviceworkers/ServiceWorkerUtils.h | 3 + 5 files changed, 72 insertions(+), 38 deletions(-) diff --git a/dom/serviceworkers/ServiceWorkerRegistration.cpp b/dom/serviceworkers/ServiceWorkerRegistration.cpp index 82dfcbf1cbc7..f5fa23c7b0b1 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistration.cpp @@ -251,18 +251,12 @@ ServiceWorkerRegistration::Unregister(ErrorResult& aRv) return nullptr; } - RefPtr> holder = - new DOMMozPromiseRequestHolder(global); - - mInner->Unregister()->Then( - global->EventTargetFor(TaskCategory::Other), __func__, - [outer, holder] (bool aSuccess) { - holder->Complete(); + mInner->Unregister( + [outer] (bool aSuccess) { outer->MaybeResolve(aSuccess); - }, [outer, holder] (nsresult aRv) { - holder->Complete(); + }, [outer] (ErrorResult& aRv) { outer->MaybeReject(aRv); - })->Track(*holder); + }); return outer.forget(); } diff --git a/dom/serviceworkers/ServiceWorkerRegistration.h b/dom/serviceworkers/ServiceWorkerRegistration.h index 83a4d1995351..0256859d8e3b 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.h +++ b/dom/serviceworkers/ServiceWorkerRegistration.h @@ -48,8 +48,9 @@ public: Update(ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) = 0; - virtual RefPtr - Unregister() = 0; + virtual void + Unregister(ServiceWorkerBoolCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) = 0; }; NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_SERVICEWORKERREGISTRATION_IID) diff --git a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp index 4258e7960e62..a2523c24e2de 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp @@ -559,23 +559,30 @@ ServiceWorkerRegistrationMainThread::Update(ServiceWorkerRegistrationCallback&& })->Track(*holder); } -RefPtr -ServiceWorkerRegistrationMainThread::Unregister() +void +ServiceWorkerRegistrationMainThread::Unregister(ServiceWorkerBoolCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) { MOZ_ASSERT(NS_IsMainThread()); MOZ_DIAGNOSTIC_ASSERT(mOuter); + nsIGlobalObject* global = mOuter->GetParentObject(); + if (!global) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + nsCOMPtr swm = mozilla::services::GetServiceWorkerManager(); if (!swm) { - return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } nsCOMPtr principal = mDescriptor.GetPrincipal(); if (!principal) { - return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR, - __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } RefPtr cb = new UnregisterCallback(); @@ -583,10 +590,21 @@ ServiceWorkerRegistrationMainThread::Unregister() nsresult rv = swm->Unregister(principal, cb, NS_ConvertUTF8toUTF16(mDescriptor.Scope())); if (NS_FAILED(rv)) { - return GenericPromise::CreateAndReject(rv, __func__); + aFailureCB(CopyableErrorResult(rv)); + return; } - return cb->Promise(); + auto holder = MakeRefPtr>(global); + + cb->Promise()->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (bool aResult) { + holder->Complete(); + successCB(aResult); + }, [failureCB = std::move(aFailureCB), holder] (nsresult aRv) { + holder->Complete(); + failureCB(CopyableErrorResult(aRv)); + })->Track(*holder); } //////////////////////////////////////////////////// @@ -794,40 +812,56 @@ ServiceWorkerRegistrationWorkerThread::Update(ServiceWorkerRegistrationCallback& } } -RefPtr -ServiceWorkerRegistrationWorkerThread::Unregister() +void +ServiceWorkerRegistrationWorkerThread::Unregister(ServiceWorkerBoolCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) { if (NS_WARN_IF(!mWorkerRef->GetPrivate())) { - return GenericPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } RefPtr workerRef = StrongWorkerRef::Create(mWorkerRef->GetPrivate(), __func__); if (NS_WARN_IF(!workerRef)) { - return GenericPromise::CreateAndReject( - NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } // Eventually we need to support all workers, but for right now this // code assumes we're on a service worker global as self.registration. if (NS_WARN_IF(!workerRef->Private()->IsServiceWorker())) { - return GenericPromise::CreateAndReject( - NS_ERROR_DOM_SECURITY_ERR, __func__); + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; } - RefPtr outer = new GenericPromise::Private(__func__); + nsIGlobalObject* global = workerRef->Private()->GlobalScope(); + if (!global) { + aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR)); + return; + } + + auto promise = MakeRefPtr(__func__); + auto holder = MakeRefPtr>(global); + + promise->Then( + global->EventTargetFor(TaskCategory::Other), __func__, + [successCB = std::move(aSuccessCB), holder] (bool aResult) { + holder->Complete(); + successCB(aResult); + }, [failureCB = std::move(aFailureCB), holder] (nsresult aRv) { + holder->Complete(); + failureCB(CopyableErrorResult(aRv)); + })->Track(*holder); RefPtr r = - new StartUnregisterRunnable(workerRef, outer, mDescriptor); + new StartUnregisterRunnable(workerRef, promise, mDescriptor); nsresult rv = workerRef->Private()->DispatchToMainThread(r); if (NS_FAILED(rv)) { - outer->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__); - return outer.forget(); + promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__); + return; } - - return outer.forget(); } void diff --git a/dom/serviceworkers/ServiceWorkerRegistrationImpl.h b/dom/serviceworkers/ServiceWorkerRegistrationImpl.h index 98b43f71cd2d..11b61a100b9c 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.h +++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.h @@ -46,8 +46,9 @@ public: Update(ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) override; - RefPtr - Unregister() override; + void + Unregister(ServiceWorkerBoolCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) override; // ServiceWorkerRegistrationListener void @@ -114,8 +115,9 @@ public: Update(ServiceWorkerRegistrationCallback&& aSuccessCB, ServiceWorkerFailureCallback&& aFailureCB) override; - RefPtr - Unregister() override; + void + Unregister(ServiceWorkerBoolCallback&& aSuccessCB, + ServiceWorkerFailureCallback&& aFailureCB) override; void UpdateFound(); diff --git a/dom/serviceworkers/ServiceWorkerUtils.h b/dom/serviceworkers/ServiceWorkerUtils.h index 857c044c87d0..f6fda7fb73b3 100644 --- a/dom/serviceworkers/ServiceWorkerUtils.h +++ b/dom/serviceworkers/ServiceWorkerUtils.h @@ -31,6 +31,9 @@ typedef std::function typedef std::function&)> ServiceWorkerRegistrationListCallback; +typedef std::function + ServiceWorkerBoolCallback; + typedef std::function ServiceWorkerFailureCallback;