From 5a7e4e2124a8c4cdbecaaf51b44dfea5a9004c12 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Wed, 6 Mar 2019 22:51:09 +0000 Subject: [PATCH 01/48] Bug 1528743 - Move the top-layer display items inside the async zoom container. r=mstange This maintains the important invariant that layers that carry scroll metadata for the RCD-RSF are inside the async zoom container. Differential Revision: https://phabricator.services.mozilla.com/D22049 --HG-- extra : moz-landing-system : lando --- layout/generic/ViewportFrame.cpp | 12 ------------ layout/generic/nsGfxScrollFrame.cpp | 24 ++++++++++++++++++++++++ layout/generic/nsGfxScrollFrame.h | 12 ++++++++++++ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp index e31624385f394..5c63475bbbbf0 100644 --- a/layout/generic/ViewportFrame.cpp +++ b/layout/generic/ViewportFrame.cpp @@ -60,18 +60,6 @@ void ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // below negative z-index elements. BuildDisplayListForChild(aBuilder, kid, aLists); } - - nsDisplayList topLayerList; - BuildDisplayListForTopLayer(aBuilder, &topLayerList); - if (!topLayerList.IsEmpty()) { - // Wrap the whole top layer in a single item with maximum z-index, - // and append it at the very end, so that it stays at the topmost. - nsDisplayWrapList* wrapList = - MakeDisplayItem(aBuilder, this, &topLayerList); - wrapList->SetOverrideZIndex( - std::numeric_limitsZIndex())>::max()); - aLists.PositionedDescendants()->AppendToTop(wrapList); - } } #ifdef DEBUG diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 46e87d70da96f..ab61d213c9dfe 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -68,6 +68,7 @@ #include "UnitTransforms.h" #include "nsPluginFrame.h" #include "nsSliderFrame.h" +#include "ViewportFrame.h" #include "mozilla/layers/APZCCallbackHelper.h" #include "mozilla/layers/AxisPhysicsModel.h" #include "mozilla/layers/AxisPhysicsMSDModel.h" @@ -3378,6 +3379,8 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, aLists); } + MaybeAddTopLayerItems(aBuilder, aLists); + if (addScrollBars) { // Add overlay scrollbars. AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, true); @@ -3662,6 +3665,8 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, } } + MaybeAddTopLayerItems(aBuilder, set); + if (willBuildAsyncZoomContainer) { MOZ_ASSERT(mClipAllDescendants); @@ -3735,6 +3740,25 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, scrolledContent.MoveTo(aLists); } +void ScrollFrameHelper::MaybeAddTopLayerItems(nsDisplayListBuilder* aBuilder, + const nsDisplayListSet& aLists) { + if (mIsRoot) { + if (ViewportFrame* viewportFrame = do_QueryFrame(mOuter->GetParent())) { + nsDisplayList topLayerList; + viewportFrame->BuildDisplayListForTopLayer(aBuilder, &topLayerList); + if (!topLayerList.IsEmpty()) { + // Wrap the whole top layer in a single item with maximum z-index, + // and append it at the very end, so that it stays at the topmost. + nsDisplayWrapList* wrapList = MakeDisplayItem( + aBuilder, viewportFrame, &topLayerList); + wrapList->SetOverrideZIndex( + std::numeric_limitsZIndex())>::max()); + aLists.PositionedDescendants()->AppendToTop(wrapList); + } + } + } +} + bool ScrollFrameHelper::DecideScrollableLayer( nsDisplayListBuilder* aBuilder, nsRect* aVisibleRect, nsRect* aDirtyRect, bool aSetBase, bool* aDirtyRectHasBeenOverriden) { diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index c28a2a109ab98..39286ed0278f5 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -82,6 +82,18 @@ class ScrollFrameHelper : public nsIReflowCallback { void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists); + // Add display items for the top-layer (which includes things like + // the fullscreen element, its backdrop, and text selection carets) + // to |aLists|. + // This is a no-op for scroll frames other than the viewport's + // root scroll frame. + // This should be called with an nsDisplayListSet that will be + // wrapped in the async zoom container, if we're building one. + // It should not be called with an ASR setter on the stack, as the + // top-layer items handle setting up their own ASRs. + void MaybeAddTopLayerItems(nsDisplayListBuilder* aBuilder, + const nsDisplayListSet& aLists); + void AppendScrollPartsTo(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists, bool aCreateLayer, bool aPositioned); From 9b1323a3aef151acb3c0cc848d77d8ecf2a6c5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 6 Mar 2019 22:31:57 +0000 Subject: [PATCH 02/48] Bug 1533142 - Update min cbindgen version. r=jrmuizel,kats Differential Revision: https://phabricator.services.mozilla.com/D22381 --HG-- extra : moz-landing-system : lando --- build/moz.configure/bindgen.configure | 2 +- taskcluster/scripts/misc/build-cbindgen.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure index 5f2e4b117a7e7..1658c8f93e157 100644 --- a/build/moz.configure/bindgen.configure +++ b/build/moz.configure/bindgen.configure @@ -14,7 +14,7 @@ cbindgen = check_prog('CBINDGEN', ['cbindgen'], paths=toolchain_search_path, @checking('cbindgen version') @imports(_from='textwrap', _import='dedent') def cbindgen_version(cbindgen): - cbindgen_min_version = Version('0.7.1') + cbindgen_min_version = Version('0.8.2') # cbindgen x.y.z version = Version(check_cmd_output(cbindgen, '--version').strip().split(" ")[1]) diff --git a/taskcluster/scripts/misc/build-cbindgen.sh b/taskcluster/scripts/misc/build-cbindgen.sh index 41dcf4826f625..e11543266e93d 100755 --- a/taskcluster/scripts/misc/build-cbindgen.sh +++ b/taskcluster/scripts/misc/build-cbindgen.sh @@ -3,7 +3,7 @@ set -x -e -v # If you update this, make sure to update the minimum version in # build/moz.configure/bindgen.configure as well. -CBINDGEN_REVISION=fbe9eff351c15c6ef348c33016fb72ad3520f32b # v0.7.1 +CBINDGEN_REVISION=60d8234bf3a287da75699936aa00ed9ec9762cc8 # v0.8.2 TARGET="$1" case "$(uname -s)" in From cb19991fd7a664e5c2405010aa8c1d6ced1493ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 6 Mar 2019 23:01:11 +0000 Subject: [PATCH 03/48] Bug 1533142 - Use more cbindgen features. r=kats We can get back the fancy flag syntax as soon as we get C++17 inline variables, which I sent an email to dev-platform@ about, with no reply. Differential Revision: https://phabricator.services.mozilla.com/D22382 --HG-- extra : moz-landing-system : lando --- gfx/2d/ScaledFontDWrite.cpp | 12 ++--- gfx/2d/ScaledFontFontconfig.cpp | 32 +++++++------- gfx/2d/ScaledFontFreeType.cpp | 4 +- gfx/2d/ScaledFontMac.cpp | 6 +-- gfx/thebes/gfxFont.cpp | 12 ++--- gfx/thebes/gfxPlatform.cpp | 51 +++++++++++---------- gfx/webrender_bindings/WebRenderAPI.cpp | 4 +- gfx/webrender_bindings/WebRenderTypes.h | 5 +-- gfx/webrender_bindings/cbindgen.toml | 6 ++- gfx/webrender_bindings/src/bindings.rs | 14 ++---- gfx/webrender_bindings/webrender_ffi.h | 54 ----------------------- gfx/wr/webrender_api/src/api.rs | 1 + gfx/wr/webrender_api/src/color.rs | 12 ++--- layout/generic/nsFrame.cpp | 2 +- layout/painting/nsCSSRendering.cpp | 3 +- layout/painting/nsCSSRenderingBorders.cpp | 4 +- layout/painting/nsDisplayList.cpp | 2 +- layout/style/FontFaceSet.cpp | 12 ++--- layout/style/nsComputedDOMStyle.cpp | 6 +-- layout/style/nsStyleCoord.h | 23 ---------- layout/style/nsStyleStruct.cpp | 4 +- layout/style/nsStyleStruct.h | 2 +- layout/style/nsTimingFunction.h | 2 +- servo/components/style/cbindgen.toml | 11 +++-- 24 files changed, 101 insertions(+), 183 deletions(-) diff --git a/gfx/2d/ScaledFontDWrite.cpp b/gfx/2d/ScaledFontDWrite.cpp index be0ee2c64e93d..2c5c58e53d135 100644 --- a/gfx/2d/ScaledFontDWrite.cpp +++ b/gfx/2d/ScaledFontDWrite.cpp @@ -404,10 +404,10 @@ ScaledFontDWrite::InstanceData::InstanceData( mGamma(2.2f), mContrast(1.0f) { if (aOptions) { - if (aOptions->flags & wr::FontInstanceFlags::EMBEDDED_BITMAPS) { + if (aOptions->flags & wr::FontInstanceFlags_EMBEDDED_BITMAPS) { mUseEmbeddedBitmap = true; } - if (aOptions->flags & wr::FontInstanceFlags::FORCE_GDI) { + if (aOptions->flags & wr::FontInstanceFlags_FORCE_GDI) { mForceGDIMode = true; } } @@ -478,15 +478,15 @@ bool ScaledFontDWrite::GetWRFontInstanceOptions( options.render_mode = wr::ToFontRenderMode(GetDefaultAAMode()); options.flags = 0; if (mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD) { - options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD; + options.flags |= wr::FontInstanceFlags_SYNTHETIC_BOLD; } if (UseEmbeddedBitmaps()) { - options.flags |= wr::FontInstanceFlags::EMBEDDED_BITMAPS; + options.flags |= wr::FontInstanceFlags_EMBEDDED_BITMAPS; } if (ForceGDIMode()) { - options.flags |= wr::FontInstanceFlags::FORCE_GDI; + options.flags |= wr::FontInstanceFlags_FORCE_GDI; } else { - options.flags |= wr::FontInstanceFlags::SUBPIXEL_POSITION; + options.flags |= wr::FontInstanceFlags_SUBPIXEL_POSITION; } options.bg_color = wr::ToColorU(Color()); options.synthetic_italics = diff --git a/gfx/2d/ScaledFontFontconfig.cpp b/gfx/2d/ScaledFontFontconfig.cpp index 1dec6d406e8e1..161545c0e51e8 100644 --- a/gfx/2d/ScaledFontFontconfig.cpp +++ b/gfx/2d/ScaledFontFontconfig.cpp @@ -120,27 +120,27 @@ ScaledFontFontconfig::InstanceData::InstanceData( mSubpixelOrder(FC_RGBA_UNKNOWN), mLcdFilter(FC_LCD_LEGACY) { if (aOptions) { - if (aOptions->flags & wr::FontInstanceFlags::FORCE_AUTOHINT) { + if (aOptions->flags & wr::FontInstanceFlags_FORCE_AUTOHINT) { mFlags |= AUTOHINT; } - if (aOptions->flags & wr::FontInstanceFlags::EMBEDDED_BITMAPS) { + if (aOptions->flags & wr::FontInstanceFlags_EMBEDDED_BITMAPS) { mFlags |= EMBEDDED_BITMAP; } - if (aOptions->flags & wr::FontInstanceFlags::SYNTHETIC_BOLD) { + if (aOptions->flags & wr::FontInstanceFlags_SYNTHETIC_BOLD) { mFlags |= EMBOLDEN; } - if (aOptions->flags & wr::FontInstanceFlags::VERTICAL_LAYOUT) { + if (aOptions->flags & wr::FontInstanceFlags_VERTICAL_LAYOUT) { mFlags |= VERTICAL_LAYOUT; } if (aOptions->render_mode != wr::FontRenderMode::Mono) { mFlags |= ANTIALIAS; if (aOptions->render_mode == wr::FontRenderMode::Subpixel) { - if (aOptions->flags & wr::FontInstanceFlags::SUBPIXEL_BGR) { - mSubpixelOrder = aOptions->flags & wr::FontInstanceFlags::LCD_VERTICAL + if (aOptions->flags & wr::FontInstanceFlags_SUBPIXEL_BGR) { + mSubpixelOrder = aOptions->flags & wr::FontInstanceFlags_LCD_VERTICAL ? FC_RGBA_VBGR : FC_RGBA_BGR; } else { - mSubpixelOrder = aOptions->flags & wr::FontInstanceFlags::LCD_VERTICAL + mSubpixelOrder = aOptions->flags & wr::FontInstanceFlags_LCD_VERTICAL ? FC_RGBA_VRGB : FC_RGBA_RGB; } @@ -302,8 +302,8 @@ bool ScaledFontFontconfig::GetWRFontInstanceOptions( wr::FontInstanceOptions options; options.render_mode = wr::FontRenderMode::Alpha; // FIXME: Cairo-FT metrics are not compatible with subpixel positioning. - // options.flags = wr::FontInstanceFlags::SUBPIXEL_POSITION; - options.flags = 0; + // options.flags = wr::FontInstanceFlags_SUBPIXEL_POSITION; + options.flags = wr::FontInstanceFlags{0}; options.bg_color = wr::ToColorU(Color()); options.synthetic_italics = wr::DegreesToSyntheticItalics(GetSyntheticObliqueAngle()); @@ -315,18 +315,18 @@ bool ScaledFontFontconfig::GetWRFontInstanceOptions( FcBool autohint; if (FcPatternGetBool(mPattern, FC_AUTOHINT, 0, &autohint) == FcResultMatch && autohint) { - options.flags |= wr::FontInstanceFlags::FORCE_AUTOHINT; + options.flags |= wr::FontInstanceFlags_FORCE_AUTOHINT; } FcBool embolden; if (FcPatternGetBool(mPattern, FC_EMBOLDEN, 0, &embolden) == FcResultMatch && embolden) { - options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD; + options.flags |= wr::FontInstanceFlags_SYNTHETIC_BOLD; } FcBool vertical; if (FcPatternGetBool(mPattern, FC_VERTICAL_LAYOUT, 0, &vertical) == FcResultMatch && vertical) { - options.flags |= wr::FontInstanceFlags::VERTICAL_LAYOUT; + options.flags |= wr::FontInstanceFlags_VERTICAL_LAYOUT; } FcBool antialias; @@ -342,11 +342,11 @@ bool ScaledFontFontconfig::GetWRFontInstanceOptions( case FC_RGBA_VBGR: options.render_mode = wr::FontRenderMode::Subpixel; if (rgba == FC_RGBA_VRGB || rgba == FC_RGBA_VBGR) { - options.flags |= wr::FontInstanceFlags::LCD_VERTICAL; + options.flags |= wr::FontInstanceFlags_LCD_VERTICAL; } platformOptions.hinting = wr::FontHinting::LCD; if (rgba == FC_RGBA_BGR || rgba == FC_RGBA_VBGR) { - options.flags |= wr::FontInstanceFlags::SUBPIXEL_BGR; + options.flags |= wr::FontInstanceFlags_SUBPIXEL_BGR; } break; case FC_RGBA_NONE: @@ -384,12 +384,12 @@ bool ScaledFontFontconfig::GetWRFontInstanceOptions( if (FcPatternGetBool(mPattern, FC_EMBEDDED_BITMAP, 0, &bitmap) == FcResultMatch && bitmap) { - options.flags |= wr::FontInstanceFlags::EMBEDDED_BITMAPS; + options.flags |= wr::FontInstanceFlags_EMBEDDED_BITMAPS; } } else { options.render_mode = wr::FontRenderMode::Mono; platformOptions.hinting = wr::FontHinting::Mono; - options.flags |= wr::FontInstanceFlags::EMBEDDED_BITMAPS; + options.flags |= wr::FontInstanceFlags_EMBEDDED_BITMAPS; } FcBool hinting; diff --git a/gfx/2d/ScaledFontFreeType.cpp b/gfx/2d/ScaledFontFreeType.cpp index bcac442b6a2cb..0d765bf9b3d07 100644 --- a/gfx/2d/ScaledFontFreeType.cpp +++ b/gfx/2d/ScaledFontFreeType.cpp @@ -55,8 +55,8 @@ bool ScaledFontFreeType::GetWRFontInstanceOptions( wr::FontInstanceOptions options; options.render_mode = wr::FontRenderMode::Alpha; // FIXME: Cairo-FT metrics are not compatible with subpixel positioning. - // options.flags = wr::FontInstanceFlags::SUBPIXEL_POSITION; - options.flags = 0; + // options.flags = wr::FontInstanceFlags_SUBPIXEL_POSITION; + options.flags = wr::FontInstanceFlags{0}; options.bg_color = wr::ToColorU(Color()); options.synthetic_italics = wr::DegreesToSyntheticItalics(GetSyntheticObliqueAngle()); diff --git a/gfx/2d/ScaledFontMac.cpp b/gfx/2d/ScaledFontMac.cpp index 47e58e6d9f6d2..5d772210c0f5b 100644 --- a/gfx/2d/ScaledFontMac.cpp +++ b/gfx/2d/ScaledFontMac.cpp @@ -420,12 +420,12 @@ bool ScaledFontMac::GetWRFontInstanceOptions( wr::FontInstanceOptions options; options.render_mode = wr::FontRenderMode::Subpixel; - options.flags = wr::FontInstanceFlags::SUBPIXEL_POSITION; + options.flags = wr::FontInstanceFlags_SUBPIXEL_POSITION; if (mUseFontSmoothing) { - options.flags |= wr::FontInstanceFlags::FONT_SMOOTHING; + options.flags |= wr::FontInstanceFlags_FONT_SMOOTHING; } if (mApplySyntheticBold) { - options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD; + options.flags |= wr::FontInstanceFlags_SYNTHETIC_BOLD; } options.bg_color = wr::ToColorU(mFontSmoothingBackgroundColor); options.synthetic_italics = diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index febb602634cc2..104f3786214e8 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -1958,12 +1958,12 @@ bool gfxFont::DrawMissingGlyph(const TextRunDrawParams& aRunParams, if (textDrawer) { // Generate an orientation matrix for the current writing mode wr::FontInstanceFlags flags = textDrawer->GetWRGlyphFlags(); - if (flags.bits & wr::FontInstanceFlags::TRANSPOSE) { + if (flags & wr::FontInstanceFlags_TRANSPOSE) { std::swap(mat._11, mat._12); std::swap(mat._21, mat._22); } - mat.PostScale(flags.bits & wr::FontInstanceFlags::FLIP_X ? -1.0f : 1.0f, - flags.bits & wr::FontInstanceFlags::FLIP_Y ? -1.0f : 1.0f); + mat.PostScale(flags & wr::FontInstanceFlags_FLIP_X ? -1.0f : 1.0f, + flags & wr::FontInstanceFlags_FLIP_Y ? -1.0f : 1.0f); matPtr = &mat; } @@ -2138,11 +2138,11 @@ void gfxFont::Draw(const gfxTextRun* aTextRun, uint32_t aStart, uint32_t aEnd, // X and Y, while left rotation flips the resulting Y axis, and right // rotation flips the resulting X axis. textDrawer->SetWRGlyphFlags( - textDrawer->GetWRGlyphFlags() | wr::FontInstanceFlags::TRANSPOSE | + textDrawer->GetWRGlyphFlags() | wr::FontInstanceFlags_TRANSPOSE | (aOrientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT - ? wr::FontInstanceFlags::FLIP_Y - : wr::FontInstanceFlags::FLIP_X)); + ? wr::FontInstanceFlags_FLIP_Y + : wr::FontInstanceFlags_FLIP_X)); } else { // For non-WebRender targets, just push a rotation transform. matrixRestore.SetContext(aRunParams.context); diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 12ff7d487638d..f20ae00519494 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -541,37 +541,42 @@ void RecordingPrefChanged(const char* aPrefName, void* aClosure) { #define WR_DEBUG_PREF "gfx.webrender.debug" static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) { - int32_t flags = 0; + wr::DebugFlags flags{0}; #define GFX_WEBRENDER_DEBUG(suffix, bit) \ if (Preferences::GetBool(WR_DEBUG_PREF suffix, false)) { \ flags |= (bit); \ } - // TODO: It would be nice to get the bit patterns directly from the rust code. - GFX_WEBRENDER_DEBUG(".profiler", 1 << 0) - GFX_WEBRENDER_DEBUG(".render-targets", 1 << 1) - GFX_WEBRENDER_DEBUG(".texture-cache", 1 << 2) - GFX_WEBRENDER_DEBUG(".gpu-time-queries", 1 << 3) - GFX_WEBRENDER_DEBUG(".gpu-sample-queries", 1 << 4) - GFX_WEBRENDER_DEBUG(".disable-batching", 1 << 5) - GFX_WEBRENDER_DEBUG(".epochs", 1 << 6) - GFX_WEBRENDER_DEBUG(".compact-profiler", 1 << 7) - GFX_WEBRENDER_DEBUG(".echo-driver-messages", 1 << 8) - GFX_WEBRENDER_DEBUG(".new-frame-indicator", 1 << 9) - GFX_WEBRENDER_DEBUG(".new-scene-indicator", 1 << 10) - GFX_WEBRENDER_DEBUG(".show-overdraw", 1 << 11) - GFX_WEBRENDER_DEBUG(".gpu-cache", 1 << 12) - GFX_WEBRENDER_DEBUG(".slow-frame-indicator", 1 << 13) - GFX_WEBRENDER_DEBUG(".texture-cache.clear-evicted", 1 << 14) - GFX_WEBRENDER_DEBUG(".picture-caching", 1 << 15) - GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", 1 << 16) - GFX_WEBRENDER_DEBUG(".primitives", 1 << 17) + GFX_WEBRENDER_DEBUG(".profiler", wr::DebugFlags_PROFILER_DBG) + GFX_WEBRENDER_DEBUG(".render-targets", wr::DebugFlags_RENDER_TARGET_DBG) + GFX_WEBRENDER_DEBUG(".texture-cache", wr::DebugFlags_TEXTURE_CACHE_DBG) + GFX_WEBRENDER_DEBUG(".gpu-time-queries", wr::DebugFlags_GPU_TIME_QUERIES) + GFX_WEBRENDER_DEBUG(".gpu-sample-queries", wr::DebugFlags_GPU_SAMPLE_QUERIES) + GFX_WEBRENDER_DEBUG(".disable-batching", wr::DebugFlags_DISABLE_BATCHING) + GFX_WEBRENDER_DEBUG(".epochs", wr::DebugFlags_EPOCHS) + GFX_WEBRENDER_DEBUG(".compact-profiler", wr::DebugFlags_COMPACT_PROFILER) + GFX_WEBRENDER_DEBUG(".echo-driver-messages", + wr::DebugFlags_ECHO_DRIVER_MESSAGES) + GFX_WEBRENDER_DEBUG(".new-frame-indicator", + wr::DebugFlags_NEW_FRAME_INDICATOR) + GFX_WEBRENDER_DEBUG(".new-scene-indicator", + wr::DebugFlags_NEW_SCENE_INDICATOR) + GFX_WEBRENDER_DEBUG(".show-overdraw", wr::DebugFlags_SHOW_OVERDRAW) + GFX_WEBRENDER_DEBUG(".gpu-cache", wr::DebugFlags_GPU_CACHE_DBG) + GFX_WEBRENDER_DEBUG(".slow-frame-indicator", + wr::DebugFlags_SLOW_FRAME_INDICATOR) + GFX_WEBRENDER_DEBUG(".texture-cache.clear-evicted", + wr::DebugFlags_TEXTURE_CACHE_DBG_CLEAR_EVICTED) + GFX_WEBRENDER_DEBUG(".picture-caching", wr::DebugFlags_PICTURE_CACHING_DBG) + GFX_WEBRENDER_DEBUG(".texture-cache.disable-shrink", + wr::DebugFlags_TEXTURE_CACHE_DBG_DISABLE_SHRINK) + GFX_WEBRENDER_DEBUG(".primitives", wr::DebugFlags_PRIMITIVE_DBG) // Bit 18 is for the zoom display, which requires the mouse position and thus // currently only works in wrench. - GFX_WEBRENDER_DEBUG(".small-screen", 1 << 19) + GFX_WEBRENDER_DEBUG(".small-screen", wr::DebugFlags_SMALL_SCREEN) #undef GFX_WEBRENDER_DEBUG - gfx::gfxVars::SetWebRenderDebugFlags(flags); + gfx::gfxVars::SetWebRenderDebugFlags(flags.bits); } #if defined(USE_SKIA) @@ -879,7 +884,7 @@ void gfxPlatform::Init() { gfxPrefs::WebGLForceMSAA()); // Prefs that don't fit into any of the other sections forcedPrefs.AppendPrintf("-T%d%d%d) ", gfxPrefs::AndroidRGB16Force(), - 0, // SkiaGL canvas no longer supported + 0, // SkiaGL canvas no longer supported gfxPrefs::ForceShmemTiles()); ScopedGfxFeatureReporter::AppNote(forcedPrefs); } diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp index 5a0f2c758e583..0c580f94e68e5 100644 --- a/gfx/webrender_bindings/WebRenderAPI.cpp +++ b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -327,8 +327,8 @@ WebRenderAPI::~WebRenderAPI() { } void WebRenderAPI::UpdateDebugFlags(uint32_t aFlags) { - if (mDebugFlags.mBits != aFlags) { - mDebugFlags.mBits = aFlags; + if (mDebugFlags.bits != aFlags) { + mDebugFlags.bits = aFlags; wr_api_set_debug_flags(mDocHandle, mDebugFlags); } } diff --git a/gfx/webrender_bindings/WebRenderTypes.h b/gfx/webrender_bindings/WebRenderTypes.h index 8e00488a971dc..92133582dfa80 100644 --- a/gfx/webrender_bindings/WebRenderTypes.h +++ b/gfx/webrender_bindings/WebRenderTypes.h @@ -41,7 +41,6 @@ typedef wr::WrFontKey FontKey; typedef wr::WrFontInstanceKey FontInstanceKey; typedef wr::WrEpoch Epoch; typedef wr::WrExternalImageId ExternalImageId; -typedef wr::WrDebugFlags DebugFlags; typedef mozilla::Maybe MaybeIdNamespace; typedef mozilla::Maybe MaybeImageMask; @@ -59,9 +58,7 @@ struct ExternalImageKeyPair { WindowId NewWindowId(); inline DebugFlags NewDebugFlags(uint32_t aFlags) { - DebugFlags flags; - flags.mBits = aFlags; - return flags; + return {aFlags}; } inline Maybe SurfaceFormatToImageFormat( diff --git a/gfx/webrender_bindings/cbindgen.toml b/gfx/webrender_bindings/cbindgen.toml index 530e0acda5378..f968e1b963bd9 100644 --- a/gfx/webrender_bindings/cbindgen.toml +++ b/gfx/webrender_bindings/cbindgen.toml @@ -15,8 +15,7 @@ language = "C++" namespaces = ["mozilla", "wr"] [export] -# Skip constants because we don't have any -item_types = ["globals", "enums", "structs", "unions", "typedefs", "opaque", "functions"] +item_types = ["globals", "enums", "structs", "unions", "typedefs", "opaque", "functions", "constants"] [parse] parse_deps = true @@ -35,6 +34,9 @@ derive_eq = true add_sentinel = true derive_helper_methods = true +[macro_expansion] +bitflags = true + [defines] "target_os = windows" = "XP_WIN" "target_os = macos" = "XP_MACOSX" diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs index ca5accc089c29..2730fc1eed54a 100644 --- a/gfx/webrender_bindings/src/bindings.rs +++ b/gfx/webrender_bindings/src/bindings.rs @@ -777,7 +777,7 @@ impl ProfilerHooks for GeckoProfilerHooks { } } -const PROFILER_HOOKS: GeckoProfilerHooks = GeckoProfilerHooks {}; +static PROFILER_HOOKS: GeckoProfilerHooks = GeckoProfilerHooks {}; #[allow(improper_ctypes)] // this is needed so that rustc doesn't complain about passing the &mut Transaction to an extern function extern "C" { @@ -1203,17 +1203,9 @@ pub unsafe extern "C" fn wr_api_notify_memory_pressure(dh: &mut DocumentHandle) dh.api.notify_memory_pressure(); } -/// cbindgen:field-names=[mBits] -#[repr(C)] -pub struct WrDebugFlags { - bits: u32, -} - #[no_mangle] -pub extern "C" fn wr_api_set_debug_flags(dh: &mut DocumentHandle, flags: WrDebugFlags) { - if let Some(dbg_flags) = DebugFlags::from_bits(flags.bits) { - dh.api.set_debug_flags(dbg_flags); - } +pub extern "C" fn wr_api_set_debug_flags(dh: &mut DocumentHandle, flags: DebugFlags) { + dh.api.set_debug_flags(flags); } #[no_mangle] diff --git a/gfx/webrender_bindings/webrender_ffi.h b/gfx/webrender_bindings/webrender_ffi.h index 79e96edde1faa..a2a218e67e5cd 100644 --- a/gfx/webrender_bindings/webrender_ffi.h +++ b/gfx/webrender_bindings/webrender_ffi.h @@ -64,60 +64,6 @@ struct InternerSubReport { #undef DECLARE_MEMBER -struct FontInstanceFlags { - uint32_t bits; - - bool operator==(const FontInstanceFlags& aOther) const { - return bits == aOther.bits; - } - - FontInstanceFlags& operator=(uint32_t aBits) { - bits = aBits; - return *this; - } - - FontInstanceFlags& operator|=(uint32_t aBits) { - bits |= aBits; - return *this; - } - - FontInstanceFlags operator|(uint32_t aBits) const { - FontInstanceFlags flags = {bits | aBits}; - return flags; - } - - FontInstanceFlags& operator&=(uint32_t aBits) { - bits &= aBits; - return *this; - } - - FontInstanceFlags operator&(uint32_t aBits) const { - FontInstanceFlags flags = {bits & aBits}; - return flags; - } - - MOZ_IMPLICIT operator bool() const { return bits != 0; } - - enum : uint32_t { - SYNTHETIC_BOLD = 1 << 1, - EMBEDDED_BITMAPS = 1 << 2, - SUBPIXEL_BGR = 1 << 3, - TRANSPOSE = 1 << 4, - FLIP_X = 1 << 5, - FLIP_Y = 1 << 6, - SUBPIXEL_POSITION = 1 << 7, - - FORCE_GDI = 1 << 16, - - FONT_SMOOTHING = 1 << 16, - - FORCE_AUTOHINT = 1 << 16, - NO_AUTOHINT = 1 << 17, - VERTICAL_LAYOUT = 1 << 18, - LCD_VERTICAL = 1 << 19 - }; -}; - struct Transaction; struct WrWindowId; struct WrPipelineInfo; diff --git a/gfx/wr/webrender_api/src/api.rs b/gfx/wr/webrender_api/src/api.rs index ac592b26f5c06..496edb58544ab 100644 --- a/gfx/wr/webrender_api/src/api.rs +++ b/gfx/wr/webrender_api/src/api.rs @@ -1008,6 +1008,7 @@ impl RenderApiSender { } bitflags! { + #[repr(C)] #[derive(Default, Deserialize, MallocSizeOf, Serialize)] pub struct DebugFlags: u32 { /// Display the frame profiler on screen. diff --git a/gfx/wr/webrender_api/src/color.rs b/gfx/wr/webrender_api/src/color.rs index abdacd7110253..8fd8298071168 100644 --- a/gfx/wr/webrender_api/src/color.rs +++ b/gfx/wr/webrender_api/src/color.rs @@ -23,9 +23,9 @@ pub struct PremultipliedColorF { #[allow(missing_docs)] impl PremultipliedColorF { - pub const BLACK: Self = PremultipliedColorF { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }; - pub const TRANSPARENT: Self = PremultipliedColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; - pub const WHITE: Self = PremultipliedColorF { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }; + pub const BLACK: PremultipliedColorF = PremultipliedColorF { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }; + pub const TRANSPARENT: PremultipliedColorF = PremultipliedColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; + pub const WHITE: PremultipliedColorF = PremultipliedColorF { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }; pub fn to_array(&self) -> [f32; 4] { [self.r, self.g, self.b, self.a] @@ -47,9 +47,9 @@ pub struct ColorF { #[allow(missing_docs)] impl ColorF { - pub const BLACK: Self = ColorF { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }; - pub const TRANSPARENT: Self = ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; - pub const WHITE: Self = ColorF { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }; + pub const BLACK: ColorF = ColorF { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }; + pub const TRANSPARENT: ColorF = ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; + pub const WHITE: ColorF = ColorF { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }; /// Constructs a new `ColorF` from its components. pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self { diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index c511595db6e1a..0846036033070 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1319,7 +1319,7 @@ void nsIFrame::SyncFrameViewProperties(nsView* aView) { ComputedStyle* sc = Style(); const nsStylePosition* position = sc->StylePosition(); if (position->mZIndex.IsInteger()) { - zIndex = position->mZIndex.integer._0; + zIndex = position->mZIndex.AsInteger(); } else { MOZ_ASSERT(position->mZIndex.IsAuto()); autoZIndex = true; diff --git a/layout/painting/nsCSSRendering.cpp b/layout/painting/nsCSSRendering.cpp index 0cd6dba4f1662..9aad06143e162 100644 --- a/layout/painting/nsCSSRendering.cpp +++ b/layout/painting/nsCSSRendering.cpp @@ -1029,8 +1029,7 @@ Maybe nsCSSRendering::CreateBorderRendererForOutline( // "User agents may treat 'auto' as 'solid'." outlineStyle = StyleBorderStyle::Solid; } else { - MOZ_ASSERT(ourOutline->mOutlineStyle.IsBorderStyle()); - outlineStyle = ourOutline->mOutlineStyle.border_style._0; + outlineStyle = ourOutline->mOutlineStyle.AsBorderStyle(); } StyleBorderStyle outlineStyles[4] = {outlineStyle, outlineStyle, outlineStyle, diff --git a/layout/painting/nsCSSRenderingBorders.cpp b/layout/painting/nsCSSRenderingBorders.cpp index ce6b3fde7de19..86936da135070 100644 --- a/layout/painting/nsCSSRenderingBorders.cpp +++ b/layout/painting/nsCSSRenderingBorders.cpp @@ -3741,10 +3741,10 @@ nsCSSBorderImageRenderer::nsCSSBorderImageRenderer( nscoord borderDimension = SideIsVertical(s) ? mArea.width : mArea.height; double value; if (slice.IsNumber()) { - value = nsPresContext::CSSPixelsToAppUnits(NS_lround(slice.number._0)); + value = nsPresContext::CSSPixelsToAppUnits(NS_lround(slice.AsNumber())); } else { MOZ_ASSERT(slice.IsPercentage()); - value = slice.percentage._0._0 * imgDimension; + value = slice.AsPercentage()._0 * imgDimension; } if (value < 0) value = 0; if (value > imgDimension) value = imgDimension; diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 474759ba767c9..460a27c598919 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -3153,7 +3153,7 @@ static int32_t ZIndexForFrame(nsIFrame* aFrame) { const nsStylePosition* position = aFrame->StylePosition(); if (position->mZIndex.IsInteger()) - return position->mZIndex.integer._0; + return position->mZIndex.AsInteger(); MOZ_ASSERT(position->mZIndex.IsAuto()); // sort the auto and 0 elements together return 0; diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index fb9d32c13a158..6343abec1c71a 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -228,10 +228,10 @@ void FontFaceSet::ParseFontShorthandForMatching( aStyle = FontSlantStyle::Italic(); break; case StyleComputedFontStyleDescriptor::Tag::Oblique: - MOZ_ASSERT(style.oblique._0 == style.oblique._1, + MOZ_ASSERT(style.AsOblique()._0 == style.AsOblique()._1, "We use ComputedFontStyleDescriptor just for convenience, " "the two values should always match"); - aStyle = FontSlantStyle::Oblique(style.oblique._0); + aStyle = FontSlantStyle::Oblique(style.AsOblique()._0); break; } @@ -961,8 +961,8 @@ static SlantStyleRange GetStyleRangeForDescriptor( case StyleComputedFontStyleDescriptor::Tag::Italic: return SlantStyleRange(FontSlantStyle::Italic()); case StyleComputedFontStyleDescriptor::Tag::Oblique: - return SlantStyleRange(FontSlantStyle::Oblique(val.oblique._0), - FontSlantStyle::Oblique(val.oblique._1)); + return SlantStyleRange(FontSlantStyle::Oblique(val.AsOblique()._0), + FontSlantStyle::Oblique(val.AsOblique()._1)); } MOZ_ASSERT_UNREACHABLE("How?"); return SlantStyleRange(FontSlantStyle::Normal()); @@ -1046,7 +1046,7 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace( const auto& component = sourceListComponents[i]; switch (component.tag) { case StyleFontFaceSourceListComponent::Tag::Local: { - nsAtom* atom = component.local._0; + nsAtom* atom = component.AsLocal(); face->mLocalName.Append(nsAtomCString(atom)); face->mSourceType = gfxFontFaceSrc::eSourceType_Local; face->mURI = nullptr; @@ -1056,7 +1056,7 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace( } case StyleFontFaceSourceListComponent::Tag::Url: { face->mSourceType = gfxFontFaceSrc::eSourceType_URL; - const URLValue* url = component.url._0; + const URLValue* url = component.AsUrl(); nsIURI* uri = url->GetURI(); face->mURI = uri ? new gfxFontSrcURI(uri) : nullptr; URLExtraData* extraData = url->ExtraData(); diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index dafe9304b2a53..74711d2a44f49 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -1095,7 +1095,7 @@ already_AddRefed nsComputedDOMStyle::DoGetTransformOrigin() { auto position = MaybeResolvePositionForTransform( origin.horizontal, origin.vertical, mInnerFrame); SetValueToPosition(position, valueList); - if (origin.depth._0 != 0.0f) { + if (!origin.depth.IsZero()) { RefPtr depth = new nsROCSSPrimitiveValue; depth->SetAppUnits(origin.depth.ToAppUnits()); valueList->AppendCSSValue(depth.forget()); @@ -1964,9 +1964,9 @@ already_AddRefed nsComputedDOMStyle::DoGetLineHeight() { auto& lh = StyleText()->mLineHeight; if (lh.IsLength()) { - val->SetAppUnits(lh.length._0.ToAppUnits()); + val->SetAppUnits(lh.AsLength().ToAppUnits()); } else if (lh.IsNumber()) { - val->SetNumber(lh.number._0); + val->SetNumber(lh.AsNumber()); } else if (lh.IsMozBlockHeight()) { val->SetIdent(eCSSKeyword__moz_block_height); } else { diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index c95c09ffb65ad..2be9dac16c2b4 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -162,11 +162,6 @@ nscoord LengthPercentage::Resolve(nscoord aPercentageBasis, } #define IMPL_LENGTHPERCENTAGE_FORWARDS(ty_) \ - template <> \ - inline const LengthPercentage& ty_::AsLengthPercentage() const { \ - MOZ_ASSERT(IsLengthPercentage()); \ - return length_percentage._0; \ - } \ template <> \ inline bool ty_::HasPercent() const { \ return IsLengthPercentage() && AsLengthPercentage().HasPercent(); \ @@ -200,23 +195,11 @@ IMPL_LENGTHPERCENTAGE_FORWARDS(LengthPercentageOrAuto) IMPL_LENGTHPERCENTAGE_FORWARDS(StyleSize) IMPL_LENGTHPERCENTAGE_FORWARDS(StyleMaxSize) -template <> -inline const StyleSize& StyleFlexBasis::AsSize() const { - MOZ_ASSERT(IsSize()); - return size._0; -} - template <> inline bool StyleFlexBasis::IsAuto() const { return IsSize() && AsSize().IsAuto(); } -template <> -inline StyleExtremumLength StyleSize::AsExtremumLength() const { - MOZ_ASSERT(IsExtremumLength()); - return extremum_length._0; -} - template <> inline bool StyleSize::BehavesLikeInitialValueOnBlockAxis() const { return IsAuto() || IsExtremumLength(); @@ -227,12 +210,6 @@ inline bool StyleMaxSize::BehavesLikeInitialValueOnBlockAxis() const { return IsNone() || IsExtremumLength(); } -template <> -inline StyleExtremumLength StyleMaxSize::AsExtremumLength() const { - MOZ_ASSERT(IsExtremumLength()); - return extremum_length._0; -} - template <> inline bool StyleBackgroundSize::IsInitialValue() const { return IsExplicitSize() && explicit_size.width.IsAuto() && diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 558d05f069020..0ac994555919d 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -315,10 +315,10 @@ nsMargin nsStyleBorder::GetImageOutset() const { const auto& coord = mBorderImageOutset.Get(s); nscoord value; if (coord.IsLength()) { - value = coord.length._0.ToAppUnits(); + value = coord.AsLength().ToAppUnits(); } else { MOZ_ASSERT(coord.IsNumber()); - value = coord.number._0 * mComputedBorder.Side(s); + value = coord.AsNumber() * mComputedBorder.Side(s); } outset.Side(s) = value; } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index b3de9f4766241..17d3d04c71e42 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1067,7 +1067,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline { } if (GetOutlineWidth() > 0) { MOZ_ASSERT( - mOutlineStyle.border_style._0 != mozilla::StyleBorderStyle::None, + mOutlineStyle.AsBorderStyle() != mozilla::StyleBorderStyle::None, "outline-style: none implies outline-width of zero"); return true; } diff --git a/layout/style/nsTimingFunction.h b/layout/style/nsTimingFunction.h index 003acc565ff96..92c9d399bd761 100644 --- a/layout/style/nsTimingFunction.h +++ b/layout/style/nsTimingFunction.h @@ -22,7 +22,7 @@ struct nsTimingFunction { bool IsLinear() const { return mTiming.IsKeyword() && - mTiming.keyword._0 == mozilla::StyleTimingKeyword::Linear; + mTiming.AsKeyword() == mozilla::StyleTimingKeyword::Linear; } bool operator==(const nsTimingFunction& aOther) const { diff --git a/servo/components/style/cbindgen.toml b/servo/components/style/cbindgen.toml index 9b7159fcba8fb..5de390cc8a622 100644 --- a/servo/components/style/cbindgen.toml +++ b/servo/components/style/cbindgen.toml @@ -40,8 +40,13 @@ include = ["cssparser", "style_traits"] derive_eq = true derive_neq = true +[macro_expansion] +bitflags = true + [enum] derive_helper_methods = true +derive_const_casts = true +cast_assert_name = "MOZ_ASSERT" [export] prefix = "Style" @@ -133,7 +138,6 @@ item_types = ["enums", "structs", "typedefs"] """ "GenericLengthPercentageOrAuto" = """ - inline const StyleLengthPercentage& AsLengthPercentage() const; inline bool ConvertsToLength() const; inline nscoord ToLength() const; inline bool ConvertsToPercentage() const; @@ -143,8 +147,6 @@ item_types = ["enums", "structs", "typedefs"] """ "GenericSize" = """ - inline const StyleLengthPercentage& AsLengthPercentage() const; - inline StyleExtremumLength AsExtremumLength() const; inline bool ConvertsToLength() const; inline nscoord ToLength() const; inline bool ConvertsToPercentage() const; @@ -156,12 +158,9 @@ item_types = ["enums", "structs", "typedefs"] "GenericFlexBasis" = """ inline bool IsAuto() const; - inline const StyleSize& AsSize() const; """ "GenericMaxSize" = """ - inline const StyleLengthPercentage& AsLengthPercentage() const; - inline StyleExtremumLength AsExtremumLength() const; inline bool ConvertsToLength() const; inline nscoord ToLength() const; inline bool ConvertsToPercentage() const; From bccb685e0396a0192bd4bd086b87f51242869887 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 6 Mar 2019 15:36:19 +0000 Subject: [PATCH 04/48] Bug 1531632 - Initialize environment variables before loading libxul. r=snorp There are at least two known side effects of initializing it after loading libxul: - We can't set LLVM_PROFILE_FILE for the instrumentation part of PGO to make the compiler-rt static initializer pick it. - We can't set MOZ_DEBUG_LINKER to enable the linker debug log (which used to work when environment variables were set earlier). Differential Revision: https://phabricator.services.mozilla.com/D21646 --HG-- extra : moz-landing-system : lando --- .../java/org/mozilla/gecko/GeckoThread.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java index 94e1e7cc632ac..da174e9486338 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java @@ -271,9 +271,6 @@ private static void loadGeckoLibs(final Context context) { private static void initGeckoEnvironment() { final Context context = GeckoAppShell.getApplicationContext(); - GeckoLoader.loadMozGlue(context); - setState(State.MOZGLUE_READY); - final Locale locale = Locale.getDefault(); final Resources res = context.getResources(); if (locale.toString().equalsIgnoreCase("zh_hk")) { @@ -414,6 +411,28 @@ public void run() { }; Looper.myQueue().addIdleHandler(idleHandler); + final Context context = GeckoAppShell.getApplicationContext(); + final List env = getEnvFromExtras(mInitInfo.extras); + + // In Gecko, the native crash reporter is enabled by default in opt builds, and + // disabled by default in debug builds. + if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) == 0 && !BuildConfig.DEBUG_BUILD) { + env.add(0, "MOZ_CRASHREPORTER_DISABLE=1"); + } else if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) != 0 && BuildConfig.DEBUG_BUILD) { + env.add(0, "MOZ_CRASHREPORTER=1"); + } + + if (!isChildProcess() && ((mInitInfo.flags & FLAG_ENABLE_MARIONETTE) != 0)) { + // The presence of this environment variable determines the initial + // value of `marionette.enabled`. + env.add(0, "MOZ_MARIONETTE=1"); + } + + GeckoLoader.loadMozGlue(context); + setState(State.MOZGLUE_READY); + + GeckoLoader.setupGeckoEnvironment(context, context.getFilesDir().getPath(), env, mInitInfo.prefs); + initGeckoEnvironment(); // Wait until initialization before calling Gecko entry point. @@ -445,31 +464,12 @@ public void run() { Log.w(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() + " - runGecko"); - final Context context = GeckoAppShell.getApplicationContext(); final String[] args = isChildProcess() ? mInitInfo.args : getMainProcessArgs(); if ((mInitInfo.flags & FLAG_DEBUGGING) != 0) { Log.i(LOGTAG, "RunGecko - args = " + TextUtils.join(" ", args)); } - final List env = getEnvFromExtras(mInitInfo.extras); - - // In Gecko, the native crash reporter is enabled by default in opt builds, and - // disabled by default in debug builds. - if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) == 0 && !BuildConfig.DEBUG_BUILD) { - env.add(0, "MOZ_CRASHREPORTER_DISABLE=1"); - } else if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) != 0 && BuildConfig.DEBUG_BUILD) { - env.add(0, "MOZ_CRASHREPORTER=1"); - } - - if (!isChildProcess() && ((mInitInfo.flags & FLAG_ENABLE_MARIONETTE) != 0)) { - // The presence of this environment variable determines the initial - // value of `marionette.enabled`. - env.add(0, "MOZ_MARIONETTE=1"); - } - - GeckoLoader.setupGeckoEnvironment(context, context.getFilesDir().getPath(), env, mInitInfo.prefs); - // And go. GeckoLoader.nativeRun(args, mInitInfo.extras.getInt(EXTRA_PREFS_FD, -1), From b61741d079b129c1dccc434c2096aa9e319a4044 Mon Sep 17 00:00:00 2001 From: "berkay.barlas" Date: Wed, 6 Mar 2019 23:03:33 +0000 Subject: [PATCH 05/48] Bug 1151732 disappear panels in sidebar after clicking the Pocket sidebar button r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D22198 --HG-- extra : moz-landing-system : lando --- toolkit/components/reader/AboutReader.jsm | 1 - 1 file changed, 1 deletion(-) diff --git a/toolkit/components/reader/AboutReader.jsm b/toolkit/components/reader/AboutReader.jsm index 149808a5eca31..bdf25142e8f55 100644 --- a/toolkit/components/reader/AboutReader.jsm +++ b/toolkit/components/reader/AboutReader.jsm @@ -951,7 +951,6 @@ AboutReader.prototype = { if (!aEvent.isTrusted) return; - aEvent.stopPropagation(); let btn = aEvent.target; callback(btn); }, true); From d03888d5bf942b6bb90869af35e324e81fa02baa Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 6 Mar 2019 23:03:47 +0000 Subject: [PATCH 06/48] Bug 1525395 - Part 1: Make Scratchpad.openFile return a promise. r=jimb Tests can use the promise to avoid racing on the text being available and the UI ready for interaction. Differential Revision: https://phabricator.services.mozilla.com/D20758 --HG-- extra : moz-landing-system : lando --- devtools/client/scratchpad/scratchpad.js | 69 ++++++++++++++---------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/devtools/client/scratchpad/scratchpad.js b/devtools/client/scratchpad/scratchpad.js index 40e05a8454bef..f0d6aeed063aa 100644 --- a/devtools/client/scratchpad/scratchpad.js +++ b/devtools/client/scratchpad/scratchpad.js @@ -1089,16 +1089,28 @@ var Scratchpad = { * * @param integer aIndex * Optional integer: clicked menuitem in the 'Open Recent'-menu. + * If omitted, prompt the user to pick a file to open. + * + * @return Promise + * A Promise that resolves to undefined when the file is opened (or + * can't be opened), or when the user cancels the file picker dialog. + * This method effectively catches all errors and reports them to the + * notificationBox, so the promise never becomes rejected. */ - openFile: function SP_openFile(aIndex) { - const promptCallback = aFile => { - this.promptSave((aCloseFile, aSaved, aStatus) => { - let shouldOpen = aCloseFile; - if (aSaved && !Components.isSuccessCode(aStatus)) { - shouldOpen = false; - } + openFile(aIndex) { + return new Promise(resolve => { + const promptCallback = aFile => { + this.promptSave((aCloseFile, aSaved, aStatus) => { + let shouldOpen = aCloseFile; + if (aSaved && !Components.isSuccessCode(aStatus)) { + shouldOpen = false; + } + + if (!shouldOpen) { + resolve(); + return; + } - if (shouldOpen) { let file; if (aFile) { file = aFile; @@ -1118,29 +1130,32 @@ var Scratchpad = { null); this.clearFiles(aIndex, 1); + resolve(); return; } - this.importFromFile(file, false); - } - }); - }; + this.importFromFile(file, false).finally(_ => resolve()); + }); + }; - if (aIndex > -1) { - promptCallback(); - } else { - const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); - fp.init(window, this.strings.GetStringFromName("openFile.title"), - Ci.nsIFilePicker.modeOpen); - fp.defaultString = ""; - fp.appendFilter("JavaScript Files", "*.js; *.jsm; *.json"); - fp.appendFilter("All Files", "*.*"); - fp.open(aResult => { - if (aResult != Ci.nsIFilePicker.returnCancel) { - promptCallback(fp.file); - } - }); - } + if (aIndex > -1) { + promptCallback(); + } else { + const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); + fp.init(window, this.strings.GetStringFromName("openFile.title"), + Ci.nsIFilePicker.modeOpen); + fp.defaultString = ""; + fp.appendFilter("JavaScript Files", "*.js; *.jsm; *.json"); + fp.appendFilter("All Files", "*.*"); + fp.open(aResult => { + if (aResult == Ci.nsIFilePicker.returnCancel) { + resolve(); + } else { + promptCallback(fp.file); + } + }); + } + }); }, /** From 8fcb34f77205138484e7f6ccfd6a30b0552d2245 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 6 Mar 2019 23:04:01 +0000 Subject: [PATCH 07/48] Bug 1525395 - Part 2: Rewrite a Scratchpad test to eliminate some race conditions. r=jimb I don't understand how the test ever worked. I think the idea was that each operation would result in changes to the prefs, because those prefs are the source of truth for the recent-files list. However, I don't understand why some tests would not trigger multiple observer callbacks, which should have been a huge mess. The new code doesn't observe the prefs at all. Where possible, it waits for an appropriate promise; in other places it uses `setTimeout()` to wait for the next tick, relying on the Scratchpad implementation to be done reacting by then. Since the original code was event-driven, most tests were split across two functions. Each test function had the bottom half of one test and the top half of the next test. The new code uses async/await and can therefore at least group related functionality into single cohesive test functions. But those test functions aren't as independent as they look -- most of them still depend on previous tests to set up the expected starting state. Differential Revision: https://phabricator.services.mozilla.com/D20759 --HG-- extra : moz-landing-system : lando --- .../test/browser_scratchpad_recent_files.js | 216 ++++++------------ 1 file changed, 66 insertions(+), 150 deletions(-) diff --git a/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js b/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js index c9685d48c3dfc..76e79a96f47ee 100644 --- a/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js +++ b/devtools/client/scratchpad/test/browser_scratchpad_recent_files.js @@ -32,17 +32,20 @@ var gFileContent02 = "hello.world.02('bug651942');"; var gFileContent03 = "hello.world.03('bug651942');"; var gFileContent04 = "hello.world.04('bug651942');"; -async function startTest() { +// Return a promise that will be resolved after one event loop turn. +function snooze() { + return new Promise(resolve => setTimeout(resolve, 0)); +} + +async function testAddedToRecent() { gScratchpad = gScratchpadWindow.Scratchpad; gFile01 = await createAndLoadTemporaryFile(gFileName01, gFileContent01); gFile02 = await createAndLoadTemporaryFile(gFileName02, gFileContent02); gFile03 = await createAndLoadTemporaryFile(gFileName03, gFileContent03); -} -// Test to see if the three files we created in the 'startTest()'-method have -// been added to the list of recent files. -async function testAddedToRecent() { + // Test to see if the files we just created have been added to the list of + // recent files. lists.recentFiles01 = gScratchpad.getRecentFiles(); is(lists.recentFiles01.length, 3, @@ -50,11 +53,9 @@ async function testAddedToRecent() { // Create a 4th file, this should clear the oldest file. gFile04 = await createAndLoadTemporaryFile(gFileName04, gFileContent04); -} -// We have opened a 4th file. Test to see if the oldest recent file was removed, -// and that the other files were reordered successfully. -function testOverwriteRecent() { + // Test to see if the oldest recent file was removed, + // and that the other files were reordered successfully. lists.recentFiles02 = gScratchpad.getRecentFiles(); is(lists.recentFiles02[0], lists.recentFiles01[1], @@ -65,12 +66,10 @@ function testOverwriteRecent() { "File04: was added successfully."); // Open the oldest recent file. - gScratchpad.openFile(0); -} + await gScratchpad.openFile(0); -// We have opened the "oldest"-recent file. Test to see if it is now the most -// recent file, and that the other files were reordered successfully. -function testOpenOldestRecent() { + // Test to see if it is now the most recent file, and that the other files + // were reordered successfully. lists.recentFiles03 = gScratchpad.getRecentFiles(); is(lists.recentFiles02[0], lists.recentFiles03[2], @@ -79,24 +78,34 @@ function testOpenOldestRecent() { "File03 was reordered successfully in the 'recent files'-list."); is(lists.recentFiles02[2], lists.recentFiles03[1], "File02 was reordered successfully in the 'recent files'-list."); +} +async function testHideMenu() { Services.prefs.setIntPref("devtools.scratchpad.recentFilesMax", 0); -} -// The "devtools.scratchpad.recentFilesMax"-preference was set to zero (0). -// This should disable the "Open Recent"-menu by hiding it (this should not -// remove any files from the list). Test to see if it's been hidden. -function testHideMenu() { + // Give the Scratchpad UI time to react to the pref change, via its observer. + // This is a race condition; to fix it, Scratchpad would need to give us some + // indication that it was finished responding to a pref update - perhaps by + // emitting an event. + await snooze(); + + // The "devtools.scratchpad.recentFilesMax"-preference was set to zero (0). + // This should disable the "Open Recent"-menu by hiding it (this should not + // remove any files from the list). Test to see if it's been hidden. const menu = gScratchpadWindow.document.getElementById("sp-open_recent-menu"); ok(menu.hasAttribute("hidden"), "The menu was hidden successfully."); +} +async function testEnableMenu() { Services.prefs.setIntPref("devtools.scratchpad.recentFilesMax", 2); -} -// We have set the recentFilesMax-pref to one (1), this enables the feature, -// removes the two oldest files, rebuilds the menu and removes the -// "hidden"-attribute from it. Test to see if this works. -function testChangedMaxRecent() { + // Give the Scratchpad UI time to react to the pref change. This is a race + // condition; see the comment in testHideMenu. + await snooze(); + + // We have set the recentFilesMax pref to a nonzero value. This enables the + // feature, removes the oldest files, rebuilds the menu and removes the + // "hidden"-attribute from it. Test to see if this works. const menu = gScratchpadWindow.document.getElementById("sp-open_recent-menu"); ok(!menu.hasAttribute("hidden"), "The menu is visible. \\o/"); @@ -117,30 +126,24 @@ function testChangedMaxRecent() { is(correctMenuItem, true, "Two recent files were successfully removed from the 'Open Recent'-menu"); +} +async function testOpenDeletedFile() { // We now remove one file from the harddrive and use the recent-menuitem for // it to make sure the user is notified that the file no longer exists. // This is tested in testOpenDeletedFile(). gFile04.remove(false); - // Make sure the file has been deleted before continuing to avoid - // intermittent oranges. - waitForFileDeletion(); -} - -function waitForFileDeletion() { - if (gFile04.exists()) { - executeSoon(waitForFileDeletion); - return; + // Make sure the file has been deleted before continuing. + while (gFile04.exists()) { + await snooze(); } - gFile04 = null; - gScratchpad.openFile(0); -} -// By now we should have two recent files stored in the list but one of the -// files should be missing on the harddrive. -function testOpenDeletedFile() { + // By now we should have two recent files stored in the list but one of the + // files should be missing on the harddrive. + await gScratchpad.openFile(0); + const doc = gScratchpadWindow.document; const popup = doc.getElementById("sp-menu-open_recentPopup"); @@ -155,13 +158,19 @@ function testOpenDeletedFile() { is(gScratchpad.notificationBox.currentNotification.messageText.textContent, gScratchpad.strings.GetStringFromName("fileNoLongerExists.notification"), "The notification label is correct."); +} +async function testClearAll() { gScratchpad.clearRecentFiles(); -} -// We have cleared the last file. Test to see if the last file was removed, -// the menu is empty and was disabled successfully. -function testClearedAll() { + // Give the UI time to react to the recent files being cleared out. This is a + // race condition. The clearRecentFiles method works asynchronously, but + // there is no way to wait for it to finish. A single event loop turn should + // be good enough. + await snooze(); + + // We have cleared the last file. Test to see if the last file was removed, + // the menu is empty and was disabled successfully. const doc = gScratchpadWindow.document; const menu = doc.getElementById("sp-open_recent-menu"); const popup = doc.getElementById("sp-menu-open_recentPopup"); @@ -171,8 +180,6 @@ function testClearedAll() { is(popup.children.length, 0, "All menuitems removed successfully."); ok(menu.hasAttribute("disabled"), "No files in the menu, it was disabled successfully."); - - finishTest(); } async function createAndLoadTemporaryFile(aFileName, aFileContent) { @@ -212,124 +219,33 @@ function checkIfMenuIsPopulated() { } } -/** - * The PreferenceObserver listens for preference changes while Scratchpad is - * running. - */ -var PreferenceObserver = { - _initialized: false, - - _timesFired: 0, - set timesFired(aNewValue) { - this._timesFired = aNewValue; - }, - get timesFired() { - return this._timesFired; - }, - - init: function PO_init() { - if (this._initialized) { - return; - } - - this.branch = Services.prefs.getBranch("devtools.scratchpad."); - this.branch.addObserver("", this); - this._initialized = true; - }, - - async observe(message, topic, data) { - if (topic != "nsPref:changed") { - return; - } - - if (this._inProgress) { - await this._inProgress; - } - - this._inProgress = new Promise(async resolve => { - info(`Times fired: ${this.timesFired}`); - switch (this.timesFired) { - case 0: - this.timesFired = 1; - break; - case 1: - this.timesFired = 2; - break; - case 2: - this.timesFired = 3; - await testAddedToRecent(); - break; - case 3: - this.timesFired = 4; - testOverwriteRecent(); - break; - case 4: - this.timesFired = 5; - testOpenOldestRecent(); - break; - case 5: - this.timesFired = 6; - testHideMenu(); - break; - case 6: - this.timesFired = 7; - testChangedMaxRecent(); - break; - case 7: - this.timesFired = 8; - testOpenDeletedFile(); - break; - case 8: - this.timesFired = 9; - testClearedAll(); - break; - } - - this._inProgress = null; - resolve(); - }); - }, - - uninit: function PO_uninit() { - this.branch.removeObserver("", this); - }, -}; - -function test() { +async function test() { waitForExplicitFinish(); registerCleanupFunction(function() { gFile01.remove(false); - gFile01 = null; gFile02.remove(false); - gFile02 = null; gFile03.remove(false); - gFile03 = null; - // gFile04 was removed earlier. - lists.recentFiles01 = null; - lists.recentFiles02 = null; - lists.recentFiles03 = null; - lists.recentFiles04 = null; - gScratchpad = null; - - PreferenceObserver.uninit(); + // If all tests passed, gFile04 was already removed, but just in case: + if (gFile04) { + gFile04.remove(false); + } Services.prefs.clearUserPref("devtools.scratchpad.recentFilesMax"); }); Services.prefs.setIntPref("devtools.scratchpad.recentFilesMax", 3); - // Initiate the preference observer after we have set the temporary recent - // files max for this test. - PreferenceObserver.init(); - gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); - BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(function() { - openScratchpad(startTest); - }); - + const loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); BrowserTestUtils.loadURI(gBrowser, "data:text/html,

test recent files in Scratchpad"); -} + await loaded; + await new Promise(openScratchpad); + + await testAddedToRecent(); + await testHideMenu(); + await testEnableMenu(); + await testOpenDeletedFile(); + await testClearAll(); -function finishTest() { finish(); } From 1032932288ae1095a3c5eccd78c0ffdcb66d2c05 Mon Sep 17 00:00:00 2001 From: Dimi Lee Date: Thu, 28 Feb 2019 08:12:36 +0000 Subject: [PATCH 08/48] Bug 1353956 - P1. Rename checksum used in SafeBrowsing V4 to SHA256. r=gcp SafeBrowsing V4 protocol use SHA-256 as the checksum to check integrity of update data and also the integrity of prefix files. SafeBrowsing V2 HashStore use MD5 as the checksum to check integrity of .sbstore Since we are going to use CRC32 as the integrity check of V4 prefix files, I think rename V4 "checksum" to SHA256 can improve readability. Differential Revision: https://phabricator.services.mozilla.com/D21460 --HG-- extra : moz-landing-system : lando --- .../components/url-classifier/Classifier.cpp | 7 +- .../components/url-classifier/HashStore.cpp | 4 +- toolkit/components/url-classifier/HashStore.h | 6 +- .../url-classifier/LookupCacheV4.cpp | 57 +++--- .../components/url-classifier/LookupCacheV4.h | 2 +- .../url-classifier/ProtocolParser.cpp | 2 +- .../gtest/TestUrlClassifierTableUpdateV4.cpp | 191 +++++++++--------- 7 files changed, 133 insertions(+), 136 deletions(-) diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index 13899b9fe8c36..cbf4c310c36fa 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -1577,9 +1577,8 @@ nsresult Classifier::LoadMetadata(nsIFile* aDirectory, nsACString& aResult) { continue; } - nsCString state; - nsCString checksum; - rv = lookupCacheV4->LoadMetadata(state, checksum); + nsCString state, sha256; + rv = lookupCacheV4->LoadMetadata(state, sha256); if (NS_FAILED(rv)) { LOG(("Failed to get metadata for table %s", tableName.get())); continue; @@ -1591,7 +1590,7 @@ nsresult Classifier::LoadMetadata(nsIFile* aDirectory, nsACString& aResult) { NS_ENSURE_SUCCESS(rv, rv); nsAutoCString checksumBase64; - rv = Base64Encode(checksum, checksumBase64); + rv = Base64Encode(sha256, checksumBase64); NS_ENSURE_SUCCESS(rv, rv); LOG(("Appending state '%s' and checksum '%s' for table %s", diff --git a/toolkit/components/url-classifier/HashStore.cpp b/toolkit/components/url-classifier/HashStore.cpp index 21287286974cf..aa8c111869830 100644 --- a/toolkit/components/url-classifier/HashStore.cpp +++ b/toolkit/components/url-classifier/HashStore.cpp @@ -206,8 +206,8 @@ nsresult TableUpdateV4::NewRemovalIndices(const uint32_t* aIndices, return NS_OK; } -void TableUpdateV4::NewChecksum(const std::string& aChecksum) { - mChecksum.Assign(aChecksum.data(), aChecksum.size()); +void TableUpdateV4::SetSHA256(const std::string& aSHA256) { + mSHA256.Assign(aSHA256.data(), aSHA256.size()); } nsresult TableUpdateV4::NewFullHashResponse( diff --git a/toolkit/components/url-classifier/HashStore.h b/toolkit/components/url-classifier/HashStore.h index f9cf6d208bdfb..2df2ecedc3776 100644 --- a/toolkit/components/url-classifier/HashStore.h +++ b/toolkit/components/url-classifier/HashStore.h @@ -159,7 +159,7 @@ class TableUpdateV4 : public TableUpdate { return mRemovalIndiceArray; } const nsACString& ClientState() const { return mClientState; } - const nsACString& Checksum() const { return mChecksum; } + const nsACString& SHA256() const { return mSHA256; } const FullHashResponseMap& FullHashResponse() const { return mFullHashResponseMap; } @@ -170,7 +170,7 @@ class TableUpdateV4 : public TableUpdate { void SetFullUpdate(bool aIsFullUpdate) { mFullUpdate = aIsFullUpdate; } void NewPrefixes(int32_t aSize, const nsACString& aPrefixes); void SetNewClientState(const nsACString& aState) { mClientState = aState; } - void NewChecksum(const std::string& aChecksum); + void SetSHA256(const std::string& aSHA256); nsresult NewRemovalIndices(const uint32_t* aIndices, size_t aNumOfIndices); nsresult NewFullHashResponse(const Prefix& aPrefix, @@ -183,7 +183,7 @@ class TableUpdateV4 : public TableUpdate { PrefixStringMap mPrefixesMap; RemovalIndiceArray mRemovalIndiceArray; nsCString mClientState; - nsCString mChecksum; + nsCString mSHA256; // This is used to store response from fullHashes.find. FullHashResponseMap mFullHashResponseMap; diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index 8aafe06f7d031..992901d962c34 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -173,15 +173,15 @@ nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { return rv; } - nsCString state, checksum; - rv = LoadMetadata(state, checksum); + nsCString state, sha256; + rv = LoadMetadata(state, sha256); Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_METADATA_CORRUPT, rv == NS_ERROR_FILE_CORRUPTED); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - rv = VerifyChecksum(checksum); + rv = VerifySHA256(sha256); Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT, rv == NS_ERROR_FILE_CORRUPTED); Unused << NS_WARN_IF(NS_FAILED(rv)); @@ -222,8 +222,8 @@ static nsresult InitCrypto(nsCOMPtr& aCrypto) { } // Read prefix into a buffer and also update the hash which -// keeps track of the checksum -static void UpdateChecksum(nsICryptoHash* aCrypto, const nsACString& aPrefix) { +// keeps track of the sha256 hash +static void UpdateSHA256(nsICryptoHash* aCrypto, const nsACString& aPrefix) { MOZ_ASSERT(aCrypto); aCrypto->Update( reinterpret_cast(const_cast(aPrefix.BeginReading())), @@ -315,7 +315,7 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return rv; } - UpdateChecksum(crypto, smallestOldPrefix); + UpdateSHA256(crypto, smallestOldPrefix); } smallestOldPrefix.SetLength(0); } else { @@ -324,7 +324,7 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return rv; } - UpdateChecksum(crypto, smallestAddPrefix); + UpdateSHA256(crypto, smallestAddPrefix); smallestAddPrefix.SetLength(0); } } @@ -343,20 +343,20 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return NS_ERROR_UC_UPDATE_WRONG_REMOVAL_INDICES; } - nsAutoCString checksum; - crypto->Finish(false, checksum); - if (aTableUpdate->Checksum().IsEmpty()) { - LOG(("Update checksum missing.")); + nsAutoCString sha256; + crypto->Finish(false, sha256); + if (aTableUpdate->SHA256().IsEmpty()) { + LOG(("Update sha256 hash missing.")); Telemetry::Accumulate( Telemetry::URLCLASSIFIER_UPDATE_ERROR, mProvider, NS_ERROR_GET_CODE(NS_ERROR_UC_UPDATE_MISSING_CHECKSUM)); - // Generate our own checksum to tableUpdate to ensure there is always + // Generate our own sha256 to tableUpdate to ensure there is always // checksum in .metadata - std::string stdChecksum(checksum.BeginReading(), checksum.Length()); - aTableUpdate->NewChecksum(stdChecksum); - } else if (aTableUpdate->Checksum() != checksum) { - LOG(("Checksum mismatch after applying partial update")); + std::string stdSha256(sha256.BeginReading(), sha256.Length()); + aTableUpdate->SetSHA256(stdSha256); + } else if (aTableUpdate->SHA256() != sha256) { + LOG(("SHA256 hash mismatch after applying partial update")); return NS_ERROR_UC_UPDATE_CHECKSUM_MISMATCH; } @@ -370,7 +370,7 @@ nsresult LookupCacheV4::AddFullHashResponseToCache( return NS_OK; } -nsresult LookupCacheV4::VerifyChecksum(const nsACString& aChecksum) { +nsresult LookupCacheV4::VerifySHA256(const nsACString& aSHA256) { nsCOMPtr crypto; nsresult rv = InitCrypto(crypto); if (NS_FAILED(rv)) { @@ -387,14 +387,14 @@ nsresult LookupCacheV4::VerifyChecksum(const nsACString& aChecksum) { if (!loadPSet.GetSmallestPrefix(prefix)) { break; } - UpdateChecksum(crypto, prefix); + UpdateSHA256(crypto, prefix); } - nsAutoCString checksum; - crypto->Finish(false, checksum); + nsAutoCString sha256; + crypto->Finish(false, sha256); - if (checksum != aChecksum) { - LOG(("Checksum mismatch when loading prefixes from file.")); + if (sha256 != aSHA256) { + LOG(("Sha256 hash mismatch when loading prefixes from file.")); return NS_ERROR_FILE_CORRUPTED; } @@ -512,15 +512,14 @@ nsresult LookupCacheV4::WriteMetadata( rv = WriteValue(outputStream, aTableUpdate->ClientState()); NS_ENSURE_SUCCESS(rv, rv); - // Write the checksum. - rv = WriteValue(outputStream, aTableUpdate->Checksum()); + // Write the SHA256 hash. + rv = WriteValue(outputStream, aTableUpdate->SHA256()); NS_ENSURE_SUCCESS(rv, rv); return rv; } -nsresult LookupCacheV4::LoadMetadata(nsACString& aState, - nsACString& aChecksum) { +nsresult LookupCacheV4::LoadMetadata(nsACString& aState, nsACString& aSHA256) { nsCOMPtr metaFile; nsresult rv = mStoreDirectory->Clone(getter_AddRefs(metaFile)); NS_ENSURE_SUCCESS(rv, rv); @@ -543,10 +542,10 @@ nsresult LookupCacheV4::LoadMetadata(nsACString& aState, return rv; } - // Read the checksum. - rv = ReadValue(localInFile, aChecksum); + // Read the SHA256 hash. + rv = ReadValue(localInFile, aSHA256); if (NS_FAILED(rv)) { - LOG(("Failed to read checksum.")); + LOG(("Failed to read SHA256 hash.")); return rv; } diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index e3ef80c67fcbd..dfb970b2d15b8 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -56,7 +56,7 @@ class LookupCacheV4 final : public LookupCache { virtual int Ver() const override { return VER; } - nsresult VerifyChecksum(const nsACString& aChecksum); + nsresult VerifySHA256(const nsACString& aSHA256); RefPtr mVLPrefixSet; }; diff --git a/toolkit/components/url-classifier/ProtocolParser.cpp b/toolkit/components/url-classifier/ProtocolParser.cpp index e0f28191ecacf..91318aa7ff349 100644 --- a/toolkit/components/url-classifier/ProtocolParser.cpp +++ b/toolkit/components/url-classifier/ProtocolParser.cpp @@ -829,7 +829,7 @@ nsresult ProtocolParserProtobuf::ProcessOneResponse( tuV4->SetNewClientState(state); if (aResponse.has_checksum()) { - tuV4->NewChecksum(aResponse.checksum().sha256()); + tuV4->SetSHA256(aResponse.checksum().sha256()); } PARSER_LOG( diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp index 383c14b6bb197..5bfd8891f2d6d 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp @@ -54,7 +54,7 @@ static void MergeAndSortArray(const _PrefixArray& array1, output.Sort(); } -static void CalculateCheckSum(_PrefixArray& prefixArray, nsCString& checksum) { +static void CalculateSHA256(_PrefixArray& prefixArray, nsCString& sha256) { prefixArray.Sort(); nsresult rv; @@ -68,7 +68,7 @@ static void CalculateCheckSum(_PrefixArray& prefixArray, nsCString& checksum) { reinterpret_cast(const_cast(prefix.get())), prefix.Length()); } - cryptoHash->Finish(false, checksum); + cryptoHash->Finish(false, sha256); } // N: Number of prefixes, MIN/MAX: minimum/maximum prefix size @@ -114,7 +114,7 @@ static void CreateRandomRemovalIndices(uint32_t N, uint32_t MAX, // Function to generate TableUpdateV4. static void GenerateUpdateData(bool fullUpdate, PrefixStringMap& add, - nsTArray* removal, nsCString* checksum, + nsTArray* removal, nsCString* sha256, TableUpdateArray& tableUpdates) { RefPtr tableUpdate = new TableUpdateV4(GTEST_TABLE); tableUpdate->SetFullUpdate(fullUpdate); @@ -128,12 +128,12 @@ static void GenerateUpdateData(bool fullUpdate, PrefixStringMap& add, tableUpdate->NewRemovalIndices(removal->Elements(), removal->Length()); } - if (checksum) { - std::string stdChecksum; - stdChecksum.assign(const_cast(checksum->BeginReading()), - checksum->Length()); + if (sha256) { + std::string stdSHA256; + stdSHA256.assign(const_cast(sha256->BeginReading()), + sha256->Length()); - tableUpdate->NewChecksum(stdChecksum); + tableUpdate->SetSHA256(stdSHA256); } tableUpdates.AppendElement(tableUpdate); @@ -200,18 +200,18 @@ static void testUpdate(TableUpdateArray& tableUpdates, VerifyPrefixSet(expected); } -static void testFullUpdate(PrefixStringMap& add, nsCString* checksum) { +static void testFullUpdate(PrefixStringMap& add, nsCString* sha256) { TableUpdateArray tableUpdates; - GenerateUpdateData(true, add, nullptr, checksum, tableUpdates); + GenerateUpdateData(true, add, nullptr, sha256, tableUpdates); testUpdate(tableUpdates, add); } static void testPartialUpdate(PrefixStringMap& add, nsTArray* removal, - nsCString* checksum, PrefixStringMap& expected) { + nsCString* sha256, PrefixStringMap& expected) { TableUpdateArray tableUpdates; - GenerateUpdateData(false, add, removal, checksum, tableUpdates); + GenerateUpdateData(false, add, removal, sha256, tableUpdates); testUpdate(tableUpdates, expected); } @@ -238,13 +238,13 @@ TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, array); PrefixArrayToPrefixStringMap(array, map); - CalculateCheckSum(array, checksum); + CalculateSHA256(array, sha256); - testFullUpdate(map, &checksum); + testFullUpdate(map, &sha256); Clear(); } @@ -252,13 +252,13 @@ TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate) { TEST(UrlClassifierTableUpdateV4, VariableLenghtPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateCheckSum(array, checksum); + CalculateSHA256(array, sha256); - testFullUpdate(map, &checksum); + testFullUpdate(map, &sha256); Clear(); } @@ -267,14 +267,14 @@ TEST(UrlClassifierTableUpdateV4, VariableLenghtPSetFullUpdate) { TEST(UrlClassifierTableUpdateV4, MixedPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, array); CreateRandomSortedPrefixArray(1000, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateCheckSum(array, checksum); + CalculateSHA256(array, sha256); - testFullUpdate(map, &checksum); + testFullUpdate(map, &sha256); Clear(); } @@ -285,21 +285,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply a partial update with removal. { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); @@ -314,9 +314,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithRemoval) { // Calculate the expected prefix map. MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - testPartialUpdate(pMap, &removal, &checksum, mergedMap); + testPartialUpdate(pMap, &removal, &sha256, mergedMap); } Clear(); @@ -328,21 +328,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithoutRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply a partial update without removal { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); @@ -352,9 +352,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithoutRemoval) { // Calculate the expected prefix map. MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - testPartialUpdate(pMap, nullptr, &checksum, mergedMap); + testPartialUpdate(pMap, nullptr, &sha256, mergedMap); } Clear(); @@ -368,13 +368,13 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdatePrefixAlreadyExist) { // Apply a full update fist. { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply a partial update which contains a prefix in previous full update. @@ -401,14 +401,14 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdatePrefixAlreadyExist) { TEST(UrlClassifierTableUpdateV4, OnlyPartialUpdate) { _PrefixArray pArray; PrefixStringMap pMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); PrefixArrayToPrefixStringMap(pArray, pMap); - CalculateCheckSum(pArray, checksum); + CalculateSHA256(pArray, sha256); - testPartialUpdate(pMap, nullptr, &checksum, pMap); + testPartialUpdate(pMap, nullptr, &sha256, pMap); Clear(); } @@ -420,21 +420,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(5000, 4, 4, fArray); CreateRandomSortedPrefixArray(1000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply a partial update without add prefix, only contain removal indices. { _PrefixArray pArray; PrefixStringMap pMap, mergedMap; - nsCString checksum; + nsCString sha256; // Remove 1/5 of elements of original prefix set. nsTArray removal; @@ -442,9 +442,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { RemoveElements(removal, fArray); PrefixArrayToPrefixStringMap(fArray, mergedMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testPartialUpdate(pMap, &removal, &checksum, mergedMap); + testPartialUpdate(pMap, &removal, &sha256, mergedMap); } Clear(); @@ -454,7 +454,7 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { _PrefixArray fArray, pArray, mergedArray; PrefixStringMap fMap, pMap, mergedMap; - nsCString checksum; + nsCString sha256; TableUpdateArray tableUpdates; @@ -462,9 +462,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - GenerateUpdateData(true, fMap, nullptr, &checksum, tableUpdates); + GenerateUpdateData(true, fMap, nullptr, &sha256, tableUpdates); // Generate second partial update CreateRandomSortedPrefixArray(3000, 4, 4, pArray); @@ -473,9 +473,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { PrefixArrayToPrefixStringMap(pArray, pMap); MergeAndSortArray(fArray, pArray, mergedArray); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates); + GenerateUpdateData(false, pMap, nullptr, &sha256, tableUpdates); // Generate thrid partial update fArray.AppendElements(pArray); @@ -493,9 +493,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); testUpdate(tableUpdates, mergedMap); @@ -510,22 +510,22 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { // Apply a full update first { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; // Generate first full udpate CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(3000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply multiple partial updates in one table update { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString checksum; + nsCString sha256; nsTArray removal; TableUpdateArray tableUpdates; @@ -540,9 +540,9 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { RemoveElements(removal, fArray); MergeAndSortArray(fArray, pArray, mergedArray); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); fArray.AppendElements(pArray); fArray.Sort(); @@ -561,9 +561,9 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateCheckSum(mergedArray, checksum); + CalculateSHA256(mergedArray, sha256); - GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); testUpdate(tableUpdates, mergedMap); } @@ -578,13 +578,13 @@ TEST(UrlClassifierTableUpdateV4, RemovalIndexTooLarge) { // Apply a full update first { PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } // Apply a partial update with removal indice array larger than @@ -615,31 +615,31 @@ TEST(UrlClassifierTableUpdateV4, ChecksumMismatch) { { _PrefixArray fArray; PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); } - // Apply a partial update with incorrect checksum + // Apply a partial update with incorrect sha256 { _PrefixArray pArray; PrefixStringMap pMap; - nsCString checksum; + nsCString sha256; TableUpdateArray tableUpdates; CreateRandomSortedPrefixArray(200, 4, 32, pArray); PrefixArrayToPrefixStringMap(pArray, pMap); - // Checksum should be calculated with both old prefix set and add prefix - // set, here we only calculate checksum with add prefix set to check if + // sha256 should be calculated with both old prefix set and add prefix + // set, here we only calculate sha256 with add prefix set to check if // applyUpdate will return failure. - CalculateCheckSum(pArray, checksum); + CalculateSHA256(pArray, sha256); - GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates); + GenerateUpdateData(false, pMap, nullptr, &sha256, tableUpdates); testUpdateFail(tableUpdates); } @@ -647,25 +647,25 @@ TEST(UrlClassifierTableUpdateV4, ChecksumMismatch) { } TEST(UrlClassifierTableUpdateV4, ApplyUpdateThenLoad) { - // Apply update with checksum + // Apply update with sha256 { _PrefixArray fArray; PrefixStringMap fMap; - nsCString checksum; + nsCString sha256; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateCheckSum(fArray, checksum); + CalculateSHA256(fArray, sha256); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); - // Open lookup cache will load prefix set and verify the checksum + // Open lookup cache will load prefix set and verify the sha256 testOpenLookupCache(); } Clear(); - // Apply update without checksum + // Apply update without sha256 { _PrefixArray fArray; PrefixStringMap fMap; @@ -706,15 +706,15 @@ TEST(UrlClassifierTableUpdateV4, ApplyUpdateWithFixedChecksum) { PrefixStringMap fMap; PrefixArrayToPrefixStringMap(fArray, fMap); - nsCString checksum( + nsCString sha256( "\xae\x18\x94\xd7\xd0\x83\x5f\xc1" "\x58\x59\x5c\x2c\x72\xb9\x6e\x5e" "\xf4\xe8\x0a\x6b\xff\x5e\x6b\x81" "\x65\x34\x06\x16\x06\x59\xa0\x67"); - testFullUpdate(fMap, &checksum); + testFullUpdate(fMap, &sha256); - // Open lookup cache will load prefix set and verify the checksum + // Open lookup cache will load prefix set and verify the sha256 testOpenLookupCache(); Clear(); @@ -728,27 +728,27 @@ TEST(UrlClassifierTableUpdateV4, EmptyUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString checksum; + nsCString sha256; - CalculateCheckSum(array, checksum); + CalculateSHA256(array, sha256); // Test apply empty full/partial update before we already // have data in DB. - testFullUpdate(emptyAddition, &checksum); - testPartialUpdate(emptyAddition, &emptyRemoval, &checksum, map); + testFullUpdate(emptyAddition, &sha256); + testPartialUpdate(emptyAddition, &emptyRemoval, &sha256, map); // Apply an full update. CreateRandomSortedPrefixArray(100, 4, 4, array); CreateRandomSortedPrefixArray(10, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateCheckSum(array, checksum); + CalculateSHA256(array, sha256); - testFullUpdate(map, &checksum); + testFullUpdate(map, &sha256); // Test apply empty full/partial update when we already // have data in DB - testPartialUpdate(emptyAddition, &emptyRemoval, &checksum, map); - testFullUpdate(emptyAddition, &checksum); + testPartialUpdate(emptyAddition, &emptyRemoval, &sha256, map); + testFullUpdate(emptyAddition, &sha256); Clear(); } @@ -762,16 +762,15 @@ TEST(UrlClassifierTableUpdateV4, EmptyUpdate2) { CreateRandomSortedPrefixArray(10, 5, 32, array); RefPtr cache = SetupLookupCache(array); - // Setup TableUpdate object with only checksum from previous update(initial + // Setup TableUpdate object with only sha256 from previous update(initial // data). - nsCString checksum; - CalculateCheckSum(array, checksum); - std::string stdChecksum; - stdChecksum.assign(const_cast(checksum.BeginReading()), - checksum.Length()); + nsCString sha256; + CalculateSHA256(array, sha256); + std::string stdSHA256; + stdSHA256.assign(const_cast(sha256.BeginReading()), sha256.Length()); RefPtr tableUpdate = new TableUpdateV4(GTEST_TABLE); - tableUpdate->NewChecksum(stdChecksum); + tableUpdate->SetSHA256(stdSHA256); // Apply update directly through LookupCache interface PrefixStringMap input, output; From d253a723f7123eefe94abe086ceca423f7b1f66c Mon Sep 17 00:00:00 2001 From: dlee Date: Thu, 28 Feb 2019 08:18:46 +0000 Subject: [PATCH 09/48] Bug 1353956 - P2. Do not use SHA-256 while loading the V4 prefix files. r=gcp SHA256 is an expensive operation, we should avoid using them if possible. SafeBrowsing prefix files are loaded during startup and verify integrity with SHA256 which may affect the performance especially on the low-end device. This patch simply removes the SHA256 integrity check. CRC32 version integrity check will be introduced in the other patch. This patch also changes the behavior of recording "Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT" a little bit. It used to records only once per session(during startup, the first time we load prefix set), now it records per update. Differential Revision: https://phabricator.services.mozilla.com/D21461 --HG-- extra : moz-landing-system : lando --- .../components/url-classifier/Classifier.cpp | 2 + .../url-classifier/LookupCacheV4.cpp | 50 +------------------ .../components/url-classifier/LookupCacheV4.h | 2 - 3 files changed, 3 insertions(+), 51 deletions(-) diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index cbf4c310c36fa..2c79808cf1625 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -1579,6 +1579,8 @@ nsresult Classifier::LoadMetadata(nsIFile* aDirectory, nsACString& aResult) { nsCString state, sha256; rv = lookupCacheV4->LoadMetadata(state, sha256); + Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_METADATA_CORRUPT, + rv == NS_ERROR_FILE_CORRUPTED); if (NS_FAILED(rv)) { LOG(("Failed to get metadata for table %s", tableName.get())); continue; diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index 992901d962c34..c5596ad35e2af 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -168,24 +168,7 @@ nsresult LookupCacheV4::StoreToFile(nsCOMPtr& aFile) { } nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { - nsresult rv = mVLPrefixSet->LoadFromFile(aFile); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - nsCString state, sha256; - rv = LoadMetadata(state, sha256); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_METADATA_CORRUPT, - rv == NS_ERROR_FILE_CORRUPTED); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = VerifySHA256(sha256); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT, - rv == NS_ERROR_FILE_CORRUPTED); - Unused << NS_WARN_IF(NS_FAILED(rv)); - return rv; + return mVLPrefixSet->LoadFromFile(aFile); } size_t LookupCacheV4::SizeOfPrefixSet() const { @@ -370,37 +353,6 @@ nsresult LookupCacheV4::AddFullHashResponseToCache( return NS_OK; } -nsresult LookupCacheV4::VerifySHA256(const nsACString& aSHA256) { - nsCOMPtr crypto; - nsresult rv = InitCrypto(crypto); - if (NS_FAILED(rv)) { - return rv; - } - - PrefixStringMap map; - mVLPrefixSet->GetPrefixes(map); - - VLPrefixSet loadPSet(map); - uint32_t index = loadPSet.Count() + 1; - for (; index > 0; index--) { - nsAutoCString prefix; - if (!loadPSet.GetSmallestPrefix(prefix)) { - break; - } - UpdateSHA256(crypto, prefix); - } - - nsAutoCString sha256; - crypto->Finish(false, sha256); - - if (sha256 != aSHA256) { - LOG(("Sha256 hash mismatch when loading prefixes from file.")); - return NS_ERROR_FILE_CORRUPTED; - } - - return NS_OK; -} - ////////////////////////////////////////////////////////////////////////// // A set of lightweight functions for reading/writing value from/to file. diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index dfb970b2d15b8..ee6af13846f4f 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -56,8 +56,6 @@ class LookupCacheV4 final : public LookupCache { virtual int Ver() const override { return VER; } - nsresult VerifySHA256(const nsACString& aSHA256); - RefPtr mVLPrefixSet; }; From b8f59ed8b6b97e10a75e4eddc094928978bdf3f5 Mon Sep 17 00:00:00 2001 From: Dimi Lee Date: Mon, 4 Mar 2019 21:22:46 +0000 Subject: [PATCH 10/48] Bug 1353956 - P3. Separate file processing and prefix data processing for SafeBrowsing prefix set. r=gcp SafeBrowsing prefix files LOAD/SAVE operations are handled in xxxPrefixSet.cpp. It would be more clear if xxxPrefixSet.cpp only processes prefix data, while LookupCacheV2/LookupCacheV4 which use prefix set process file. This patch doesn't change any behavior, testcases need to update because the LookupCache & xxxPrefixSet APIs are changed. Differential Revision: https://phabricator.services.mozilla.com/D21462 --HG-- extra : moz-landing-system : lando --- .../components/url-classifier/LookupCache.cpp | 66 +++- .../components/url-classifier/LookupCache.h | 12 +- .../url-classifier/LookupCacheV4.cpp | 67 +++- .../components/url-classifier/LookupCacheV4.h | 5 +- .../VariableLengthPrefixSet.cpp | 96 +---- .../url-classifier/VariableLengthPrefixSet.h | 10 +- .../nsIUrlClassifierPrefixSet.idl | 2 - .../nsUrlClassifierPrefixSet.cpp | 80 +--- .../url-classifier/nsUrlClassifierPrefixSet.h | 8 +- .../gtest/TestUrlClassifierTableUpdateV4.cpp | 17 +- .../gtest/TestVariableLengthPrefixSet.cpp | 352 ++++++++++-------- .../tests/unit/test_prefixset.js | 62 +-- 12 files changed, 375 insertions(+), 402 deletions(-) diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 2e95d70dc6ac4..ea7851a284bc9 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -651,11 +651,73 @@ nsresult LookupCacheV2::ClearPrefixes() { } nsresult LookupCacheV2::StoreToFile(nsCOMPtr& aFile) { - return mPrefixSet->StoreToFile(aFile); + nsCOMPtr localOutFile; + nsresult rv = + NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, + PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); + NS_ENSURE_SUCCESS(rv, rv); + + uint32_t fileSize; + + // Preallocate the file storage + { + nsCOMPtr fos(do_QueryInterface(localOutFile)); + Telemetry::AutoTimer timer; + + fileSize = mPrefixSet->CalculatePreallocateSize(); + + // Ignore failure, the preallocation is a hint and we write out the entire + // file later on + Unused << fos->Preallocate(fileSize); + } + + // Convert to buffered stream + nsCOMPtr out; + rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), + std::min(fileSize, MAX_BUFFER_SIZE)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mPrefixSet->WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + LOG(("[%s] Storing PrefixSet successful", mTableName.get())); + return NS_OK; } nsresult LookupCacheV2::LoadFromFile(nsCOMPtr& aFile) { - return mPrefixSet->LoadFromFile(aFile); + Telemetry::AutoTimer timer; + + nsCOMPtr localInFile; + nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, + PR_RDONLY | nsIFile::OS_READAHEAD); + NS_ENSURE_SUCCESS(rv, rv); + + // Calculate how big the file is, make sure our read buffer isn't bigger + // than the file itself which is just wasting memory. + int64_t fileSize; + rv = aFile->GetFileSize(&fileSize); + NS_ENSURE_SUCCESS(rv, rv); + + if (fileSize < 0 || fileSize > UINT32_MAX) { + return NS_ERROR_FAILURE; + } + + uint32_t bufferSize = + std::min(static_cast(fileSize), MAX_BUFFER_SIZE); + + // Convert to buffered stream + nsCOMPtr in; + rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), + bufferSize); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mPrefixSet->LoadPrefixes(in); + NS_ENSURE_SUCCESS(rv, rv); + + mPrimed = true; + LOG(("[%s] Loading PrefixSet successful", mTableName.get())); + + return NS_OK; } size_t LookupCacheV2::SizeOfPrefixSet() const { diff --git a/toolkit/components/url-classifier/LookupCache.h b/toolkit/components/url-classifier/LookupCache.h index d4ba335f3baba..9b1d876e5a58f 100644 --- a/toolkit/components/url-classifier/LookupCache.h +++ b/toolkit/components/url-classifier/LookupCache.h @@ -231,6 +231,9 @@ class LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) = 0; + virtual nsresult StoreToFile(nsCOMPtr& aFile) = 0; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) = 0; + virtual bool IsEmpty() const = 0; virtual void ClearAll(); @@ -250,8 +253,6 @@ class LookupCache { private: nsresult LoadPrefixSet(); - virtual nsresult StoreToFile(nsCOMPtr& aFile) = 0; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) = 0; virtual size_t SizeOfPrefixSet() const = 0; virtual int Ver() const = 0; @@ -259,6 +260,8 @@ class LookupCache { protected: virtual ~LookupCache() {} + static const uint32_t MAX_BUFFER_SIZE = 64 * 1024; + // Check completions in positive cache and prefix in negative cache. // 'aHas' and 'aConfirmed' are output parameters. nsresult CheckCache(const Completion& aCompletion, bool* aHas, @@ -292,6 +295,9 @@ class LookupCacheV2 final : public LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) override; + virtual nsresult StoreToFile(nsCOMPtr& aFile) override; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; + virtual bool IsEmpty() const override; nsresult Build(AddPrefixArray& aAddPrefixes, AddCompleteArray& aAddCompletes); @@ -314,8 +320,6 @@ class LookupCacheV2 final : public LookupCache { nsresult ReadCompletions(); virtual nsresult ClearPrefixes() override; - virtual nsresult StoreToFile(nsCOMPtr& aFile) override; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; virtual size_t SizeOfPrefixSet() const override; private: diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index c5596ad35e2af..68d6dcb01650c 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -164,11 +164,74 @@ nsresult LookupCacheV4::ClearPrefixes() { } nsresult LookupCacheV4::StoreToFile(nsCOMPtr& aFile) { - return mVLPrefixSet->StoreToFile(aFile); + NS_ENSURE_ARG_POINTER(aFile); + + nsCOMPtr localOutFile; + nsresult rv = + NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, + PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); + NS_ENSURE_SUCCESS(rv, rv); + + uint32_t fileSize = 0; + // Preallocate the file storage + { + nsCOMPtr fos(do_QueryInterface(localOutFile)); + Telemetry::AutoTimer timer; + + fileSize = mVLPrefixSet->CalculatePreallocateSize(); + + Unused << fos->Preallocate(fileSize); + } + + // Convert to buffered stream + nsCOMPtr out; + rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), + std::min(fileSize, MAX_BUFFER_SIZE)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mVLPrefixSet->WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + LOG(("[%s] Storing PrefixSet successful", mTableName.get())); + return NS_OK; } nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { - return mVLPrefixSet->LoadFromFile(aFile); + Telemetry::AutoTimer timer; + + nsCOMPtr localInFile; + nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, + PR_RDONLY | nsIFile::OS_READAHEAD); + NS_ENSURE_SUCCESS(rv, rv); + + // Calculate how big the file is, make sure our read buffer isn't bigger + // than the file itself which is just wasting memory. + int64_t fileSize; + rv = aFile->GetFileSize(&fileSize); + NS_ENSURE_SUCCESS(rv, rv); + + if (fileSize < 0 || fileSize > UINT32_MAX) { + return NS_ERROR_FAILURE; + } + + uint32_t bufferSize = + std::min(static_cast(fileSize), MAX_BUFFER_SIZE); + + // Convert to buffered stream + nsCOMPtr in; + rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), + bufferSize); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mVLPrefixSet->LoadPrefixes(in); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + mPrimed = true; + LOG(("[%s] Loading PrefixSet successful", mTableName.get())); + + return NS_OK; } size_t LookupCacheV4::SizeOfPrefixSet() const { diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index ee6af13846f4f..883cc7512779e 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -25,6 +25,9 @@ class LookupCacheV4 final : public LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) override; + virtual nsresult StoreToFile(nsCOMPtr& aFile) override; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; + virtual bool IsEmpty() const override; nsresult Build(PrefixStringMap& aPrefixMap); @@ -47,8 +50,6 @@ class LookupCacheV4 final : public LookupCache { protected: virtual nsresult ClearPrefixes() override; - virtual nsresult StoreToFile(nsCOMPtr& aFile) override; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; virtual size_t SizeOfPrefixSet() const override; private: diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp index 67534a491b2c2..bccea09af372a 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp @@ -204,91 +204,18 @@ nsresult VariableLengthPrefixSet::IsEmpty(bool* aEmpty) const { return NS_OK; } -nsresult VariableLengthPrefixSet::LoadFromFile(nsCOMPtr& aFile) { - MutexAutoLock lock(mLock); - - NS_ENSURE_ARG_POINTER(aFile); - - Telemetry::AutoTimer timer; - - nsCOMPtr localInFile; - nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, - PR_RDONLY | nsIFile::OS_READAHEAD); - NS_ENSURE_SUCCESS(rv, rv); - - // Calculate how big the file is, make sure our read buffer isn't bigger - // than the file itself which is just wasting memory. - int64_t fileSize; - rv = aFile->GetFileSize(&fileSize); - NS_ENSURE_SUCCESS(rv, rv); - - if (fileSize < 0 || fileSize > UINT32_MAX) { - return NS_ERROR_FAILURE; - } - - uint32_t bufferSize = - std::min(static_cast(fileSize), MAX_BUFFER_SIZE); - - // Convert to buffered stream - nsCOMPtr in; - rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), - bufferSize); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mFixedPrefixSet->LoadPrefixes(in); - NS_ENSURE_SUCCESS(rv, rv); - - rv = LoadPrefixes(in); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; - ; -} - -nsresult VariableLengthPrefixSet::StoreToFile(nsCOMPtr& aFile) const { - NS_ENSURE_ARG_POINTER(aFile); - +nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { MutexAutoLock lock(mLock); - nsCOMPtr localOutFile; - nsresult rv = - NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, - PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); + // First read prefixes from fixed-length prefix set + nsresult rv = mFixedPrefixSet->LoadPrefixes(in); NS_ENSURE_SUCCESS(rv, rv); - uint32_t fileSize = 0; - // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; - - fileSize += mFixedPrefixSet->CalculatePreallocateSize(); - fileSize += CalculatePreallocateSize(); - - Unused << fos->Preallocate(fileSize); - } - - // Convert to buffered stream - nsCOMPtr out; - rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), - std::min(fileSize, MAX_BUFFER_SIZE)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mFixedPrefixSet->WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); - - rv = WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { + // Then read prefixes from variable-length prefix set uint32_t magic; uint32_t read; - nsresult rv = - in->Read(reinterpret_cast(&magic), sizeof(uint32_t), &read); + rv = in->Read(reinterpret_cast(&magic), sizeof(uint32_t), &read); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(read == sizeof(uint32_t), NS_ERROR_FAILURE); @@ -349,6 +276,10 @@ nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { uint32_t VariableLengthPrefixSet::CalculatePreallocateSize() const { uint32_t fileSize = 0; + // Size of fixed length prefix set. + fileSize += mFixedPrefixSet->CalculatePreallocateSize(); + + // Size of variable length prefix set. // Store how many prefix string. fileSize += sizeof(uint32_t); @@ -363,10 +294,17 @@ uint32_t VariableLengthPrefixSet::CalculatePreallocateSize() const { nsresult VariableLengthPrefixSet::WritePrefixes( nsCOMPtr& out) const { + MutexAutoLock lock(mLock); + + // First, write fixed length prefix set + nsresult rv = mFixedPrefixSet->WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + // Then, write variable length prefix set uint32_t written; uint32_t writelen = sizeof(uint32_t); uint32_t magic = PREFIXSET_VERSION_MAGIC; - nsresult rv = out->Write(reinterpret_cast(&magic), writelen, &written); + rv = out->Write(reinterpret_cast(&magic), writelen, &written); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(written == writelen, NS_ERROR_FAILURE); diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.h b/toolkit/components/url-classifier/VariableLengthPrefixSet.h index 65fe6c27b332f..37f919358b554 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.h +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.h @@ -30,8 +30,10 @@ class VariableLengthPrefixSet final : public nsIMemoryReporter { nsresult GetFixedLengthPrefixes(FallibleTArray& aPrefixes); nsresult Matches(const nsACString& aFullHash, uint32_t* aLength) const; nsresult IsEmpty(bool* aEmpty) const; - nsresult LoadFromFile(nsCOMPtr& aFile); - nsresult StoreToFile(nsCOMPtr& aFile) const; + + nsresult WritePrefixes(nsCOMPtr& out) const; + nsresult LoadPrefixes(nsCOMPtr& in); + uint32_t CalculatePreallocateSize() const; size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; @@ -47,10 +49,6 @@ class VariableLengthPrefixSet final : public nsIMemoryReporter { bool BinarySearch(const nsACString& aFullHash, const nsACString& aPrefixes, uint32_t aPrefixSize) const; - uint32_t CalculatePreallocateSize() const; - nsresult WritePrefixes(nsCOMPtr& out) const; - nsresult LoadPrefixes(nsCOMPtr& in); - // Lock to prevent races between the url-classifier thread (which does most // of the operations) and the main thread (which does memory reporting). // It should be held for all operations between Init() and destruction that diff --git a/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl b/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl index 7e1a527d76f35..6ccb5ae7d109a 100644 --- a/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl +++ b/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl @@ -24,6 +24,4 @@ interface nsIUrlClassifierPrefixSet : nsISupports // Do a lookup in the PrefixSet, return whether the value is present. boolean contains(in unsigned long aPrefix); boolean isEmpty(); - void loadFromFile(in nsIFile aFile); - void storeToFile(in nsIFile aFile); }; diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index e25ffd9c0cdb2..51b1f86c44324 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -12,16 +12,13 @@ #include "nsPrintfCString.h" #include "nsTArray.h" #include "nsString.h" -#include "nsIFile.h" #include "nsTArray.h" #include "nsThreadUtils.h" #include "nsNetUtil.h" #include "nsISeekableStream.h" #include "nsIBufferedStreams.h" -#include "nsIFileStreams.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Telemetry.h" -#include "mozilla/FileUtils.h" #include "mozilla/Logging.h" #include "mozilla/Unused.h" #include @@ -345,83 +342,10 @@ nsUrlClassifierPrefixSet::IsEmpty(bool* aEmpty) { return NS_OK; } -NS_IMETHODIMP -nsUrlClassifierPrefixSet::LoadFromFile(nsIFile* aFile) { - MutexAutoLock lock(mLock); - - Telemetry::AutoTimer timer; - - nsCOMPtr localInFile; - nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, - PR_RDONLY | nsIFile::OS_READAHEAD); - NS_ENSURE_SUCCESS(rv, rv); - - // Calculate how big the file is, make sure our read buffer isn't bigger - // than the file itself which is just wasting memory. - int64_t fileSize; - rv = aFile->GetFileSize(&fileSize); - NS_ENSURE_SUCCESS(rv, rv); - - if (fileSize < 0 || fileSize > UINT32_MAX) { - return NS_ERROR_FAILURE; - } - - uint32_t bufferSize = - std::min(static_cast(fileSize), MAX_BUFFER_SIZE); - - // Convert to buffered stream - nsCOMPtr in; - rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), - bufferSize); - NS_ENSURE_SUCCESS(rv, rv); - - rv = LoadPrefixes(in); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -NS_IMETHODIMP -nsUrlClassifierPrefixSet::StoreToFile(nsIFile* aFile) { +nsresult nsUrlClassifierPrefixSet::LoadPrefixes(nsCOMPtr& in) { MutexAutoLock lock(mLock); - nsCOMPtr localOutFile; - nsresult rv = - NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, - PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); - NS_ENSURE_SUCCESS(rv, rv); - - uint32_t fileSize; - - // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; - - fileSize = CalculatePreallocateSize(); - - // Ignore failure, the preallocation is a hint and we write out the entire - // file later on - Unused << fos->Preallocate(fileSize); - } - - // Convert to buffered stream - nsCOMPtr out; - rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), - std::min(fileSize, MAX_BUFFER_SIZE)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); - - LOG(("[%s] Storing PrefixSet successful", mName.get())); - - return NS_OK; -} - -nsresult nsUrlClassifierPrefixSet::LoadPrefixes(nsCOMPtr& in) { mCanary.Check(); - Clear(); uint32_t magic; @@ -518,6 +442,8 @@ uint32_t nsUrlClassifierPrefixSet::CalculatePreallocateSize() const { nsresult nsUrlClassifierPrefixSet::WritePrefixes( nsCOMPtr& out) const { + MutexAutoLock lock(mLock); + mCanary.Check(); // In Bug 1362761, crashes happened while reading mIndexDeltas[i]. diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h index c51523719802e..1e1e9c1e5f654 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h @@ -39,10 +39,11 @@ class nsUrlClassifierPrefixSet final : public nsIUrlClassifierPrefixSet, NS_IMETHOD GetPrefixes(uint32_t* aCount, uint32_t** aPrefixes) override; NS_IMETHOD Contains(uint32_t aPrefix, bool* aFound) override; NS_IMETHOD IsEmpty(bool* aEmpty) override; - NS_IMETHOD LoadFromFile(nsIFile* aFile) override; - NS_IMETHOD StoreToFile(nsIFile* aFile) override; nsresult GetPrefixesNative(FallibleTArray& outArray); + nsresult WritePrefixes(nsCOMPtr& out) const; + nsresult LoadPrefixes(nsCOMPtr& in); + uint32_t CalculatePreallocateSize() const; size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; @@ -63,9 +64,6 @@ class nsUrlClassifierPrefixSet final : public nsIUrlClassifierPrefixSet, nsresult MakePrefixSet(const uint32_t* aArray, uint32_t aLength); uint32_t BinSearch(uint32_t start, uint32_t end, uint32_t target) const; bool IsEmptyInternal() const; - uint32_t CalculatePreallocateSize() const; - nsresult WritePrefixes(nsCOMPtr& out) const; - nsresult LoadPrefixes(nsCOMPtr& in); // Lock to prevent races between the url-classifier thread (which does most // of the operations) and the main thread (which does memory reporting). diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp index 5bfd8891f2d6d..4d9b3b3c146f3 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp @@ -143,16 +143,17 @@ static void VerifyPrefixSet(PrefixStringMap& expected) { // Verify the prefix set is written to disk. nsCOMPtr file; NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->AppendNative(GTEST_SAFEBROWSING_DIR); - file->AppendNative(GTEST_PREFIXFILE); - RefPtr load = new VariableLengthPrefixSet; - load->Init(GTEST_TABLE); + RefPtr lookup = + new LookupCacheV4(GTEST_TABLE, NS_LITERAL_CSTRING("test"), file); + lookup->Init(); + + file->AppendNative(GTEST_PREFIXFILE); + lookup->LoadFromFile(file); PrefixStringMap prefixesInFile; - load->LoadFromFile(file); - load->GetPrefixes(prefixesInFile); + lookup->GetPrefixes(prefixesInFile); for (auto iter = expected.ConstIter(); !iter.Done(); iter.Next()) { nsCString* expectedPrefix = iter.Data(); @@ -233,7 +234,7 @@ static void testOpenLookupCache() { } // Tests start from here. -TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate) { +TEST(UrlClassifierTableUpdateV4, FixLengthPSetFullUpdate) { srand(time(NULL)); _PrefixArray array; @@ -249,7 +250,7 @@ TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate) { Clear(); } -TEST(UrlClassifierTableUpdateV4, VariableLenghtPSetFullUpdate) { +TEST(UrlClassifierTableUpdateV4, VariableLengthPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; nsCString sha256; diff --git a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp index 74c52f9890acd..d26e366a3421c 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp @@ -17,11 +17,11 @@ typedef nsCString _Prefix; typedef nsTArray<_Prefix> _PrefixArray; // Create fullhash by appending random characters. -static nsCString* CreateFullHash(const nsACString& in) { - nsCString* out = new nsCString(in); - out->SetLength(32); +static nsCString CreateFullHash(const nsACString& in) { + nsCString out(in); + out.SetLength(32); for (size_t i = in.Length(); i < 32; i++) { - out->SetCharAt(char(rand() % 256), i); + out.SetCharAt(char(rand() % 256), i); } return out; @@ -55,10 +55,9 @@ static void RandomPrefixes(uint32_t N, uint32_t MIN, uint32_t MAX, } } -static void CheckContent(VariableLengthPrefixSet* pset, - PrefixStringMap& expected) { +static void CheckContent(LookupCacheV4* cache, PrefixStringMap& expected) { PrefixStringMap vlPSetMap; - pset->GetPrefixes(vlPSetMap); + cache->GetPrefixes(vlPSetMap); for (auto iter = vlPSetMap.Iter(); !iter.Done(); iter.Next()) { nsCString* expectedPrefix = expected.Get(iter.Key()); @@ -71,15 +70,16 @@ static void CheckContent(VariableLengthPrefixSet* pset, // This test loops through all the prefixes and converts each prefix to // fullhash by appending random characters, each converted fullhash // should at least match its original length in the prefixSet. -static void DoExpectedLookup(VariableLengthPrefixSet* pset, - _PrefixArray& array) { +static void DoExpectedLookup(LookupCacheV4* cache, _PrefixArray& array) { uint32_t matchLength = 0; for (uint32_t i = 0; i < array.Length(); i++) { const nsCString& prefix = array[i]; - UniquePtr fullhash(CreateFullHash(prefix)); + Completion complete; + complete.Assign(CreateFullHash(prefix)); // Find match for prefix-generated full hash - pset->Matches(*fullhash, &matchLength); + bool has, confirmed; + cache->Has(complete, &has, &matchLength, &confirmed); MOZ_ASSERT(matchLength != 0); if (matchLength != prefix.Length()) { @@ -93,8 +93,7 @@ static void DoExpectedLookup(VariableLengthPrefixSet* pset, continue; } - if (0 == memcmp(fullhash->BeginReading(), array[j].BeginReading(), - matchLength)) { + if (0 == memcmp(complete.buf, array[j].BeginReading(), matchLength)) { found = true; break; } @@ -104,7 +103,7 @@ static void DoExpectedLookup(VariableLengthPrefixSet* pset, } } -static void DoRandomLookup(VariableLengthPrefixSet* pset, uint32_t N, +static void DoRandomLookup(LookupCacheV4* cache, uint32_t N, _PrefixArray& array) { for (uint32_t i = 0; i < N; i++) { // Random 32-bytes test fullhash @@ -122,8 +121,11 @@ static void DoRandomLookup(VariableLengthPrefixSet* pset, uint32_t N, } } + Completion complete; + complete.Assign(nsDependentCSubstring(buf, 32)); + bool has, confirmed; uint32_t matchLength = 0; - pset->Matches(nsDependentCSubstring(buf, 32), &matchLength); + cache->Has(complete, &has, &matchLength, &confirmed); ASSERT_TRUE(expected.IsEmpty() ? !matchLength : expected.Contains(matchLength)); @@ -168,12 +170,23 @@ static void SetupPrefixMap(const _PrefixArray& array, PrefixStringMap& map) { } } +static already_AddRefed SetupLookupCache( + const nsACString& aName) { + nsCOMPtr rootDir; + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(rootDir)); + + nsAutoCString provider("test"); + RefPtr lookup = new LookupCacheV4(aName, provider, rootDir); + lookup->Init(); + + return lookup.forget(); +} + // Test setting prefix set with only 4-bytes prefixes TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { srand(time(nullptr)); - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -182,13 +195,11 @@ TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { }; SetupPrefixMap(array, map); - pset->SetPrefixes(map); - - DoExpectedLookup(pset, array); + cache->Build(map); - DoRandomLookup(pset, 1000, array); - - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); // Run random test array.Clear(); @@ -197,19 +208,16 @@ TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { RandomPrefixes(1500, 4, 4, array); SetupPrefixMap(array, map); - pset->SetPrefixes(map); - - DoExpectedLookup(pset, array); + cache->Build(map); - DoRandomLookup(pset, 1000, array); - - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); } // Test setting prefix set with only 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -223,13 +231,11 @@ TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { _Prefix("yankee"), _Prefix("ZuluZuluZuluZulu")}; SetupPrefixMap(array, map); - pset->SetPrefixes(map); - - DoExpectedLookup(pset, array); + cache->Build(map); - DoRandomLookup(pset, 1000, array); - - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); // Run random test array.Clear(); @@ -238,19 +244,16 @@ TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { RandomPrefixes(1500, 5, 32, array); SetupPrefixMap(array, map); - pset->SetPrefixes(map); - - DoExpectedLookup(pset, array); - - DoRandomLookup(pset, 1000, array); + cache->Build(map); - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); } // Test setting prefix set with both 4-bytes prefixes and 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = {_Prefix("enus"), @@ -273,13 +276,11 @@ TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { _Prefix("Stheno, Euryale and Medusa")}; SetupPrefixMap(array, map); - pset->SetPrefixes(map); - - DoExpectedLookup(pset, array); - - DoRandomLookup(pset, 1000, array); + cache->Build(map); - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); // Run random test array.Clear(); @@ -288,19 +289,16 @@ TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { RandomPrefixes(1500, 4, 32, array); SetupPrefixMap(array, map); - pset->SetPrefixes(map); + cache->Build(map); - DoExpectedLookup(pset, array); - - DoRandomLookup(pset, 1000, array); - - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); } // Test resetting prefix set TEST(UrlClassifierVLPrefixSet, ResetPrefix) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); // First prefix set _PrefixArray array1 = { @@ -313,9 +311,9 @@ TEST(UrlClassifierVLPrefixSet, ResetPrefix) { PrefixStringMap map; SetupPrefixMap(array1, map); - pset->SetPrefixes(map); + cache->Build(map); - DoExpectedLookup(pset, array1); + DoExpectedLookup(cache, array1); } // Second @@ -329,25 +327,28 @@ TEST(UrlClassifierVLPrefixSet, ResetPrefix) { PrefixStringMap map; SetupPrefixMap(array2, map); - pset->SetPrefixes(map); + cache->Build(map); - DoExpectedLookup(pset, array2); + DoExpectedLookup(cache, array2); } // Should not match any of the first prefix set uint32_t matchLength = 0; for (uint32_t i = 0; i < array1.Length(); i++) { - UniquePtr fullhash(CreateFullHash(array1[i])); + Completion complete; + complete.Assign(CreateFullHash(array1[i])); + + // Find match for prefix-generated full hash + bool has, confirmed; + cache->Has(complete, &has, &matchLength, &confirmed); - pset->Matches(*fullhash, &matchLength); ASSERT_TRUE(matchLength == 0); } } // Test only set one 4-bytes prefix and one full-length prefix TEST(UrlClassifierVLPrefixSet, TinyPrefixSet) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -356,52 +357,47 @@ TEST(UrlClassifierVLPrefixSet, TinyPrefixSet) { }; SetupPrefixMap(array, map); - pset->SetPrefixes(map); + cache->Build(map); - DoExpectedLookup(pset, array); - - DoRandomLookup(pset, 1000, array); - - CheckContent(pset, map); + DoExpectedLookup(cache, array); + DoRandomLookup(cache, 1000, array); + CheckContent(cache, map); } // Test empty prefix set and IsEmpty function TEST(UrlClassifierVLPrefixSet, EmptyPrefixSet) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); - bool empty; - pset->IsEmpty(&empty); + bool empty = cache->IsEmpty(); ASSERT_TRUE(empty); PrefixStringMap map; _PrefixArray array1; // Lookup an empty array should never match - DoRandomLookup(pset, 100, array1); + DoRandomLookup(cache, 100, array1); // Insert an 4-bytes prefix, then IsEmpty should return false _PrefixArray array2 = {_Prefix("test")}; SetupPrefixMap(array2, map); - pset->SetPrefixes(map); + cache->Build(map); - pset->IsEmpty(&empty); + empty = cache->IsEmpty(); ASSERT_TRUE(!empty); _PrefixArray array3 = {_Prefix("test variable length")}; // Insert an 5~32 bytes prefix, then IsEmpty should return false SetupPrefixMap(array3, map); - pset->SetPrefixes(map); + cache->Build(map); - pset->IsEmpty(&empty); + empty = cache->IsEmpty(); ASSERT_TRUE(!empty); } // Test prefix size should only between 4~32 bytes TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { - RefPtr pset = new VariableLengthPrefixSet; - pset->Init(NS_LITERAL_CSTRING("test")); + RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); PrefixStringMap map; { @@ -409,7 +405,7 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh")}; SetupPrefixMap(array, map); - nsresult rv = pset->SetPrefixes(map); + nsresult rv = cache->Build(map); ASSERT_TRUE(rv == NS_OK); } @@ -418,7 +414,7 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _PrefixArray array = {_Prefix("123")}; SetupPrefixMap(array, map); - nsresult rv = pset->SetPrefixes(map); + nsresult rv = cache->Build(map); ASSERT_TRUE(NS_FAILED(rv)); } @@ -427,123 +423,171 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _PrefixArray array = {_Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh9")}; SetupPrefixMap(array, map); - nsresult rv = pset->SetPrefixes(map); + nsresult rv = cache->Build(map); ASSERT_TRUE(NS_FAILED(rv)); } } // Test save then load prefix set with only 4-bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSaveFixedLengthPrefixSet) { - RefPtr save = new VariableLengthPrefixSet; - save->Init(NS_LITERAL_CSTRING("test-save")); - + nsCOMPtr file; _PrefixArray array; - RandomPrefixes(10000, 4, 4, array); - PrefixStringMap map; - SetupPrefixMap(array, map); - save->SetPrefixes(map); - - DoExpectedLookup(save, array); - - DoRandomLookup(save, 1000, array); - - CheckContent(save, map); - nsCOMPtr file; - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); + // Save + { + RefPtr save = + SetupLookupCache(NS_LITERAL_CSTRING("test-save")); - save->StoreToFile(file); + RandomPrefixes(10000, 4, 4, array); - RefPtr load = new VariableLengthPrefixSet; - load->Init(NS_LITERAL_CSTRING("test-load")); + SetupPrefixMap(array, map); + save->Build(map); - load->LoadFromFile(file); + DoExpectedLookup(save, array); + DoRandomLookup(save, 1000, array); + CheckContent(save, map); - DoExpectedLookup(load, array); + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); + save->StoreToFile(file); + } - DoRandomLookup(load, 1000, array); + // Load + { + RefPtr load = + SetupLookupCache(NS_LITERAL_CSTRING("test-load")); + load->LoadFromFile(file); - CheckContent(load, map); + DoExpectedLookup(load, array); + DoRandomLookup(load, 1000, array); + CheckContent(load, map); + } file->Remove(false); } // Test save then load prefix set with only 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSaveVariableLengthPrefixSet) { - RefPtr save = new VariableLengthPrefixSet; - save->Init(NS_LITERAL_CSTRING("test-save")); - + nsCOMPtr file; _PrefixArray array; - RandomPrefixes(10000, 5, 32, array); - PrefixStringMap map; - SetupPrefixMap(array, map); - save->SetPrefixes(map); - - DoExpectedLookup(save, array); - - DoRandomLookup(save, 1000, array); - CheckContent(save, map); - - nsCOMPtr file; - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); + // Save + { + RefPtr save = + SetupLookupCache(NS_LITERAL_CSTRING("test-save")); - save->StoreToFile(file); + RandomPrefixes(10000, 5, 32, array); - RefPtr load = new VariableLengthPrefixSet; - load->Init(NS_LITERAL_CSTRING("test-load")); + SetupPrefixMap(array, map); + save->Build(map); - load->LoadFromFile(file); + DoExpectedLookup(save, array); + DoRandomLookup(save, 1000, array); + CheckContent(save, map); - DoExpectedLookup(load, array); + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); + save->StoreToFile(file); + } - DoRandomLookup(load, 1000, array); + // Load + { + RefPtr load = + SetupLookupCache(NS_LITERAL_CSTRING("test-load")); + load->LoadFromFile(file); - CheckContent(load, map); + DoExpectedLookup(load, array); + DoRandomLookup(load, 1000, array); + CheckContent(load, map); + } file->Remove(false); } // Test save then load prefix with both 4 bytes prefixes and 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSavePrefixSet) { - RefPtr save = new VariableLengthPrefixSet; - save->Init(NS_LITERAL_CSTRING("test-save")); - - // Try to simulate the real case that most prefixes are 4bytes + nsCOMPtr file; _PrefixArray array; - RandomPrefixes(20000, 4, 4, array); - RandomPrefixes(1000, 5, 32, array); - PrefixStringMap map; - SetupPrefixMap(array, map); - save->SetPrefixes(map); - DoExpectedLookup(save, array); + // Save + { + RefPtr save = + SetupLookupCache(NS_LITERAL_CSTRING("test-save")); + + // Try to simulate the real case that most prefixes are 4bytes + RandomPrefixes(20000, 4, 4, array); + RandomPrefixes(1000, 5, 32, array); - DoRandomLookup(save, 1000, array); + SetupPrefixMap(array, map); + save->Build(map); - CheckContent(save, map); + DoExpectedLookup(save, array); + DoRandomLookup(save, 1000, array); + CheckContent(save, map); + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); + save->StoreToFile(file); + } + + // Load + { + RefPtr load = + SetupLookupCache(NS_LITERAL_CSTRING("test-load")); + load->LoadFromFile(file); + + DoExpectedLookup(load, array); + DoRandomLookup(load, 1000, array); + CheckContent(load, map); + } + + file->Remove(false); +} + +// This is for fixed-length prefixset +TEST(UrlClassifierVLPrefixSet, LoadSaveNoDelta) { nsCOMPtr file; - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); + _PrefixArray array; + PrefixStringMap map; + + for (uint32_t i = 0; i < 100; i++) { + // construct a tree without deltas by making the distance + // between entries larger than 16 bits + uint32_t v = ((1 << 16) + 1) * i; + nsCString* ele = array.AppendElement(); + ele->AppendASCII(reinterpret_cast(&v), 4); + } - save->StoreToFile(file); + // Save + { + RefPtr save = + SetupLookupCache(NS_LITERAL_CSTRING("test-save")); - RefPtr load = new VariableLengthPrefixSet; - load->Init(NS_LITERAL_CSTRING("test-load")); + SetupPrefixMap(array, map); + save->Build(map); - load->LoadFromFile(file); + DoExpectedLookup(save, array); + DoRandomLookup(save, 1000, array); + CheckContent(save, map); - DoExpectedLookup(load, array); + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); + save->StoreToFile(file); + } - DoRandomLookup(load, 1000, array); + // Load + { + RefPtr load = + SetupLookupCache(NS_LITERAL_CSTRING("test-load")); + load->LoadFromFile(file); - CheckContent(load, map); + DoExpectedLookup(load, array); + DoRandomLookup(load, 1000, array); + CheckContent(load, map); + } file->Remove(false); } diff --git a/toolkit/components/url-classifier/tests/unit/test_prefixset.js b/toolkit/components/url-classifier/tests/unit/test_prefixset.js index f41ff1c8d8b36..8f24daadccd8a 100644 --- a/toolkit/components/url-classifier/tests/unit/test_prefixset.js +++ b/toolkit/components/url-classifier/tests/unit/test_prefixset.js @@ -140,40 +140,6 @@ function testReSetPrefixes() { checkContents(pset, secondPrefixes); } -function testLoadSaveLargeSet() { - let N = 1000; - let arr = []; - - for (let i = 0; i < N; i++) { - let randInt = Math.floor(Math.random() * Math.pow(2, 32)); - arr.push(randInt); - } - - arr.sort((x, y) => x - y); - - let pset = newPset(); - pset.setPrefixes(arr, arr.length); - - doExpectedLookups(pset, arr, 1); - doRandomLookups(pset, arr, 1000); - - checkContents(pset, arr); - - // Now try to save, restore, and redo the lookups - var file = Services.dirsvc.get("ProfLD", Ci.nsIFile); - file.append("testLarge.pset"); - - pset.storeToFile(file); - - let psetLoaded = newPset(); - psetLoaded.loadFromFile(file); - - doExpectedLookups(psetLoaded, arr, 1); - doRandomLookups(psetLoaded, arr, 1000); - - checkContents(psetLoaded, arr); -} - function testTinySet() { let pset = Cc["@mozilla.org/url-classifier/prefixset;1"] .createInstance(Ci.nsIUrlClassifierPrefixSet); @@ -190,37 +156,11 @@ function testTinySet() { checkContents(pset, prefixes); } -function testLoadSaveNoDelta() { - let N = 100; - let arr = []; - - for (let i = 0; i < N; i++) { - // construct a tree without deltas by making the distance - // between entries larger than 16 bits - arr.push(((1 << 16) + 1) * i); - } - - let pset = newPset(); - pset.setPrefixes(arr, arr.length); - - doExpectedLookups(pset, arr, 1); - - var file = Services.dirsvc.get("ProfLD", Ci.nsIFile); - file.append("testNoDelta.pset"); - - pset.storeToFile(file); - pset.loadFromFile(file); - - doExpectedLookups(pset, arr, 1); -} - var tests = [testBasicPset, testSimplePset, testReSetPrefixes, - testLoadSaveLargeSet, testDuplicates, - testTinySet, - testLoadSaveNoDelta]; + testTinySet]; function run_test() { // None of the tests use |executeSoon| or any sort of callbacks, so we can From 7bc29f97cdf81d6dfb373696b2327635e228c4a2 Mon Sep 17 00:00:00 2001 From: dlee Date: Wed, 6 Mar 2019 22:57:12 +0000 Subject: [PATCH 11/48] Bug 1353956 - P4. Add header and CRC32 checksum to SafeBrowsing V4 prefix files. r=gcp After this patch, we may have the following files in SafeBrowsing directory: - (v2) .sbstore : Store V2 chunkdata, for update, MD5 integrity check while load - (v2) .pset : Store V2 prefixset, for lookup, load upon startup, no integrity check - (v4) .metadata : Store V4 state, for update, no integrity check - (v4) .vlpset : Store V4 prefixset, for lookup, load upon startup, CRC32 integrity check - (v4) .pset : V4 prefix set before this patch, should be removed The magic string is also added to ".vlpset" header so we can add a telemetry to see if sanity check is good enough for prefix set integrity check (The telemetry is not yet added). If yes, we can remove the CRC32 in the future for even better performance. Differential Revision: https://phabricator.services.mozilla.com/D21463 --HG-- extra : moz-landing-system : lando --- .../safebrowsing/test_initial_download.py | 2 +- .../components/url-classifier/LookupCache.cpp | 11 +- .../components/url-classifier/LookupCache.h | 2 + .../url-classifier/LookupCacheV4.cpp | 291 ++++++++++++------ .../components/url-classifier/LookupCacheV4.h | 10 + .../nsCheckSummedOutputStream.cpp | 34 ++ .../nsCheckSummedOutputStream.h | 32 ++ .../tests/gtest/TestFailUpdate.cpp | 4 +- .../gtest/TestUrlClassifierTableUpdateV4.cpp | 2 +- 9 files changed, 293 insertions(+), 95 deletions(-) diff --git a/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py b/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py index 933b240322b58..2a48b64b5835a 100644 --- a/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py +++ b/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py @@ -17,7 +17,7 @@ class TestSafeBrowsingInitialDownload(PuppeteerMixin, MarionetteTestCase): ] v4_file_extensions = [ - 'pset', + 'vlpset', 'metadata', ] diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index ea7851a284bc9..1277b911a50c0 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -31,9 +31,6 @@ // returned from the gethash server. They are not serialized, // only cached until the next update. -// Name of the persistent PrefixSet storage -#define PREFIXSET_SUFFIX ".pset" - #define V2_CACHE_DURATION_SEC (15 * 60) // MOZ_LOG=UrlClassifierDbService:5 @@ -120,7 +117,7 @@ nsresult LookupCache::WriteFile() { nsresult rv = mStoreDirectory->Clone(getter_AddRefs(psFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = psFile->AppendNative(mTableName + NS_LITERAL_CSTRING(PREFIXSET_SUFFIX)); + rv = psFile->AppendNative(mTableName + GetPrefixSetSuffix()); NS_ENSURE_SUCCESS(rv, rv); rv = StoreToFile(psFile); @@ -439,7 +436,7 @@ nsresult LookupCache::LoadPrefixSet() { nsresult rv = mStoreDirectory->Clone(getter_AddRefs(psFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = psFile->AppendNative(mTableName + NS_LITERAL_CSTRING(PREFIXSET_SUFFIX)); + rv = psFile->AppendNative(mTableName + GetPrefixSetSuffix()); NS_ENSURE_SUCCESS(rv, rv); bool exists; @@ -724,6 +721,10 @@ size_t LookupCacheV2::SizeOfPrefixSet() const { return mPrefixSet->SizeOfIncludingThis(moz_malloc_size_of); } +nsCString LookupCacheV2::GetPrefixSetSuffix() const { + return NS_LITERAL_CSTRING(".pset"); +} + #ifdef DEBUG template static void EnsureSorted(T* aArray) { diff --git a/toolkit/components/url-classifier/LookupCache.h b/toolkit/components/url-classifier/LookupCache.h index 9b1d876e5a58f..b21c7083e6da3 100644 --- a/toolkit/components/url-classifier/LookupCache.h +++ b/toolkit/components/url-classifier/LookupCache.h @@ -254,6 +254,7 @@ class LookupCache { nsresult LoadPrefixSet(); virtual size_t SizeOfPrefixSet() const = 0; + virtual nsCString GetPrefixSetSuffix() const = 0; virtual int Ver() const = 0; @@ -321,6 +322,7 @@ class LookupCacheV2 final : public LookupCache { virtual nsresult ClearPrefixes() override; virtual size_t SizeOfPrefixSet() const override; + virtual nsCString GetPrefixSetSuffix() const override; private: ~LookupCacheV2() {} diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index 68d6dcb01650c..02cf42e7a22f4 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -6,6 +6,8 @@ #include "LookupCacheV4.h" #include "HashStore.h" #include "mozilla/Unused.h" +#include "nsCheckSummedOutputStream.h" +#include "crc32c.h" #include // MOZ_LOG=UrlClassifierDbService:5 @@ -16,6 +18,94 @@ extern mozilla::LazyLogModule gUrlClassifierDbServiceLog; MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) #define METADATA_SUFFIX NS_LITERAL_CSTRING(".metadata") +namespace { + +static const uint64_t STREAM_BUFFER_SIZE = 4096; + +////////////////////////////////////////////////////////////////////////// +// A set of lightweight functions for reading/writing value from/to file. +template +struct ValueTraits { + static_assert(sizeof(T) <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, + "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); + static uint32_t Length(const T& aValue) { return sizeof(T); } + static char* WritePtr(T& aValue, uint32_t aLength) { return (char*)&aValue; } + static const char* ReadPtr(const T& aValue) { return (char*)&aValue; } + static bool IsFixedLength() { return true; } +}; + +template <> +struct ValueTraits { + static bool IsFixedLength() { return false; } + + static uint32_t Length(const nsACString& aValue) { return aValue.Length(); } + + static char* WritePtr(nsACString& aValue, uint32_t aLength) { + aValue.SetLength(aLength); + return aValue.BeginWriting(); + } + + static const char* ReadPtr(const nsACString& aValue) { + return aValue.BeginReading(); + } +}; + +template +static nsresult WriteValue(nsIOutputStream* aOutputStream, const T& aValue) { + uint32_t writeLength = ValueTraits::Length(aValue); + MOZ_ASSERT(writeLength <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, + "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); + if (!ValueTraits::IsFixedLength()) { + // We need to write out the variable value length. + nsresult rv = WriteValue(aOutputStream, writeLength); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Write out the value. + auto valueReadPtr = ValueTraits::ReadPtr(aValue); + uint32_t written; + nsresult rv = aOutputStream->Write(valueReadPtr, writeLength, &written); + NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(written != writeLength)) { + return NS_ERROR_FAILURE; + } + + return rv; +} + +template +static nsresult ReadValue(nsIInputStream* aInputStream, T& aValue) { + nsresult rv; + + uint32_t readLength; + if (ValueTraits::IsFixedLength()) { + readLength = ValueTraits::Length(aValue); + } else { + // Read the variable value length from file. + nsresult rv = ReadValue(aInputStream, readLength); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Sanity-check the readLength in case of disk corruption + // (see bug 1433636). + if (readLength > LookupCacheV4::MAX_METADATA_VALUE_LENGTH) { + return NS_ERROR_FILE_CORRUPTED; + } + + // Read the value. + uint32_t read; + auto valueWritePtr = ValueTraits::WritePtr(aValue, readLength); + rv = aInputStream->Read(valueWritePtr, readLength, &read); + if (NS_FAILED(rv) || read != readLength) { + LOG(("Failed to read the value.")); + return NS_FAILED(rv) ? rv : NS_ERROR_FAILURE; + } + + return rv; +} + +} // end of unnamed namespace. +//////////////////////////////////////////////////////////////////////// namespace mozilla { namespace safebrowsing { @@ -23,6 +113,9 @@ namespace safebrowsing { const int LookupCacheV4::VER = 4; const uint32_t LookupCacheV4::MAX_METADATA_VALUE_LENGTH = 256; +const uint32_t VLPSET_MAGIC = 0x36044a35; +const uint32_t VLPSET_VERSION = 1; + // Prefixes coming from updates and VLPrefixSet are both stored in the HashTable // where the (key, value) pair is a prefix size and a lexicographic-sorted // string. The difference is prefixes from updates use std:string(to avoid @@ -166,49 +259,77 @@ nsresult LookupCacheV4::ClearPrefixes() { nsresult LookupCacheV4::StoreToFile(nsCOMPtr& aFile) { NS_ENSURE_ARG_POINTER(aFile); + uint32_t fileSize = sizeof(Header) + + mVLPrefixSet->CalculatePreallocateSize() + + nsCrc32CheckSumedOutputStream::CHECKSUM_SIZE; + nsCOMPtr localOutFile; nsresult rv = - NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, - PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); - NS_ENSURE_SUCCESS(rv, rv); + NS_NewSafeLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, + PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } - uint32_t fileSize = 0; // Preallocate the file storage { nsCOMPtr fos(do_QueryInterface(localOutFile)); Telemetry::AutoTimer timer; - fileSize = mVLPrefixSet->CalculatePreallocateSize(); - Unused << fos->Preallocate(fileSize); } - // Convert to buffered stream nsCOMPtr out; - rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), - std::min(fileSize, MAX_BUFFER_SIZE)); - NS_ENSURE_SUCCESS(rv, rv); + rv = NS_NewCrc32OutputStream(getter_AddRefs(out), localOutFile.forget(), + std::min(fileSize, MAX_BUFFER_SIZE)); + // Write header + Header header = {.magic = VLPSET_MAGIC, .version = VLPSET_VERSION}; + rv = WriteValue(out, header); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + // Write prefixes rv = mVLPrefixSet->WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + // Write checksum + nsCOMPtr safeOut = do_QueryInterface(out, &rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = safeOut->Finish(); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } LOG(("[%s] Storing PrefixSet successful", mTableName.get())); return NS_OK; } nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { + NS_ENSURE_ARG_POINTER(aFile); + Telemetry::AutoTimer timer; nsCOMPtr localInFile; nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, PR_RDONLY | nsIFile::OS_READAHEAD); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } // Calculate how big the file is, make sure our read buffer isn't bigger // than the file itself which is just wasting memory. int64_t fileSize; rv = aFile->GetFileSize(&fileSize); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } if (fileSize < 0 || fileSize > UINT32_MAX) { return NS_ERROR_FAILURE; @@ -221,15 +342,48 @@ nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { nsCOMPtr in; rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), bufferSize); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + // Load header + Header header; + rv = ReadValue(in, header); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = SanityCheck(header); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + // Load data rv = mVLPrefixSet->LoadPrefixes(in); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } + // Load crc32 checksum and verify + rv = VerifyCRC32(in); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + mPrimed = true; + LOG(("[%s] Loading PrefixSet successful", mTableName.get())); + return NS_OK; +} + +nsresult LookupCacheV4::SanityCheck(const Header& aHeader) { + if (aHeader.magic != VLPSET_MAGIC) { + return NS_ERROR_FILE_CORRUPTED; + } + + if (aHeader.version != VLPSET_VERSION) { + return NS_ERROR_FAILURE; + } return NS_OK; } @@ -238,6 +392,10 @@ size_t LookupCacheV4::SizeOfPrefixSet() const { return mVLPrefixSet->SizeOfIncludingThis(moz_malloc_size_of); } +nsCString LookupCacheV4::GetPrefixSetSuffix() const { + return NS_LITERAL_CSTRING(".vlpset"); +} + static nsresult AppendPrefixToMap(PrefixStringMap& prefixes, const nsACString& prefix) { uint32_t len = prefix.Length(); @@ -416,94 +574,55 @@ nsresult LookupCacheV4::AddFullHashResponseToCache( return NS_OK; } -////////////////////////////////////////////////////////////////////////// -// A set of lightweight functions for reading/writing value from/to file. - -namespace { - -template -struct ValueTraits { - static_assert(sizeof(T) <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, - "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); - static uint32_t Length(const T& aValue) { return sizeof(T); } - static char* WritePtr(T& aValue, uint32_t aLength) { return (char*)&aValue; } - static const char* ReadPtr(const T& aValue) { return (char*)&aValue; } - static bool IsFixedLength() { return true; } -}; - -template <> -struct ValueTraits { - static bool IsFixedLength() { return false; } - - static uint32_t Length(const nsACString& aValue) { return aValue.Length(); } - - static char* WritePtr(nsACString& aValue, uint32_t aLength) { - aValue.SetLength(aLength); - return aValue.BeginWriting(); +// This function assumes CRC32 checksum is in the end of the input stream +nsresult LookupCacheV4::VerifyCRC32(nsCOMPtr& aIn) { + nsCOMPtr seekIn = do_QueryInterface(aIn); + nsresult rv = seekIn->Seek(nsISeekableStream::NS_SEEK_SET, 0); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; } - static const char* ReadPtr(const nsACString& aValue) { - return aValue.BeginReading(); + uint64_t len; + rv = aIn->Available(&len); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; } -}; -template -static nsresult WriteValue(nsIOutputStream* aOutputStream, const T& aValue) { - uint32_t writeLength = ValueTraits::Length(aValue); - MOZ_ASSERT(writeLength <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, - "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); - if (!ValueTraits::IsFixedLength()) { - // We need to write out the variable value length. - nsresult rv = WriteValue(aOutputStream, writeLength); - NS_ENSURE_SUCCESS(rv, rv); - } + uint32_t calculateCrc32 = ~0; - // Write out the value. - auto valueReadPtr = ValueTraits::ReadPtr(aValue); - uint32_t written; - nsresult rv = aOutputStream->Write(valueReadPtr, writeLength, &written); - NS_ENSURE_SUCCESS(rv, rv); - if (NS_WARN_IF(written != writeLength)) { - return NS_ERROR_FAILURE; - } + // We don't want to include the checksum itself + len = len - nsCrc32CheckSumedOutputStream::CHECKSUM_SIZE; - return rv; -} + char buffer[STREAM_BUFFER_SIZE]; + while (len) { + uint32_t read; + uint64_t readLimit = std::min(STREAM_BUFFER_SIZE, len); -template -static nsresult ReadValue(nsIInputStream* aInputStream, T& aValue) { - nsresult rv; + rv = aIn->Read(buffer, readLimit, &read); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } - uint32_t readLength; - if (ValueTraits::IsFixedLength()) { - readLength = ValueTraits::Length(aValue); - } else { - // Read the variable value length from file. - nsresult rv = ReadValue(aInputStream, readLength); - NS_ENSURE_SUCCESS(rv, rv); + calculateCrc32 = ComputeCrc32c( + calculateCrc32, reinterpret_cast(buffer), read); + + len -= read; } - // Sanity-check the readLength in case of disk corruption - // (see bug 1433636). - if (readLength > LookupCacheV4::MAX_METADATA_VALUE_LENGTH) { - return NS_ERROR_FILE_CORRUPTED; + // Now read the CRC32 + uint32_t crc32; + ReadValue(aIn, crc32); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; } - // Read the value. - uint32_t read; - auto valueWritePtr = ValueTraits::WritePtr(aValue, readLength); - rv = aInputStream->Read(valueWritePtr, readLength, &read); - if (NS_FAILED(rv) || read != readLength) { - LOG(("Failed to read the value.")); - return NS_FAILED(rv) ? rv : NS_ERROR_FAILURE; + if (crc32 != calculateCrc32) { + return NS_ERROR_FILE_CORRUPTED; } - return rv; + return NS_OK; } -} // end of unnamed namespace. -//////////////////////////////////////////////////////////////////////// - nsresult LookupCacheV4::WriteMetadata( RefPtr aTableUpdate) { NS_ENSURE_ARG_POINTER(aTableUpdate); diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index 883cc7512779e..d2c07f4588ac0 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -51,12 +51,22 @@ class LookupCacheV4 final : public LookupCache { protected: virtual nsresult ClearPrefixes() override; virtual size_t SizeOfPrefixSet() const override; + virtual nsCString GetPrefixSetSuffix() const override; + nsCString GetMetadataSuffix() const; private: ~LookupCacheV4() {} virtual int Ver() const override { return VER; } + struct Header { + uint32_t magic; + uint32_t version; + }; + + nsresult SanityCheck(const Header& aHeader); + nsresult VerifyCRC32(nsCOMPtr& aIn); + RefPtr mVLPrefixSet; }; diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp index 3c55cb9c5cffa..f3488480eae69 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp @@ -7,6 +7,7 @@ #include "nsIFile.h" #include "nsISupportsImpl.h" #include "nsCheckSummedOutputStream.h" +#include "crc32c.h" //////////////////////////////////////////////////////////////////////////////// // nsCheckSummedOutputStream @@ -51,3 +52,36 @@ nsCheckSummedOutputStream::Write(const char *buf, uint32_t count, } //////////////////////////////////////////////////////////////////////////////// +// nsCrc32CheckSumedOutputStream +NS_IMPL_ISUPPORTS_INHERITED(nsCrc32CheckSumedOutputStream, + nsBufferedOutputStream, nsISafeOutputStream) + +NS_IMETHODIMP +nsCrc32CheckSumedOutputStream::Init(nsIOutputStream *stream, + uint32_t bufferSize) { + mCheckSum = ~0; + + return nsBufferedOutputStream::Init(stream, bufferSize); +} + +NS_IMETHODIMP +nsCrc32CheckSumedOutputStream::Finish() { + uint32_t written; + nsresult rv = nsBufferedOutputStream::Write( + reinterpret_cast(&mCheckSum), sizeof(mCheckSum), &written); + NS_ASSERTION(written == sizeof(mCheckSum), "Error writing stream checksum"); + NS_ENSURE_SUCCESS(rv, rv); + + return nsBufferedOutputStream::Finish(); +} + +NS_IMETHODIMP +nsCrc32CheckSumedOutputStream::Write(const char *buf, uint32_t count, + uint32_t *result) { + mCheckSum = + ComputeCrc32c(mCheckSum, reinterpret_cast(buf), count); + + return nsBufferedOutputStream::Write(buf, count, result); +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h index b8dd79543920b..f698d0dc0563a 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h @@ -53,4 +53,36 @@ inline nsresult NS_NewCheckSummedOutputStream(nsIOutputStream **result, return rv; } +class nsCrc32CheckSumedOutputStream : public nsBufferedOutputStream { + public: + NS_DECL_ISUPPORTS_INHERITED + + static const uint32_t CHECKSUM_SIZE = 4; + + nsCrc32CheckSumedOutputStream() = default; + + NS_IMETHOD Finish() override; + NS_IMETHOD Write(const char *buf, uint32_t count, uint32_t *result) override; + NS_IMETHOD Init(nsIOutputStream *stream, uint32_t bufferSize) override; + + protected: + virtual ~nsCrc32CheckSumedOutputStream() { nsBufferedOutputStream::Close(); } + + uint32_t mCheckSum; +}; + +inline nsresult NS_NewCrc32OutputStream( + nsIOutputStream **aResult, already_AddRefed aOutput, + uint32_t aBufferSize) { + nsCOMPtr out = std::move(aOutput); + + nsCOMPtr bufferOutput = + new nsCrc32CheckSumedOutputStream(); + nsresult rv = bufferOutput->Init(out, aBufferSize); + if (NS_SUCCEEDED(rv)) { + bufferOutput.forget(aResult); + } + return rv; +} + #endif diff --git a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp b/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp index b31860fd70237..db8bbb40f7300 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp @@ -8,7 +8,7 @@ using namespace mozilla; using namespace mozilla::safebrowsing; static const char* kFilesInV2[] = {".pset", ".sbstore"}; -static const char* kFilesInV4[] = {".pset", ".metadata"}; +static const char* kFilesInV4[] = {".vlpset", ".metadata"}; #define V2_TABLE "gtest-malware-simple" #define V4_TABLE1 "goog-malware-proto" @@ -63,7 +63,7 @@ TEST(UrlClassifierFailUpdate, CheckTableReset) { ApplyUpdate(update); - // A successful V4 update should create .pset & .metadata files + // A successful V4 update should create .vlpset & .metadata files CheckFileExist(V4_TABLE1, kFilesInV4, true); } diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp index 4d9b3b3c146f3..cfffef4b8c44d 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp @@ -21,7 +21,7 @@ typedef nsTArray<_Prefix> _PrefixArray; #define GTEST_SAFEBROWSING_DIR NS_LITERAL_CSTRING("safebrowsing") #define GTEST_TABLE NS_LITERAL_CSTRING("gtest-malware-proto") -#define GTEST_PREFIXFILE NS_LITERAL_CSTRING("gtest-malware-proto.pset") +#define GTEST_PREFIXFILE NS_LITERAL_CSTRING("gtest-malware-proto.vlpset") // This function removes common elements of inArray and outArray from // outArray. This is used by partial update testcase to ensure partial update From 6d5752afaeecd17f0095bcb3b955df851b198952 Mon Sep 17 00:00:00 2001 From: dlee Date: Tue, 5 Mar 2019 18:32:23 +0000 Subject: [PATCH 12/48] Bug 1353956 - P5. Remove old v4 prefix files after new files are stored. r=gcp This patch is to cleanup old SafeBrowsing v4 prefix files. Differential Revision: https://phabricator.services.mozilla.com/D21464 --HG-- extra : moz-landing-system : lando --- .../url-classifier/LookupCacheV4.cpp | 33 +++++++++++++++++++ .../components/url-classifier/LookupCacheV4.h | 1 + 2 files changed, 34 insertions(+) diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index 02cf42e7a22f4..f8ef974428ccc 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -308,6 +308,39 @@ nsresult LookupCacheV4::StoreToFile(nsCOMPtr& aFile) { } LOG(("[%s] Storing PrefixSet successful", mTableName.get())); + + // This is to remove old ".pset" files if exist + Unused << CleanOldPrefixSet(); + return NS_OK; +} + +nsresult LookupCacheV4::CleanOldPrefixSet() { + nsCOMPtr file; + nsresult rv = mStoreDirectory->Clone(getter_AddRefs(file)); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = file->AppendNative(mTableName + NS_LITERAL_CSTRING(".pset")); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + bool exists; + rv = file->Exists(&exists); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + if (exists) { + rv = file->Remove(false); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + LOG(("[%s] Old PrefixSet is succuessfully removed!", mTableName.get())); + } + return NS_OK; } diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index d2c07f4588ac0..2d6de5b2f429d 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -66,6 +66,7 @@ class LookupCacheV4 final : public LookupCache { nsresult SanityCheck(const Header& aHeader); nsresult VerifyCRC32(nsCOMPtr& aIn); + nsresult CleanOldPrefixSet(); RefPtr mVLPrefixSet; }; From 2170ff35edc5c52daa713ca677fbeee731600b22 Mon Sep 17 00:00:00 2001 From: dlee Date: Wed, 6 Mar 2019 09:41:34 +0000 Subject: [PATCH 13/48] Bug 1353956 - P6. Load the old prefixset(.pset) when there is no .vlpset. r=gcp To avoid forcing a redownload of SafeBrowsing v4 list. Differential Revision: https://phabricator.services.mozilla.com/D21876 --HG-- extra : moz-landing-system : lando --- .../components/url-classifier/LookupCache.cpp | 11 +++- .../components/url-classifier/LookupCache.h | 4 ++ .../url-classifier/LookupCacheV4.cpp | 62 +++++++++++++++++++ .../components/url-classifier/LookupCacheV4.h | 2 + 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 1277b911a50c0..69d6e6ca819ee 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -451,7 +451,14 @@ nsresult LookupCache::LoadPrefixSet() { } mPrimed = true; } else { - LOG(("no (usable) stored PrefixSet found")); + // The only scenario we load the old .pset file is when we haven't received + // a SafeBrowsng update before. After receiving an update, new .vlpset will + // be stored while old .pset will be removed. + if (NS_SUCCEEDED(LoadLegacyFile())) { + mPrimed = true; + } else { + LOG(("no (usable) stored PrefixSet found")); + } } #ifdef DEBUG @@ -681,6 +688,8 @@ nsresult LookupCacheV2::StoreToFile(nsCOMPtr& aFile) { return NS_OK; } +nsresult LookupCacheV2::LoadLegacyFile() { return NS_ERROR_NOT_IMPLEMENTED; } + nsresult LookupCacheV2::LoadFromFile(nsCOMPtr& aFile) { Telemetry::AutoTimer timer; diff --git a/toolkit/components/url-classifier/LookupCache.h b/toolkit/components/url-classifier/LookupCache.h index b21c7083e6da3..c90eb32eccdfa 100644 --- a/toolkit/components/url-classifier/LookupCache.h +++ b/toolkit/components/url-classifier/LookupCache.h @@ -258,6 +258,8 @@ class LookupCache { virtual int Ver() const = 0; + virtual nsresult LoadLegacyFile() = 0; + protected: virtual ~LookupCache() {} @@ -329,6 +331,8 @@ class LookupCacheV2 final : public LookupCache { virtual int Ver() const override { return VER; } + virtual nsresult LoadLegacyFile() override; + // Construct a Prefix Set with known prefixes. // This will Clear() aAddPrefixes when done. nsresult ConstructPrefixSet(AddPrefixArray& aAddPrefixes); diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index f8ef974428ccc..faa96654d3d8a 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -344,6 +344,68 @@ nsresult LookupCacheV4::CleanOldPrefixSet() { return NS_OK; } +nsresult LookupCacheV4::LoadLegacyFile() { + nsCOMPtr file; + nsresult rv = mStoreDirectory->Clone(getter_AddRefs(file)); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + rv = file->AppendNative(mTableName + NS_LITERAL_CSTRING(".pset")); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + bool exists; + rv = file->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + + if (!exists) { + return NS_ERROR_FAILURE; + } + + nsCOMPtr localInFile; + rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), file, + PR_RDONLY | nsIFile::OS_READAHEAD); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + // Calculate how big the file is, make sure our read buffer isn't bigger + // than the file itself which is just wasting memory. + int64_t fileSize; + rv = file->GetFileSize(&fileSize); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + if (fileSize < 0 || fileSize > UINT32_MAX) { + return NS_ERROR_FAILURE; + } + + uint32_t bufferSize = + std::min(static_cast(fileSize), MAX_BUFFER_SIZE); + + // Convert to buffered stream + nsCOMPtr in; + rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), + bufferSize); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + // Load data + rv = mVLPrefixSet->LoadPrefixes(in); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + mPrimed = true; + + LOG(("[%s] Loading Legacy PrefixSet successful", mTableName.get())); + return NS_OK; +} + nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { NS_ENSURE_ARG_POINTER(aFile); diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index 2d6de5b2f429d..66c5475396b58 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -59,6 +59,8 @@ class LookupCacheV4 final : public LookupCache { virtual int Ver() const override { return VER; } + virtual nsresult LoadLegacyFile() override; + struct Header { uint32_t magic; uint32_t version; From be8ce9ba8a6e01b32e32ea861e4b5a5b97a5d9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 7 Mar 2019 00:14:06 +0100 Subject: [PATCH 14/48] Bug 1532135 - followup: Add a comment as requested on Phabricator. --- servo/components/style/values/specified/length.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servo/components/style/values/specified/length.rs b/servo/components/style/values/specified/length.rs index 735e829b83a69..677ca3901b45f 100644 --- a/servo/components/style/values/specified/length.rs +++ b/servo/components/style/values/specified/length.rs @@ -992,6 +992,10 @@ impl NonNegativeLengthPercentage { pub type LengthOrNormal = Either; /// Either a `` or the `auto` keyword. +/// +/// Note that we use LengthPercentage just for convenience, since it pretty much +/// is everything we care about, but we could just add a similar LengthOrAuto +/// instead if we think getting rid of this weirdness is worth it. pub type LengthOrAuto = generics::LengthPercentageOrAuto; impl LengthOrAuto { From c6307e16b703ee4c180d9cd7ea8a9368a5d4af27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 7 Mar 2019 00:14:43 +0100 Subject: [PATCH 15/48] No bug - fix a typo. DONTBUILD --- servo/components/style/traversal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servo/components/style/traversal.rs b/servo/components/style/traversal.rs index f1821900bb4b1..d5a9a5c503392 100644 --- a/servo/components/style/traversal.rs +++ b/servo/components/style/traversal.rs @@ -686,7 +686,7 @@ where // sibling or cousin. Otherwise, recascading a bunch of identical // elements would unnecessarily flood the cache with identical entries. // - // This is analagous to the obvious "don't insert an element that just + // This is analogous to the obvious "don't insert an element that just // got a hit in the style sharing cache" behavior in the MatchAndCascade // handling above. // From f5d7a9b9408ca2124d01c0a8ef6813396790cd57 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 6 Mar 2019 23:11:19 +0000 Subject: [PATCH 16/48] Bug 1533088: Initialize member-var FlexItem::mAlignSelfFlags to zero, in the legacy-box and 'visibility:collapse' FlexItem scenarios. r=heycam Differential Revision: https://phabricator.services.mozilla.com/D22350 --HG-- extra : moz-landing-system : lando --- layout/generic/nsFlexContainerFrame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 69be5e182fd97..970202edc3053 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1918,6 +1918,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput, float aFlexGrow, // value and disregards their own "align-self" property. const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL(); mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL); + mAlignSelfFlags = 0; } else { mAlignSelf = aFlexItemReflowInput.mStylePosition->UsedAlignSelf( containerRS->mFrame->Style()); @@ -2000,7 +2001,8 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize, mIsInlineAxisMainAxis(true), // (doesn't matter, we're not doing layout) mNeedsMinSizeAutoResolution(false), mHasAnyAutoMargin(false), - mAlignSelf(NS_STYLE_ALIGN_FLEX_START) { + mAlignSelf(NS_STYLE_ALIGN_FLEX_START), + mAlignSelfFlags(0) { MOZ_ASSERT(mFrame, "expecting a non-null child frame"); MOZ_ASSERT( NS_STYLE_VISIBILITY_COLLAPSE == mFrame->StyleVisibility()->mVisible, From cd9ccbbe428d92949a50e1e664465e287174d067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 7 Mar 2019 00:32:58 +0100 Subject: [PATCH 17/48] Bug 1533142 - followup: Fix Windows MinGW bustage. r=me --- gfx/2d/ScaledFontDWrite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/2d/ScaledFontDWrite.cpp b/gfx/2d/ScaledFontDWrite.cpp index 2c5c58e53d135..ba13132bfdded 100644 --- a/gfx/2d/ScaledFontDWrite.cpp +++ b/gfx/2d/ScaledFontDWrite.cpp @@ -476,7 +476,7 @@ bool ScaledFontDWrite::GetWRFontInstanceOptions( std::vector* aOutVariations) { wr::FontInstanceOptions options; options.render_mode = wr::ToFontRenderMode(GetDefaultAAMode()); - options.flags = 0; + options.flags = wr::FontInstanceFlags{0}; if (mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD) { options.flags |= wr::FontInstanceFlags_SYNTHETIC_BOLD; } From 91e094a66a0633aebb9b3955f6c5cec319b20980 Mon Sep 17 00:00:00 2001 From: hrdktg Date: Wed, 6 Mar 2019 23:36:23 +0000 Subject: [PATCH 18/48] Bug 1532570 - nsDOMCSSDeclaration::SetProperty should check for the "important" string in a case-insensitive way. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D22423 --HG-- extra : moz-landing-system : lando --- layout/style/nsDOMCSSDeclaration.cpp | 2 +- .../css/cssom/css-style-declaration-modifications.html | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/layout/style/nsDOMCSSDeclaration.cpp b/layout/style/nsDOMCSSDeclaration.cpp index ba1c783c94753..1a88b0d251449 100644 --- a/layout/style/nsDOMCSSDeclaration.cpp +++ b/layout/style/nsDOMCSSDeclaration.cpp @@ -194,7 +194,7 @@ nsDOMCSSDeclaration::SetProperty(const nsAString& aPropertyName, bool important; if (aPriority.IsEmpty()) { important = false; - } else if (aPriority.EqualsLiteral("important")) { + } else if (aPriority.LowerCaseEqualsASCII("important")) { important = true; } else { // XXX silent failure? diff --git a/testing/web-platform/tests/css/cssom/css-style-declaration-modifications.html b/testing/web-platform/tests/css/cssom/css-style-declaration-modifications.html index 4db637d7de9ed..a0e22754911cc 100644 --- a/testing/web-platform/tests/css/cssom/css-style-declaration-modifications.html +++ b/testing/web-platform/tests/css/cssom/css-style-declaration-modifications.html @@ -48,6 +48,7 @@ declaration.setProperty("margin-left", "15px"); declaration.setProperty("padding-left", "15px"); + assert_equals(declaration.length, 2); assert_equals(declaration.item(0), "margin-left"); assert_equals(declaration.item(1), "padding-left"); @@ -57,7 +58,14 @@ var computedStyle = window.getComputedStyle(document.getElementById("test")); assert_equals(computedStyle.getPropertyValue("margin-left"), "15px"); assert_equals(computedStyle.getPropertyValue("padding-left"), "15px"); + }, "Calling CSSStyleDeclaration#setProperty"); + + test(function() { + declaration.setProperty("background-color", "red", "ImPoRtAnt"); + assert_equals(declaration.getPropertyPriority("background-color"), "important"); + }, "setProperty priority should be case-insensitive"); + From fc78eb74a3d302ebcf4db376f714395291a04ebd Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Thu, 7 Mar 2019 01:49:03 +0200 Subject: [PATCH 19/48] Backed out 6 changesets (bug 1353956) for Linux Build bustage Backed out changeset 71dafccc22ae (bug 1353956) Backed out changeset f1f29fe519cf (bug 1353956) Backed out changeset 4978556a66f6 (bug 1353956) Backed out changeset bc0b91abce9b (bug 1353956) Backed out changeset 6b8412db5a05 (bug 1353956) Backed out changeset 3d326cfcd002 (bug 1353956) --- .../safebrowsing/test_initial_download.py | 2 +- .../components/url-classifier/Classifier.cpp | 9 +- .../components/url-classifier/HashStore.cpp | 4 +- toolkit/components/url-classifier/HashStore.h | 6 +- .../components/url-classifier/LookupCache.cpp | 88 +--- .../components/url-classifier/LookupCache.h | 18 +- .../url-classifier/LookupCacheV4.cpp | 490 +++++------------- .../components/url-classifier/LookupCacheV4.h | 18 +- .../url-classifier/ProtocolParser.cpp | 2 +- .../VariableLengthPrefixSet.cpp | 96 +++- .../url-classifier/VariableLengthPrefixSet.h | 10 +- .../nsCheckSummedOutputStream.cpp | 34 -- .../nsCheckSummedOutputStream.h | 32 -- .../nsIUrlClassifierPrefixSet.idl | 2 + .../nsUrlClassifierPrefixSet.cpp | 80 ++- .../url-classifier/nsUrlClassifierPrefixSet.h | 8 +- .../tests/gtest/TestFailUpdate.cpp | 4 +- .../gtest/TestUrlClassifierTableUpdateV4.cpp | 210 ++++---- .../gtest/TestVariableLengthPrefixSet.cpp | 352 ++++++------- .../tests/unit/test_prefixset.js | 62 ++- 20 files changed, 648 insertions(+), 879 deletions(-) diff --git a/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py b/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py index 2a48b64b5835a..933b240322b58 100644 --- a/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py +++ b/testing/firefox-ui/tests/functional/safebrowsing/test_initial_download.py @@ -17,7 +17,7 @@ class TestSafeBrowsingInitialDownload(PuppeteerMixin, MarionetteTestCase): ] v4_file_extensions = [ - 'vlpset', + 'pset', 'metadata', ] diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index 2c79808cf1625..13899b9fe8c36 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -1577,10 +1577,9 @@ nsresult Classifier::LoadMetadata(nsIFile* aDirectory, nsACString& aResult) { continue; } - nsCString state, sha256; - rv = lookupCacheV4->LoadMetadata(state, sha256); - Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_METADATA_CORRUPT, - rv == NS_ERROR_FILE_CORRUPTED); + nsCString state; + nsCString checksum; + rv = lookupCacheV4->LoadMetadata(state, checksum); if (NS_FAILED(rv)) { LOG(("Failed to get metadata for table %s", tableName.get())); continue; @@ -1592,7 +1591,7 @@ nsresult Classifier::LoadMetadata(nsIFile* aDirectory, nsACString& aResult) { NS_ENSURE_SUCCESS(rv, rv); nsAutoCString checksumBase64; - rv = Base64Encode(sha256, checksumBase64); + rv = Base64Encode(checksum, checksumBase64); NS_ENSURE_SUCCESS(rv, rv); LOG(("Appending state '%s' and checksum '%s' for table %s", diff --git a/toolkit/components/url-classifier/HashStore.cpp b/toolkit/components/url-classifier/HashStore.cpp index aa8c111869830..21287286974cf 100644 --- a/toolkit/components/url-classifier/HashStore.cpp +++ b/toolkit/components/url-classifier/HashStore.cpp @@ -206,8 +206,8 @@ nsresult TableUpdateV4::NewRemovalIndices(const uint32_t* aIndices, return NS_OK; } -void TableUpdateV4::SetSHA256(const std::string& aSHA256) { - mSHA256.Assign(aSHA256.data(), aSHA256.size()); +void TableUpdateV4::NewChecksum(const std::string& aChecksum) { + mChecksum.Assign(aChecksum.data(), aChecksum.size()); } nsresult TableUpdateV4::NewFullHashResponse( diff --git a/toolkit/components/url-classifier/HashStore.h b/toolkit/components/url-classifier/HashStore.h index 2df2ecedc3776..f9cf6d208bdfb 100644 --- a/toolkit/components/url-classifier/HashStore.h +++ b/toolkit/components/url-classifier/HashStore.h @@ -159,7 +159,7 @@ class TableUpdateV4 : public TableUpdate { return mRemovalIndiceArray; } const nsACString& ClientState() const { return mClientState; } - const nsACString& SHA256() const { return mSHA256; } + const nsACString& Checksum() const { return mChecksum; } const FullHashResponseMap& FullHashResponse() const { return mFullHashResponseMap; } @@ -170,7 +170,7 @@ class TableUpdateV4 : public TableUpdate { void SetFullUpdate(bool aIsFullUpdate) { mFullUpdate = aIsFullUpdate; } void NewPrefixes(int32_t aSize, const nsACString& aPrefixes); void SetNewClientState(const nsACString& aState) { mClientState = aState; } - void SetSHA256(const std::string& aSHA256); + void NewChecksum(const std::string& aChecksum); nsresult NewRemovalIndices(const uint32_t* aIndices, size_t aNumOfIndices); nsresult NewFullHashResponse(const Prefix& aPrefix, @@ -183,7 +183,7 @@ class TableUpdateV4 : public TableUpdate { PrefixStringMap mPrefixesMap; RemovalIndiceArray mRemovalIndiceArray; nsCString mClientState; - nsCString mSHA256; + nsCString mChecksum; // This is used to store response from fullHashes.find. FullHashResponseMap mFullHashResponseMap; diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 69d6e6ca819ee..2e95d70dc6ac4 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -31,6 +31,9 @@ // returned from the gethash server. They are not serialized, // only cached until the next update. +// Name of the persistent PrefixSet storage +#define PREFIXSET_SUFFIX ".pset" + #define V2_CACHE_DURATION_SEC (15 * 60) // MOZ_LOG=UrlClassifierDbService:5 @@ -117,7 +120,7 @@ nsresult LookupCache::WriteFile() { nsresult rv = mStoreDirectory->Clone(getter_AddRefs(psFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = psFile->AppendNative(mTableName + GetPrefixSetSuffix()); + rv = psFile->AppendNative(mTableName + NS_LITERAL_CSTRING(PREFIXSET_SUFFIX)); NS_ENSURE_SUCCESS(rv, rv); rv = StoreToFile(psFile); @@ -436,7 +439,7 @@ nsresult LookupCache::LoadPrefixSet() { nsresult rv = mStoreDirectory->Clone(getter_AddRefs(psFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = psFile->AppendNative(mTableName + GetPrefixSetSuffix()); + rv = psFile->AppendNative(mTableName + NS_LITERAL_CSTRING(PREFIXSET_SUFFIX)); NS_ENSURE_SUCCESS(rv, rv); bool exists; @@ -451,14 +454,7 @@ nsresult LookupCache::LoadPrefixSet() { } mPrimed = true; } else { - // The only scenario we load the old .pset file is when we haven't received - // a SafeBrowsng update before. After receiving an update, new .vlpset will - // be stored while old .pset will be removed. - if (NS_SUCCEEDED(LoadLegacyFile())) { - mPrimed = true; - } else { - LOG(("no (usable) stored PrefixSet found")); - } + LOG(("no (usable) stored PrefixSet found")); } #ifdef DEBUG @@ -655,85 +651,17 @@ nsresult LookupCacheV2::ClearPrefixes() { } nsresult LookupCacheV2::StoreToFile(nsCOMPtr& aFile) { - nsCOMPtr localOutFile; - nsresult rv = - NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, - PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); - NS_ENSURE_SUCCESS(rv, rv); - - uint32_t fileSize; - - // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; - - fileSize = mPrefixSet->CalculatePreallocateSize(); - - // Ignore failure, the preallocation is a hint and we write out the entire - // file later on - Unused << fos->Preallocate(fileSize); - } - - // Convert to buffered stream - nsCOMPtr out; - rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), - std::min(fileSize, MAX_BUFFER_SIZE)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mPrefixSet->WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); - - LOG(("[%s] Storing PrefixSet successful", mTableName.get())); - return NS_OK; + return mPrefixSet->StoreToFile(aFile); } -nsresult LookupCacheV2::LoadLegacyFile() { return NS_ERROR_NOT_IMPLEMENTED; } - nsresult LookupCacheV2::LoadFromFile(nsCOMPtr& aFile) { - Telemetry::AutoTimer timer; - - nsCOMPtr localInFile; - nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, - PR_RDONLY | nsIFile::OS_READAHEAD); - NS_ENSURE_SUCCESS(rv, rv); - - // Calculate how big the file is, make sure our read buffer isn't bigger - // than the file itself which is just wasting memory. - int64_t fileSize; - rv = aFile->GetFileSize(&fileSize); - NS_ENSURE_SUCCESS(rv, rv); - - if (fileSize < 0 || fileSize > UINT32_MAX) { - return NS_ERROR_FAILURE; - } - - uint32_t bufferSize = - std::min(static_cast(fileSize), MAX_BUFFER_SIZE); - - // Convert to buffered stream - nsCOMPtr in; - rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), - bufferSize); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mPrefixSet->LoadPrefixes(in); - NS_ENSURE_SUCCESS(rv, rv); - - mPrimed = true; - LOG(("[%s] Loading PrefixSet successful", mTableName.get())); - - return NS_OK; + return mPrefixSet->LoadFromFile(aFile); } size_t LookupCacheV2::SizeOfPrefixSet() const { return mPrefixSet->SizeOfIncludingThis(moz_malloc_size_of); } -nsCString LookupCacheV2::GetPrefixSetSuffix() const { - return NS_LITERAL_CSTRING(".pset"); -} - #ifdef DEBUG template static void EnsureSorted(T* aArray) { diff --git a/toolkit/components/url-classifier/LookupCache.h b/toolkit/components/url-classifier/LookupCache.h index c90eb32eccdfa..d4ba335f3baba 100644 --- a/toolkit/components/url-classifier/LookupCache.h +++ b/toolkit/components/url-classifier/LookupCache.h @@ -231,9 +231,6 @@ class LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) = 0; - virtual nsresult StoreToFile(nsCOMPtr& aFile) = 0; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) = 0; - virtual bool IsEmpty() const = 0; virtual void ClearAll(); @@ -253,18 +250,15 @@ class LookupCache { private: nsresult LoadPrefixSet(); + virtual nsresult StoreToFile(nsCOMPtr& aFile) = 0; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) = 0; virtual size_t SizeOfPrefixSet() const = 0; - virtual nsCString GetPrefixSetSuffix() const = 0; virtual int Ver() const = 0; - virtual nsresult LoadLegacyFile() = 0; - protected: virtual ~LookupCache() {} - static const uint32_t MAX_BUFFER_SIZE = 64 * 1024; - // Check completions in positive cache and prefix in negative cache. // 'aHas' and 'aConfirmed' are output parameters. nsresult CheckCache(const Completion& aCompletion, bool* aHas, @@ -298,9 +292,6 @@ class LookupCacheV2 final : public LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) override; - virtual nsresult StoreToFile(nsCOMPtr& aFile) override; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; - virtual bool IsEmpty() const override; nsresult Build(AddPrefixArray& aAddPrefixes, AddCompleteArray& aAddCompletes); @@ -323,16 +314,15 @@ class LookupCacheV2 final : public LookupCache { nsresult ReadCompletions(); virtual nsresult ClearPrefixes() override; + virtual nsresult StoreToFile(nsCOMPtr& aFile) override; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; virtual size_t SizeOfPrefixSet() const override; - virtual nsCString GetPrefixSetSuffix() const override; private: ~LookupCacheV2() {} virtual int Ver() const override { return VER; } - virtual nsresult LoadLegacyFile() override; - // Construct a Prefix Set with known prefixes. // This will Clear() aAddPrefixes when done. nsresult ConstructPrefixSet(AddPrefixArray& aAddPrefixes); diff --git a/toolkit/components/url-classifier/LookupCacheV4.cpp b/toolkit/components/url-classifier/LookupCacheV4.cpp index faa96654d3d8a..8aafe06f7d031 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.cpp +++ b/toolkit/components/url-classifier/LookupCacheV4.cpp @@ -6,8 +6,6 @@ #include "LookupCacheV4.h" #include "HashStore.h" #include "mozilla/Unused.h" -#include "nsCheckSummedOutputStream.h" -#include "crc32c.h" #include // MOZ_LOG=UrlClassifierDbService:5 @@ -18,94 +16,6 @@ extern mozilla::LazyLogModule gUrlClassifierDbServiceLog; MOZ_LOG_TEST(gUrlClassifierDbServiceLog, mozilla::LogLevel::Debug) #define METADATA_SUFFIX NS_LITERAL_CSTRING(".metadata") -namespace { - -static const uint64_t STREAM_BUFFER_SIZE = 4096; - -////////////////////////////////////////////////////////////////////////// -// A set of lightweight functions for reading/writing value from/to file. -template -struct ValueTraits { - static_assert(sizeof(T) <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, - "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); - static uint32_t Length(const T& aValue) { return sizeof(T); } - static char* WritePtr(T& aValue, uint32_t aLength) { return (char*)&aValue; } - static const char* ReadPtr(const T& aValue) { return (char*)&aValue; } - static bool IsFixedLength() { return true; } -}; - -template <> -struct ValueTraits { - static bool IsFixedLength() { return false; } - - static uint32_t Length(const nsACString& aValue) { return aValue.Length(); } - - static char* WritePtr(nsACString& aValue, uint32_t aLength) { - aValue.SetLength(aLength); - return aValue.BeginWriting(); - } - - static const char* ReadPtr(const nsACString& aValue) { - return aValue.BeginReading(); - } -}; - -template -static nsresult WriteValue(nsIOutputStream* aOutputStream, const T& aValue) { - uint32_t writeLength = ValueTraits::Length(aValue); - MOZ_ASSERT(writeLength <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, - "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); - if (!ValueTraits::IsFixedLength()) { - // We need to write out the variable value length. - nsresult rv = WriteValue(aOutputStream, writeLength); - NS_ENSURE_SUCCESS(rv, rv); - } - - // Write out the value. - auto valueReadPtr = ValueTraits::ReadPtr(aValue); - uint32_t written; - nsresult rv = aOutputStream->Write(valueReadPtr, writeLength, &written); - NS_ENSURE_SUCCESS(rv, rv); - if (NS_WARN_IF(written != writeLength)) { - return NS_ERROR_FAILURE; - } - - return rv; -} - -template -static nsresult ReadValue(nsIInputStream* aInputStream, T& aValue) { - nsresult rv; - - uint32_t readLength; - if (ValueTraits::IsFixedLength()) { - readLength = ValueTraits::Length(aValue); - } else { - // Read the variable value length from file. - nsresult rv = ReadValue(aInputStream, readLength); - NS_ENSURE_SUCCESS(rv, rv); - } - - // Sanity-check the readLength in case of disk corruption - // (see bug 1433636). - if (readLength > LookupCacheV4::MAX_METADATA_VALUE_LENGTH) { - return NS_ERROR_FILE_CORRUPTED; - } - - // Read the value. - uint32_t read; - auto valueWritePtr = ValueTraits::WritePtr(aValue, readLength); - rv = aInputStream->Read(valueWritePtr, readLength, &read); - if (NS_FAILED(rv) || read != readLength) { - LOG(("Failed to read the value.")); - return NS_FAILED(rv) ? rv : NS_ERROR_FAILURE; - } - - return rv; -} - -} // end of unnamed namespace. -//////////////////////////////////////////////////////////////////////// namespace mozilla { namespace safebrowsing { @@ -113,9 +23,6 @@ namespace safebrowsing { const int LookupCacheV4::VER = 4; const uint32_t LookupCacheV4::MAX_METADATA_VALUE_LENGTH = 256; -const uint32_t VLPSET_MAGIC = 0x36044a35; -const uint32_t VLPSET_VERSION = 1; - // Prefixes coming from updates and VLPrefixSet are both stored in the HashTable // where the (key, value) pair is a prefix size and a lexicographic-sorted // string. The difference is prefixes from updates use std:string(to avoid @@ -257,240 +164,34 @@ nsresult LookupCacheV4::ClearPrefixes() { } nsresult LookupCacheV4::StoreToFile(nsCOMPtr& aFile) { - NS_ENSURE_ARG_POINTER(aFile); - - uint32_t fileSize = sizeof(Header) + - mVLPrefixSet->CalculatePreallocateSize() + - nsCrc32CheckSumedOutputStream::CHECKSUM_SIZE; - - nsCOMPtr localOutFile; - nsresult rv = - NS_NewSafeLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, - PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; - - Unused << fos->Preallocate(fileSize); - } - - nsCOMPtr out; - rv = NS_NewCrc32OutputStream(getter_AddRefs(out), localOutFile.forget(), - std::min(fileSize, MAX_BUFFER_SIZE)); - - // Write header - Header header = {.magic = VLPSET_MAGIC, .version = VLPSET_VERSION}; - rv = WriteValue(out, header); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Write prefixes - rv = mVLPrefixSet->WritePrefixes(out); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Write checksum - nsCOMPtr safeOut = do_QueryInterface(out, &rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = safeOut->Finish(); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - LOG(("[%s] Storing PrefixSet successful", mTableName.get())); - - // This is to remove old ".pset" files if exist - Unused << CleanOldPrefixSet(); - return NS_OK; -} - -nsresult LookupCacheV4::CleanOldPrefixSet() { - nsCOMPtr file; - nsresult rv = mStoreDirectory->Clone(getter_AddRefs(file)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = file->AppendNative(mTableName + NS_LITERAL_CSTRING(".pset")); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - bool exists; - rv = file->Exists(&exists); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - if (exists) { - rv = file->Remove(false); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - LOG(("[%s] Old PrefixSet is succuessfully removed!", mTableName.get())); - } - - return NS_OK; -} - -nsresult LookupCacheV4::LoadLegacyFile() { - nsCOMPtr file; - nsresult rv = mStoreDirectory->Clone(getter_AddRefs(file)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = file->AppendNative(mTableName + NS_LITERAL_CSTRING(".pset")); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - bool exists; - rv = file->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - - if (!exists) { - return NS_ERROR_FAILURE; - } - - nsCOMPtr localInFile; - rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), file, - PR_RDONLY | nsIFile::OS_READAHEAD); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Calculate how big the file is, make sure our read buffer isn't bigger - // than the file itself which is just wasting memory. - int64_t fileSize; - rv = file->GetFileSize(&fileSize); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - if (fileSize < 0 || fileSize > UINT32_MAX) { - return NS_ERROR_FAILURE; - } - - uint32_t bufferSize = - std::min(static_cast(fileSize), MAX_BUFFER_SIZE); - - // Convert to buffered stream - nsCOMPtr in; - rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), - bufferSize); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Load data - rv = mVLPrefixSet->LoadPrefixes(in); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - mPrimed = true; - - LOG(("[%s] Loading Legacy PrefixSet successful", mTableName.get())); - return NS_OK; + return mVLPrefixSet->StoreToFile(aFile); } nsresult LookupCacheV4::LoadFromFile(nsCOMPtr& aFile) { - NS_ENSURE_ARG_POINTER(aFile); - - Telemetry::AutoTimer timer; - - nsCOMPtr localInFile; - nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, - PR_RDONLY | nsIFile::OS_READAHEAD); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Calculate how big the file is, make sure our read buffer isn't bigger - // than the file itself which is just wasting memory. - int64_t fileSize; - rv = aFile->GetFileSize(&fileSize); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - if (fileSize < 0 || fileSize > UINT32_MAX) { - return NS_ERROR_FAILURE; - } - - uint32_t bufferSize = - std::min(static_cast(fileSize), MAX_BUFFER_SIZE); - - // Convert to buffered stream - nsCOMPtr in; - rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), - bufferSize); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Load header - Header header; - rv = ReadValue(in, header); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - rv = SanityCheck(header); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // Load data - rv = mVLPrefixSet->LoadPrefixes(in); + nsresult rv = mVLPrefixSet->LoadFromFile(aFile); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - // Load crc32 checksum and verify - rv = VerifyCRC32(in); + nsCString state, checksum; + rv = LoadMetadata(state, checksum); + Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_METADATA_CORRUPT, + rv == NS_ERROR_FILE_CORRUPTED); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - mPrimed = true; - - LOG(("[%s] Loading PrefixSet successful", mTableName.get())); - return NS_OK; -} - -nsresult LookupCacheV4::SanityCheck(const Header& aHeader) { - if (aHeader.magic != VLPSET_MAGIC) { - return NS_ERROR_FILE_CORRUPTED; - } - - if (aHeader.version != VLPSET_VERSION) { - return NS_ERROR_FAILURE; - } - - return NS_OK; + rv = VerifyChecksum(checksum); + Telemetry::Accumulate(Telemetry::URLCLASSIFIER_VLPS_LOAD_CORRUPT, + rv == NS_ERROR_FILE_CORRUPTED); + Unused << NS_WARN_IF(NS_FAILED(rv)); + return rv; } size_t LookupCacheV4::SizeOfPrefixSet() const { return mVLPrefixSet->SizeOfIncludingThis(moz_malloc_size_of); } -nsCString LookupCacheV4::GetPrefixSetSuffix() const { - return NS_LITERAL_CSTRING(".vlpset"); -} - static nsresult AppendPrefixToMap(PrefixStringMap& prefixes, const nsACString& prefix) { uint32_t len = prefix.Length(); @@ -521,8 +222,8 @@ static nsresult InitCrypto(nsCOMPtr& aCrypto) { } // Read prefix into a buffer and also update the hash which -// keeps track of the sha256 hash -static void UpdateSHA256(nsICryptoHash* aCrypto, const nsACString& aPrefix) { +// keeps track of the checksum +static void UpdateChecksum(nsICryptoHash* aCrypto, const nsACString& aPrefix) { MOZ_ASSERT(aCrypto); aCrypto->Update( reinterpret_cast(const_cast(aPrefix.BeginReading())), @@ -614,7 +315,7 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return rv; } - UpdateSHA256(crypto, smallestOldPrefix); + UpdateChecksum(crypto, smallestOldPrefix); } smallestOldPrefix.SetLength(0); } else { @@ -623,7 +324,7 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return rv; } - UpdateSHA256(crypto, smallestAddPrefix); + UpdateChecksum(crypto, smallestAddPrefix); smallestAddPrefix.SetLength(0); } } @@ -642,20 +343,20 @@ nsresult LookupCacheV4::ApplyUpdate(RefPtr aTableUpdate, return NS_ERROR_UC_UPDATE_WRONG_REMOVAL_INDICES; } - nsAutoCString sha256; - crypto->Finish(false, sha256); - if (aTableUpdate->SHA256().IsEmpty()) { - LOG(("Update sha256 hash missing.")); + nsAutoCString checksum; + crypto->Finish(false, checksum); + if (aTableUpdate->Checksum().IsEmpty()) { + LOG(("Update checksum missing.")); Telemetry::Accumulate( Telemetry::URLCLASSIFIER_UPDATE_ERROR, mProvider, NS_ERROR_GET_CODE(NS_ERROR_UC_UPDATE_MISSING_CHECKSUM)); - // Generate our own sha256 to tableUpdate to ensure there is always + // Generate our own checksum to tableUpdate to ensure there is always // checksum in .metadata - std::string stdSha256(sha256.BeginReading(), sha256.Length()); - aTableUpdate->SetSHA256(stdSha256); - } else if (aTableUpdate->SHA256() != sha256) { - LOG(("SHA256 hash mismatch after applying partial update")); + std::string stdChecksum(checksum.BeginReading(), checksum.Length()); + aTableUpdate->NewChecksum(stdChecksum); + } else if (aTableUpdate->Checksum() != checksum) { + LOG(("Checksum mismatch after applying partial update")); return NS_ERROR_UC_UPDATE_CHECKSUM_MISMATCH; } @@ -669,55 +370,125 @@ nsresult LookupCacheV4::AddFullHashResponseToCache( return NS_OK; } -// This function assumes CRC32 checksum is in the end of the input stream -nsresult LookupCacheV4::VerifyCRC32(nsCOMPtr& aIn) { - nsCOMPtr seekIn = do_QueryInterface(aIn); - nsresult rv = seekIn->Seek(nsISeekableStream::NS_SEEK_SET, 0); - if (NS_WARN_IF(NS_FAILED(rv))) { +nsresult LookupCacheV4::VerifyChecksum(const nsACString& aChecksum) { + nsCOMPtr crypto; + nsresult rv = InitCrypto(crypto); + if (NS_FAILED(rv)) { return rv; } - uint64_t len; - rv = aIn->Available(&len); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; + PrefixStringMap map; + mVLPrefixSet->GetPrefixes(map); + + VLPrefixSet loadPSet(map); + uint32_t index = loadPSet.Count() + 1; + for (; index > 0; index--) { + nsAutoCString prefix; + if (!loadPSet.GetSmallestPrefix(prefix)) { + break; + } + UpdateChecksum(crypto, prefix); } - uint32_t calculateCrc32 = ~0; + nsAutoCString checksum; + crypto->Finish(false, checksum); - // We don't want to include the checksum itself - len = len - nsCrc32CheckSumedOutputStream::CHECKSUM_SIZE; + if (checksum != aChecksum) { + LOG(("Checksum mismatch when loading prefixes from file.")); + return NS_ERROR_FILE_CORRUPTED; + } - char buffer[STREAM_BUFFER_SIZE]; - while (len) { - uint32_t read; - uint64_t readLimit = std::min(STREAM_BUFFER_SIZE, len); + return NS_OK; +} - rv = aIn->Read(buffer, readLimit, &read); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } +////////////////////////////////////////////////////////////////////////// +// A set of lightweight functions for reading/writing value from/to file. - calculateCrc32 = ComputeCrc32c( - calculateCrc32, reinterpret_cast(buffer), read); +namespace { + +template +struct ValueTraits { + static_assert(sizeof(T) <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, + "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); + static uint32_t Length(const T& aValue) { return sizeof(T); } + static char* WritePtr(T& aValue, uint32_t aLength) { return (char*)&aValue; } + static const char* ReadPtr(const T& aValue) { return (char*)&aValue; } + static bool IsFixedLength() { return true; } +}; + +template <> +struct ValueTraits { + static bool IsFixedLength() { return false; } - len -= read; + static uint32_t Length(const nsACString& aValue) { return aValue.Length(); } + + static char* WritePtr(nsACString& aValue, uint32_t aLength) { + aValue.SetLength(aLength); + return aValue.BeginWriting(); } - // Now read the CRC32 - uint32_t crc32; - ReadValue(aIn, crc32); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; + static const char* ReadPtr(const nsACString& aValue) { + return aValue.BeginReading(); + } +}; + +template +static nsresult WriteValue(nsIOutputStream* aOutputStream, const T& aValue) { + uint32_t writeLength = ValueTraits::Length(aValue); + MOZ_ASSERT(writeLength <= LookupCacheV4::MAX_METADATA_VALUE_LENGTH, + "LookupCacheV4::MAX_METADATA_VALUE_LENGTH is too small."); + if (!ValueTraits::IsFixedLength()) { + // We need to write out the variable value length. + nsresult rv = WriteValue(aOutputStream, writeLength); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Write out the value. + auto valueReadPtr = ValueTraits::ReadPtr(aValue); + uint32_t written; + nsresult rv = aOutputStream->Write(valueReadPtr, writeLength, &written); + NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(written != writeLength)) { + return NS_ERROR_FAILURE; } - if (crc32 != calculateCrc32) { + return rv; +} + +template +static nsresult ReadValue(nsIInputStream* aInputStream, T& aValue) { + nsresult rv; + + uint32_t readLength; + if (ValueTraits::IsFixedLength()) { + readLength = ValueTraits::Length(aValue); + } else { + // Read the variable value length from file. + nsresult rv = ReadValue(aInputStream, readLength); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Sanity-check the readLength in case of disk corruption + // (see bug 1433636). + if (readLength > LookupCacheV4::MAX_METADATA_VALUE_LENGTH) { return NS_ERROR_FILE_CORRUPTED; } - return NS_OK; + // Read the value. + uint32_t read; + auto valueWritePtr = ValueTraits::WritePtr(aValue, readLength); + rv = aInputStream->Read(valueWritePtr, readLength, &read); + if (NS_FAILED(rv) || read != readLength) { + LOG(("Failed to read the value.")); + return NS_FAILED(rv) ? rv : NS_ERROR_FAILURE; + } + + return rv; } +} // end of unnamed namespace. +//////////////////////////////////////////////////////////////////////// + nsresult LookupCacheV4::WriteMetadata( RefPtr aTableUpdate) { NS_ENSURE_ARG_POINTER(aTableUpdate); @@ -741,14 +512,15 @@ nsresult LookupCacheV4::WriteMetadata( rv = WriteValue(outputStream, aTableUpdate->ClientState()); NS_ENSURE_SUCCESS(rv, rv); - // Write the SHA256 hash. - rv = WriteValue(outputStream, aTableUpdate->SHA256()); + // Write the checksum. + rv = WriteValue(outputStream, aTableUpdate->Checksum()); NS_ENSURE_SUCCESS(rv, rv); return rv; } -nsresult LookupCacheV4::LoadMetadata(nsACString& aState, nsACString& aSHA256) { +nsresult LookupCacheV4::LoadMetadata(nsACString& aState, + nsACString& aChecksum) { nsCOMPtr metaFile; nsresult rv = mStoreDirectory->Clone(getter_AddRefs(metaFile)); NS_ENSURE_SUCCESS(rv, rv); @@ -771,10 +543,10 @@ nsresult LookupCacheV4::LoadMetadata(nsACString& aState, nsACString& aSHA256) { return rv; } - // Read the SHA256 hash. - rv = ReadValue(localInFile, aSHA256); + // Read the checksum. + rv = ReadValue(localInFile, aChecksum); if (NS_FAILED(rv)) { - LOG(("Failed to read SHA256 hash.")); + LOG(("Failed to read checksum.")); return rv; } diff --git a/toolkit/components/url-classifier/LookupCacheV4.h b/toolkit/components/url-classifier/LookupCacheV4.h index 66c5475396b58..e3ef80c67fcbd 100644 --- a/toolkit/components/url-classifier/LookupCacheV4.h +++ b/toolkit/components/url-classifier/LookupCacheV4.h @@ -25,9 +25,6 @@ class LookupCacheV4 final : public LookupCache { virtual nsresult Has(const Completion& aCompletion, bool* aHas, uint32_t* aMatchLength, bool* aConfirmed) override; - virtual nsresult StoreToFile(nsCOMPtr& aFile) override; - virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; - virtual bool IsEmpty() const override; nsresult Build(PrefixStringMap& aPrefixMap); @@ -50,25 +47,16 @@ class LookupCacheV4 final : public LookupCache { protected: virtual nsresult ClearPrefixes() override; + virtual nsresult StoreToFile(nsCOMPtr& aFile) override; + virtual nsresult LoadFromFile(nsCOMPtr& aFile) override; virtual size_t SizeOfPrefixSet() const override; - virtual nsCString GetPrefixSetSuffix() const override; - nsCString GetMetadataSuffix() const; private: ~LookupCacheV4() {} virtual int Ver() const override { return VER; } - virtual nsresult LoadLegacyFile() override; - - struct Header { - uint32_t magic; - uint32_t version; - }; - - nsresult SanityCheck(const Header& aHeader); - nsresult VerifyCRC32(nsCOMPtr& aIn); - nsresult CleanOldPrefixSet(); + nsresult VerifyChecksum(const nsACString& aChecksum); RefPtr mVLPrefixSet; }; diff --git a/toolkit/components/url-classifier/ProtocolParser.cpp b/toolkit/components/url-classifier/ProtocolParser.cpp index 91318aa7ff349..e0f28191ecacf 100644 --- a/toolkit/components/url-classifier/ProtocolParser.cpp +++ b/toolkit/components/url-classifier/ProtocolParser.cpp @@ -829,7 +829,7 @@ nsresult ProtocolParserProtobuf::ProcessOneResponse( tuV4->SetNewClientState(state); if (aResponse.has_checksum()) { - tuV4->SetSHA256(aResponse.checksum().sha256()); + tuV4->NewChecksum(aResponse.checksum().sha256()); } PARSER_LOG( diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp index bccea09af372a..67534a491b2c2 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp @@ -204,18 +204,91 @@ nsresult VariableLengthPrefixSet::IsEmpty(bool* aEmpty) const { return NS_OK; } -nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { +nsresult VariableLengthPrefixSet::LoadFromFile(nsCOMPtr& aFile) { + MutexAutoLock lock(mLock); + + NS_ENSURE_ARG_POINTER(aFile); + + Telemetry::AutoTimer timer; + + nsCOMPtr localInFile; + nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, + PR_RDONLY | nsIFile::OS_READAHEAD); + NS_ENSURE_SUCCESS(rv, rv); + + // Calculate how big the file is, make sure our read buffer isn't bigger + // than the file itself which is just wasting memory. + int64_t fileSize; + rv = aFile->GetFileSize(&fileSize); + NS_ENSURE_SUCCESS(rv, rv); + + if (fileSize < 0 || fileSize > UINT32_MAX) { + return NS_ERROR_FAILURE; + } + + uint32_t bufferSize = + std::min(static_cast(fileSize), MAX_BUFFER_SIZE); + + // Convert to buffered stream + nsCOMPtr in; + rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), + bufferSize); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mFixedPrefixSet->LoadPrefixes(in); + NS_ENSURE_SUCCESS(rv, rv); + + rv = LoadPrefixes(in); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; + ; +} + +nsresult VariableLengthPrefixSet::StoreToFile(nsCOMPtr& aFile) const { + NS_ENSURE_ARG_POINTER(aFile); + MutexAutoLock lock(mLock); - // First read prefixes from fixed-length prefix set - nsresult rv = mFixedPrefixSet->LoadPrefixes(in); + nsCOMPtr localOutFile; + nsresult rv = + NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, + PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); NS_ENSURE_SUCCESS(rv, rv); - // Then read prefixes from variable-length prefix set + uint32_t fileSize = 0; + // Preallocate the file storage + { + nsCOMPtr fos(do_QueryInterface(localOutFile)); + Telemetry::AutoTimer timer; + + fileSize += mFixedPrefixSet->CalculatePreallocateSize(); + fileSize += CalculatePreallocateSize(); + + Unused << fos->Preallocate(fileSize); + } + + // Convert to buffered stream + nsCOMPtr out; + rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), + std::min(fileSize, MAX_BUFFER_SIZE)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mFixedPrefixSet->WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + rv = WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { uint32_t magic; uint32_t read; - rv = in->Read(reinterpret_cast(&magic), sizeof(uint32_t), &read); + nsresult rv = + in->Read(reinterpret_cast(&magic), sizeof(uint32_t), &read); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(read == sizeof(uint32_t), NS_ERROR_FAILURE); @@ -276,10 +349,6 @@ nsresult VariableLengthPrefixSet::LoadPrefixes(nsCOMPtr& in) { uint32_t VariableLengthPrefixSet::CalculatePreallocateSize() const { uint32_t fileSize = 0; - // Size of fixed length prefix set. - fileSize += mFixedPrefixSet->CalculatePreallocateSize(); - - // Size of variable length prefix set. // Store how many prefix string. fileSize += sizeof(uint32_t); @@ -294,17 +363,10 @@ uint32_t VariableLengthPrefixSet::CalculatePreallocateSize() const { nsresult VariableLengthPrefixSet::WritePrefixes( nsCOMPtr& out) const { - MutexAutoLock lock(mLock); - - // First, write fixed length prefix set - nsresult rv = mFixedPrefixSet->WritePrefixes(out); - NS_ENSURE_SUCCESS(rv, rv); - - // Then, write variable length prefix set uint32_t written; uint32_t writelen = sizeof(uint32_t); uint32_t magic = PREFIXSET_VERSION_MAGIC; - rv = out->Write(reinterpret_cast(&magic), writelen, &written); + nsresult rv = out->Write(reinterpret_cast(&magic), writelen, &written); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(written == writelen, NS_ERROR_FAILURE); diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.h b/toolkit/components/url-classifier/VariableLengthPrefixSet.h index 37f919358b554..65fe6c27b332f 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.h +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.h @@ -30,10 +30,8 @@ class VariableLengthPrefixSet final : public nsIMemoryReporter { nsresult GetFixedLengthPrefixes(FallibleTArray& aPrefixes); nsresult Matches(const nsACString& aFullHash, uint32_t* aLength) const; nsresult IsEmpty(bool* aEmpty) const; - - nsresult WritePrefixes(nsCOMPtr& out) const; - nsresult LoadPrefixes(nsCOMPtr& in); - uint32_t CalculatePreallocateSize() const; + nsresult LoadFromFile(nsCOMPtr& aFile); + nsresult StoreToFile(nsCOMPtr& aFile) const; size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; @@ -49,6 +47,10 @@ class VariableLengthPrefixSet final : public nsIMemoryReporter { bool BinarySearch(const nsACString& aFullHash, const nsACString& aPrefixes, uint32_t aPrefixSize) const; + uint32_t CalculatePreallocateSize() const; + nsresult WritePrefixes(nsCOMPtr& out) const; + nsresult LoadPrefixes(nsCOMPtr& in); + // Lock to prevent races between the url-classifier thread (which does most // of the operations) and the main thread (which does memory reporting). // It should be held for all operations between Init() and destruction that diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp index f3488480eae69..3c55cb9c5cffa 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp @@ -7,7 +7,6 @@ #include "nsIFile.h" #include "nsISupportsImpl.h" #include "nsCheckSummedOutputStream.h" -#include "crc32c.h" //////////////////////////////////////////////////////////////////////////////// // nsCheckSummedOutputStream @@ -52,36 +51,3 @@ nsCheckSummedOutputStream::Write(const char *buf, uint32_t count, } //////////////////////////////////////////////////////////////////////////////// -// nsCrc32CheckSumedOutputStream -NS_IMPL_ISUPPORTS_INHERITED(nsCrc32CheckSumedOutputStream, - nsBufferedOutputStream, nsISafeOutputStream) - -NS_IMETHODIMP -nsCrc32CheckSumedOutputStream::Init(nsIOutputStream *stream, - uint32_t bufferSize) { - mCheckSum = ~0; - - return nsBufferedOutputStream::Init(stream, bufferSize); -} - -NS_IMETHODIMP -nsCrc32CheckSumedOutputStream::Finish() { - uint32_t written; - nsresult rv = nsBufferedOutputStream::Write( - reinterpret_cast(&mCheckSum), sizeof(mCheckSum), &written); - NS_ASSERTION(written == sizeof(mCheckSum), "Error writing stream checksum"); - NS_ENSURE_SUCCESS(rv, rv); - - return nsBufferedOutputStream::Finish(); -} - -NS_IMETHODIMP -nsCrc32CheckSumedOutputStream::Write(const char *buf, uint32_t count, - uint32_t *result) { - mCheckSum = - ComputeCrc32c(mCheckSum, reinterpret_cast(buf), count); - - return nsBufferedOutputStream::Write(buf, count, result); -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h index f698d0dc0563a..b8dd79543920b 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h @@ -53,36 +53,4 @@ inline nsresult NS_NewCheckSummedOutputStream(nsIOutputStream **result, return rv; } -class nsCrc32CheckSumedOutputStream : public nsBufferedOutputStream { - public: - NS_DECL_ISUPPORTS_INHERITED - - static const uint32_t CHECKSUM_SIZE = 4; - - nsCrc32CheckSumedOutputStream() = default; - - NS_IMETHOD Finish() override; - NS_IMETHOD Write(const char *buf, uint32_t count, uint32_t *result) override; - NS_IMETHOD Init(nsIOutputStream *stream, uint32_t bufferSize) override; - - protected: - virtual ~nsCrc32CheckSumedOutputStream() { nsBufferedOutputStream::Close(); } - - uint32_t mCheckSum; -}; - -inline nsresult NS_NewCrc32OutputStream( - nsIOutputStream **aResult, already_AddRefed aOutput, - uint32_t aBufferSize) { - nsCOMPtr out = std::move(aOutput); - - nsCOMPtr bufferOutput = - new nsCrc32CheckSumedOutputStream(); - nsresult rv = bufferOutput->Init(out, aBufferSize); - if (NS_SUCCEEDED(rv)) { - bufferOutput.forget(aResult); - } - return rv; -} - #endif diff --git a/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl b/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl index 6ccb5ae7d109a..7e1a527d76f35 100644 --- a/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl +++ b/toolkit/components/url-classifier/nsIUrlClassifierPrefixSet.idl @@ -24,4 +24,6 @@ interface nsIUrlClassifierPrefixSet : nsISupports // Do a lookup in the PrefixSet, return whether the value is present. boolean contains(in unsigned long aPrefix); boolean isEmpty(); + void loadFromFile(in nsIFile aFile); + void storeToFile(in nsIFile aFile); }; diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index 51b1f86c44324..e25ffd9c0cdb2 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -12,13 +12,16 @@ #include "nsPrintfCString.h" #include "nsTArray.h" #include "nsString.h" +#include "nsIFile.h" #include "nsTArray.h" #include "nsThreadUtils.h" #include "nsNetUtil.h" #include "nsISeekableStream.h" #include "nsIBufferedStreams.h" +#include "nsIFileStreams.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Telemetry.h" +#include "mozilla/FileUtils.h" #include "mozilla/Logging.h" #include "mozilla/Unused.h" #include @@ -342,10 +345,83 @@ nsUrlClassifierPrefixSet::IsEmpty(bool* aEmpty) { return NS_OK; } -nsresult nsUrlClassifierPrefixSet::LoadPrefixes(nsCOMPtr& in) { +NS_IMETHODIMP +nsUrlClassifierPrefixSet::LoadFromFile(nsIFile* aFile) { + MutexAutoLock lock(mLock); + + Telemetry::AutoTimer timer; + + nsCOMPtr localInFile; + nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, + PR_RDONLY | nsIFile::OS_READAHEAD); + NS_ENSURE_SUCCESS(rv, rv); + + // Calculate how big the file is, make sure our read buffer isn't bigger + // than the file itself which is just wasting memory. + int64_t fileSize; + rv = aFile->GetFileSize(&fileSize); + NS_ENSURE_SUCCESS(rv, rv); + + if (fileSize < 0 || fileSize > UINT32_MAX) { + return NS_ERROR_FAILURE; + } + + uint32_t bufferSize = + std::min(static_cast(fileSize), MAX_BUFFER_SIZE); + + // Convert to buffered stream + nsCOMPtr in; + rv = NS_NewBufferedInputStream(getter_AddRefs(in), localInFile.forget(), + bufferSize); + NS_ENSURE_SUCCESS(rv, rv); + + rv = LoadPrefixes(in); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +NS_IMETHODIMP +nsUrlClassifierPrefixSet::StoreToFile(nsIFile* aFile) { MutexAutoLock lock(mLock); + nsCOMPtr localOutFile; + nsresult rv = + NS_NewLocalFileOutputStream(getter_AddRefs(localOutFile), aFile, + PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE); + NS_ENSURE_SUCCESS(rv, rv); + + uint32_t fileSize; + + // Preallocate the file storage + { + nsCOMPtr fos(do_QueryInterface(localOutFile)); + Telemetry::AutoTimer timer; + + fileSize = CalculatePreallocateSize(); + + // Ignore failure, the preallocation is a hint and we write out the entire + // file later on + Unused << fos->Preallocate(fileSize); + } + + // Convert to buffered stream + nsCOMPtr out; + rv = NS_NewBufferedOutputStream(getter_AddRefs(out), localOutFile.forget(), + std::min(fileSize, MAX_BUFFER_SIZE)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = WritePrefixes(out); + NS_ENSURE_SUCCESS(rv, rv); + + LOG(("[%s] Storing PrefixSet successful", mName.get())); + + return NS_OK; +} + +nsresult nsUrlClassifierPrefixSet::LoadPrefixes(nsCOMPtr& in) { mCanary.Check(); + Clear(); uint32_t magic; @@ -442,8 +518,6 @@ uint32_t nsUrlClassifierPrefixSet::CalculatePreallocateSize() const { nsresult nsUrlClassifierPrefixSet::WritePrefixes( nsCOMPtr& out) const { - MutexAutoLock lock(mLock); - mCanary.Check(); // In Bug 1362761, crashes happened while reading mIndexDeltas[i]. diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h index 1e1e9c1e5f654..c51523719802e 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h @@ -39,11 +39,10 @@ class nsUrlClassifierPrefixSet final : public nsIUrlClassifierPrefixSet, NS_IMETHOD GetPrefixes(uint32_t* aCount, uint32_t** aPrefixes) override; NS_IMETHOD Contains(uint32_t aPrefix, bool* aFound) override; NS_IMETHOD IsEmpty(bool* aEmpty) override; + NS_IMETHOD LoadFromFile(nsIFile* aFile) override; + NS_IMETHOD StoreToFile(nsIFile* aFile) override; nsresult GetPrefixesNative(FallibleTArray& outArray); - nsresult WritePrefixes(nsCOMPtr& out) const; - nsresult LoadPrefixes(nsCOMPtr& in); - uint32_t CalculatePreallocateSize() const; size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; @@ -64,6 +63,9 @@ class nsUrlClassifierPrefixSet final : public nsIUrlClassifierPrefixSet, nsresult MakePrefixSet(const uint32_t* aArray, uint32_t aLength); uint32_t BinSearch(uint32_t start, uint32_t end, uint32_t target) const; bool IsEmptyInternal() const; + uint32_t CalculatePreallocateSize() const; + nsresult WritePrefixes(nsCOMPtr& out) const; + nsresult LoadPrefixes(nsCOMPtr& in); // Lock to prevent races between the url-classifier thread (which does most // of the operations) and the main thread (which does memory reporting). diff --git a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp b/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp index db8bbb40f7300..b31860fd70237 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp @@ -8,7 +8,7 @@ using namespace mozilla; using namespace mozilla::safebrowsing; static const char* kFilesInV2[] = {".pset", ".sbstore"}; -static const char* kFilesInV4[] = {".vlpset", ".metadata"}; +static const char* kFilesInV4[] = {".pset", ".metadata"}; #define V2_TABLE "gtest-malware-simple" #define V4_TABLE1 "goog-malware-proto" @@ -63,7 +63,7 @@ TEST(UrlClassifierFailUpdate, CheckTableReset) { ApplyUpdate(update); - // A successful V4 update should create .vlpset & .metadata files + // A successful V4 update should create .pset & .metadata files CheckFileExist(V4_TABLE1, kFilesInV4, true); } diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp index cfffef4b8c44d..383c14b6bb197 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp @@ -21,7 +21,7 @@ typedef nsTArray<_Prefix> _PrefixArray; #define GTEST_SAFEBROWSING_DIR NS_LITERAL_CSTRING("safebrowsing") #define GTEST_TABLE NS_LITERAL_CSTRING("gtest-malware-proto") -#define GTEST_PREFIXFILE NS_LITERAL_CSTRING("gtest-malware-proto.vlpset") +#define GTEST_PREFIXFILE NS_LITERAL_CSTRING("gtest-malware-proto.pset") // This function removes common elements of inArray and outArray from // outArray. This is used by partial update testcase to ensure partial update @@ -54,7 +54,7 @@ static void MergeAndSortArray(const _PrefixArray& array1, output.Sort(); } -static void CalculateSHA256(_PrefixArray& prefixArray, nsCString& sha256) { +static void CalculateCheckSum(_PrefixArray& prefixArray, nsCString& checksum) { prefixArray.Sort(); nsresult rv; @@ -68,7 +68,7 @@ static void CalculateSHA256(_PrefixArray& prefixArray, nsCString& sha256) { reinterpret_cast(const_cast(prefix.get())), prefix.Length()); } - cryptoHash->Finish(false, sha256); + cryptoHash->Finish(false, checksum); } // N: Number of prefixes, MIN/MAX: minimum/maximum prefix size @@ -114,7 +114,7 @@ static void CreateRandomRemovalIndices(uint32_t N, uint32_t MAX, // Function to generate TableUpdateV4. static void GenerateUpdateData(bool fullUpdate, PrefixStringMap& add, - nsTArray* removal, nsCString* sha256, + nsTArray* removal, nsCString* checksum, TableUpdateArray& tableUpdates) { RefPtr tableUpdate = new TableUpdateV4(GTEST_TABLE); tableUpdate->SetFullUpdate(fullUpdate); @@ -128,12 +128,12 @@ static void GenerateUpdateData(bool fullUpdate, PrefixStringMap& add, tableUpdate->NewRemovalIndices(removal->Elements(), removal->Length()); } - if (sha256) { - std::string stdSHA256; - stdSHA256.assign(const_cast(sha256->BeginReading()), - sha256->Length()); + if (checksum) { + std::string stdChecksum; + stdChecksum.assign(const_cast(checksum->BeginReading()), + checksum->Length()); - tableUpdate->SetSHA256(stdSHA256); + tableUpdate->NewChecksum(stdChecksum); } tableUpdates.AppendElement(tableUpdate); @@ -143,17 +143,16 @@ static void VerifyPrefixSet(PrefixStringMap& expected) { // Verify the prefix set is written to disk. nsCOMPtr file; NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->AppendNative(GTEST_SAFEBROWSING_DIR); - - RefPtr lookup = - new LookupCacheV4(GTEST_TABLE, NS_LITERAL_CSTRING("test"), file); - lookup->Init(); + file->AppendNative(GTEST_SAFEBROWSING_DIR); file->AppendNative(GTEST_PREFIXFILE); - lookup->LoadFromFile(file); + + RefPtr load = new VariableLengthPrefixSet; + load->Init(GTEST_TABLE); PrefixStringMap prefixesInFile; - lookup->GetPrefixes(prefixesInFile); + load->LoadFromFile(file); + load->GetPrefixes(prefixesInFile); for (auto iter = expected.ConstIter(); !iter.Done(); iter.Next()) { nsCString* expectedPrefix = iter.Data(); @@ -201,18 +200,18 @@ static void testUpdate(TableUpdateArray& tableUpdates, VerifyPrefixSet(expected); } -static void testFullUpdate(PrefixStringMap& add, nsCString* sha256) { +static void testFullUpdate(PrefixStringMap& add, nsCString* checksum) { TableUpdateArray tableUpdates; - GenerateUpdateData(true, add, nullptr, sha256, tableUpdates); + GenerateUpdateData(true, add, nullptr, checksum, tableUpdates); testUpdate(tableUpdates, add); } static void testPartialUpdate(PrefixStringMap& add, nsTArray* removal, - nsCString* sha256, PrefixStringMap& expected) { + nsCString* checksum, PrefixStringMap& expected) { TableUpdateArray tableUpdates; - GenerateUpdateData(false, add, removal, sha256, tableUpdates); + GenerateUpdateData(false, add, removal, checksum, tableUpdates); testUpdate(tableUpdates, expected); } @@ -234,32 +233,32 @@ static void testOpenLookupCache() { } // Tests start from here. -TEST(UrlClassifierTableUpdateV4, FixLengthPSetFullUpdate) { +TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate) { srand(time(NULL)); _PrefixArray array; PrefixStringMap map; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, array); PrefixArrayToPrefixStringMap(array, map); - CalculateSHA256(array, sha256); + CalculateCheckSum(array, checksum); - testFullUpdate(map, &sha256); + testFullUpdate(map, &checksum); Clear(); } -TEST(UrlClassifierTableUpdateV4, VariableLengthPSetFullUpdate) { +TEST(UrlClassifierTableUpdateV4, VariableLenghtPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateSHA256(array, sha256); + CalculateCheckSum(array, checksum); - testFullUpdate(map, &sha256); + testFullUpdate(map, &checksum); Clear(); } @@ -268,14 +267,14 @@ TEST(UrlClassifierTableUpdateV4, VariableLengthPSetFullUpdate) { TEST(UrlClassifierTableUpdateV4, MixedPSetFullUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, array); CreateRandomSortedPrefixArray(1000, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateSHA256(array, sha256); + CalculateCheckSum(array, checksum); - testFullUpdate(map, &sha256); + testFullUpdate(map, &checksum); Clear(); } @@ -286,21 +285,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply a partial update with removal. { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); @@ -315,9 +314,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithRemoval) { // Calculate the expected prefix map. MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - testPartialUpdate(pMap, &removal, &sha256, mergedMap); + testPartialUpdate(pMap, &removal, &checksum, mergedMap); } Clear(); @@ -329,21 +328,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithoutRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply a partial update without removal { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); @@ -353,9 +352,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateWithoutRemoval) { // Calculate the expected prefix map. MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - testPartialUpdate(pMap, nullptr, &sha256, mergedMap); + testPartialUpdate(pMap, nullptr, &checksum, mergedMap); } Clear(); @@ -369,13 +368,13 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdatePrefixAlreadyExist) { // Apply a full update fist. { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply a partial update which contains a prefix in previous full update. @@ -402,14 +401,14 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdatePrefixAlreadyExist) { TEST(UrlClassifierTableUpdateV4, OnlyPartialUpdate) { _PrefixArray pArray; PrefixStringMap pMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, pArray); CreateRandomSortedPrefixArray(1000, 5, 32, pArray); PrefixArrayToPrefixStringMap(pArray, pMap); - CalculateSHA256(pArray, sha256); + CalculateCheckSum(pArray, checksum); - testPartialUpdate(pMap, nullptr, &sha256, pMap); + testPartialUpdate(pMap, nullptr, &checksum, pMap); Clear(); } @@ -421,21 +420,21 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { // Apply a full update first. { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(5000, 4, 4, fArray); CreateRandomSortedPrefixArray(1000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply a partial update without add prefix, only contain removal indices. { _PrefixArray pArray; PrefixStringMap pMap, mergedMap; - nsCString sha256; + nsCString checksum; // Remove 1/5 of elements of original prefix set. nsTArray removal; @@ -443,9 +442,9 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { RemoveElements(removal, fArray); PrefixArrayToPrefixStringMap(fArray, mergedMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testPartialUpdate(pMap, &removal, &sha256, mergedMap); + testPartialUpdate(pMap, &removal, &checksum, mergedMap); } Clear(); @@ -455,7 +454,7 @@ TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval) { TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { _PrefixArray fArray, pArray, mergedArray; PrefixStringMap fMap, pMap, mergedMap; - nsCString sha256; + nsCString checksum; TableUpdateArray tableUpdates; @@ -463,9 +462,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(2000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - GenerateUpdateData(true, fMap, nullptr, &sha256, tableUpdates); + GenerateUpdateData(true, fMap, nullptr, &checksum, tableUpdates); // Generate second partial update CreateRandomSortedPrefixArray(3000, 4, 4, pArray); @@ -474,9 +473,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { PrefixArrayToPrefixStringMap(pArray, pMap); MergeAndSortArray(fArray, pArray, mergedArray); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - GenerateUpdateData(false, pMap, nullptr, &sha256, tableUpdates); + GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates); // Generate thrid partial update fArray.AppendElements(pArray); @@ -494,9 +493,9 @@ TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates) { MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); testUpdate(tableUpdates, mergedMap); @@ -511,22 +510,22 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { // Apply a full update first { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; // Generate first full udpate CreateRandomSortedPrefixArray(10000, 4, 4, fArray); CreateRandomSortedPrefixArray(3000, 5, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply multiple partial updates in one table update { _PrefixArray pArray, mergedArray; PrefixStringMap pMap, mergedMap; - nsCString sha256; + nsCString checksum; nsTArray removal; TableUpdateArray tableUpdates; @@ -541,9 +540,9 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { RemoveElements(removal, fArray); MergeAndSortArray(fArray, pArray, mergedArray); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); fArray.AppendElements(pArray); fArray.Sort(); @@ -562,9 +561,9 @@ TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates) { MergeAndSortArray(fArray, pArray, mergedArray); PrefixArrayToPrefixStringMap(mergedArray, mergedMap); - CalculateSHA256(mergedArray, sha256); + CalculateCheckSum(mergedArray, checksum); - GenerateUpdateData(false, pMap, &removal, &sha256, tableUpdates); + GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates); testUpdate(tableUpdates, mergedMap); } @@ -579,13 +578,13 @@ TEST(UrlClassifierTableUpdateV4, RemovalIndexTooLarge) { // Apply a full update first { PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } // Apply a partial update with removal indice array larger than @@ -616,31 +615,31 @@ TEST(UrlClassifierTableUpdateV4, ChecksumMismatch) { { _PrefixArray fArray; PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); } - // Apply a partial update with incorrect sha256 + // Apply a partial update with incorrect checksum { _PrefixArray pArray; PrefixStringMap pMap; - nsCString sha256; + nsCString checksum; TableUpdateArray tableUpdates; CreateRandomSortedPrefixArray(200, 4, 32, pArray); PrefixArrayToPrefixStringMap(pArray, pMap); - // sha256 should be calculated with both old prefix set and add prefix - // set, here we only calculate sha256 with add prefix set to check if + // Checksum should be calculated with both old prefix set and add prefix + // set, here we only calculate checksum with add prefix set to check if // applyUpdate will return failure. - CalculateSHA256(pArray, sha256); + CalculateCheckSum(pArray, checksum); - GenerateUpdateData(false, pMap, nullptr, &sha256, tableUpdates); + GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates); testUpdateFail(tableUpdates); } @@ -648,25 +647,25 @@ TEST(UrlClassifierTableUpdateV4, ChecksumMismatch) { } TEST(UrlClassifierTableUpdateV4, ApplyUpdateThenLoad) { - // Apply update with sha256 + // Apply update with checksum { _PrefixArray fArray; PrefixStringMap fMap; - nsCString sha256; + nsCString checksum; CreateRandomSortedPrefixArray(1000, 4, 32, fArray); PrefixArrayToPrefixStringMap(fArray, fMap); - CalculateSHA256(fArray, sha256); + CalculateCheckSum(fArray, checksum); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); - // Open lookup cache will load prefix set and verify the sha256 + // Open lookup cache will load prefix set and verify the checksum testOpenLookupCache(); } Clear(); - // Apply update without sha256 + // Apply update without checksum { _PrefixArray fArray; PrefixStringMap fMap; @@ -707,15 +706,15 @@ TEST(UrlClassifierTableUpdateV4, ApplyUpdateWithFixedChecksum) { PrefixStringMap fMap; PrefixArrayToPrefixStringMap(fArray, fMap); - nsCString sha256( + nsCString checksum( "\xae\x18\x94\xd7\xd0\x83\x5f\xc1" "\x58\x59\x5c\x2c\x72\xb9\x6e\x5e" "\xf4\xe8\x0a\x6b\xff\x5e\x6b\x81" "\x65\x34\x06\x16\x06\x59\xa0\x67"); - testFullUpdate(fMap, &sha256); + testFullUpdate(fMap, &checksum); - // Open lookup cache will load prefix set and verify the sha256 + // Open lookup cache will load prefix set and verify the checksum testOpenLookupCache(); Clear(); @@ -729,27 +728,27 @@ TEST(UrlClassifierTableUpdateV4, EmptyUpdate) { _PrefixArray array; PrefixStringMap map; - nsCString sha256; + nsCString checksum; - CalculateSHA256(array, sha256); + CalculateCheckSum(array, checksum); // Test apply empty full/partial update before we already // have data in DB. - testFullUpdate(emptyAddition, &sha256); - testPartialUpdate(emptyAddition, &emptyRemoval, &sha256, map); + testFullUpdate(emptyAddition, &checksum); + testPartialUpdate(emptyAddition, &emptyRemoval, &checksum, map); // Apply an full update. CreateRandomSortedPrefixArray(100, 4, 4, array); CreateRandomSortedPrefixArray(10, 5, 32, array); PrefixArrayToPrefixStringMap(array, map); - CalculateSHA256(array, sha256); + CalculateCheckSum(array, checksum); - testFullUpdate(map, &sha256); + testFullUpdate(map, &checksum); // Test apply empty full/partial update when we already // have data in DB - testPartialUpdate(emptyAddition, &emptyRemoval, &sha256, map); - testFullUpdate(emptyAddition, &sha256); + testPartialUpdate(emptyAddition, &emptyRemoval, &checksum, map); + testFullUpdate(emptyAddition, &checksum); Clear(); } @@ -763,15 +762,16 @@ TEST(UrlClassifierTableUpdateV4, EmptyUpdate2) { CreateRandomSortedPrefixArray(10, 5, 32, array); RefPtr cache = SetupLookupCache(array); - // Setup TableUpdate object with only sha256 from previous update(initial + // Setup TableUpdate object with only checksum from previous update(initial // data). - nsCString sha256; - CalculateSHA256(array, sha256); - std::string stdSHA256; - stdSHA256.assign(const_cast(sha256.BeginReading()), sha256.Length()); + nsCString checksum; + CalculateCheckSum(array, checksum); + std::string stdChecksum; + stdChecksum.assign(const_cast(checksum.BeginReading()), + checksum.Length()); RefPtr tableUpdate = new TableUpdateV4(GTEST_TABLE); - tableUpdate->SetSHA256(stdSHA256); + tableUpdate->NewChecksum(stdChecksum); // Apply update directly through LookupCache interface PrefixStringMap input, output; diff --git a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp index d26e366a3421c..74c52f9890acd 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp @@ -17,11 +17,11 @@ typedef nsCString _Prefix; typedef nsTArray<_Prefix> _PrefixArray; // Create fullhash by appending random characters. -static nsCString CreateFullHash(const nsACString& in) { - nsCString out(in); - out.SetLength(32); +static nsCString* CreateFullHash(const nsACString& in) { + nsCString* out = new nsCString(in); + out->SetLength(32); for (size_t i = in.Length(); i < 32; i++) { - out.SetCharAt(char(rand() % 256), i); + out->SetCharAt(char(rand() % 256), i); } return out; @@ -55,9 +55,10 @@ static void RandomPrefixes(uint32_t N, uint32_t MIN, uint32_t MAX, } } -static void CheckContent(LookupCacheV4* cache, PrefixStringMap& expected) { +static void CheckContent(VariableLengthPrefixSet* pset, + PrefixStringMap& expected) { PrefixStringMap vlPSetMap; - cache->GetPrefixes(vlPSetMap); + pset->GetPrefixes(vlPSetMap); for (auto iter = vlPSetMap.Iter(); !iter.Done(); iter.Next()) { nsCString* expectedPrefix = expected.Get(iter.Key()); @@ -70,16 +71,15 @@ static void CheckContent(LookupCacheV4* cache, PrefixStringMap& expected) { // This test loops through all the prefixes and converts each prefix to // fullhash by appending random characters, each converted fullhash // should at least match its original length in the prefixSet. -static void DoExpectedLookup(LookupCacheV4* cache, _PrefixArray& array) { +static void DoExpectedLookup(VariableLengthPrefixSet* pset, + _PrefixArray& array) { uint32_t matchLength = 0; for (uint32_t i = 0; i < array.Length(); i++) { const nsCString& prefix = array[i]; - Completion complete; - complete.Assign(CreateFullHash(prefix)); + UniquePtr fullhash(CreateFullHash(prefix)); // Find match for prefix-generated full hash - bool has, confirmed; - cache->Has(complete, &has, &matchLength, &confirmed); + pset->Matches(*fullhash, &matchLength); MOZ_ASSERT(matchLength != 0); if (matchLength != prefix.Length()) { @@ -93,7 +93,8 @@ static void DoExpectedLookup(LookupCacheV4* cache, _PrefixArray& array) { continue; } - if (0 == memcmp(complete.buf, array[j].BeginReading(), matchLength)) { + if (0 == memcmp(fullhash->BeginReading(), array[j].BeginReading(), + matchLength)) { found = true; break; } @@ -103,7 +104,7 @@ static void DoExpectedLookup(LookupCacheV4* cache, _PrefixArray& array) { } } -static void DoRandomLookup(LookupCacheV4* cache, uint32_t N, +static void DoRandomLookup(VariableLengthPrefixSet* pset, uint32_t N, _PrefixArray& array) { for (uint32_t i = 0; i < N; i++) { // Random 32-bytes test fullhash @@ -121,11 +122,8 @@ static void DoRandomLookup(LookupCacheV4* cache, uint32_t N, } } - Completion complete; - complete.Assign(nsDependentCSubstring(buf, 32)); - bool has, confirmed; uint32_t matchLength = 0; - cache->Has(complete, &has, &matchLength, &confirmed); + pset->Matches(nsDependentCSubstring(buf, 32), &matchLength); ASSERT_TRUE(expected.IsEmpty() ? !matchLength : expected.Contains(matchLength)); @@ -170,23 +168,12 @@ static void SetupPrefixMap(const _PrefixArray& array, PrefixStringMap& map) { } } -static already_AddRefed SetupLookupCache( - const nsACString& aName) { - nsCOMPtr rootDir; - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(rootDir)); - - nsAutoCString provider("test"); - RefPtr lookup = new LookupCacheV4(aName, provider, rootDir); - lookup->Init(); - - return lookup.forget(); -} - // Test setting prefix set with only 4-bytes prefixes TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { srand(time(nullptr)); - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -195,11 +182,13 @@ TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { }; SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); + + DoExpectedLookup(pset, array); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + DoRandomLookup(pset, 1000, array); + + CheckContent(pset, map); // Run random test array.Clear(); @@ -208,16 +197,19 @@ TEST(UrlClassifierVLPrefixSet, FixedLengthSet) { RandomPrefixes(1500, 4, 4, array); SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); + + DoExpectedLookup(pset, array); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + DoRandomLookup(pset, 1000, array); + + CheckContent(pset, map); } // Test setting prefix set with only 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -231,11 +223,13 @@ TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { _Prefix("yankee"), _Prefix("ZuluZuluZuluZulu")}; SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); + + DoExpectedLookup(pset, array); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + DoRandomLookup(pset, 1000, array); + + CheckContent(pset, map); // Run random test array.Clear(); @@ -244,16 +238,19 @@ TEST(UrlClassifierVLPrefixSet, VariableLengthSet) { RandomPrefixes(1500, 5, 32, array); SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); + + DoExpectedLookup(pset, array); + + DoRandomLookup(pset, 1000, array); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + CheckContent(pset, map); } // Test setting prefix set with both 4-bytes prefixes and 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = {_Prefix("enus"), @@ -276,11 +273,13 @@ TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { _Prefix("Stheno, Euryale and Medusa")}; SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); + + DoExpectedLookup(pset, array); + + DoRandomLookup(pset, 1000, array); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + CheckContent(pset, map); // Run random test array.Clear(); @@ -289,16 +288,19 @@ TEST(UrlClassifierVLPrefixSet, MixedPrefixSet) { RandomPrefixes(1500, 4, 32, array); SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + DoExpectedLookup(pset, array); + + DoRandomLookup(pset, 1000, array); + + CheckContent(pset, map); } // Test resetting prefix set TEST(UrlClassifierVLPrefixSet, ResetPrefix) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); // First prefix set _PrefixArray array1 = { @@ -311,9 +313,9 @@ TEST(UrlClassifierVLPrefixSet, ResetPrefix) { PrefixStringMap map; SetupPrefixMap(array1, map); - cache->Build(map); + pset->SetPrefixes(map); - DoExpectedLookup(cache, array1); + DoExpectedLookup(pset, array1); } // Second @@ -327,28 +329,25 @@ TEST(UrlClassifierVLPrefixSet, ResetPrefix) { PrefixStringMap map; SetupPrefixMap(array2, map); - cache->Build(map); + pset->SetPrefixes(map); - DoExpectedLookup(cache, array2); + DoExpectedLookup(pset, array2); } // Should not match any of the first prefix set uint32_t matchLength = 0; for (uint32_t i = 0; i < array1.Length(); i++) { - Completion complete; - complete.Assign(CreateFullHash(array1[i])); - - // Find match for prefix-generated full hash - bool has, confirmed; - cache->Has(complete, &has, &matchLength, &confirmed); + UniquePtr fullhash(CreateFullHash(array1[i])); + pset->Matches(*fullhash, &matchLength); ASSERT_TRUE(matchLength == 0); } } // Test only set one 4-bytes prefix and one full-length prefix TEST(UrlClassifierVLPrefixSet, TinyPrefixSet) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); PrefixStringMap map; _PrefixArray array = { @@ -357,47 +356,52 @@ TEST(UrlClassifierVLPrefixSet, TinyPrefixSet) { }; SetupPrefixMap(array, map); - cache->Build(map); + pset->SetPrefixes(map); - DoExpectedLookup(cache, array); - DoRandomLookup(cache, 1000, array); - CheckContent(cache, map); + DoExpectedLookup(pset, array); + + DoRandomLookup(pset, 1000, array); + + CheckContent(pset, map); } // Test empty prefix set and IsEmpty function TEST(UrlClassifierVLPrefixSet, EmptyPrefixSet) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); - bool empty = cache->IsEmpty(); + bool empty; + pset->IsEmpty(&empty); ASSERT_TRUE(empty); PrefixStringMap map; _PrefixArray array1; // Lookup an empty array should never match - DoRandomLookup(cache, 100, array1); + DoRandomLookup(pset, 100, array1); // Insert an 4-bytes prefix, then IsEmpty should return false _PrefixArray array2 = {_Prefix("test")}; SetupPrefixMap(array2, map); - cache->Build(map); + pset->SetPrefixes(map); - empty = cache->IsEmpty(); + pset->IsEmpty(&empty); ASSERT_TRUE(!empty); _PrefixArray array3 = {_Prefix("test variable length")}; // Insert an 5~32 bytes prefix, then IsEmpty should return false SetupPrefixMap(array3, map); - cache->Build(map); + pset->SetPrefixes(map); - empty = cache->IsEmpty(); + pset->IsEmpty(&empty); ASSERT_TRUE(!empty); } // Test prefix size should only between 4~32 bytes TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { - RefPtr cache = SetupLookupCache(NS_LITERAL_CSTRING("test")); + RefPtr pset = new VariableLengthPrefixSet; + pset->Init(NS_LITERAL_CSTRING("test")); PrefixStringMap map; { @@ -405,7 +409,7 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh")}; SetupPrefixMap(array, map); - nsresult rv = cache->Build(map); + nsresult rv = pset->SetPrefixes(map); ASSERT_TRUE(rv == NS_OK); } @@ -414,7 +418,7 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _PrefixArray array = {_Prefix("123")}; SetupPrefixMap(array, map); - nsresult rv = cache->Build(map); + nsresult rv = pset->SetPrefixes(map); ASSERT_TRUE(NS_FAILED(rv)); } @@ -423,171 +427,123 @@ TEST(UrlClassifierVLPrefixSet, MinMaxPrefixSet) { _PrefixArray array = {_Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh9")}; SetupPrefixMap(array, map); - nsresult rv = cache->Build(map); + nsresult rv = pset->SetPrefixes(map); ASSERT_TRUE(NS_FAILED(rv)); } } // Test save then load prefix set with only 4-bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSaveFixedLengthPrefixSet) { - nsCOMPtr file; + RefPtr save = new VariableLengthPrefixSet; + save->Init(NS_LITERAL_CSTRING("test-save")); + _PrefixArray array; + RandomPrefixes(10000, 4, 4, array); + PrefixStringMap map; + SetupPrefixMap(array, map); + save->SetPrefixes(map); - // Save - { - RefPtr save = - SetupLookupCache(NS_LITERAL_CSTRING("test-save")); + DoExpectedLookup(save, array); - RandomPrefixes(10000, 4, 4, array); + DoRandomLookup(save, 1000, array); - SetupPrefixMap(array, map); - save->Build(map); + CheckContent(save, map); + + nsCOMPtr file; + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); - DoExpectedLookup(save, array); - DoRandomLookup(save, 1000, array); - CheckContent(save, map); + save->StoreToFile(file); - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); - save->StoreToFile(file); - } + RefPtr load = new VariableLengthPrefixSet; + load->Init(NS_LITERAL_CSTRING("test-load")); - // Load - { - RefPtr load = - SetupLookupCache(NS_LITERAL_CSTRING("test-load")); - load->LoadFromFile(file); + load->LoadFromFile(file); - DoExpectedLookup(load, array); - DoRandomLookup(load, 1000, array); - CheckContent(load, map); - } + DoExpectedLookup(load, array); + + DoRandomLookup(load, 1000, array); + + CheckContent(load, map); file->Remove(false); } // Test save then load prefix set with only 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSaveVariableLengthPrefixSet) { - nsCOMPtr file; + RefPtr save = new VariableLengthPrefixSet; + save->Init(NS_LITERAL_CSTRING("test-save")); + _PrefixArray array; + RandomPrefixes(10000, 5, 32, array); + PrefixStringMap map; + SetupPrefixMap(array, map); + save->SetPrefixes(map); - // Save - { - RefPtr save = - SetupLookupCache(NS_LITERAL_CSTRING("test-save")); + DoExpectedLookup(save, array); - RandomPrefixes(10000, 5, 32, array); + DoRandomLookup(save, 1000, array); - SetupPrefixMap(array, map); - save->Build(map); + CheckContent(save, map); - DoExpectedLookup(save, array); - DoRandomLookup(save, 1000, array); - CheckContent(save, map); + nsCOMPtr file; + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); - save->StoreToFile(file); - } + save->StoreToFile(file); - // Load - { - RefPtr load = - SetupLookupCache(NS_LITERAL_CSTRING("test-load")); - load->LoadFromFile(file); + RefPtr load = new VariableLengthPrefixSet; + load->Init(NS_LITERAL_CSTRING("test-load")); - DoExpectedLookup(load, array); - DoRandomLookup(load, 1000, array); - CheckContent(load, map); - } + load->LoadFromFile(file); + + DoExpectedLookup(load, array); + + DoRandomLookup(load, 1000, array); + + CheckContent(load, map); file->Remove(false); } // Test save then load prefix with both 4 bytes prefixes and 5~32 bytes prefixes TEST(UrlClassifierVLPrefixSet, LoadSavePrefixSet) { - nsCOMPtr file; - _PrefixArray array; - PrefixStringMap map; - - // Save - { - RefPtr save = - SetupLookupCache(NS_LITERAL_CSTRING("test-save")); - - // Try to simulate the real case that most prefixes are 4bytes - RandomPrefixes(20000, 4, 4, array); - RandomPrefixes(1000, 5, 32, array); - - SetupPrefixMap(array, map); - save->Build(map); + RefPtr save = new VariableLengthPrefixSet; + save->Init(NS_LITERAL_CSTRING("test-save")); - DoExpectedLookup(save, array); - DoRandomLookup(save, 1000, array); - CheckContent(save, map); + // Try to simulate the real case that most prefixes are 4bytes + _PrefixArray array; + RandomPrefixes(20000, 4, 4, array); + RandomPrefixes(1000, 5, 32, array); - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); - save->StoreToFile(file); - } + PrefixStringMap map; + SetupPrefixMap(array, map); + save->SetPrefixes(map); - // Load - { - RefPtr load = - SetupLookupCache(NS_LITERAL_CSTRING("test-load")); - load->LoadFromFile(file); + DoExpectedLookup(save, array); - DoExpectedLookup(load, array); - DoRandomLookup(load, 1000, array); - CheckContent(load, map); - } + DoRandomLookup(save, 1000, array); - file->Remove(false); -} + CheckContent(save, map); -// This is for fixed-length prefixset -TEST(UrlClassifierVLPrefixSet, LoadSaveNoDelta) { nsCOMPtr file; - _PrefixArray array; - PrefixStringMap map; - - for (uint32_t i = 0; i < 100; i++) { - // construct a tree without deltas by making the distance - // between entries larger than 16 bits - uint32_t v = ((1 << 16) + 1) * i; - nsCString* ele = array.AppendElement(); - ele->AppendASCII(reinterpret_cast(&v), 4); - } + NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); + file->Append(NS_LITERAL_STRING("test.vlpset")); - // Save - { - RefPtr save = - SetupLookupCache(NS_LITERAL_CSTRING("test-save")); + save->StoreToFile(file); - SetupPrefixMap(array, map); - save->Build(map); + RefPtr load = new VariableLengthPrefixSet; + load->Init(NS_LITERAL_CSTRING("test-load")); - DoExpectedLookup(save, array); - DoRandomLookup(save, 1000, array); - CheckContent(save, map); + load->LoadFromFile(file); - NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file)); - file->Append(NS_LITERAL_STRING("test.vlpset")); - save->StoreToFile(file); - } + DoExpectedLookup(load, array); - // Load - { - RefPtr load = - SetupLookupCache(NS_LITERAL_CSTRING("test-load")); - load->LoadFromFile(file); + DoRandomLookup(load, 1000, array); - DoExpectedLookup(load, array); - DoRandomLookup(load, 1000, array); - CheckContent(load, map); - } + CheckContent(load, map); file->Remove(false); } diff --git a/toolkit/components/url-classifier/tests/unit/test_prefixset.js b/toolkit/components/url-classifier/tests/unit/test_prefixset.js index 8f24daadccd8a..f41ff1c8d8b36 100644 --- a/toolkit/components/url-classifier/tests/unit/test_prefixset.js +++ b/toolkit/components/url-classifier/tests/unit/test_prefixset.js @@ -140,6 +140,40 @@ function testReSetPrefixes() { checkContents(pset, secondPrefixes); } +function testLoadSaveLargeSet() { + let N = 1000; + let arr = []; + + for (let i = 0; i < N; i++) { + let randInt = Math.floor(Math.random() * Math.pow(2, 32)); + arr.push(randInt); + } + + arr.sort((x, y) => x - y); + + let pset = newPset(); + pset.setPrefixes(arr, arr.length); + + doExpectedLookups(pset, arr, 1); + doRandomLookups(pset, arr, 1000); + + checkContents(pset, arr); + + // Now try to save, restore, and redo the lookups + var file = Services.dirsvc.get("ProfLD", Ci.nsIFile); + file.append("testLarge.pset"); + + pset.storeToFile(file); + + let psetLoaded = newPset(); + psetLoaded.loadFromFile(file); + + doExpectedLookups(psetLoaded, arr, 1); + doRandomLookups(psetLoaded, arr, 1000); + + checkContents(psetLoaded, arr); +} + function testTinySet() { let pset = Cc["@mozilla.org/url-classifier/prefixset;1"] .createInstance(Ci.nsIUrlClassifierPrefixSet); @@ -156,11 +190,37 @@ function testTinySet() { checkContents(pset, prefixes); } +function testLoadSaveNoDelta() { + let N = 100; + let arr = []; + + for (let i = 0; i < N; i++) { + // construct a tree without deltas by making the distance + // between entries larger than 16 bits + arr.push(((1 << 16) + 1) * i); + } + + let pset = newPset(); + pset.setPrefixes(arr, arr.length); + + doExpectedLookups(pset, arr, 1); + + var file = Services.dirsvc.get("ProfLD", Ci.nsIFile); + file.append("testNoDelta.pset"); + + pset.storeToFile(file); + pset.loadFromFile(file); + + doExpectedLookups(pset, arr, 1); +} + var tests = [testBasicPset, testSimplePset, testReSetPrefixes, + testLoadSaveLargeSet, testDuplicates, - testTinySet]; + testTinySet, + testLoadSaveNoDelta]; function run_test() { // None of the tests use |executeSoon| or any sort of callbacks, so we can From 49ee8d1cb07e1de26dcbcc44d3084e0f31553982 Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Fri, 22 Feb 2019 04:00:29 +0000 Subject: [PATCH 20/48] Bug 1524610: Add a document for building GeckoView Example. r=jdescottes,m_kato Differential Revision: https://phabricator.services.mozilla.com/D19106 --HG-- extra : moz-landing-system : lando --- .../documentation/GECKOVIEW_EXAMPLE_BUILD.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 devtools/client/aboutdebugging-new/documentation/GECKOVIEW_EXAMPLE_BUILD.md diff --git a/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_EXAMPLE_BUILD.md b/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_EXAMPLE_BUILD.md new file mode 100644 index 0000000000000..cedc073369315 --- /dev/null +++ b/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_EXAMPLE_BUILD.md @@ -0,0 +1,66 @@ +# Build GeckoView Example + +## When do you need to build GeckoView Example + +If a remote debugging change impacts the server (file located in `devtools/server` or in `devtools/shared`), you will not be able to test it without building your GeckoView Example. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of `devtools/client` (including `devtools/client/aboutdebugging-new`). And `devtools/server` runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build GeckoView Example and deploy it on a test device. + +## Setup your environment + +This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://mozilla.github.io/geckoview/ and https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build. + +The whole setup needs to download several gigabytes of dependencies so try to have a fast internet connection to follow those steps. + +### Clone mozilla-central + +It is recommended to create a new clone of mozilla-central for your GeckoView Example builds. + +``` + hg clone https://hg.mozilla.org/mozilla-central mozilla-central-gecko-view + cd mozilla-central-gecko-view +``` + +### Run bootstrap + +Next simply run `mach bootstrap` and select the third option `3. GeckoView/Firefox for Android Artifact Mode` + +``` + > ./mach bootstrap + Please choose the version of Firefox you want to build: + 1. Firefox for Desktop Artifact Mode + 2. Firefox for Desktop + 3. GeckoView/Firefox for Android Artifact Mode + 4. GeckoView/Firefox for Android + > 3 +``` + +Follow the instructions, it will take some time as it needs to download a lot of dependencies. At the end it will provide you with a template you should use to create a `.mozconfig` file. You can use the proposed content without changing anything. + +### Enable USB debugging on your phone + +If you already used your device for USB debugging, this should already be enabled, but we will repeat the steps here. + +In the Settings menu, choose "About" and scroll down to the Build Number option. There's a hidden option there to activate "developer mode": tap the Build Number option seven times. You’ll see a countdown, and then a "Developer Options" menu will appear in your Settings. Don’t worry — you can turn this off whenever you like. The last step is to enable USB Debugging in the Developer Options menu. + +## Build and deploy to your phone + +Connect your phone to your computer with a USB cable. Then run: + +``` + ./mach build + ./mach package + ./mach android install-geckoview_example +``` + +At this step if you go to the list of applications on your phone, you should be able to spot a "GeckoView Example" application. + +## Reflect changes + +If you change server files that impact GeckoView, you need to build and install again. Reflect the changes by: + +``` + ./mach build faster + ./mach package + ./mach android install-geckoview_example +``` + +Once you built all, the changes under `devtools/server` and `devtools/shared` can be built with `faster` option. This should be faster. From a66aaef5b23cbdb39d383bf6c5d337117cd3d781 Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 6 Mar 2019 23:57:16 +0000 Subject: [PATCH 21/48] Bug 1524610: Add a document for Reference Browser. r=jdescottes,agi,snorp Depends on D19106 Differential Revision: https://phabricator.services.mozilla.com/D19465 --HG-- extra : moz-landing-system : lando --- .../GECKOVIEW_REFERENCE_BROWSER_BUILD.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 devtools/client/aboutdebugging-new/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md diff --git a/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md b/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md new file mode 100644 index 0000000000000..90a578b26572a --- /dev/null +++ b/devtools/client/aboutdebugging-new/documentation/GECKOVIEW_REFERENCE_BROWSER_BUILD.md @@ -0,0 +1,152 @@ +# Build GeckoView Reference Browser + +## When do you need to build GeckoView Reference Browser + +If a remote debugging change impacts the server (file located in `devtools/server` or in `devtools/shared`), you will not be able to test it without building your GeckoView Reference Browser. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of `devtools/client` (including `devtools/client/aboutdebugging-new`). And `devtools/server` runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build GeckoView Reference Browser and deploy it on a test device. To build custom Reference Browser, need two modules of GeckoView and Reference Browser. + +## Setup your environment and build + +This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://mozilla.github.io/geckoview/ and https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build. + +The whole setup needs to download several gigabytes of dependencies so try to have a fast internet connection to follow those steps. + +### Make empty directory + +It is recommended to create a new directory to build your GeckoView and Reference Browser. + +``` + mkdir geckoview-reference-browser + cd geckoview-reference-browser +``` + +### Build GeckoView + +#### Clone mozilla-central + +It is recommended to create a new clone of mozilla-central for your GeckoView builds. + +``` + hg clone https://hg.mozilla.org/mozilla-central mozilla-central-gecko-view + cd mozilla-central-gecko-view +``` + +#### Run bootstrap + +Next simply run `mach bootstrap` and select the third option `3. GeckoView/Firefox for Android Artifact Mode` + +``` + > ./mach bootstrap + Please choose the version of Firefox you want to build: + 1. Firefox for Desktop Artifact Mode + 2. Firefox for Desktop + 3. GeckoView/Firefox for Android Artifact Mode + 4. GeckoView/Firefox for Android + > 3 +``` + +Follow the instructions, it will take some time as it needs to download a lot of dependencies. At the end it will provide you with a template you should use to create a `.mozconfig` file. You can use the proposed content without changing anything. + +### Build + +Execute command below to build. + +``` + ./mach build + ./mach package + ./mach android archive-geckoview +``` + +If the build has finished successfully, the GeckoView AAR file will be created in your build output directory. You can find this file with following command: + +``` + > ls mozilla-central-gecko-view//gradle/build/mobile/android/geckoview/outputs/aar + geckoview-withGeckoBinaries-debug.aar +``` + + +### Build Reference Browser + +#### Clone reference-browser + +It is recommended to create a new clone of reference-browser for your Reference Browser builds. + +``` + cd ../ + git clone https://github.com/mozilla-mobile/reference-browser + cd reference-browser +``` + +#### Create `local.properties` file + +`local.properties` file is necessary to specify the location of the Android SDK. Please write the absolute path of Android SDK with `sdk.dir` key. If you did `./mach bootstrap` once, Android SDK should already installed. You can find the directory whose name is like `android-sdk-` under `~/.mozconfig/`. Thus, in mac osx case, the content of `local.properties` should be like below: + +``` +sdk.dir=/Users/xxxxxx/.mozbuild/android-sdk-osx +``` + +#### Edit `app/build.gradle` to build Reference Browser with above GeckoView + +You need to edit two places in `app/build.gradle`. + +1. Add `repositories` block with following content to bottom of file. is the directory which was created by `./mach android archive-geckoview` to build GeckoView. This should be like `/User/xxxxxx/mozilla-central-gecko-view//gradle/build/mobile/android/geckoview/outputs/aar`. + +``` +repositories { + flatDir( + name: "localBuild", + dirs: "" + ) +} +``` + +2. Edit `geckoNightlyArmImplementation` + +``` +dependencies { + // ... + + //geckoNightlyArmImplementation Gecko.geckoview_nightly_arm + geckoNightlyArmImplementation( + name: 'geckoview-withGeckoBinaries-debug', + ext: 'aar' + ) + + // ... +} +``` + +#### Build and deploy to your phone + +Connect your phone to your computer with a USB cable. Then run: + +``` + ./gradlew build + ./gradlew installGeckoNightlyArmDebug +``` + +At this step if you go to the list of applications on your phone, you should be able to spot a "Reference Browser" application. + +### Enable USB debugging on your phone + +If you already used your device for USB debugging, this should already be enabled, but we will repeat the steps here. + +In the Settings menu, choose "About" and scroll down to the Build Number option. There's a hidden option there to activate "developer mode": tap the Build Number option seven times. You’ll see a countdown, and then a "Developer Options" menu will appear in your Settings. Don’t worry — you can turn this off whenever you like. The last step is to enable USB Debugging in the Developer Options menu on Reference Browser on your device. + +And, you can test with Reference Browser with custom GeckoView! + +## Reflect changes + +If you change codes in GeckoView, need to build and install again. Reflect the changes by: + +``` + cd mozilla-central-gecko-view + ./mach build faster + ./mach package + ./mach android archive-geckoview + cd ../ + cd reference-browser + ./gradlew build + ./gradlew installGeckoNightlyArmDebug +``` + +Once you built all, the changes under `devtools/server` and `devtools/shared` can build with `faster` option. This should be faster. From 069c5d4850db21fcb0594207e3b5fb86d2f0847a Mon Sep 17 00:00:00 2001 From: Andrew Erickson Date: Wed, 6 Mar 2019 20:57:04 +0000 Subject: [PATCH 22/48] Bug 1531313: reenable dom/base/test/test_progress_events_for_gzip_data.html for android r=gbrown,jkt Differential Revision: https://phabricator.services.mozilla.com/D21590 --HG-- extra : moz-landing-system : lando --- dom/base/test/mochitest.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index bc06c2d9bfd69..cb5d09d19ded6 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -766,7 +766,6 @@ support-files = worker_postMessages.js support-files = file_receiveMessage.html [test_processing_instruction_update_stylesheet.xhtml] [test_progress_events_for_gzip_data.html] -skip-if = toolkit == 'android' [test_range_bounds.html] skip-if = toolkit == 'android' [test_reentrant_flush.html] From 6e3743ce12a94caa21a707aec86209813596a953 Mon Sep 17 00:00:00 2001 From: prathiksha Date: Thu, 7 Mar 2019 00:06:42 +0000 Subject: [PATCH 23/48] Bug 1530029 - Pressing enter on the autocomplete footer should open the password manager dialog. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D21603 --HG-- extra : moz-landing-system : lando --- browser/components/BrowserGlue.jsm | 1 + .../components/passwordmgr/LoginHelper.jsm | 3 +- .../passwordmgr/LoginManagerContent.jsm | 47 ++++++++++++- .../passwordmgr/LoginManagerParent.jsm | 5 ++ .../browser/browser_autocomplete_footer.js | 69 +++++++++++++++---- 5 files changed, 111 insertions(+), 14 deletions(-) diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 4ff9841e3fe7e..441af487afa0f 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -536,6 +536,7 @@ const listeners = { "PasswordManager:autoCompleteLogins": ["LoginManagerParent"], "PasswordManager:removeLogin": ["LoginManagerParent"], "PasswordManager:insecureLoginFormPresent": ["LoginManagerParent"], + "PasswordManager:OpenPreferences": ["LoginManagerParent"], // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js "rtcpeer:CancelRequest": ["webrtcUI"], "rtcpeer:Request": ["webrtcUI"], diff --git a/toolkit/components/passwordmgr/LoginHelper.jsm b/toolkit/components/passwordmgr/LoginHelper.jsm index 294fce21d4122..2e7b7d40e8fdf 100644 --- a/toolkit/components/passwordmgr/LoginHelper.jsm +++ b/toolkit/components/passwordmgr/LoginHelper.jsm @@ -31,6 +31,7 @@ var LoginHelper = { schemeUpgrades: null, insecureAutofill: null, privateBrowsingCaptureEnabled: null, + showAutoCompleteFooter: null, init() { // Watch for pref changes to update cached pref values. @@ -48,8 +49,8 @@ var LoginHelper = { Services.prefs.getBoolPref("signon.privateBrowsingCapture.enabled"); this.schemeUpgrades = Services.prefs.getBoolPref("signon.schemeUpgrades"); - this.storeWhenAutocompleteOff = Services.prefs.getBoolPref("signon.storeWhenAutocompleteOff"); this.showAutoCompleteFooter = Services.prefs.getBoolPref("signon.showAutoCompleteFooter"); + this.storeWhenAutocompleteOff = Services.prefs.getBoolPref("signon.storeWhenAutocompleteOff"); }, createLogger(aLogPrefix) { diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index 634f992f8baaa..90ce2abf22b74 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -191,6 +191,9 @@ var LoginManagerContent = { // Number of outstanding requests to each manager. _managers: new Map(), + // Input element on which enter keydown event was fired. + _keyDownEnterForInput: null, + _takeRequest(msg) { let data = msg.data; let request = this._requests.get(data.requestId); @@ -235,6 +238,27 @@ var LoginManagerContent = { return deferred.promise; }, + _onKeyDown(event) { + let focusedElement = LoginManagerContent._formFillService.focusedInput; + if (event.keyCode != event.DOM_VK_RETURN || focusedElement != event.target) { + this._keyDownEnterForInput = null; + return; + } + LoginManagerContent._keyDownEnterForInput = focusedElement; + }, + + _onPopupClosed(selectedRowStyle, mm) { + let focusedElement = LoginManagerContent._formFillService.focusedInput; + let eventTarget = LoginManagerContent._keyDownEnterForInput; + if (!eventTarget || eventTarget !== focusedElement || + selectedRowStyle != "loginsFooter") { + this._keyDownEnterForInput = null; + return; + } + let hostname = eventTarget.ownerDocument.documentURIObject.host; + mm.sendAsyncMessage("PasswordManager:OpenPreferences", {hostname}); + }, + receiveMessage(msg, topWindow) { if (msg.name == "PasswordManager:fillForm") { this.fillForm({ @@ -247,10 +271,10 @@ var LoginManagerContent = { return; } - let request = this._takeRequest(msg); switch (msg.name) { case "PasswordManager:loginsFound": { let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins); + let request = this._takeRequest(msg); request.promise.resolve({ form: request.form, loginsFound, @@ -262,9 +286,25 @@ var LoginManagerContent = { case "PasswordManager:loginsAutoCompleted": { let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins); let messageManager = msg.target; + let request = this._takeRequest(msg); request.promise.resolve({ logins: loginsFound, messageManager }); break; } + + case "FormAutoComplete:PopupOpened": { + let {chromeEventHandler} = msg.target.docShell; + chromeEventHandler.addEventListener("keydown", this._onKeyDown, + true); + break; + } + + case "FormAutoComplete:PopupClosed": { + this._onPopupClosed(msg.data.selectedRowStyle, msg.target); + let {chromeEventHandler} = msg.target.docShell; + chromeEventHandler.removeEventListener("keydown", this._onKeyDown, + true); + break; + } } }, @@ -324,6 +364,11 @@ var LoginManagerContent = { isPasswordField: aElement.type == "password", }; + if (LoginHelper.showAutoCompleteFooter) { + messageManager.addMessageListener("FormAutoComplete:PopupOpened", this); + messageManager.addMessageListener("FormAutoComplete:PopupClosed", this); + } + return this._sendRequest(messageManager, requestData, "PasswordManager:autoCompleteLogins", messageData); diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index ad18f69583b7d..45b37b5635ae6 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -115,6 +115,11 @@ var LoginManagerParent = { AutoCompletePopup.removeLogin(login); break; } + + case "PasswordManager:OpenPreferences": { + LoginHelper.openPasswordManager(msg.target.ownerGlobal, msg.data.hostname); + break; + } } return undefined; diff --git a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js index c051cf1d2bf21..3ae1ff7ded5f0 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js +++ b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js @@ -21,6 +21,24 @@ function loginList() { ]; } +function openPopup(popup, browser) { + return new Promise(async (resolve) => { + let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown"); + + await SimpleTest.promiseFocus(browser); + info("content window focused"); + + // Focus the username field to open the popup. + await ContentTask.spawn(browser, null, function openAutocomplete() { + content.document.getElementById("form-basic-username").focus(); + }); + + let shown = await promiseShown; + ok(shown, "autocomplete popup shown"); + resolve(shown); + }); +} + /** * Initialize logins and set prefs needed for the test. */ @@ -35,27 +53,50 @@ add_task(async function test_initialize() { } }); -add_task(async function test_autocomplete_footer() { +add_task(async function test_autocomplete_footer_onclick() { let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH; await BrowserTestUtils.withNewTab({ gBrowser, url, - }, async function(browser) { + }, async function footer_onclick(browser) { let popup = document.getElementById("PopupAutoComplete"); ok(popup, "Got popup"); - let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown"); + await openPopup(popup, browser); - await SimpleTest.promiseFocus(browser); - info("content window focused"); + let footer = popup.querySelector(`[originaltype="loginsFooter"]`); + ok(footer, "Got footer richlistitem"); - // Focus the username field to open the popup. - await ContentTask.spawn(browser, null, function openAutocomplete() { - content.document.getElementById("form-basic-username").focus(); - }); + await TestUtils.waitForCondition(() => { + return !EventUtils.isHidden(footer); + }, "Waiting for footer to become visible"); - await promiseShown; - ok(promiseShown, "autocomplete shown"); + EventUtils.synthesizeMouseAtCenter(footer, {}); + await TestUtils.waitForCondition(() => { + return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null; + }, "Waiting for the password manager dialog to open"); + info("Login dialog was opened"); + + let window = Services.wm.getMostRecentWindow("Toolkit:PasswordManager"); + await TestUtils.waitForCondition(() => { + return window.document.getElementById("filter").value == "example.com"; + }, "Waiting for the search string to filter logins"); + + window.close(); + popup.hidePopup(); + }); +}); + +add_task(async function test_autocomplete_footer_keydown() { + let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH; + await BrowserTestUtils.withNewTab({ + gBrowser, + url, + }, async function footer_enter_keydown(browser) { + let popup = document.getElementById("PopupAutoComplete"); + ok(popup, "Got popup"); + + await openPopup(popup, browser); let footer = popup.querySelector(`[originaltype="loginsFooter"]`); ok(footer, "Got footer richlistitem"); @@ -64,7 +105,11 @@ add_task(async function test_autocomplete_footer() { return !EventUtils.isHidden(footer); }, "Waiting for footer to become visible"); - EventUtils.synthesizeMouseAtCenter(footer, {}); + await EventUtils.synthesizeKey("KEY_ArrowDown"); + await EventUtils.synthesizeKey("KEY_ArrowDown"); + await EventUtils.synthesizeKey("KEY_ArrowDown"); + await EventUtils.synthesizeKey("KEY_Enter"); + await TestUtils.waitForCondition(() => { return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null; }, "Waiting for the password manager dialog to open"); From 882aee42b62226432d1cbd7a08c5c4459a956e6e Mon Sep 17 00:00:00 2001 From: prathiksha Date: Thu, 7 Mar 2019 00:06:46 +0000 Subject: [PATCH 24/48] Bug 1530029 - Turn on the signon.showAutoCompleteFooter pref. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D22425 --HG-- extra : moz-landing-system : lando --- browser/app/profile/firefox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 3137af204716a..a1f6882d830ef 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1703,6 +1703,7 @@ pref("extensions.pocket.site", "getpocket.com"); pref("signon.schemeUpgrades", true); pref("signon.privateBrowsingCapture.enabled", true); +pref("signon.showAutoCompleteFooter", true); // Enable the "Simplify Page" feature in Print Preview. This feature // is disabled by default in toolkit. From 7c4355ade7b1ee2077b64a547e9b08104335083d Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 7 Mar 2019 00:27:57 +0000 Subject: [PATCH 25/48] Bug 1524435 - Stop using JSRope::new_ when allocating test ropes r=jonco Differential Revision: https://phabricator.services.mozilla.com/D22033 --HG-- extra : moz-landing-system : lando --- js/src/builtin/TestingFunctions.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 2d8bcf4a483e9..5b974d824e20a 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1657,17 +1657,16 @@ static bool NewRope(JSContext* cx, unsigned argc, Value* vp) { } } - JSString* left = args[0].toString(); - JSString* right = args[1].toString(); + RootedString left(cx, args[0].toString()); + RootedString right(cx, args[1].toString()); size_t length = JS_GetStringLength(left) + JS_GetStringLength(right); if (length > JSString::MAX_LENGTH) { JS_ReportErrorASCII(cx, "rope length exceeds maximum string length"); return false; } - Rooted str(cx, JSRope::new_(cx, left, right, length, heap)); + Rooted str(cx, JSRope::new_(cx, left, right, length, heap)); if (!str) { - JS_ReportOutOfMemory(cx); return false; } From 571984a7b6180472fe644126391a770376e0bbb5 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Thu, 7 Mar 2019 02:29:50 +0200 Subject: [PATCH 26/48] Backed out changeset b57ec6985cd1 (bug 1531632) for Geckoview failures. CLOSED TREE --HG-- extra : rebase_source : bf3f36df156ac78c02b027923af4a9615053fac2 --- .../java/org/mozilla/gecko/GeckoThread.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java index da174e9486338..94e1e7cc632ac 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java @@ -271,6 +271,9 @@ private static void loadGeckoLibs(final Context context) { private static void initGeckoEnvironment() { final Context context = GeckoAppShell.getApplicationContext(); + GeckoLoader.loadMozGlue(context); + setState(State.MOZGLUE_READY); + final Locale locale = Locale.getDefault(); final Resources res = context.getResources(); if (locale.toString().equalsIgnoreCase("zh_hk")) { @@ -411,28 +414,6 @@ public void run() { }; Looper.myQueue().addIdleHandler(idleHandler); - final Context context = GeckoAppShell.getApplicationContext(); - final List env = getEnvFromExtras(mInitInfo.extras); - - // In Gecko, the native crash reporter is enabled by default in opt builds, and - // disabled by default in debug builds. - if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) == 0 && !BuildConfig.DEBUG_BUILD) { - env.add(0, "MOZ_CRASHREPORTER_DISABLE=1"); - } else if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) != 0 && BuildConfig.DEBUG_BUILD) { - env.add(0, "MOZ_CRASHREPORTER=1"); - } - - if (!isChildProcess() && ((mInitInfo.flags & FLAG_ENABLE_MARIONETTE) != 0)) { - // The presence of this environment variable determines the initial - // value of `marionette.enabled`. - env.add(0, "MOZ_MARIONETTE=1"); - } - - GeckoLoader.loadMozGlue(context); - setState(State.MOZGLUE_READY); - - GeckoLoader.setupGeckoEnvironment(context, context.getFilesDir().getPath(), env, mInitInfo.prefs); - initGeckoEnvironment(); // Wait until initialization before calling Gecko entry point. @@ -464,12 +445,31 @@ public void run() { Log.w(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() + " - runGecko"); + final Context context = GeckoAppShell.getApplicationContext(); final String[] args = isChildProcess() ? mInitInfo.args : getMainProcessArgs(); if ((mInitInfo.flags & FLAG_DEBUGGING) != 0) { Log.i(LOGTAG, "RunGecko - args = " + TextUtils.join(" ", args)); } + final List env = getEnvFromExtras(mInitInfo.extras); + + // In Gecko, the native crash reporter is enabled by default in opt builds, and + // disabled by default in debug builds. + if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) == 0 && !BuildConfig.DEBUG_BUILD) { + env.add(0, "MOZ_CRASHREPORTER_DISABLE=1"); + } else if ((mInitInfo.flags & FLAG_ENABLE_NATIVE_CRASHREPORTER) != 0 && BuildConfig.DEBUG_BUILD) { + env.add(0, "MOZ_CRASHREPORTER=1"); + } + + if (!isChildProcess() && ((mInitInfo.flags & FLAG_ENABLE_MARIONETTE) != 0)) { + // The presence of this environment variable determines the initial + // value of `marionette.enabled`. + env.add(0, "MOZ_MARIONETTE=1"); + } + + GeckoLoader.setupGeckoEnvironment(context, context.getFilesDir().getPath(), env, mInitInfo.prefs); + // And go. GeckoLoader.nativeRun(args, mInitInfo.extras.getInt(EXTRA_PREFS_FD, -1), From 7695d88b21ac9e80e6dd200093d75033b814a223 Mon Sep 17 00:00:00 2001 From: Edwin Gao Date: Thu, 7 Mar 2019 00:37:07 +0000 Subject: [PATCH 27/48] Bug 1533164 - disable browser_enable_DRM_prompt.js test r=jmaher Changes: - added skip-if clause for `windows10-aarch64` Differential Revision: https://phabricator.services.mozilla.com/D22417 --HG-- extra : moz-landing-system : lando --- browser/base/content/test/plugins/browser.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/base/content/test/plugins/browser.ini b/browser/base/content/test/plugins/browser.ini index 93fd31c1e1a78..4442fddece073 100644 --- a/browser/base/content/test/plugins/browser.ini +++ b/browser/base/content/test/plugins/browser.ini @@ -87,6 +87,7 @@ tags = blocklist skip-if = !e10s tags = blocklist [browser_enable_DRM_prompt.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533164 [browser_private_browsing_eme_persistent_state.js] [browser_globalplugin_crashinfobar.js] skip-if = !crashreporter From 7e4426091e8bfcfb72f96f10cdc4c7b879c78e3f Mon Sep 17 00:00:00 2001 From: Edwin Gao Date: Thu, 7 Mar 2019 00:37:05 +0000 Subject: [PATCH 28/48] Bug 1533141 - disable browser_appmenu.js for windows10-aarch64 r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D22421 --HG-- extra : moz-landing-system : lando --- browser/base/content/test/performance/browser.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/test/performance/browser.ini b/browser/base/content/test/performance/browser.ini index 9a424e58f891d..66dfb5463cc89 100644 --- a/browser/base/content/test/performance/browser.ini +++ b/browser/base/content/test/performance/browser.ini @@ -17,7 +17,7 @@ prefs = support-files = head.js [browser_appmenu.js] -skip-if = asan || debug || (os == 'win' && bits == 32) # Bug 1382809, bug 1369959, Win32 because of intermittent OOM failures +skip-if = asan || debug || (os == 'win' && bits == 32) || (os == 'win' && processor == 'aarch64') # Bug 1382809, bug 1369959, Win32 because of intermittent OOM failures, bug 1533141 for aarch64 [browser_preferences_usage.js] skip-if = !debug [browser_startup.js] From 6f89be791ab3370d4320a0189a78085a856cae2f Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Wed, 6 Mar 2019 06:03:54 +0000 Subject: [PATCH 29/48] Bug 1466208 - part 33: Create PresShell::EventHandler::RecordEventHandlingResponsePerformance() r=smaug `PresShell::EventHandler::HandleEventInternal()` recodes event handling response performance with telemetry after it dispatches the event. We can move it into new method simply. Differential Revision: https://phabricator.services.mozilla.com/D21334 --HG-- extra : moz-landing-system : lando --- layout/base/PresShell.cpp | 104 ++++++++++++++++++++------------------ layout/base/PresShell.h | 8 +++ 2 files changed, 63 insertions(+), 49 deletions(-) diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 2f2d14bbae346..d6cac8d1a1c7b 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -7967,62 +7967,68 @@ nsresult PresShell::EventHandler::HandleEventInternal( } } } + RecordEventHandlingResponsePerformance(aEvent); + return rv; +} - if (Telemetry::CanRecordBase() && !aEvent->mTimeStamp.IsNull() && - aEvent->mTimeStamp > mPresShell->mLastOSWake && aEvent->AsInputEvent()) { - TimeStamp now = TimeStamp::Now(); - double millis = (now - aEvent->mTimeStamp).ToMilliseconds(); - Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_MS, millis); - if (GetDocument() && - GetDocument()->GetReadyStateEnum() != Document::READYSTATE_COMPLETE) { - Telemetry::Accumulate(Telemetry::LOAD_INPUT_EVENT_RESPONSE_MS, millis); - } - - if (!sLastInputProcessed || sLastInputProcessed < aEvent->mTimeStamp) { - if (sLastInputProcessed) { - // This input event was created after we handled the last one. - // Accumulate the previous events' coalesced duration. - double lastMillis = - (sLastInputProcessed - sLastInputCreated).ToMilliseconds(); - Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_COALESCED_MS, - lastMillis); +void PresShell::EventHandler::RecordEventHandlingResponsePerformance( + const WidgetEvent* aEvent) { + if (!Telemetry::CanRecordBase() || aEvent->mTimeStamp.IsNull() || + aEvent->mTimeStamp <= mPresShell->mLastOSWake || + !aEvent->AsInputEvent()) { + return; + } - if (MOZ_UNLIKELY(!PresShell::sProcessInteractable)) { - // For content process, we use the ready state of - // top-level-content-document to know if the process has finished the - // start-up. - // For parent process, see the topic - // 'sessionstore-one-or-no-tab-restored' in PresShell::Observe. - if (XRE_IsContentProcess() && GetDocument() && - GetDocument()->IsTopLevelContentDocument()) { - switch (GetDocument()->GetReadyStateEnum()) { - case Document::READYSTATE_INTERACTIVE: - case Document::READYSTATE_COMPLETE: - PresShell::sProcessInteractable = true; - break; - default: - break; - } + TimeStamp now = TimeStamp::Now(); + double millis = (now - aEvent->mTimeStamp).ToMilliseconds(); + Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_MS, millis); + if (GetDocument() && + GetDocument()->GetReadyStateEnum() != Document::READYSTATE_COMPLETE) { + Telemetry::Accumulate(Telemetry::LOAD_INPUT_EVENT_RESPONSE_MS, millis); + } + + if (!sLastInputProcessed || sLastInputProcessed < aEvent->mTimeStamp) { + if (sLastInputProcessed) { + // This input event was created after we handled the last one. + // Accumulate the previous events' coalesced duration. + double lastMillis = + (sLastInputProcessed - sLastInputCreated).ToMilliseconds(); + Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_COALESCED_MS, + lastMillis); + + if (MOZ_UNLIKELY(!PresShell::sProcessInteractable)) { + // For content process, we use the ready state of + // top-level-content-document to know if the process has finished the + // start-up. + // For parent process, see the topic + // 'sessionstore-one-or-no-tab-restored' in PresShell::Observe. + if (XRE_IsContentProcess() && GetDocument() && + GetDocument()->IsTopLevelContentDocument()) { + switch (GetDocument()->GetReadyStateEnum()) { + case Document::READYSTATE_INTERACTIVE: + case Document::READYSTATE_COMPLETE: + PresShell::sProcessInteractable = true; + break; + default: + break; } } - if (MOZ_LIKELY(PresShell::sProcessInteractable)) { - Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_POST_STARTUP_MS, - lastMillis); - } else { - Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_STARTUP_MS, - lastMillis); - } } - sLastInputCreated = aEvent->mTimeStamp; - } else if (aEvent->mTimeStamp < sLastInputCreated) { - // This event was created before the last input. May be processing out - // of order, so coalesce backwards, too. - sLastInputCreated = aEvent->mTimeStamp; + if (MOZ_LIKELY(PresShell::sProcessInteractable)) { + Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_POST_STARTUP_MS, + lastMillis); + } else { + Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_STARTUP_MS, + lastMillis); + } } - sLastInputProcessed = now; + sLastInputCreated = aEvent->mTimeStamp; + } else if (aEvent->mTimeStamp < sLastInputCreated) { + // This event was created before the last input. May be processing out + // of order, so coalesce backwards, too. + sLastInputCreated = aEvent->mTimeStamp; } - - return rv; + sLastInputProcessed = now; } // static diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index cc2215df44a3d..ac887df239f92 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -1050,6 +1050,14 @@ class PresShell final : public nsIPresShell, bool aIsHandlingNativeEvent, nsIContent* aOverrideClickTarget); + /** + * RecordEventHandlingResponsePerformance() records event handling response + * performance with telemetry. + * + * @param aEvent The handled event. + */ + void RecordEventHandlingResponsePerformance(const WidgetEvent* aEvent); + /** * This and the next two helper methods are used to target and position the * context menu when the keyboard shortcut is used to open it. From 7663d037e949ec7ba8402778d222e781d7144715 Mon Sep 17 00:00:00 2001 From: Ricky Rosario Date: Wed, 6 Mar 2019 23:43:15 +0000 Subject: [PATCH 30/48] Bug 1529340 - CFR Pinned tabs popup animation r=k88hudson MozReview-Commit-ID: FTr5Pi7ySbY Differential Revision: https://phabricator.services.mozilla.com/D22398 --HG-- extra : moz-landing-system : lando --- browser/base/content/popup-notifications.inc | 18 ++++--- browser/themes/shared/browser.inc.css | 57 +++++++++++++++++++- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/browser/base/content/popup-notifications.inc b/browser/base/content/popup-notifications.inc index 880203a83a64b..b29dafb451e56 100644 --- a/browser/base/content/popup-notifications.inc +++ b/browser/base/content/popup-notifications.inc @@ -96,14 +96,16 @@ - - - - - + + + + + + + diff --git a/browser/themes/shared/browser.inc.css b/browser/themes/shared/browser.inc.css index b6c2863fa6a72..ac95c83679040 100644 --- a/browser/themes/shared/browser.inc.css +++ b/browser/themes/shared/browser.inc.css @@ -232,7 +232,8 @@ margin-bottom: 0; } -#cfr-notification-footer { +#cfr-notification-footer-text-and-addon-info { + display: block; padding: 10px var(--arrowpanel-padding); } @@ -294,6 +295,60 @@ flex-grow: 1; } +#cfr-notification-footer-pintab-animation-container { + background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_animated.png"); + background-position: top center; + background-repeat: no-repeat; + height: 173px; + width: 343px; +} + +#contextual-feature-recommendation-notification[data-notification-category="cfrAddons"] #cfr-notification-footer-pintab-animation-container { + display: none; +} + +#cfr-notification-footer-pintab-animation-container:not([animate]), +#cfr-notification-footer-pintab-animation-container[paused], +:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container:not([animate]), +:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container[paused] { + background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_static.png"); +} + +:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container { + background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_animated_darktheme.png"); +} + +#cfr-notification-footer-animation-controls { + background: linear-gradient(transparent 0%, rgba(255, 255, 255, 0.95) 35%); + padding: 20px var(--arrowpanel-padding) 10px; +} + +:root[lwt-popup-brighttext] #cfr-notification-footer-animation-controls { + margin-left: 13px; +} + +#cfr-notification-footer-pintab-animation-container:not([animate]) #cfr-notification-footer-animation-controls, +#cfr-notification-footer-pintab-animation-container[paused] #cfr-notification-footer-animation-controls { + visibility: hidden; +} + +#cfr-notification-footer-pause-button, +#cfr-notification-footer-pause-label { + color: rgba(12, 12, 13, 0.8); + cursor: pointer; +} + +#cfr-notification-footer-pause-icon { + background-image: url("resource://activity-stream/data/content/assets/glyph-pause-12.svg"); + background-position: center center; + background-repeat: no-repeat; + background-size: 12px; + -moz-context-properties: fill; + fill: rgba(12, 12, 13, 0.8); + height: 12px; + width: 12px; +} + #content-mask { background: rgba(0, 0, 0, 0.5); } From eecd28a654fed337cd22b21dd9ca98fdbc673e69 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Thu, 7 Mar 2019 00:50:39 +0000 Subject: [PATCH 31/48] Bug 1531830 - Part 1: Ship String.prototype.matchAll and Symbol.matchAll. r=jwalden No pref; the feature is not risky or complicated enough to warrant it. It's easy enough to back this out if need be. Differential Revision: https://phabricator.services.mozilla.com/D22370 --HG-- extra : moz-landing-system : lando --- js/src/builtin/RegExp.cpp | 2 -- js/src/builtin/String.cpp | 2 -- js/src/builtin/Symbol.cpp | 5 ----- 3 files changed, 9 deletions(-) diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 05f32700e5a8a..8651fecef48c8 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -783,9 +783,7 @@ const JSFunctionSpec js::regexp_methods[] = { JS_SELF_HOSTED_FN("exec", "RegExp_prototype_Exec", 1, 0), JS_SELF_HOSTED_FN("test", "RegExpTest", 1, 0), JS_SELF_HOSTED_SYM_FN(match, "RegExpMatch", 1, 0), -#ifdef NIGHTLY_BUILD JS_SELF_HOSTED_SYM_FN(matchAll, "RegExpMatchAll", 1, 0), -#endif JS_SELF_HOSTED_SYM_FN(replace, "RegExpReplace", 2, 0), JS_SELF_HOSTED_SYM_FN(search, "RegExpSearch", 1, 0), JS_SELF_HOSTED_SYM_FN(split, "RegExpSplit", 2, 0), diff --git a/js/src/builtin/String.cpp b/js/src/builtin/String.cpp index e78b6458fd92b..10f538ef4ad7d 100644 --- a/js/src/builtin/String.cpp +++ b/js/src/builtin/String.cpp @@ -3377,9 +3377,7 @@ static const JSFunctionSpec string_methods[] = { /* Perl-ish methods (search is actually Python-esque). */ JS_SELF_HOSTED_FN("match", "String_match", 1, 0), -#ifdef NIGHTLY_BUILD JS_SELF_HOSTED_FN("matchAll", "String_matchAll", 1, 0), -#endif JS_SELF_HOSTED_FN("search", "String_search", 1, 0), JS_SELF_HOSTED_FN("replace", "String_replace", 2, 0), JS_SELF_HOSTED_FN("split", "String_split", 2, 0), diff --git a/js/src/builtin/Symbol.cpp b/js/src/builtin/Symbol.cpp index 6cd2b3fa9afbe..dd18e7faa3d6f 100644 --- a/js/src/builtin/Symbol.cpp +++ b/js/src/builtin/Symbol.cpp @@ -65,11 +65,6 @@ JSObject* SymbolObject::initClass(JSContext* cx, Handle global, unsigned attrs = JSPROP_READONLY | JSPROP_PERMANENT; WellKnownSymbols* wks = cx->runtime()->wellKnownSymbols; for (size_t i = 0; i < JS::WellKnownSymbolLimit; i++) { -#ifndef NIGHTLY_BUILD - if (i == static_cast(SymbolCode::matchAll)) { - continue; - } -#endif value.setSymbol(wks->get(i)); if (!NativeDefineDataProperty(cx, ctor, names[i], value, attrs)) { return nullptr; From e726943dcf8e7169c16c3b33120ddcd0e55f85e2 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Thu, 7 Mar 2019 00:01:49 +0000 Subject: [PATCH 32/48] Bug 1531830 - Part 2: Update test262 to run matchAll tests unconditionally. r=jwalden The previous patch makes both String.prototype.matchAll and Symbol.matchAll unconditional features. This patch was made by first making the changes to test262-update.py, then re-running it against the test262 revision already indicated by js/src/tests/test262/GIT-INFO: `python test262-update.py --revision 59b89a1c834faadc359aecc882587b513877b59b`. Depends on D22370 Differential Revision: https://phabricator.services.mozilla.com/D22371 --HG-- extra : moz-landing-system : lando --- js/src/tests/test262-update.py | 2 -- .../RegExp/prototype/Symbol.matchAll/isregexp-called-once.js | 1 - .../RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js | 1 - .../built-ins/RegExp/prototype/Symbol.matchAll/length.js | 1 - .../test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js | 1 - .../built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js | 1 - .../prototype/Symbol.matchAll/regexpcreate-this-throws.js | 1 - .../species-constructor-get-constructor-throws.js | 1 - .../Symbol.matchAll/species-constructor-get-species-throws.js | 1 - .../Symbol.matchAll/species-constructor-is-not-object-throws.js | 1 - .../Symbol.matchAll/species-constructor-is-undefined.js | 1 - .../species-constructor-species-is-not-constructor.js | 1 - .../species-constructor-species-is-null-or-undefined.js | 1 - .../Symbol.matchAll/species-constructor-species-throws.js | 1 - .../RegExp/prototype/Symbol.matchAll/species-constructor.js | 1 - .../Symbol.matchAll/species-regexp-get-global-throws.js | 1 - .../Symbol.matchAll/species-regexp-get-unicode-throws.js | 1 - .../RegExp/prototype/Symbol.matchAll/string-tostring-throws.js | 1 - .../RegExp/prototype/Symbol.matchAll/string-tostring.js | 1 - .../RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js | 1 - .../RegExp/prototype/Symbol.matchAll/this-get-flags.js | 1 - .../RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js | 1 - .../RegExp/prototype/Symbol.matchAll/this-not-object-throws.js | 1 - .../prototype/Symbol.matchAll/this-tolength-lastindex-throws.js | 1 - .../prototype/Symbol.matchAll/this-tostring-flags-throws.js | 1 - .../RegExp/prototype/Symbol.matchAll/this-tostring-flags.js | 1 - .../RegExpStringIteratorPrototype/Symbol.toStringTag.js | 1 - .../test262/built-ins/RegExpStringIteratorPrototype/ancestry.js | 1 - .../next/custom-regexpexec-call-throws.js | 1 - .../next/custom-regexpexec-get-throws.js | 1 - .../next/custom-regexpexec-match-get-0-throws.js | 1 - .../next/custom-regexpexec-match-get-0-tostring-throws.js | 1 - .../next/custom-regexpexec-match-get-0-tostring.js | 1 - .../next/custom-regexpexec-not-callable.js | 1 - .../RegExpStringIteratorPrototype/next/custom-regexpexec.js | 1 - .../built-ins/RegExpStringIteratorPrototype/next/length.js | 1 - .../built-ins/RegExpStringIteratorPrototype/next/name.js | 1 - .../RegExpStringIteratorPrototype/next/next-iteration-global.js | 1 - .../RegExpStringIteratorPrototype/next/next-iteration.js | 1 - .../next/next-missing-internal-slots.js | 1 - .../built-ins/RegExpStringIteratorPrototype/next/prop-desc.js | 1 - .../next/regexp-tolength-lastindex-throws.js | 1 - .../next/this-is-not-object-throws.js | 1 - .../tests/test262/built-ins/String/prototype/matchAll/length.js | 1 - .../tests/test262/built-ins/String/prototype/matchAll/name.js | 1 - .../test262/built-ins/String/prototype/matchAll/prop-desc.js | 1 - .../String/prototype/matchAll/regexp-get-matchAll-throws.js | 1 - .../built-ins/String/prototype/matchAll/regexp-is-null.js | 1 - .../matchAll/regexp-is-undefined-or-null-invokes-matchAll.js | 1 - .../built-ins/String/prototype/matchAll/regexp-is-undefined.js | 1 - .../String/prototype/matchAll/regexp-matchAll-invocation.js | 1 - .../prototype/matchAll/regexp-matchAll-is-undefined-or-null.js | 1 - .../String/prototype/matchAll/regexp-matchAll-not-callable.js | 1 - .../String/prototype/matchAll/regexp-matchAll-throws.js | 1 - .../prototype/matchAll/regexp-prototype-get-matchAll-throws.js | 1 - .../prototype/matchAll/regexp-prototype-has-no-matchAll.js | 1 - .../prototype/matchAll/regexp-prototype-matchAll-invocation.js | 1 - .../prototype/matchAll/regexp-prototype-matchAll-throws.js | 1 - .../String/prototype/matchAll/this-val-non-obj-coercible.js | 1 - .../built-ins/String/prototype/matchAll/toString-this-val.js | 1 - js/src/tests/test262/built-ins/Symbol/matchAll/cross-realm.js | 1 - js/src/tests/test262/built-ins/Symbol/matchAll/prop-desc.js | 1 - 62 files changed, 63 deletions(-) diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py index 3fa8d97cae278..86adefb7d478c 100755 --- a/js/src/tests/test262-update.py +++ b/js/src/tests/test262-update.py @@ -43,8 +43,6 @@ "BigInt": "!this.hasOwnProperty('BigInt')", "SharedArrayBuffer": "!this.hasOwnProperty('SharedArrayBuffer')", "dynamic-import": "!xulRuntime.shell", - "String.prototype.matchAll": "!String.prototype.hasOwnProperty('matchAll')", - "Symbol.matchAll": "!Symbol.hasOwnProperty('matchAll')", } RELEASE_OR_BETA = set() diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js index cf8390f110226..4d0888f201252 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-called-once.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js index f7f10249c7452..528c0cd5ade14 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js index 196a4d22dd0a7..ec522ab2f56c8 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js index fbac1a09a82d7..f9a1e9bf87973 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js index c4abd2fc222f8..5fc20a0f9cd70 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js index 81e33650ff8e4..edb02b3b8c4be 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js index 8557b7475a51f..73baa39d78066 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js index a75066287da86..4f3ebb94b492a 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js index b58549080d944..12a96e9dc62b7 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js index eb54fc92db589..6b1fe894dae67 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js index d4a19e8ada357..6499c3b06ac85 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js index 046519edbaf23..fbc5affa42de3 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js index 1dcb6399913be..9ba712e86ae91 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js index e700edfb46132..521301b3816ca 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js index eaec2d6da4a8f..dacf9b4249825 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js index 97f85e3f6589d..f58fe1169b822 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js index 5a2c080167aea..b9f70a5cea88b 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js index b2d6c2cef1f8f..f7a03a6c569c4 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js index a9dc63f0bfbd1..7612c19e3e180 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js index d8fff8c153db0..083f7e4e50d5b 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js index d121f6402f71d..0c669c359403b 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js index 34a8de3a8dbae..83cf79f929775 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js index e28c931225343..a3fd259a40be8 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js index 9d0ceedc0f327..3dc84b9a0c9fa 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js index 84190a44dc2c1..a2b69cfd1bcbc 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js index c56c854b6e562..8a758e65d553c 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/ancestry.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/ancestry.js index 07cbf0aee3de7..7278de7f3dd71 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/ancestry.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/ancestry.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js index 0f210d0debe7d..4358d95c29a91 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js index 24d60f9e806ca..b70afc1f65621 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js index 4c64e903ed8d0..1db7bb3da988e 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js index d833c31554355..246d158f35946 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js index fb2cde96d397b..3a494cb95f97e 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js index 8d9fede74d04a..2f41827aa47d5 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js index 5d0974c1d343c..b7970c1db23b6 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js index 032f1d49d0a85..da310cd3f2c91 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js index dda4df77cf369..bd178670f9c49 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js index 17775817c3940..480f4abc84066 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js index 32faf8c433bc3..e8018291e98d9 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js index 57f18326bf278..a3c9deba9e017 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js index 63f67c89f68cb..30a506ebbb356 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js index 1f697b931bf8e..54985688ab1a1 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js index c3e71ab5473e2..3d587339c9de3 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js index 10caa6b4708a5..49fc24912e715 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js index f0af5b560ee1b..efab01207fb52 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/prop-desc.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/prop-desc.js index bd4f7377a2e03..4354fc6ae6b93 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/prop-desc.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/prop-desc.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js index af98e81d339f0..0b238fa5529cc 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js index 4ab6d07375d4f..0244014e4ce64 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js index cea2124b64fb4..04fe8fb7fc762 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined.js index 9f36422dc6191..255c0d5a09a88 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js index a9dab11217b1c..02463378340e1 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js index 8a809d0be6a6c..66e7660e197f7 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js index dee0ee90b50d8..647b38fb66d52 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js index 76716e69a242c..55c3799d8d641 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js index 053418fade4b0..422f3b6264fe6 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js index 7da8a4a49b70e..9e42bfef2a8dc 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js index 39360103ee223..fef7c1cc8a86d 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js index 703021575c3a4..dd821f8290d98 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js index 0f704528fc439..6e214fc4160cb 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!String.prototype.hasOwnProperty('matchAll')) -- String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js index ffbe8a4c5bfb0..6652e29f064fd 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')||!String.prototype.hasOwnProperty('matchAll')) -- Symbol.matchAll,String.prototype.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Symbol/matchAll/cross-realm.js b/js/src/tests/test262/built-ins/Symbol/matchAll/cross-realm.js index 0ac8cb9a6977b..7fe4c2a5328f1 100644 --- a/js/src/tests/test262/built-ins/Symbol/matchAll/cross-realm.js +++ b/js/src/tests/test262/built-ins/Symbol/matchAll/cross-realm.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Symbol/matchAll/prop-desc.js b/js/src/tests/test262/built-ins/Symbol/matchAll/prop-desc.js index 20c183cce425a..e0f76d1c7e43d 100644 --- a/js/src/tests/test262/built-ins/Symbol/matchAll/prop-desc.js +++ b/js/src/tests/test262/built-ins/Symbol/matchAll/prop-desc.js @@ -1,4 +1,3 @@ -// |reftest| skip-if(!Symbol.hasOwnProperty('matchAll')) -- Symbol.matchAll is not enabled unconditionally // Copyright (C) 2018 Peter Wong. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- From aad36dec250159b4e0d708d2b5ed93b66656bd09 Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Thu, 7 Mar 2019 00:57:54 +0000 Subject: [PATCH 33/48] Bug 1532996 - Disable test262 atomic tests if ARM64_SIMULATOR. r=jwalden Atomic tests are invalid in the ARM64 Simulator, because it lacks proper atomics emulation. Differential Revision: https://phabricator.services.mozilla.com/D22307 --HG-- extra : moz-landing-system : lando --- js/src/tests/test262-update.py | 5 +++++ js/src/tests/test262/built-ins/Atomics/add/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/add/bigint/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/add/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/add/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/add/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/add/non-views.js | 2 +- .../test262/built-ins/Atomics/add/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/and/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/and/bigint/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/and/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/and/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/and/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/and/non-views.js | 2 +- .../test262/built-ins/Atomics/and/shared-nonint-views.js | 2 +- .../test262/built-ins/Atomics/compareExchange/bad-range.js | 2 +- .../built-ins/Atomics/compareExchange/bigint/bad-range.js | 2 +- .../built-ins/Atomics/compareExchange/bigint/good-views.js | 2 +- .../Atomics/compareExchange/expected-return-value.js | 2 +- .../test262/built-ins/Atomics/compareExchange/good-views.js | 2 +- .../test262/built-ins/Atomics/compareExchange/non-views.js | 2 +- .../built-ins/Atomics/compareExchange/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js | 2 +- .../test262/built-ins/Atomics/exchange/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/exchange/bigint/good-views.js | 2 +- .../built-ins/Atomics/exchange/expected-return-value.js | 2 +- .../tests/test262/built-ins/Atomics/exchange/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/exchange/non-views.js | 2 +- .../built-ins/Atomics/exchange/shared-nonint-views.js | 2 +- .../Atomics/isLockFree/bigint/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/load/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/load/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/load/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/load/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/load/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/load/non-views.js | 2 +- .../test262/built-ins/Atomics/load/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/bad-range.js | 2 +- .../test262/built-ins/Atomics/notify/bigint/bad-range.js | 2 +- .../built-ins/Atomics/notify/bigint/notify-all-on-loc.js | 2 +- .../test262/built-ins/Atomics/notify/count-boundary-cases.js | 2 +- .../Atomics/notify/count-defaults-to-infinity-missing.js | 2 +- .../Atomics/notify/count-defaults-to-infinity-undefined.js | 2 +- .../test262/built-ins/Atomics/notify/count-from-nans.js | 2 +- .../test262/built-ins/Atomics/notify/count-symbol-throws.js | 2 +- .../notify/count-tointeger-throws-then-wake-throws.js | 2 +- .../tests/test262/built-ins/Atomics/notify/negative-count.js | 2 +- .../built-ins/Atomics/notify/negative-index-throws.js | 2 +- .../test262/built-ins/Atomics/notify/non-shared-int-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/non-views.js | 2 +- .../test262/built-ins/Atomics/notify/notify-all-on-loc.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/notify-all.js | 2 +- .../built-ins/Atomics/notify/notify-in-order-one-time.js | 2 +- .../test262/built-ins/Atomics/notify/notify-in-order.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/notify-one.js | 2 +- .../test262/built-ins/Atomics/notify/notify-renotify-noop.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/notify-two.js | 2 +- .../Atomics/notify/notify-with-no-agents-waiting.js | 2 +- .../Atomics/notify/notify-with-no-matching-agents-waiting.js | 2 +- js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js | 2 +- .../built-ins/Atomics/notify/out-of-range-index-throws.js | 2 +- .../test262/built-ins/Atomics/notify/shared-nonint-views.js | 2 +- .../built-ins/Atomics/notify/symbol-for-index-throws.js | 2 +- .../Atomics/notify/undefined-index-defaults-to-zero.js | 2 +- js/src/tests/test262/built-ins/Atomics/or/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/or/bigint/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/or/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/or/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/or/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/or/non-views.js | 2 +- .../test262/built-ins/Atomics/or/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/store/bad-range.js | 2 +- .../test262/built-ins/Atomics/store/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/store/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/store/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/store/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/store/non-views.js | 2 +- .../test262/built-ins/Atomics/store/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/sub/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/sub/bigint/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/sub/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/sub/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/sub/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/sub/non-views.js | 2 +- .../test262/built-ins/Atomics/sub/shared-nonint-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/wait/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/wait/bigint/bad-range.js | 2 +- .../built-ins/Atomics/wait/bigint/cannot-suspend-throws.js | 2 +- .../built-ins/Atomics/wait/bigint/false-for-timeout-agent.js | 2 +- .../built-ins/Atomics/wait/bigint/false-for-timeout.js | 2 +- .../test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js | 2 +- .../built-ins/Atomics/wait/bigint/negative-index-throws.js | 2 +- .../built-ins/Atomics/wait/bigint/negative-timeout-agent.js | 2 +- .../built-ins/Atomics/wait/bigint/negative-timeout.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-no-operation.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-add.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-and.js | 2 +- .../wait/bigint/no-spurious-wakeup-on-compareExchange.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-or.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-store.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-sub.js | 2 +- .../Atomics/wait/bigint/no-spurious-wakeup-on-xor.js | 2 +- .../Atomics/wait/bigint/non-bigint64-typedarray-throws.js | 2 +- .../Atomics/wait/bigint/out-of-range-index-throws.js | 2 +- .../test262/built-ins/Atomics/wait/bigint/value-not-equal.js | 2 +- .../wait/bigint/waiterlist-block-indexedposition-wake.js | 2 +- .../wait/bigint/waiterlist-order-of-operations-is-fifo.js | 2 +- .../Atomics/wait/bigint/was-woken-before-timeout.js | 2 +- .../test262/built-ins/Atomics/wait/cannot-suspend-throws.js | 2 +- .../built-ins/Atomics/wait/false-for-timeout-agent.js | 2 +- .../test262/built-ins/Atomics/wait/false-for-timeout.js | 2 +- .../tests/test262/built-ins/Atomics/wait/nan-for-timeout.js | 2 +- .../test262/built-ins/Atomics/wait/negative-index-throws.js | 2 +- .../test262/built-ins/Atomics/wait/negative-timeout-agent.js | 2 +- .../tests/test262/built-ins/Atomics/wait/negative-timeout.js | 2 +- .../Atomics/wait/no-spurious-wakeup-no-operation.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-add.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-and.js | 2 +- .../Atomics/wait/no-spurious-wakeup-on-compareExchange.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-or.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-store.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js | 2 +- .../built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js | 2 +- .../test262/built-ins/Atomics/wait/null-for-timeout-agent.js | 2 +- .../tests/test262/built-ins/Atomics/wait/null-for-timeout.js | 2 +- .../built-ins/Atomics/wait/object-for-timeout-agent.js | 2 +- .../test262/built-ins/Atomics/wait/object-for-timeout.js | 2 +- .../built-ins/Atomics/wait/out-of-range-index-throws.js | 2 +- .../Atomics/wait/poisoned-object-for-timeout-throws-agent.js | 2 +- .../Atomics/wait/poisoned-object-for-timeout-throws.js | 2 +- .../built-ins/Atomics/wait/symbol-for-index-throws-agent.js | 2 +- .../built-ins/Atomics/wait/symbol-for-index-throws.js | 2 +- .../Atomics/wait/symbol-for-timeout-throws-agent.js | 2 +- .../built-ins/Atomics/wait/symbol-for-timeout-throws.js | 2 +- .../built-ins/Atomics/wait/symbol-for-value-throws-agent.js | 2 +- .../built-ins/Atomics/wait/symbol-for-value-throws.js | 2 +- .../test262/built-ins/Atomics/wait/true-for-timeout-agent.js | 2 +- .../tests/test262/built-ins/Atomics/wait/true-for-timeout.js | 2 +- .../test262/built-ins/Atomics/wait/undefined-for-timeout.js | 2 +- .../Atomics/wait/undefined-index-defaults-to-zero.js | 2 +- .../tests/test262/built-ins/Atomics/wait/value-not-equal.js | 2 +- .../built-ins/Atomics/wait/wait-index-value-not-equal.js | 2 +- .../Atomics/wait/waiterlist-block-indexedposition-wake.js | 2 +- .../Atomics/wait/waiterlist-order-of-operations-is-fifo.js | 2 +- .../built-ins/Atomics/wait/was-woken-before-timeout.js | 2 +- js/src/tests/test262/built-ins/Atomics/xor/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/xor/bigint/bad-range.js | 2 +- .../tests/test262/built-ins/Atomics/xor/bigint/good-views.js | 2 +- .../test262/built-ins/Atomics/xor/expected-return-value.js | 2 +- js/src/tests/test262/built-ins/Atomics/xor/good-views.js | 2 +- js/src/tests/test262/built-ins/Atomics/xor/non-views.js | 2 +- .../test262/built-ins/Atomics/xor/shared-nonint-views.js | 2 +- 155 files changed, 159 insertions(+), 154 deletions(-) diff --git a/js/src/tests/test262-update.py b/js/src/tests/test262-update.py index 86adefb7d478c..2b0fb7720623b 100755 --- a/js/src/tests/test262-update.py +++ b/js/src/tests/test262-update.py @@ -296,6 +296,11 @@ def convertTestFile(test262parser, testSource, testName, includeSet, strictTests "%s is not enabled unconditionally" % ",".join( featureCheckNeeded))) + if "Atomics" in testRec["features"] and "SharedArrayBuffer" in testRec["features"]: + refTestSkipIf.append(("(this.hasOwnProperty('getBuildConfiguration')" + "&&getBuildConfiguration()['arm64-simulator'])", + "ARM64 Simulator cannot emulate atomics")) + # Includes for every test file in a directory is collected in a single # shell.js file per directory level. This is done to avoid adding all # test harness files to the top level shell.js file. diff --git a/js/src/tests/test262/built-ins/Atomics/add/bad-range.js b/js/src/tests/test262/built-ins/Atomics/add/bad-range.js index 7fb5ab1a41197..9e783fc6906e5 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/add/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js index f9e76522b35f6..357514ec313c8 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/add/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/add/bigint/good-views.js index 9e1f2cb8942c9..9e913ece499f7 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/add/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/add/expected-return-value.js index 78daf3991ba96..2a6e701349b20 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/add/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/add/good-views.js b/js/src/tests/test262/built-ins/Atomics/add/good-views.js index 257f1d39fe006..2b68c773b9df0 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/add/non-views.js b/js/src/tests/test262/built-ins/Atomics/add/non-views.js index 0e88a867d2562..8675ac1c1eaa0 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/add/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/add/shared-nonint-views.js index aecfd43bee7d6..b9828b5e807e1 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/and/bad-range.js b/js/src/tests/test262/built-ins/Atomics/and/bad-range.js index 83bba1f89ae1e..056db7b036e2a 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/and/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js index f062372b074fd..e4e2b5bc7cf71 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/and/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/and/bigint/good-views.js index c397185d9bfe6..dc5287c63c4dc 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/and/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/and/expected-return-value.js index 6ffc6decc79cc..737b262f3db17 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/and/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/and/good-views.js b/js/src/tests/test262/built-ins/Atomics/and/good-views.js index 827e4dc1f6b7c..f242b8d271b2b 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/and/non-views.js b/js/src/tests/test262/built-ins/Atomics/and/non-views.js index 22d3378f1bc82..9ffc1e5b9e5b0 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/and/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/and/shared-nonint-views.js index 0b7089b764ff6..aaea2be9aa2bb 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js index faea59777861e..570a7a864d49e 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js index be9c4d0afd689..3b1e1b9fd1986 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/good-views.js index 412ab17f5de5b..599b0f569528f 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/expected-return-value.js index 9aed45685664c..1219bf1bae06e 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js index 153bd71c95be6..a9a8afc53f234 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js index c35953822268e..79c1904ad218b 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/shared-nonint-views.js index 6e1c728a53195..d868841908d06 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js b/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js index e35fc3b74a773..a308ea18ec60e 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js index 50f4e035ecd63..8f8f09eb8d24c 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/good-views.js index 877ec1f70181c..cd3bf5b269b63 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/exchange/expected-return-value.js index eb735dd038ff9..be86e9bb75dc7 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js index b95a904c246fc..99de503adaeaa 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js index b68e24b75c119..fd4fe97c8ab50 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/shared-nonint-views.js index e17eb50f17f6e..6deba0894ebc7 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js index e699feb19359d..664263256e62c 100644 --- a/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/isLockFree/bigint/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/bad-range.js b/js/src/tests/test262/built-ins/Atomics/load/bad-range.js index 64346a413d803..016513c68bf00 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/load/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js index 4ce50a215642e..4f0c1aee452f1 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/load/bigint/good-views.js index 0329a9c9d55dd..63d288fd230ee 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/load/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/load/expected-return-value.js index 424fcccb2c52f..60e7d12c4b9fd 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/load/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/good-views.js b/js/src/tests/test262/built-ins/Atomics/load/good-views.js index 2a96ad92b90b9..34007adc638fb 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/non-views.js b/js/src/tests/test262/built-ins/Atomics/load/non-views.js index 6899d9cd9ee50..27ce355f3faaf 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/load/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/load/shared-nonint-views.js index 0773446ab15f0..a89153974ff88 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js b/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js index 5be50b87c2194..cd149aea8343d 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js index b5de263c953d5..492127bf94047 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js index 4948995634475..930a60b87c215 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-boundary-cases.js b/js/src/tests/test262/built-ins/Atomics/notify/count-boundary-cases.js index 8916dcf091d3b..c9975fe467857 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-boundary-cases.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-boundary-cases.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js index 10beac55cc001..e798141f3090b 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js index 66101c7944a07..c51af980189e0 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-from-nans.js b/js/src/tests/test262/built-ins/Atomics/notify/count-from-nans.js index 05462b2d0b867..2922eca7014da 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-from-nans.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-from-nans.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js index d1119eaf7decd..d791756ef887e 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js index a9223187648de..184c2006d5560 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js b/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js index 86a3e4561a025..7ed96b1d7fcc8 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js index 58ee322b077b3..a6dc83754031a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js index b11efe2b341bc..29613794742b4 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-views.js b/js/src/tests/test262/built-ins/Atomics/notify/non-views.js index ec687c8662db9..ef42622ab8cf8 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js index 3796e8f4ba763..dbc902b6a1fdc 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js index 8fdd6fe4d3b57..9f283156ffaff 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js index 0142fa61d0c39..b4abca79d33bf 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js index 0142fa61d0c39..b4abca79d33bf 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js index da2be752476a2..909fc9a37cf38 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js index 3799e9a1fe2eb..9142d8b4c2a35 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js index e1a88d2d5a675..6aa5bbb186370 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js index 886f054dfd943..69225a2630f15 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js index bc5c99dbf5f78..870632bfd05e7 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js index 80d213ac9c51e..66f41832a5c6a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js index dc0d07ffabf9b..56df7777151e6 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js index d4673ab039f3e..e4e2d9f809fd1 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/notify/shared-nonint-views.js index a61080d34a188..bc3e37ab7627b 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js index af5d0f926fcbf..33bbc00a1b25a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js b/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js index d621db1ff63e3..7533c65f53515 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/or/bad-range.js b/js/src/tests/test262/built-ins/Atomics/or/bad-range.js index 495c2ef43f6a7..7782bf6b3f72f 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/or/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js index 23cb7dc9a6528..0b59883440c41 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/or/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/or/bigint/good-views.js index 10114799ce075..4d6cab07f4b28 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/or/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/or/expected-return-value.js index 624a74fe20d86..ed4b4985f952b 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/or/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/or/good-views.js b/js/src/tests/test262/built-ins/Atomics/or/good-views.js index fccaf777ccd33..c8c64c46578c0 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/or/non-views.js b/js/src/tests/test262/built-ins/Atomics/or/non-views.js index d290090baeedf..86e860786cf80 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/or/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/or/shared-nonint-views.js index be313c3e68f56..b00ecf165fadb 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/store/bad-range.js b/js/src/tests/test262/built-ins/Atomics/store/bad-range.js index 4fb441cc1177b..8a802eeb0a5df 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/store/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js index 7d646689c5842..b4520ccddb4ca 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/store/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/store/bigint/good-views.js index 9d1673ebef5dd..eef341a2510b3 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/store/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/store/expected-return-value.js index a8861bfe6f7e4..2e4b30fbbb615 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/store/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/store/good-views.js b/js/src/tests/test262/built-ins/Atomics/store/good-views.js index 5f298da191d47..0248022db9afb 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/store/non-views.js b/js/src/tests/test262/built-ins/Atomics/store/non-views.js index ab684237e3591..b857994f6d855 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/store/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/store/shared-nonint-views.js index de9839cfe1311..ebe942ccaeb29 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js b/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js index 3721ed5f7276e..f167d0e997725 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js index 11f71c31cee7f..b7ce33876d0e9 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/sub/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/sub/bigint/good-views.js index a56f43dda252e..ee7e9ae37edf3 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/sub/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/sub/expected-return-value.js index ab3958b52f0d7..d9be3e9144e40 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/sub/good-views.js b/js/src/tests/test262/built-ins/Atomics/sub/good-views.js index 22e896d2b091c..c99583692ee4a 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/sub/non-views.js b/js/src/tests/test262/built-ins/Atomics/sub/non-views.js index a10b5bcc11693..0e86139b8988f 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/sub/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/sub/shared-nonint-views.js index 205e5e6070cb2..4d6e90909b27f 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js b/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js index c7cba3b0db41d..777d623b65edd 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js index dc625981d579c..2a68fae113e90 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js index c72915c7334ea..8130fc0151e51 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- shell can block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- shell can block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js index 27f592439e3e0..f39b214ce75aa 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout.js index ee485ac45ffb7..db08119560fdb 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js index 270d2d176ef64..d3292dc2607ee 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js index 6ffb995f3be65..d806ff6b8529c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js index af379d679f69c..7899e550077e1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout.js index 84aeb37e2af59..86a1002f15a0f 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js index 94182b6e1790f..0158728d5243e 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js index cf53ace6c2a16..5ba61fad101b7 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js index 28a27872bf421..8599a72a83966 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js index 8c59d02bad625..86ab549453d9d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js index 7f112f451945b..5a2a9673a203b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js index 7eb13ad71b9c0..0bd4b92138eb4 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js index ce3b4f421ed3e..340ab4939cda8 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js index 7917f7afd4a1d..7f5a0c2a0e0c0 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js index 9dd441396d396..05c98154d1c43 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js index 94733a02111d0..02edc652c19f6 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js index 9febcd3479463..f18effa90bb80 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js index 9b6e92f029c10..9ea55866402c6 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js index e42a4ff36204c..43a83e002de1d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js index 3ba8d4ada02ca..1c1eb2dba3dd7 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js index fa1418f5012a9..d882632d842a5 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js index ced0e3bf65581..696a86fda4420 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- shell can block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- shell can block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js index 90af603a5b62f..32966ed7825db 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout.js index 6e79548525698..b744c5aede69b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js index 006cc204b09a1..373083aa5a270 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js index 356bdea0ae495..d25d57c1c76f7 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js index 9dc10cb5e5a1b..0d2f8f7d1ef14 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout.js index 64f5961d8eda0..299f4d307f9f3 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js index e6769b8bab4a6..da8bf75be0835 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js index bc2df97dceda4..27a2914b2ee2b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js index 8843258949227..13dfa1cfb7d23 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js index 3fe8530ee8ce6..1da28e628f62d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js index 7417f05f46a8c..88793bf8efe33 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js index 2a4c5438773bf..6b457df3010cd 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js index 75b8a7aa7e607..0ab8075e1403d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js index 4a5c7625a8969..24bc5127ebd67 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js index 45757a0c9d636..0d0802c42cf5e 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js index 6cd222ace2c85..a2cd76790a941 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout.js index 00acd5f36286a..a336e07a7e481 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js index 112435bd060b3..90ecd630e0895 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout.js index f8001225b4558..c9459196b93f8 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js index 86b9ad75e6997..d2dd3da578484 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js index 099e4f7ecfaed..ae1882d4a16dc 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js index 82e5ac0efa2c6..cffe81af60f11 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js index 354739517947f..771b497c4e81c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js index cb40d894bc4d9..d5f12ffbdfabd 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js index 599b3fb453193..d30d0f0488ab9 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js index 8e15822419d20..a6be3df183b90 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js index 6f6c00b051763..5491987f91d1c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js index c672947bfc02c..52a0bbfbf0e55 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js index bdc7e519b9a1e..383815abc1c4b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout.js index 88c259867009e..3dbc97048a05f 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!xulRuntime.shell||!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- browser cannot block main thread, Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js index fe3e7bbefe3bc..834b962422f48 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js b/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js index dc999cfa31ac8..3ea0dcc13305d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js index 9ac7d8cb06ff2..e5ecb4a34b0c8 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js index bcf4d64e7442d..1947cd6a93d78 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js index 119636483dc7c..f3b2a06300545 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js index 930df10ab2f5b..42fd5d4827051 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js index 4c209cd664192..b1f132660ecae 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Amal Hussein. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js b/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js index 2da3645d2ba41..4aae0e925fac8 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js index 7310026879c97..e2c88ae81fd22 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/xor/bigint/good-views.js b/js/src/tests/test262/built-ins/Atomics/xor/bigint/good-views.js index 65cb3f1de7ed2..7ad54e76f75a7 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/bigint/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/bigint/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Atomics/xor/expected-return-value.js b/js/src/tests/test262/built-ins/Atomics/xor/expected-return-value.js index 1b322529d6aab..9ebcd51663c66 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/expected-return-value.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/expected-return-value.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/xor/good-views.js b/js/src/tests/test262/built-ins/Atomics/xor/good-views.js index aa6f7becf6e19..f881f87dee29a 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/xor/non-views.js b/js/src/tests/test262/built-ins/Atomics/xor/non-views.js index f4198be622313..d23ca3ec64fef 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/non-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/Atomics/xor/shared-nonint-views.js b/js/src/tests/test262/built-ins/Atomics/xor/shared-nonint-views.js index 6a2eb87a1d770..1937e182aa21e 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/shared-nonint-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/shared-nonint-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration()['arm64-simulator'])) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. From 1944262d43d66c9d8ec4dfa99440d52475ef0c0b Mon Sep 17 00:00:00 2001 From: ravefalcon92 Date: Thu, 7 Mar 2019 01:01:05 +0000 Subject: [PATCH 34/48] Bug 1530423 - Ensure breakpoints are added to newly-cloned JSScripts for existing sources. r=loganfsmyth Similar to bug 1528654, we currently bail out too early and don't process all of the correct scripts when adding breakpoints. Differential Revision: https://phabricator.services.mozilla.com/D22355 --HG-- extra : moz-landing-system : lando --- devtools/server/actors/thread.js | 9 --- devtools/server/tests/unit/test_source-04.js | 80 ++++++++++++++++++++ devtools/server/tests/unit/xpcshell.ini | 1 + 3 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 devtools/server/tests/unit/test_source-04.js diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index 9551e14279bf7..02bc5f8a37076 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -1734,15 +1734,6 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { // and so we also need to be sure that there is still a source actor for the source. let sourceActor; if (this._debuggerSourcesSeen.has(source) && this.sources.hasSourceActor(source)) { - // When replaying, fall through and try to setup breakpoints, even for - // sources we have seen before. When replaying, we can have actors for - // sources that have not been created yet, and trying to set breakpoints - // in them will not produce any scripts. When execution proceeds to the - // point where the source is created (and we readd the source), we will - // be able to get its scripts. - if (!this.dbg.replaying) { - return false; - } sourceActor = this.sources.getSourceActor(source); } else { sourceActor = this.sources.createSourceActor(source); diff --git a/devtools/server/tests/unit/test_source-04.js b/devtools/server/tests/unit/test_source-04.js new file mode 100644 index 0000000000000..1f66327506978 --- /dev/null +++ b/devtools/server/tests/unit/test_source-04.js @@ -0,0 +1,80 @@ +/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* eslint-disable no-shadow, max-nested-callbacks */ + +"use strict"; + +const SOURCE_URL = getFileUrl("source-03.js"); + +add_task(threadClientTest(async ({ threadClient, server }) => { + const promise = waitForNewSource(threadClient, SOURCE_URL); + + // Create two globals in the default junk sandbox compartment so that + // both globals are part of the same compartment. + server.allowNewThreadGlobals(); + const debuggee1 = Cu.Sandbox(systemPrincipal); + debuggee1.__name = "debuggee2.js"; + const debuggee2 = Cu.Sandbox(systemPrincipal); + debuggee2.__name = "debuggee2.js"; + server.disallowNewThreadGlobals(); + + // Load first copy of the source file. The first call to "loadSubScript" will + // create a ScriptSourceObject and a JSScript which references it. + loadSubScript(SOURCE_URL, debuggee1); + + await promise; + + // We want to set a breakpoint and make sure that the breakpoint is properly + // set on _both_ files backed + await setBreakpoint(threadClient, { + sourceUrl: SOURCE_URL, + line: 4, + }); + + const { sources } = await getSources(threadClient); + Assert.equal(sources.length, 1); + + // Ensure that the breakpoint was properly applied to the JSScipt loaded + // in the first global. + let pausedOne = false; + threadClient.addOneTimeListener("paused", function(event, packet) { + pausedOne = true; + resume(threadClient); + }); + Cu.evalInSandbox( + "init()", + debuggee1, + "1.8", + "test.js", + 1 + ); + Assert.equal(pausedOne, true); + + // Load second copy of the source file. The second call will attempt to + // re-use JSScript objects because that is what loadSubScript does for + // instances of the same file that are loaded in the system principal in + // the same compartment. + // + // We explicitly want this because it is an edge case of the server. Most + // of the time a Debugger.Source will only have a single Debugger.Script + // associated with a given function, but in the context of explicitly + // cloned JSScripts, this is not the case, and we need to handle that. + loadSubScript(SOURCE_URL, debuggee2); + + // Ensure that the breakpoint was properly applied to the JSScipt loaded + // in the second global. + let pausedTwo = false; + threadClient.addOneTimeListener("paused", function(event, packet) { + pausedTwo = true; + resume(threadClient); + }); + Cu.evalInSandbox( + "init()", + debuggee2, + "1.8", + "test.js", + 1 + ); + Assert.equal(pausedTwo, true); +}, { doNotRunWorker: true })); diff --git a/devtools/server/tests/unit/xpcshell.ini b/devtools/server/tests/unit/xpcshell.ini index 5a677165b0f3f..1e83871140eec 100644 --- a/devtools/server/tests/unit/xpcshell.ini +++ b/devtools/server/tests/unit/xpcshell.ini @@ -209,6 +209,7 @@ skip-if = true # breakpoint sliding is not supported bug 1525685 [test_source-01.js] [test_source-02.js] [test_source-03.js] +[test_source-04.js] [test_wasm_source-01.js] [test_breakpoint-actor-map.js] skip-if = true # tests for breakpoint actors are obsolete bug 1524374 From cdedc6cb3afeae64b056ed586ef3204bacc62e29 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Thu, 7 Mar 2019 01:35:43 +0000 Subject: [PATCH 35/48] Bug 1532805 - Move UserAutoCompleteResult to its own file and rename to LoginAutoCompleteResult. r=prathiksha Differential Revision: https://phabricator.services.mozilla.com/D22419 --HG-- rename : toolkit/components/passwordmgr/LoginManagerContent.jsm => toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm rename : toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js => toolkit/components/passwordmgr/test/unit/test_login_autocomplete_result.js extra : moz-landing-system : lando --- .../passwordmgr/LoginAutoCompleteResult.jsm | 206 ++++++++++++++++++ .../components/passwordmgr/LoginManager.jsm | 6 +- .../passwordmgr/LoginManagerContent.jsm | 190 +--------------- toolkit/components/passwordmgr/moz.build | 1 + .../test_password_field_autocomplete.html | 2 +- ...t.js => test_login_autocomplete_result.js} | 13 +- .../passwordmgr/test/unit/xpcshell.ini | 4 +- tools/lint/eslint/modules.json | 2 +- 8 files changed, 224 insertions(+), 200 deletions(-) create mode 100644 toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm rename toolkit/components/passwordmgr/test/unit/{test_user_autocomplete_result.js => test_login_autocomplete_result.js} (96%) diff --git a/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm b/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm new file mode 100644 index 0000000000000..477079773a7cf --- /dev/null +++ b/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm @@ -0,0 +1,206 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * nsIAutoCompleteResult implementation for saved logins. + */ + +"use strict"; + +var EXPORTED_SYMBOLS = ["LoginAutoCompleteResult"]; + +const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); +const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); + +ChromeUtils.defineModuleGetter(this, "LoginHelper", + "resource://gre/modules/LoginHelper.jsm"); + +XPCOMUtils.defineLazyGetter(this, "log", () => { + let logger = LoginHelper.createLogger("LoginAutoCompleteResult"); + return logger.log.bind(logger); +}); + +// nsIAutoCompleteResult implementation +function LoginAutoCompleteResult(aSearchString, matchingLogins, {isSecure, messageManager, isPasswordField, hostname}) { + function loginSort(a, b) { + let userA = a.username.toLowerCase(); + let userB = b.username.toLowerCase(); + + if (userA < userB) { + return -1; + } + + if (userA > userB) { + return 1; + } + + return 0; + } + + function findDuplicates(loginList) { + let seen = new Set(); + let duplicates = new Set(); + for (let login of loginList) { + if (seen.has(login.username)) { + duplicates.add(login.username); + } + seen.add(login.username); + } + return duplicates; + } + + this._showInsecureFieldWarning = (!isSecure && LoginHelper.showInsecureFieldWarning) ? 1 : 0; + this._showAutoCompleteFooter = LoginHelper.showAutoCompleteFooter ? 1 : 0; + this.searchString = aSearchString; + this.logins = matchingLogins.sort(loginSort); + this.matchCount = matchingLogins.length + this._showInsecureFieldWarning + this._showAutoCompleteFooter; + this._messageManager = messageManager; + this._stringBundle = Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties"); + this._dateAndTimeFormatter = new Services.intl.DateTimeFormat(undefined, { dateStyle: "medium" }); + + this._isPasswordField = isPasswordField; + this._hostname = hostname; + + this._duplicateUsernames = findDuplicates(matchingLogins); + + if (this.matchCount > 0) { + this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS; + this.defaultIndex = 0; + } +} + +LoginAutoCompleteResult.prototype = { + QueryInterface: ChromeUtils.generateQI([Ci.nsIAutoCompleteResult, + Ci.nsISupportsWeakReference]), + + // private + logins: null, + + // Allow autoCompleteSearch to get at the JS object so it can + // modify some readonly properties for internal use. + get wrappedJSObject() { + return this; + }, + + // Interfaces from idl... + searchString: null, + searchResult: Ci.nsIAutoCompleteResult.RESULT_NOMATCH, + defaultIndex: -1, + errorDescription: "", + matchCount: 0, + + getValueAt(index) { + if (index < 0 || index >= this.matchCount) { + throw new Error("Index out of range."); + } + + if (this._showInsecureFieldWarning && index === 0) { + return ""; + } + + if (this._showAutoCompleteFooter && index === this.matchCount - 1) { + return ""; + } + + let selectedLogin = this.logins[index - this._showInsecureFieldWarning]; + + return this._isPasswordField ? selectedLogin.password : selectedLogin.username; + }, + + getLabelAt(index) { + if (index < 0 || index >= this.matchCount) { + throw new Error("Index out of range."); + } + + let getLocalizedString = (key, formatArgs = null) => { + if (formatArgs) { + return this._stringBundle.formatStringFromName(key, formatArgs, formatArgs.length); + } + return this._stringBundle.GetStringFromName(key); + }; + + if (this._showInsecureFieldWarning && index === 0) { + let learnMoreString = getLocalizedString("insecureFieldWarningLearnMore"); + return getLocalizedString("insecureFieldWarningDescription2", [learnMoreString]); + } else if (this._showAutoCompleteFooter && index === this.matchCount - 1) { + return JSON.stringify({ + label: getLocalizedString("viewSavedLogins.label"), + hostname: this._hostname, + }); + } + + let login = this.logins[index - this._showInsecureFieldWarning]; + let username = login.username; + // If login is empty or duplicated we want to append a modification date to it. + if (!username || this._duplicateUsernames.has(username)) { + if (!username) { + username = getLocalizedString("noUsername"); + } + let meta = login.QueryInterface(Ci.nsILoginMetaInfo); + let time = this._dateAndTimeFormatter.format(new Date(meta.timePasswordChanged)); + username = getLocalizedString("loginHostAge", [username, time]); + } + + return username; + }, + + getCommentAt(index) { + return ""; + }, + + getStyleAt(index) { + if (index == 0 && this._showInsecureFieldWarning) { + return "insecureWarning"; + } else if (this._showAutoCompleteFooter && index == this.matchCount - 1) { + return "loginsFooter"; + } + + return "login"; + }, + + getImageAt(index) { + return ""; + }, + + getFinalCompleteValueAt(index) { + return this.getValueAt(index); + }, + + removeValueAt(index, removeFromDB) { + if (index < 0 || index >= this.matchCount) { + throw new Error("Index out of range."); + } + + if (this._showInsecureFieldWarning && index === 0) { + // Ignore the warning message item. + return; + } + + if (this._showInsecureFieldWarning) { + index--; + } + + // The user cannot delete the autocomplete footer. + if (this._showAutoCompleteFooter && index === this.matchCount - 1) { + return; + } + + let [removedLogin] = this.logins.splice(index, 1); + + this.matchCount--; + if (this.defaultIndex > this.logins.length) { + this.defaultIndex--; + } + + if (removeFromDB) { + if (this._messageManager) { + let vanilla = LoginHelper.loginToVanillaObject(removedLogin); + this._messageManager.sendAsyncMessage("PasswordManager:removeLogin", + { login: vanilla }); + } else { + Services.logins.removeLogin(removedLogin); + } + } + }, +}; diff --git a/toolkit/components/passwordmgr/LoginManager.jsm b/toolkit/components/passwordmgr/LoginManager.jsm index 91aedfe23d238..161febfa6351b 100644 --- a/toolkit/components/passwordmgr/LoginManager.jsm +++ b/toolkit/components/passwordmgr/LoginManager.jsm @@ -17,8 +17,8 @@ ChromeUtils.defineModuleGetter(this, "LoginFormFactory", "resource://gre/modules/LoginManagerContent.jsm"); ChromeUtils.defineModuleGetter(this, "LoginManagerContent", "resource://gre/modules/LoginManagerContent.jsm"); -ChromeUtils.defineModuleGetter(this, "UserAutoCompleteResult", - "resource://gre/modules/LoginManagerContent.jsm"); +ChromeUtils.defineModuleGetter(this, "LoginAutoCompleteResult", + "resource://gre/modules/LoginAutoCompleteResult.jsm"); ChromeUtils.defineModuleGetter(this, "InsecurePasswordUtils", "resource://gre/modules/InsecurePasswordUtils.jsm"); @@ -534,7 +534,7 @@ LoginManager.prototype = { } this._autoCompleteLookupPromise = null; - let results = new UserAutoCompleteResult(aSearchString, logins, { + let results = new LoginAutoCompleteResult(aSearchString, logins, { messageManager, isSecure, isPasswordField, diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index 90ce2abf22b74..c05e02088a012 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -11,9 +11,10 @@ "use strict"; -var EXPORTED_SYMBOLS = [ "LoginManagerContent", - "LoginFormFactory", - "UserAutoCompleteResult" ]; +var EXPORTED_SYMBOLS = [ + "LoginManagerContent", + "LoginFormFactory", +]; const PASSWORD_INPUT_ADDED_COALESCING_THRESHOLD_MS = 1; const AUTOCOMPLETE_AFTER_RIGHT_CLICK_THRESHOLD_MS = 400; @@ -1564,189 +1565,6 @@ var LoginManagerContent = { }, }; -// nsIAutoCompleteResult implementation -function UserAutoCompleteResult(aSearchString, matchingLogins, {isSecure, messageManager, isPasswordField, hostname}) { - function loginSort(a, b) { - var userA = a.username.toLowerCase(); - var userB = b.username.toLowerCase(); - - if (userA < userB) { - return -1; - } - - if (userA > userB) { - return 1; - } - - return 0; - } - - function findDuplicates(loginList) { - let seen = new Set(); - let duplicates = new Set(); - for (let login of loginList) { - if (seen.has(login.username)) { - duplicates.add(login.username); - } - seen.add(login.username); - } - return duplicates; - } - - this._showInsecureFieldWarning = (!isSecure && LoginHelper.showInsecureFieldWarning) ? 1 : 0; - this._showAutoCompleteFooter = LoginHelper.showAutoCompleteFooter ? 1 : 0; - this.searchString = aSearchString; - this.logins = matchingLogins.sort(loginSort); - this.matchCount = matchingLogins.length + this._showInsecureFieldWarning + this._showAutoCompleteFooter; - this._messageManager = messageManager; - this._stringBundle = Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties"); - this._dateAndTimeFormatter = new Services.intl.DateTimeFormat(undefined, { dateStyle: "medium" }); - - this._isPasswordField = isPasswordField; - this._hostname = hostname; - - this._duplicateUsernames = findDuplicates(matchingLogins); - - if (this.matchCount > 0) { - this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS; - this.defaultIndex = 0; - } -} - -UserAutoCompleteResult.prototype = { - QueryInterface: ChromeUtils.generateQI([Ci.nsIAutoCompleteResult, - Ci.nsISupportsWeakReference]), - - // private - logins: null, - - // Allow autoCompleteSearch to get at the JS object so it can - // modify some readonly properties for internal use. - get wrappedJSObject() { - return this; - }, - - // Interfaces from idl... - searchString: null, - searchResult: Ci.nsIAutoCompleteResult.RESULT_NOMATCH, - defaultIndex: -1, - errorDescription: "", - matchCount: 0, - - getValueAt(index) { - if (index < 0 || index >= this.matchCount) { - throw new Error("Index out of range."); - } - - if (this._showInsecureFieldWarning && index === 0) { - return ""; - } - - if (this._showAutoCompleteFooter && index === this.matchCount - 1) { - return ""; - } - - let selectedLogin = this.logins[index - this._showInsecureFieldWarning]; - - return this._isPasswordField ? selectedLogin.password : selectedLogin.username; - }, - - getLabelAt(index) { - if (index < 0 || index >= this.matchCount) { - throw new Error("Index out of range."); - } - - let getLocalizedString = (key, formatArgs = null) => { - if (formatArgs) { - return this._stringBundle.formatStringFromName(key, formatArgs, formatArgs.length); - } - return this._stringBundle.GetStringFromName(key); - }; - - if (this._showInsecureFieldWarning && index === 0) { - let learnMoreString = getLocalizedString("insecureFieldWarningLearnMore"); - return getLocalizedString("insecureFieldWarningDescription2", [learnMoreString]); - } else if (this._showAutoCompleteFooter && index === this.matchCount - 1) { - return JSON.stringify({ - label: getLocalizedString("viewSavedLogins.label"), - hostname: this._hostname, - }); - } - - let login = this.logins[index - this._showInsecureFieldWarning]; - let username = login.username; - // If login is empty or duplicated we want to append a modification date to it. - if (!username || this._duplicateUsernames.has(username)) { - if (!username) { - username = getLocalizedString("noUsername"); - } - let meta = login.QueryInterface(Ci.nsILoginMetaInfo); - let time = this._dateAndTimeFormatter.format(new Date(meta.timePasswordChanged)); - username = getLocalizedString("loginHostAge", [username, time]); - } - - return username; - }, - - getCommentAt(index) { - return ""; - }, - - getStyleAt(index) { - if (index == 0 && this._showInsecureFieldWarning) { - return "insecureWarning"; - } else if (this._showAutoCompleteFooter && index == this.matchCount - 1) { - return "loginsFooter"; - } - - return "login"; - }, - - getImageAt(index) { - return ""; - }, - - getFinalCompleteValueAt(index) { - return this.getValueAt(index); - }, - - removeValueAt(index, removeFromDB) { - if (index < 0 || index >= this.matchCount) { - throw new Error("Index out of range."); - } - - if (this._showInsecureFieldWarning && index === 0) { - // Ignore the warning message item. - return; - } - - if (this._showInsecureFieldWarning) { - index--; - } - - // The user cannot delete the autocomplete footer. - if (this._showAutoCompleteFooter && index === this.matchCount - 1) { - return; - } - - var [removedLogin] = this.logins.splice(index, 1); - - this.matchCount--; - if (this.defaultIndex > this.logins.length) { - this.defaultIndex--; - } - - if (removeFromDB) { - if (this._messageManager) { - let vanilla = LoginHelper.loginToVanillaObject(removedLogin); - this._messageManager.sendAsyncMessage("PasswordManager:removeLogin", - { login: vanilla }); - } else { - Services.logins.removeLogin(removedLogin); - } - } - }, -}; /** * A factory to generate FormLike objects that represent a set of login fields diff --git a/toolkit/components/passwordmgr/moz.build b/toolkit/components/passwordmgr/moz.build index 2a16b5e08fccc..11476b775da6d 100644 --- a/toolkit/components/passwordmgr/moz.build +++ b/toolkit/components/passwordmgr/moz.build @@ -31,6 +31,7 @@ XPIDL_MODULE = 'loginmgr' EXTRA_JS_MODULES += [ 'crypto-SDR.js', 'InsecurePasswordUtils.jsm', + 'LoginAutoCompleteResult.jsm', 'LoginHelper.jsm', 'LoginInfo.jsm', 'LoginManager.jsm', diff --git a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html index 9416737c020c4..3d8308ac48872 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html @@ -107,7 +107,7 @@ async function reinitializeForm(index) { // Using innerHTML is for creating the autocomplete popup again, so the // preference value will be applied to the constructor of - // UserAutoCompleteResult. + // LoginAutoCompleteResult. let form = document.getElementById("form" + index); let temp = form.innerHTML; form.innerHTML = ""; diff --git a/toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js b/toolkit/components/passwordmgr/test/unit/test_login_autocomplete_result.js similarity index 96% rename from toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js rename to toolkit/components/passwordmgr/test/unit/test_login_autocomplete_result.js index 9f493962c4970..ea27494664e02 100644 --- a/toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js +++ b/toolkit/components/passwordmgr/test/unit/test_login_autocomplete_result.js @@ -1,4 +1,4 @@ -const {UserAutoCompleteResult} = ChromeUtils.import("resource://gre/modules/LoginManagerContent.jsm"); +const {LoginAutoCompleteResult} = ChromeUtils.import("resource://gre/modules/LoginAutoCompleteResult.jsm"); var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init"); @@ -455,17 +455,16 @@ let expectedResults = [ ]; add_task(async function test_all_patterns() { - LoginHelper.createLogger("UserAutoCompleteResult"); + LoginHelper.createLogger("LoginAutoCompleteResult"); expectedResults.forEach(pattern => { Services.prefs.setBoolPref(PREF_INSECURE_FIELD_WARNING_ENABLED, pattern.insecureFieldWarningEnabled); Services.prefs.setBoolPref(PREF_INSECURE_AUTOFILLFORMS_ENABLED, pattern.insecureAutoFillFormsEnabled); - let actual = new UserAutoCompleteResult("", pattern.matchingLogins, - { - isSecure: pattern.isSecure, - isPasswordField: pattern.isPasswordField, - }); + let actual = new LoginAutoCompleteResult("", pattern.matchingLogins, { + isSecure: pattern.isSecure, + isPasswordField: pattern.isPasswordField, + }); pattern.items.forEach((item, index) => { equal(actual.getValueAt(index), item.value); equal(actual.getLabelAt(index), item.label); diff --git a/toolkit/components/passwordmgr/test/unit/xpcshell.ini b/toolkit/components/passwordmgr/test/unit/xpcshell.ini index 0dc28d6b766c0..882ced28e85ab 100644 --- a/toolkit/components/passwordmgr/test/unit/xpcshell.ini +++ b/toolkit/components/passwordmgr/test/unit/xpcshell.ini @@ -27,11 +27,11 @@ run-if = buildapp == "browser" [test_isOriginMatching.js] [test_legacy_empty_formSubmitURL.js] [test_legacy_validation.js] +[test_login_autocomplete_result.js] +skip-if = os == "android" [test_logins_change.js] [test_logins_decrypt_failure.js] skip-if = os == "android" # Bug 1171687: Needs fixing on Android -[test_user_autocomplete_result.js] -skip-if = os == "android" [test_logins_metainfo.js] [test_logins_search.js] [test_maybeImportLogin.js] diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json index 7d83dbe0c83f8..fde9908ae3f5d 100644 --- a/tools/lint/eslint/modules.json +++ b/tools/lint/eslint/modules.json @@ -125,7 +125,7 @@ "log.js": ["Log"], "logger.jsm": ["Logger"], "logging.js": ["getTestLogger", "initTestLogging"], - "LoginManagerContent.jsm": ["LoginManagerContent", "LoginFormFactory", "UserAutoCompleteResult"], + "LoginManagerContent.jsm": ["LoginManagerContent", "LoginFormFactory"], "LoginRecipes.jsm": ["LoginRecipesContent", "LoginRecipesParent"], "logmanager.js": ["LogManager"], "lz4.js": ["Lz4"], From 62025568c89899a9da989474861e298cf7ce7a98 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Thu, 7 Mar 2019 03:55:12 +0200 Subject: [PATCH 36/48] Backed out 2 changesets (bug 1530029) for Mochitest failues in toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html Backed out changeset ad613d1154eb (bug 1530029) Backed out changeset 21d6040d2bd8 (bug 1530029) --- browser/app/profile/firefox.js | 1 - browser/components/BrowserGlue.jsm | 1 - .../components/passwordmgr/LoginHelper.jsm | 3 +- .../passwordmgr/LoginManagerContent.jsm | 47 +------------ .../passwordmgr/LoginManagerParent.jsm | 5 -- .../browser/browser_autocomplete_footer.js | 69 ++++--------------- 6 files changed, 14 insertions(+), 112 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index a1f6882d830ef..3137af204716a 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1703,7 +1703,6 @@ pref("extensions.pocket.site", "getpocket.com"); pref("signon.schemeUpgrades", true); pref("signon.privateBrowsingCapture.enabled", true); -pref("signon.showAutoCompleteFooter", true); // Enable the "Simplify Page" feature in Print Preview. This feature // is disabled by default in toolkit. diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 441af487afa0f..4ff9841e3fe7e 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -536,7 +536,6 @@ const listeners = { "PasswordManager:autoCompleteLogins": ["LoginManagerParent"], "PasswordManager:removeLogin": ["LoginManagerParent"], "PasswordManager:insecureLoginFormPresent": ["LoginManagerParent"], - "PasswordManager:OpenPreferences": ["LoginManagerParent"], // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js "rtcpeer:CancelRequest": ["webrtcUI"], "rtcpeer:Request": ["webrtcUI"], diff --git a/toolkit/components/passwordmgr/LoginHelper.jsm b/toolkit/components/passwordmgr/LoginHelper.jsm index 2e7b7d40e8fdf..294fce21d4122 100644 --- a/toolkit/components/passwordmgr/LoginHelper.jsm +++ b/toolkit/components/passwordmgr/LoginHelper.jsm @@ -31,7 +31,6 @@ var LoginHelper = { schemeUpgrades: null, insecureAutofill: null, privateBrowsingCaptureEnabled: null, - showAutoCompleteFooter: null, init() { // Watch for pref changes to update cached pref values. @@ -49,8 +48,8 @@ var LoginHelper = { Services.prefs.getBoolPref("signon.privateBrowsingCapture.enabled"); this.schemeUpgrades = Services.prefs.getBoolPref("signon.schemeUpgrades"); - this.showAutoCompleteFooter = Services.prefs.getBoolPref("signon.showAutoCompleteFooter"); this.storeWhenAutocompleteOff = Services.prefs.getBoolPref("signon.storeWhenAutocompleteOff"); + this.showAutoCompleteFooter = Services.prefs.getBoolPref("signon.showAutoCompleteFooter"); }, createLogger(aLogPrefix) { diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index c05e02088a012..7bb460a6bd48f 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -192,9 +192,6 @@ var LoginManagerContent = { // Number of outstanding requests to each manager. _managers: new Map(), - // Input element on which enter keydown event was fired. - _keyDownEnterForInput: null, - _takeRequest(msg) { let data = msg.data; let request = this._requests.get(data.requestId); @@ -239,27 +236,6 @@ var LoginManagerContent = { return deferred.promise; }, - _onKeyDown(event) { - let focusedElement = LoginManagerContent._formFillService.focusedInput; - if (event.keyCode != event.DOM_VK_RETURN || focusedElement != event.target) { - this._keyDownEnterForInput = null; - return; - } - LoginManagerContent._keyDownEnterForInput = focusedElement; - }, - - _onPopupClosed(selectedRowStyle, mm) { - let focusedElement = LoginManagerContent._formFillService.focusedInput; - let eventTarget = LoginManagerContent._keyDownEnterForInput; - if (!eventTarget || eventTarget !== focusedElement || - selectedRowStyle != "loginsFooter") { - this._keyDownEnterForInput = null; - return; - } - let hostname = eventTarget.ownerDocument.documentURIObject.host; - mm.sendAsyncMessage("PasswordManager:OpenPreferences", {hostname}); - }, - receiveMessage(msg, topWindow) { if (msg.name == "PasswordManager:fillForm") { this.fillForm({ @@ -272,10 +248,10 @@ var LoginManagerContent = { return; } + let request = this._takeRequest(msg); switch (msg.name) { case "PasswordManager:loginsFound": { let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins); - let request = this._takeRequest(msg); request.promise.resolve({ form: request.form, loginsFound, @@ -287,25 +263,9 @@ var LoginManagerContent = { case "PasswordManager:loginsAutoCompleted": { let loginsFound = LoginHelper.vanillaObjectsToLogins(msg.data.logins); let messageManager = msg.target; - let request = this._takeRequest(msg); request.promise.resolve({ logins: loginsFound, messageManager }); break; } - - case "FormAutoComplete:PopupOpened": { - let {chromeEventHandler} = msg.target.docShell; - chromeEventHandler.addEventListener("keydown", this._onKeyDown, - true); - break; - } - - case "FormAutoComplete:PopupClosed": { - this._onPopupClosed(msg.data.selectedRowStyle, msg.target); - let {chromeEventHandler} = msg.target.docShell; - chromeEventHandler.removeEventListener("keydown", this._onKeyDown, - true); - break; - } } }, @@ -365,11 +325,6 @@ var LoginManagerContent = { isPasswordField: aElement.type == "password", }; - if (LoginHelper.showAutoCompleteFooter) { - messageManager.addMessageListener("FormAutoComplete:PopupOpened", this); - messageManager.addMessageListener("FormAutoComplete:PopupClosed", this); - } - return this._sendRequest(messageManager, requestData, "PasswordManager:autoCompleteLogins", messageData); diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index 45b37b5635ae6..ad18f69583b7d 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -115,11 +115,6 @@ var LoginManagerParent = { AutoCompletePopup.removeLogin(login); break; } - - case "PasswordManager:OpenPreferences": { - LoginHelper.openPasswordManager(msg.target.ownerGlobal, msg.data.hostname); - break; - } } return undefined; diff --git a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js index 3ae1ff7ded5f0..c051cf1d2bf21 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js +++ b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_footer.js @@ -21,24 +21,6 @@ function loginList() { ]; } -function openPopup(popup, browser) { - return new Promise(async (resolve) => { - let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown"); - - await SimpleTest.promiseFocus(browser); - info("content window focused"); - - // Focus the username field to open the popup. - await ContentTask.spawn(browser, null, function openAutocomplete() { - content.document.getElementById("form-basic-username").focus(); - }); - - let shown = await promiseShown; - ok(shown, "autocomplete popup shown"); - resolve(shown); - }); -} - /** * Initialize logins and set prefs needed for the test. */ @@ -53,50 +35,27 @@ add_task(async function test_initialize() { } }); -add_task(async function test_autocomplete_footer_onclick() { +add_task(async function test_autocomplete_footer() { let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH; await BrowserTestUtils.withNewTab({ gBrowser, url, - }, async function footer_onclick(browser) { + }, async function(browser) { let popup = document.getElementById("PopupAutoComplete"); ok(popup, "Got popup"); - await openPopup(popup, browser); - - let footer = popup.querySelector(`[originaltype="loginsFooter"]`); - ok(footer, "Got footer richlistitem"); - - await TestUtils.waitForCondition(() => { - return !EventUtils.isHidden(footer); - }, "Waiting for footer to become visible"); - - EventUtils.synthesizeMouseAtCenter(footer, {}); - await TestUtils.waitForCondition(() => { - return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null; - }, "Waiting for the password manager dialog to open"); - info("Login dialog was opened"); - - let window = Services.wm.getMostRecentWindow("Toolkit:PasswordManager"); - await TestUtils.waitForCondition(() => { - return window.document.getElementById("filter").value == "example.com"; - }, "Waiting for the search string to filter logins"); + let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown"); - window.close(); - popup.hidePopup(); - }); -}); + await SimpleTest.promiseFocus(browser); + info("content window focused"); -add_task(async function test_autocomplete_footer_keydown() { - let url = TEST_HOSTNAME + BASIC_FORM_PAGE_PATH; - await BrowserTestUtils.withNewTab({ - gBrowser, - url, - }, async function footer_enter_keydown(browser) { - let popup = document.getElementById("PopupAutoComplete"); - ok(popup, "Got popup"); + // Focus the username field to open the popup. + await ContentTask.spawn(browser, null, function openAutocomplete() { + content.document.getElementById("form-basic-username").focus(); + }); - await openPopup(popup, browser); + await promiseShown; + ok(promiseShown, "autocomplete shown"); let footer = popup.querySelector(`[originaltype="loginsFooter"]`); ok(footer, "Got footer richlistitem"); @@ -105,11 +64,7 @@ add_task(async function test_autocomplete_footer_keydown() { return !EventUtils.isHidden(footer); }, "Waiting for footer to become visible"); - await EventUtils.synthesizeKey("KEY_ArrowDown"); - await EventUtils.synthesizeKey("KEY_ArrowDown"); - await EventUtils.synthesizeKey("KEY_ArrowDown"); - await EventUtils.synthesizeKey("KEY_Enter"); - + EventUtils.synthesizeMouseAtCenter(footer, {}); await TestUtils.waitForCondition(() => { return Services.wm.getMostRecentWindow("Toolkit:PasswordManager") !== null; }, "Waiting for the password manager dialog to open"); From 1ecd53f46684f20ae8782024290df141cd7be55d Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Thu, 7 Mar 2019 02:04:36 +0000 Subject: [PATCH 37/48] Bug 1512445 - Import latest AudioIPC from upstream, including Windows backend. r=chunmin Differential Revision: https://phabricator.services.mozilla.com/D22153 --HG-- extra : moz-landing-system : lando --- media/audioipc/README_MOZILLA | 2 +- media/audioipc/audioipc/Cargo.toml | 7 +- media/audioipc/audioipc/src/async.rs | 17 +- media/audioipc/audioipc/src/fd_passing.rs | 61 +++-- media/audioipc/audioipc/src/handle_passing.rs | 256 ++++++++++++++++++ media/audioipc/audioipc/src/lib.rs | 144 +++++++++- media/audioipc/audioipc/src/messages.rs | 40 ++- .../audioipc/src/messagestream_unix.rs | 96 +++++++ .../audioipc/src/messagestream_win.rs | 109 ++++++++ .../audioipc/src/tokio_named_pipes.rs | 175 ++++++++++++ media/audioipc/client/Cargo.toml | 2 +- media/audioipc/client/src/context.rs | 22 +- media/audioipc/client/src/lib.rs | 13 +- media/audioipc/client/src/stream.rs | 22 +- .../register-collection-not-supported.patch | 22 -- media/audioipc/server/Cargo.toml | 2 +- media/audioipc/server/src/lib.rs | 23 +- media/audioipc/server/src/server.rs | 30 +- media/audioipc/update.sh | 4 +- 19 files changed, 909 insertions(+), 138 deletions(-) create mode 100644 media/audioipc/audioipc/src/handle_passing.rs create mode 100644 media/audioipc/audioipc/src/messagestream_unix.rs create mode 100644 media/audioipc/audioipc/src/messagestream_win.rs create mode 100644 media/audioipc/audioipc/src/tokio_named_pipes.rs delete mode 100644 media/audioipc/register-collection-not-supported.patch diff --git a/media/audioipc/README_MOZILLA b/media/audioipc/README_MOZILLA index 3fa647793a901..f6dd258876618 100644 --- a/media/audioipc/README_MOZILLA +++ b/media/audioipc/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The audioipc-2 git repository is: https://github.com/djg/audioipc-2.git -The git commit ID used was c2148b95128f5e54ef1d18e5e457a2fa45e7ac43 (2019-02-05 15:18:22 +1300) +The git commit ID used was 137eb45d702f628cae622d374975903c23a7a814 (2019-03-07 10:31:45 +1300) diff --git a/media/audioipc/audioipc/Cargo.toml b/media/audioipc/audioipc/Cargo.toml index ffa215d822643..f5eb7e94db2c3 100644 --- a/media/audioipc/audioipc/Cargo.toml +++ b/media/audioipc/audioipc/Cargo.toml @@ -8,7 +8,7 @@ authors = [ description = "Remote Cubeb IPC" [dependencies] -cubeb = "0.5.2" +cubeb = "0.5.4" bincode = "1.0" bytes = "0.4" futures = "0.1.18" @@ -22,7 +22,12 @@ serde_derive = "1.*.*" tokio-core = "0.1" tokio-io = "0.1" tokio-uds = "0.1.7" +winapi = "0.3.6" +mio-named-pipes = "=0.1.5" [dependencies.error-chain] version = "0.11.0" default-features = false + +[build-dependencies] +cc = "1.0" diff --git a/media/audioipc/audioipc/src/async.rs b/media/audioipc/audioipc/src/async.rs index 6a3edbc68341f..376b073f21299 100644 --- a/media/audioipc/audioipc/src/async.rs +++ b/media/audioipc/audioipc/src/async.rs @@ -6,12 +6,15 @@ //! Various async helpers modelled after futures-rs and tokio-io. use bytes::{Buf, BufMut}; -use futures::{Async, Poll}; +#[cfg(unix)] +use futures::Async; +use futures::Poll; +#[cfg(unix)] use iovec::IoVec; +#[cfg(unix)] use msg::{RecvMsg, SendMsg}; use std::io; use tokio_io::{AsyncRead, AsyncWrite}; -use tokio_uds::UnixStream; pub trait AsyncRecvMsg: AsyncRead { /// Pull some bytes from this source into the specified `Buf`, returning @@ -54,12 +57,13 @@ pub trait AsyncSendMsg: AsyncWrite { //////////////////////////////////////////////////////////////////////////////// -impl AsyncRecvMsg for UnixStream { +#[cfg(unix)] +impl AsyncRecvMsg for super::AsyncMessageStream { fn recv_msg_buf(&mut self, buf: &mut B, cmsg: &mut B) -> Poll<(usize, i32), io::Error> where B: BufMut, { - if let Async::NotReady = ::poll_read(self) { + if let Async::NotReady = ::poll_read(self) { return Ok(Async::NotReady); } let r = unsafe { @@ -123,13 +127,14 @@ impl AsyncRecvMsg for UnixStream { } } -impl AsyncSendMsg for UnixStream { +#[cfg(unix)] +impl AsyncSendMsg for super::AsyncMessageStream { fn send_msg_buf(&mut self, buf: &mut B, cmsg: &C) -> Poll where B: Buf, C: Buf, { - if let Async::NotReady = ::poll_write(self) { + if let Async::NotReady = ::poll_write(self) { return Ok(Async::NotReady); } let r = { diff --git a/media/audioipc/audioipc/src/fd_passing.rs b/media/audioipc/audioipc/src/fd_passing.rs index 26feb6956b526..ed8de3deac1a6 100644 --- a/media/audioipc/audioipc/src/fd_passing.rs +++ b/media/audioipc/audioipc/src/fd_passing.rs @@ -8,8 +8,7 @@ use bytes::{Bytes, BytesMut, IntoBuf}; use cmsg; use codec::Codec; use futures::{AsyncSink, Poll, Sink, StartSend, Stream}; -use libc; -use messages::AssocRawFd; +use messages::AssocRawPlatformHandle; use std::collections::VecDeque; use std::os::unix::io::RawFd; use std::{fmt, io, mem}; @@ -66,7 +65,7 @@ struct Frame { /// A unified `Stream` and `Sink` interface over an I/O object, using /// the `Codec` trait to encode and decode the payload. -pub struct FramedWithFds { +pub struct FramedWithPlatformHandles { io: A, codec: C, // Stream @@ -80,7 +79,7 @@ pub struct FramedWithFds { outgoing_fds: BytesMut, } -impl FramedWithFds +impl FramedWithPlatformHandles where A: AsyncSendMsg, { @@ -162,11 +161,11 @@ where } } -impl Stream for FramedWithFds +impl Stream for FramedWithPlatformHandles where A: AsyncRecvMsg, C: Codec, - C::Out: AssocRawFd, + C::Out: AssocRawPlatformHandle, { type Item = C::Out; type Error = io::Error; @@ -181,7 +180,7 @@ where if self.is_readable { if self.eof { let mut item = try!(self.codec.decode_eof(&mut self.read_buf)); - item.take_fd(|| self.incoming_fds.take_fds()); + item.take_platform_handles(|| self.incoming_fds.take_fds()); return Ok(Some(item).into()); } @@ -189,7 +188,7 @@ where if let Some(mut item) = try!(self.codec.decode(&mut self.read_buf)) { trace!("frame decoded from buffer"); - item.take_fd(|| self.incoming_fds.take_fds()); + item.take_platform_handles(|| self.incoming_fds.take_fds()); return Ok(Some(item).into()); } @@ -206,10 +205,6 @@ where .recv_msg_buf(&mut self.read_buf, self.incoming_fds.cmsg()) ); - // if flags != 0 { - // error!("recv_msg_buf: flags = {:x}", flags) - // } - if n == 0 { self.eof = true; } @@ -219,11 +214,11 @@ where } } -impl Sink for FramedWithFds +impl Sink for FramedWithPlatformHandles where A: AsyncSendMsg, C: Codec, - C::In: AssocRawFd + fmt::Debug, + C::In: AssocRawPlatformHandle + fmt::Debug, { type SinkItem = C::In; type SinkError = io::Error; @@ -241,11 +236,11 @@ where } } - let fds = item.fd(); + let fds = item.platform_handles(); try!(self.codec.encode(item, &mut self.write_buf)); let fds = fds.and_then(|fds| { cmsg::builder(&mut self.outgoing_fds) - .rights(&fds[..]) + .rights(&fds.0[..]) .finish() .ok() }); @@ -278,8 +273,8 @@ where } } -pub fn framed_with_fds(io: A, codec: C) -> FramedWithFds { - FramedWithFds { +pub fn framed_with_platformhandles(io: A, codec: C) -> FramedWithPlatformHandles { + FramedWithPlatformHandles { io: io, codec: codec, read_buf: BytesMut::with_capacity(INITIAL_CAPACITY), @@ -307,7 +302,7 @@ where fn close_fds(fds: &[RawFd]) { for fd in fds { unsafe { - libc::close(*fd); + super::close_platformhandle(*fd); } } } @@ -315,15 +310,26 @@ fn close_fds(fds: &[RawFd]) { #[cfg(test)] mod tests { use bytes::BufMut; + use libc; + use std; + + extern { + fn cmsghdr_bytes(size: *mut libc::size_t) -> *const libc::uint8_t; + } - const CMSG_BYTES: &[u8] = - b"\x1c\0\0\0\0\0\0\0\x01\0\0\0\x01\0\0\02\0\0\0[\0\0\0\\\0\0\0\xe5\xe5\xe5\xe5"; + fn cmsg_bytes() -> &'static [u8] { + let mut size = 0; + unsafe { + let ptr = cmsghdr_bytes(&mut size); + std::slice::from_raw_parts(ptr, size) + } + } #[test] fn single_cmsg() { let mut incoming = super::IncomingFds::new(16); - incoming.cmsg().put_slice(CMSG_BYTES); + incoming.cmsg().put_slice(cmsg_bytes()); assert!(incoming.take_fds().is_some()); assert!(incoming.take_fds().is_none()); } @@ -332,9 +338,9 @@ mod tests { fn multiple_cmsg_1() { let mut incoming = super::IncomingFds::new(16); - incoming.cmsg().put_slice(CMSG_BYTES); + incoming.cmsg().put_slice(cmsg_bytes()); assert!(incoming.take_fds().is_some()); - incoming.cmsg().put_slice(CMSG_BYTES); + incoming.cmsg().put_slice(cmsg_bytes()); assert!(incoming.take_fds().is_some()); assert!(incoming.take_fds().is_none()); } @@ -342,11 +348,12 @@ mod tests { #[test] fn multiple_cmsg_2() { let mut incoming = super::IncomingFds::new(16); + println!("cmsg_bytes() {}", cmsg_bytes().len()); - incoming.cmsg().put_slice(CMSG_BYTES); - incoming.cmsg().put_slice(CMSG_BYTES); + incoming.cmsg().put_slice(cmsg_bytes()); + incoming.cmsg().put_slice(cmsg_bytes()); assert!(incoming.take_fds().is_some()); - incoming.cmsg().put_slice(CMSG_BYTES); + incoming.cmsg().put_slice(cmsg_bytes()); assert!(incoming.take_fds().is_some()); assert!(incoming.take_fds().is_some()); assert!(incoming.take_fds().is_none()); diff --git a/media/audioipc/audioipc/src/handle_passing.rs b/media/audioipc/audioipc/src/handle_passing.rs new file mode 100644 index 0000000000000..b177047937c74 --- /dev/null +++ b/media/audioipc/audioipc/src/handle_passing.rs @@ -0,0 +1,256 @@ +// Copyright © 2017 Mozilla Foundation +// +// This program is made available under an ISC-style license. See the +// accompanying file LICENSE for details + +use tokio_io::{AsyncRead, AsyncWrite}; +use bytes::{Bytes, BytesMut, IntoBuf}; +use codec::Codec; +use futures::{AsyncSink, Poll, Sink, StartSend, Stream}; +use messages::AssocRawPlatformHandle; +use std::collections::VecDeque; +use std::{fmt, io}; + +const INITIAL_CAPACITY: usize = 1024; +const BACKPRESSURE_THRESHOLD: usize = 4 * INITIAL_CAPACITY; + +#[derive(Debug)] +struct Frame { + msgs: Bytes, +} + +/// A unified `Stream` and `Sink` interface over an I/O object, using +/// the `Codec` trait to encode and decode the payload. +pub struct FramedWithPlatformHandles { + io: A, + codec: C, + // Stream + read_buf: BytesMut, + is_readable: bool, + eof: bool, + // Sink + frames: VecDeque, + write_buf: BytesMut, +} + +impl FramedWithPlatformHandles +where + A: AsyncWrite, +{ + // If there is a buffered frame, try to write it to `A` + fn do_write(&mut self) -> Poll<(), io::Error> { + trace!("do_write..."); + // Create a frame from any pending message in `write_buf`. + if !self.write_buf.is_empty() { + self.set_frame(); + } + + trace!("pending frames: {:?}", self.frames); + + let mut processed = 0; + + loop { + let n = match self.frames.front() { + Some(frame) => { + trace!("sending msg {:?}", frame.msgs); + let mut msgs = frame.msgs.clone().into_buf(); + try_ready!(self.io.write_buf(&mut msgs)) + } + _ => { + // No pending frames. + return Ok(().into()); + } + }; + + match self.frames.pop_front() { + Some(mut frame) => { + processed += 1; + + if n != frame.msgs.len() { + // If only part of the message was sent then + // re-queue the remaining message at the head + // of the queue. (Don't need to resend the + // handles since they've been sent with the + // first part.) + drop(frame.msgs.split_to(n)); + self.frames.push_front(frame); + break; + } + } + _ => panic!(), + } + } + trace!("process {} frames", processed); + trace!("pending frames: {:?}", self.frames); + + Ok(().into()) + } + + fn set_frame(&mut self) { + if self.write_buf.is_empty() { + trace!("set_frame: No pending messages..."); + return; + } + + let msgs = self.write_buf.take().freeze(); + trace!("set_frame: msgs={:?}", msgs); + + self.frames.push_back(Frame { msgs }); + } +} + +impl Stream for FramedWithPlatformHandles +where + A: AsyncRead, + C: Codec, + C::Out: AssocRawPlatformHandle, +{ + type Item = C::Out; + type Error = io::Error; + + fn poll(&mut self) -> Poll, Self::Error> { + loop { + // Repeatedly call `decode` or `decode_eof` as long as it is + // "readable". Readable is defined as not having returned `None`. If + // the upstream has returned EOF, and the decoder is no longer + // readable, it can be assumed that the decoder will never become + // readable again, at which point the stream is terminated. + if self.is_readable { + if self.eof { + let item = try!(self.codec.decode_eof(&mut self.read_buf)); + return Ok(Some(item).into()); + } + + trace!("attempting to decode a frame"); + + if let Some(item) = try!(self.codec.decode(&mut self.read_buf)) { + trace!("frame decoded from buffer"); + return Ok(Some(item).into()); + } + + self.is_readable = false; + } + + assert!(!self.eof); + + // Otherwise, try to read more data and try again. Make sure we've + // got room for at least one byte to read to ensure that we don't + // get a spurious 0 that looks like EOF + let n = try_ready!( + self.io + .read_buf(&mut self.read_buf) + ); + + if n == 0 { + self.eof = true; + } + + self.is_readable = true; + } + } +} + +impl Sink for FramedWithPlatformHandles +where + A: AsyncWrite, + C: Codec, + C::In: AssocRawPlatformHandle + fmt::Debug, +{ + type SinkItem = C::In; + type SinkError = io::Error; + + fn start_send(&mut self, mut item: Self::SinkItem) -> StartSend { + trace!("start_send: item={:?}", item); + + // If the buffer is already over BACKPRESSURE_THRESHOLD, + // then attempt to flush it. If after flush it's *still* + // over BACKPRESSURE_THRESHOLD, then reject the send. + if self.write_buf.len() > BACKPRESSURE_THRESHOLD { + try!(self.poll_complete()); + if self.write_buf.len() > BACKPRESSURE_THRESHOLD { + return Ok(AsyncSink::NotReady(item)); + } + } + + let mut got_handles = false; + if let Some((handles, target_pid)) = item.platform_handles() { + got_handles = true; + let remote_handles = unsafe { + [duplicate_platformhandle(handles[0], target_pid)?, + duplicate_platformhandle(handles[1], target_pid)?, + duplicate_platformhandle(handles[2], target_pid)?] + }; + trace!("item handles: {:?} remote_handles: {:?}", handles, remote_handles); + item.take_platform_handles(|| Some(remote_handles)); + } + + try!(self.codec.encode(item, &mut self.write_buf)); + + if got_handles { + // Enforce splitting sends on messages that contain file + // descriptors. + self.set_frame(); + } + + Ok(AsyncSink::Ready) + } + + fn poll_complete(&mut self) -> Poll<(), Self::SinkError> { + trace!("flushing framed transport"); + + try_ready!(self.do_write()); + + try_nb!(self.io.flush()); + + trace!("framed transport flushed"); + Ok(().into()) + } + + fn close(&mut self) -> Poll<(), Self::SinkError> { + try_ready!(self.poll_complete()); + self.io.shutdown() + } +} + +pub fn framed_with_platformhandles(io: A, codec: C) -> FramedWithPlatformHandles { + FramedWithPlatformHandles { + io: io, + codec: codec, + read_buf: BytesMut::with_capacity(INITIAL_CAPACITY), + is_readable: false, + eof: false, + frames: VecDeque::new(), + write_buf: BytesMut::with_capacity(INITIAL_CAPACITY), + } +} + +use winapi::um::{processthreadsapi, winnt, handleapi}; +use winapi::shared::minwindef::{DWORD, FALSE}; +use super::PlatformHandleType; + +// source_handle is effectively taken ownership of (consumed) and +// closed when duplicate_platformhandle is called. +// TODO: Make this transfer more explicit via the type system. +unsafe fn duplicate_platformhandle(source_handle: PlatformHandleType, + target_pid: DWORD) -> Result { + let source = processthreadsapi::GetCurrentProcess(); + let target = processthreadsapi::OpenProcess(winnt::PROCESS_DUP_HANDLE, + FALSE, + target_pid); + if !super::valid_handle(target) { + return Err(std::io::Error::new(std::io::ErrorKind::Other, "invalid target process")); + } + + let mut target_handle = std::ptr::null_mut(); + let ok = handleapi::DuplicateHandle(source, + source_handle, + target, + &mut target_handle, + 0, + FALSE, + winnt::DUPLICATE_CLOSE_SOURCE | winnt::DUPLICATE_SAME_ACCESS); + if ok == FALSE { + return Err(std::io::Error::new(std::io::ErrorKind::Other, "DuplicateHandle failed")); + } + Ok(target_handle) +} diff --git a/media/audioipc/audioipc/src/lib.rs b/media/audioipc/audioipc/src/lib.rs index ade1fdea57406..f95097345ad31 100644 --- a/media/audioipc/audioipc/src/lib.rs +++ b/media/audioipc/audioipc/src/lib.rs @@ -28,16 +28,27 @@ extern crate tokio_core; #[macro_use] extern crate tokio_io; extern crate tokio_uds; +#[cfg(windows)] +extern crate winapi; mod async; +#[cfg(unix)] mod cmsg; pub mod codec; pub mod core; #[allow(deprecated)] pub mod errors; +#[cfg(unix)] pub mod fd_passing; +#[cfg(unix)] +pub use fd_passing as platformhandle_passing; +#[cfg(windows)] +pub mod handle_passing; +#[cfg(windows)] +pub use handle_passing as platformhandle_passing; pub mod frame; pub mod messages; +#[cfg(unix)] mod msg; pub mod rpc; pub mod shm; @@ -46,16 +57,141 @@ pub use messages::{ClientMessage, ServerMessage}; use std::env::temp_dir; use std::path::PathBuf; +#[cfg(windows)] +use std::os::windows::io::{FromRawHandle, IntoRawHandle}; +#[cfg(unix)] +use std::os::unix::io::{FromRawFd, IntoRawFd}; + // This must match the definition of // ipc::FileDescriptor::PlatformHandleType in Gecko. -#[cfg(target_os = "windows")] -pub type PlatformHandleType = *mut std::os::raw::c_void; -#[cfg(not(target_os = "windows"))] +#[cfg(windows)] +pub type PlatformHandleType = std::os::windows::raw::HANDLE; +#[cfg(unix)] pub type PlatformHandleType = libc::c_int; +// This stands in for RawFd/RawHandle. +#[derive(Copy, Clone, Debug)] +pub struct PlatformHandle(PlatformHandleType); + +unsafe impl Send for PlatformHandle {} + +// Custom serialization to treat HANDLEs as i64. This is not valid in +// general, but after sending the HANDLE value to a remote process we +// use it to create a valid HANDLE via DuplicateHandle. +// To avoid duplicating the serialization code, we're lazy and treat +// file descriptors as i64 rather than i32. +impl serde::Serialize for PlatformHandle { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_i64(self.0 as i64) + } +} + +struct PlatformHandleVisitor; +impl<'de> serde::de::Visitor<'de> for PlatformHandleVisitor { + type Value = PlatformHandle; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("an integer between -2^63 and 2^63") + } + + fn visit_i64(self, value: i64) -> Result + where + E: serde::de::Error, + { + Ok(PlatformHandle::new(value as PlatformHandleType)) + } +} + +impl<'de> serde::Deserialize<'de> for PlatformHandle { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + deserializer.deserialize_i64(PlatformHandleVisitor) + } +} + +#[cfg(unix)] +fn valid_handle(handle: PlatformHandleType) -> bool { + handle >= 0 +} + +#[cfg(windows)] +fn valid_handle(handle: PlatformHandleType) -> bool { + const INVALID_HANDLE_VALUE: PlatformHandleType = -1isize as PlatformHandleType; + const NULL_HANDLE_VALUE: PlatformHandleType = 0isize as PlatformHandleType; + handle != INVALID_HANDLE_VALUE && handle != NULL_HANDLE_VALUE +} + +impl PlatformHandle { + pub fn new(raw: PlatformHandleType) -> PlatformHandle { + PlatformHandle(raw) + } + + pub fn try_new(raw: PlatformHandleType) -> Option { + if !valid_handle(raw) { + return None; + } + Some(PlatformHandle::new(raw)) + } + + #[cfg(windows)] + pub fn from(from: T) -> PlatformHandle { + PlatformHandle::new(from.into_raw_handle()) + } + + #[cfg(unix)] + pub fn from(from: T) -> PlatformHandle { + PlatformHandle::new(from.into_raw_fd()) + } + + #[cfg(windows)] + pub unsafe fn into_file(self) -> std::fs::File { + std::fs::File::from_raw_handle(self.0) + } + + #[cfg(unix)] + pub unsafe fn into_file(self) -> std::fs::File { + std::fs::File::from_raw_fd(self.0) + } + + pub fn as_raw(&self) -> PlatformHandleType { + self.0 + } + + pub unsafe fn close(self) { + close_platformhandle(self.0); + } +} + +#[cfg(unix)] +unsafe fn close_platformhandle(handle: PlatformHandleType) { + libc::close(handle); +} + +#[cfg(windows)] +unsafe fn close_platformhandle(handle: PlatformHandleType) { + winapi::um::handleapi::CloseHandle(handle); +} + pub fn get_shm_path(dir: &str) -> PathBuf { - let pid = unsafe { libc::getpid() }; + let pid = std::process::id(); let mut temp = temp_dir(); temp.push(&format!("cubeb-shm-{}-{}", pid, dir)); temp } + +#[cfg(unix)] +pub mod messagestream_unix; +#[cfg(unix)] +pub use messagestream_unix::*; + +#[cfg(windows)] +pub mod messagestream_win; +#[cfg(windows)] +pub use messagestream_win::*; +#[cfg(windows)] +mod tokio_named_pipes; diff --git a/media/audioipc/audioipc/src/messages.rs b/media/audioipc/audioipc/src/messages.rs index fa83f2e311bf8..6a6fa39a57b3d 100644 --- a/media/audioipc/audioipc/src/messages.rs +++ b/media/audioipc/audioipc/src/messages.rs @@ -3,10 +3,11 @@ // This program is made available under an ISC-style license. See the // accompanying file LICENSE for details +use PlatformHandle; +use PlatformHandleType; use cubeb::{self, ffi}; use std::ffi::{CStr, CString}; use std::os::raw::{c_char, c_int, c_uint}; -use std::os::unix::io::RawFd; use std::ptr; #[derive(Debug, Serialize, Deserialize)] @@ -169,7 +170,8 @@ fn opt_str(v: Option>) -> *mut c_char { #[derive(Debug, Serialize, Deserialize)] pub struct StreamCreate { pub token: usize, - pub fds: [RawFd; 3], + pub platform_handles: [PlatformHandle; 3], + pub target_pid: u32, } // Client -> Server messages. @@ -177,7 +179,7 @@ pub struct StreamCreate { // ServerConn::process_msg doesn't have a catch-all case. #[derive(Debug, Serialize, Deserialize)] pub enum ServerMessage { - ClientConnect, + ClientConnect(u32), ClientDisconnect, ContextGetBackendId, @@ -241,32 +243,40 @@ pub enum CallbackResp { State, } -pub trait AssocRawFd { - fn fd(&self) -> Option<[RawFd; 3]> { +pub trait AssocRawPlatformHandle { + fn platform_handles(&self) -> Option<([PlatformHandleType; 3], u32)> { None } - fn take_fd(&mut self, _: F) + + fn take_platform_handles(&mut self, f: F) where - F: FnOnce() -> Option<[RawFd; 3]>, - { + F: FnOnce() -> Option<[PlatformHandleType; 3]> { + assert!(f().is_none()); } } -impl AssocRawFd for ServerMessage {} -impl AssocRawFd for ClientMessage { - fn fd(&self) -> Option<[RawFd; 3]> { +impl AssocRawPlatformHandle for ServerMessage {} + +impl AssocRawPlatformHandle for ClientMessage { + fn platform_handles(&self) -> Option<([PlatformHandleType; 3], u32)> { match *self { - ClientMessage::StreamCreated(ref data) => Some(data.fds), + ClientMessage::StreamCreated(ref data) => Some(([data.platform_handles[0].as_raw(), + data.platform_handles[1].as_raw(), + data.platform_handles[2].as_raw()], + data.target_pid)), _ => None, } } - fn take_fd(&mut self, f: F) + fn take_platform_handles(&mut self, f: F) where - F: FnOnce() -> Option<[RawFd; 3]>, + F: FnOnce() -> Option<[PlatformHandleType; 3]>, { if let ClientMessage::StreamCreated(ref mut data) = *self { - data.fds = f().unwrap(); + let handles = f().expect("platform_handles must be available when processing StreamCreated"); + data.platform_handles = [PlatformHandle::new(handles[0]), + PlatformHandle::new(handles[1]), + PlatformHandle::new(handles[2])] } } } diff --git a/media/audioipc/audioipc/src/messagestream_unix.rs b/media/audioipc/audioipc/src/messagestream_unix.rs new file mode 100644 index 0000000000000..4f6846e2b4842 --- /dev/null +++ b/media/audioipc/audioipc/src/messagestream_unix.rs @@ -0,0 +1,96 @@ +// Copyright © 2017 Mozilla Foundation +// +// This program is made available under an ISC-style license. See the +// accompanying file LICENSE for details + +use std::os::unix::io::{IntoRawFd, FromRawFd, AsRawFd, RawFd}; +use std::os::unix::net; +use tokio_io::{AsyncRead, AsyncWrite}; + +#[derive(Debug)] +pub struct MessageStream(net::UnixStream); +pub struct AsyncMessageStream(tokio_uds::UnixStream); + +impl MessageStream { + fn new(stream: net::UnixStream) -> MessageStream { + MessageStream(stream) + } + + pub fn anonymous_ipc_pair() -> std::result::Result<(MessageStream, MessageStream), std::io::Error> { + let pair = net::UnixStream::pair()?; + Ok((MessageStream::new(pair.0), MessageStream::new(pair.1))) + } + + pub unsafe fn from_raw_fd(raw: super::PlatformHandleType) -> MessageStream { + MessageStream::new(net::UnixStream::from_raw_fd(raw)) + } + + pub fn into_tokio_ipc(self, handle: &tokio_core::reactor::Handle) -> std::result::Result { + Ok(AsyncMessageStream::new(tokio_uds::UnixStream::from_stream(self.0, handle)?)) + } +} + +impl AsyncMessageStream { + fn new(stream: tokio_uds::UnixStream) -> AsyncMessageStream { + AsyncMessageStream(stream) + } + + pub fn poll_read(&self) -> futures::Async<()> { + self.0.poll_read() + } + + pub fn poll_write(&self) -> futures::Async<()> { + self.0.poll_write() + } + + pub fn need_read(&self) { + self.0.need_read() + } + + pub fn need_write(&self) { + self.0.need_write() + } +} + +impl std::io::Read for AsyncMessageStream { + fn read(&mut self, buf: &mut [u8]) -> std::io::Result { + self.0.read(buf) + } +} + +impl std::io::Write for AsyncMessageStream { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + self.0.write(buf) + } + fn flush(&mut self) -> std::io::Result<()> { + self.0.flush() + } +} + +impl AsyncRead for AsyncMessageStream { + fn read_buf(&mut self, buf: &mut B) -> futures::Poll { + <&tokio_uds::UnixStream>::read_buf(&mut &self.0, buf) + } +} + +impl AsyncWrite for AsyncMessageStream { + fn shutdown(&mut self) -> futures::Poll<(), std::io::Error> { + <&tokio_uds::UnixStream>::shutdown(&mut &self.0) + } + + fn write_buf(&mut self, buf: &mut B) -> futures::Poll { + <&tokio_uds::UnixStream>::write_buf(&mut &self.0, buf) + } +} + +impl AsRawFd for AsyncMessageStream { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + +impl IntoRawFd for MessageStream { + fn into_raw_fd(self) -> RawFd { + self.0.into_raw_fd() + } +} diff --git a/media/audioipc/audioipc/src/messagestream_win.rs b/media/audioipc/audioipc/src/messagestream_win.rs new file mode 100644 index 0000000000000..b2b99ddea872b --- /dev/null +++ b/media/audioipc/audioipc/src/messagestream_win.rs @@ -0,0 +1,109 @@ +// Copyright © 2017 Mozilla Foundation +// +// This program is made available under an ISC-style license. See the +// accompanying file LICENSE for details + +extern crate mio_named_pipes; +use std::os::windows::io::{IntoRawHandle, FromRawHandle, AsRawHandle, RawHandle}; +use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; +use tokio_io::{AsyncRead, AsyncWrite}; +use tokio_named_pipes; + +#[derive(Debug)] +pub struct MessageStream(mio_named_pipes::NamedPipe); +pub struct AsyncMessageStream(tokio_named_pipes::NamedPipe); + +impl MessageStream { + fn new(stream: mio_named_pipes::NamedPipe) -> MessageStream { + MessageStream(stream) + } + + + pub fn anonymous_ipc_pair() -> std::result::Result<(MessageStream, MessageStream), std::io::Error> { + let pipe1 = mio_named_pipes::NamedPipe::new(get_pipe_name())?; + let pipe2 = unsafe { mio_named_pipes::NamedPipe::from_raw_handle(pipe1.as_raw_handle()) }; + Ok((MessageStream::new(pipe1), MessageStream::new(pipe2))) + } + + pub unsafe fn from_raw_fd(raw: super::PlatformHandleType) -> MessageStream { + MessageStream::new(mio_named_pipes::NamedPipe::from_raw_handle(raw)) + } + + pub fn into_tokio_ipc(self, handle: &tokio_core::reactor::Handle) -> std::result::Result { + Ok(AsyncMessageStream::new(tokio_named_pipes::NamedPipe::from_pipe(self.0, handle)?)) + } +} + +impl AsyncMessageStream { + fn new(stream: tokio_named_pipes::NamedPipe) -> AsyncMessageStream { + AsyncMessageStream(stream) + } + + pub fn poll_read(&self) -> futures::Async<()> { + self.0.poll_read() + } + + pub fn poll_write(&self) -> futures::Async<()> { + self.0.poll_write() + } + + pub fn need_read(&self) { + self.0.need_read() + } + + pub fn need_write(&self) { + self.0.need_write() + } +} + +impl std::io::Read for AsyncMessageStream { + fn read(&mut self, buf: &mut [u8]) -> std::io::Result { + self.0.read(buf) + } +} + +impl std::io::Write for AsyncMessageStream { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + self.0.write(buf) + } + fn flush(&mut self) -> std::io::Result<()> { + self.0.flush() + } +} + +impl AsyncRead for AsyncMessageStream { + fn read_buf(&mut self, buf: &mut B) -> futures::Poll { + ::read_buf(&mut self.0, buf) + } +} + +impl AsyncWrite for AsyncMessageStream { + fn shutdown(&mut self) -> futures::Poll<(), std::io::Error> { + ::shutdown(&mut self.0) + } + + fn write_buf(&mut self, buf: &mut B) -> futures::Poll { + ::write_buf(&mut self.0, buf) + } +} + +impl AsRawHandle for AsyncMessageStream { + fn as_raw_handle(&self) -> RawHandle { + self.0.as_raw_handle() + } +} + +impl IntoRawHandle for MessageStream { + fn into_raw_handle(self) -> RawHandle { + // XXX: Ideally this would call into_raw_handle. + self.0.as_raw_handle() + } +} + +static PIPE_ID: AtomicUsize = ATOMIC_USIZE_INIT; + +fn get_pipe_name() -> String { + let pid = std::process::id(); + let pipe_id = PIPE_ID.fetch_add(1, Ordering::SeqCst); + format!("\\\\.\\pipe\\cubeb-pipe-{}-{}", pid, pipe_id) +} diff --git a/media/audioipc/audioipc/src/tokio_named_pipes.rs b/media/audioipc/audioipc/src/tokio_named_pipes.rs new file mode 100644 index 0000000000000..b7be123446b6d --- /dev/null +++ b/media/audioipc/audioipc/src/tokio_named_pipes.rs @@ -0,0 +1,175 @@ +// From https://github.com/alexcrichton/tokio-named-pipes/commit/3a22f8fc9a441b548aec25bd5df3b1e0ab99fabe +// License MIT/Apache-2.0 +// Sloppily updated to be compatible with tokio_io +// To be replaced with tokio_named_pipes crate after tokio 0.1 update. +#![cfg(windows)] + +extern crate bytes; +extern crate tokio_core; +extern crate mio_named_pipes; +extern crate futures; + +use std::ffi::OsStr; +use std::fmt; +use std::io::{self, Read, Write}; +use std::os::windows::io::*; + +use futures::{Async, Poll}; +use bytes::{BufMut, Buf}; +#[allow(deprecated)] +use tokio_core::io::Io; +use tokio_io::{AsyncRead, AsyncWrite}; +use tokio_core::reactor::{PollEvented, Handle}; + +pub struct NamedPipe { + io: PollEvented, +} + +impl NamedPipe { + pub fn new>(p: P, handle: &Handle) -> io::Result { + NamedPipe::_new(p.as_ref(), handle) + } + + fn _new(p: &OsStr, handle: &Handle) -> io::Result { + let inner = try!(mio_named_pipes::NamedPipe::new(p)); + NamedPipe::from_pipe(inner, handle) + } + + pub fn from_pipe(pipe: mio_named_pipes::NamedPipe, + handle: &Handle) + -> io::Result { + Ok(NamedPipe { + io: try!(PollEvented::new(pipe, handle)), + }) + } + + pub fn connect(&self) -> io::Result<()> { + self.io.get_ref().connect() + } + + pub fn disconnect(&self) -> io::Result<()> { + self.io.get_ref().disconnect() + } + + pub fn need_read(&self) { + self.io.need_read() + } + + pub fn need_write(&self) { + self.io.need_write() + } + + pub fn poll_read(&self) -> Async<()> { + self.io.poll_read() + } + + pub fn poll_write(&self) -> Async<()> { + self.io.poll_write() + } +} + +impl Read for NamedPipe { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + self.io.read(buf) + } +} + +impl Write for NamedPipe { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.io.write(buf) + } + fn flush(&mut self) -> io::Result<()> { + self.io.flush() + } +} + +#[allow(deprecated)] +impl Io for NamedPipe { + fn poll_read(&mut self) -> Async<()> { + ::poll_read(self) + } + + fn poll_write(&mut self) -> Async<()> { + ::poll_write(self) + } +} + +impl AsyncRead for NamedPipe { + unsafe fn prepare_uninitialized_buffer(&self, _: &mut [u8]) -> bool { + false + } + + fn read_buf(&mut self, buf: &mut B) -> Poll { + if NamedPipe::poll_read(self).is_not_ready() { + return Ok(Async::NotReady) + } + + let mut stack_buf = [0u8; 1024]; + let bytes_read = self.io.read(&mut stack_buf); + match bytes_read { + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => { + self.io.need_read(); + return Ok(Async::NotReady); + }, + Err(e) => Err(e), + Ok(bytes_read) => { + buf.put_slice(&stack_buf[0..bytes_read]); + Ok(Async::Ready(bytes_read)) + } + } + } +} + +impl AsyncWrite for NamedPipe { + fn shutdown(&mut self) -> Poll<(), io::Error> { + Ok(().into()) + } + + fn write_buf(&mut self, buf: &mut B) -> Poll { + if NamedPipe::poll_write(self).is_not_ready() { + return Ok(Async::NotReady) + } + + let bytes_wrt = self.io.write(buf.bytes()); + match bytes_wrt { + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => { + self.io.need_write(); + return Ok(Async::NotReady); + }, + Err(e) => Err(e), + Ok(bytes_wrt) => { + buf.advance(bytes_wrt); + Ok(Async::Ready(bytes_wrt)) + } + } + } + +} + +impl<'a> Read for &'a NamedPipe { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + (&self.io).read(buf) + } +} + +impl<'a> Write for &'a NamedPipe { + fn write(&mut self, buf: &[u8]) -> io::Result { + (&self.io).write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + (&self.io).flush() + } +} + +impl fmt::Debug for NamedPipe { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.io.get_ref().fmt(f) + } +} + +impl AsRawHandle for NamedPipe { + fn as_raw_handle(&self) -> RawHandle { + self.io.get_ref().as_raw_handle() + } +} diff --git a/media/audioipc/client/Cargo.toml b/media/audioipc/client/Cargo.toml index fad366c890c03..3f1f5cd2557bc 100644 --- a/media/audioipc/client/Cargo.toml +++ b/media/audioipc/client/Cargo.toml @@ -9,7 +9,7 @@ description = "Cubeb Backend for talking to remote cubeb server." [dependencies] audioipc = { path="../audioipc" } -cubeb-backend = "0.5" +cubeb-backend = "0.5.4" foreign-types = "0.3" futures = { version="0.1.18", default-features=false, features=["use_std"] } futures-cpupool = { version="0.1.8", default-features=false } diff --git a/media/audioipc/client/src/context.rs b/media/audioipc/client/src/context.rs index 920663c7505c0..83643b6712b83 100644 --- a/media/audioipc/client/src/context.rs +++ b/media/audioipc/client/src/context.rs @@ -5,7 +5,7 @@ use assert_not_in_callback; use audioipc::codec::LengthDelimitedCodec; -use audioipc::fd_passing::{framed_with_fds, FramedWithFds}; +use audioipc::platformhandle_passing::{framed_with_platformhandles, FramedWithPlatformHandles}; use audioipc::{core, rpc}; use audioipc::{messages, ClientMessage, ServerMessage}; use cubeb_backend::{ @@ -14,17 +14,13 @@ use cubeb_backend::{ }; use futures::Future; use futures_cpupool::{self, CpuPool}; -use libc; use std::ffi::{CStr, CString}; use std::os::raw::c_void; -use std::os::unix::io::FromRawFd; -use std::os::unix::net; use std::sync::mpsc; use std::thread; use std::{fmt, io, mem, ptr}; use stream; use tokio_core::reactor::{Handle, Remote}; -use tokio_uds::UnixStream; use {ClientStream, CPUPOOL_INIT_PARAMS, G_SERVER_FD}; struct CubebClient; @@ -32,7 +28,7 @@ struct CubebClient; impl rpc::Client for CubebClient { type Request = ServerMessage; type Response = ClientMessage; - type Transport = FramedWithFds>; + type Transport = FramedWithPlatformHandles>; } macro_rules! t( @@ -73,10 +69,10 @@ impl ClientContext { } // TODO: encapsulate connect, etc inside audioipc. -fn open_server_stream() -> Result { +fn open_server_stream() -> Result { unsafe { if let Some(fd) = G_SERVER_FD { - return Ok(net::UnixStream::from_raw_fd(fd)); + return Ok(audioipc::MessageStream::from_raw_fd(fd.as_raw())); } Err(Error::default()) @@ -86,11 +82,11 @@ fn open_server_stream() -> Result { impl ContextOps for ClientContext { fn init(_context_name: Option<&CStr>) -> Result { fn bind_and_send_client( - stream: UnixStream, + stream: audioipc::AsyncMessageStream, handle: &Handle, tx_rpc: &mpsc::Sender>, ) -> Option<()> { - let transport = framed_with_fds(stream, Default::default()); + let transport = framed_with_platformhandles(stream, Default::default()); let rpc = rpc::bind_client::(transport, handle); // If send fails then the rx end has closed // which is unlikely here. @@ -121,7 +117,7 @@ impl ContextOps for ClientContext { open_server_stream() .ok() - .and_then(|stream| UnixStream::from_stream(stream, &handle).ok()) + .and_then(|stream| stream.into_tokio_ipc(&handle).ok()) .and_then(|stream| bind_and_send_client(stream, &handle, &tx_rpc)) .ok_or_else(|| { io::Error::new( @@ -140,6 +136,8 @@ impl ContextOps for ClientContext { .stack_size(params.stack_size) .create(); + send_recv!(rpc, ClientConnect(std::process::id()) => ClientConnected)?; + let ctx = Box::new(ClientContext { _ops: &CLIENT_OPS as *const _, rpc: rpc, @@ -280,7 +278,7 @@ impl Drop for ClientContext { let _ = send_recv!(self.rpc(), ClientDisconnect => ClientDisconnected); unsafe { if G_SERVER_FD.is_some() { - libc::close(super::G_SERVER_FD.take().unwrap()); + G_SERVER_FD.take().unwrap().close(); } } } diff --git a/media/audioipc/client/src/lib.rs b/media/audioipc/client/src/lib.rs index 050b47afdcea4..1ace11175a465 100644 --- a/media/audioipc/client/src/lib.rs +++ b/media/audioipc/client/src/lib.rs @@ -20,11 +20,10 @@ mod send_recv; mod context; mod stream; -use audioipc::PlatformHandleType; +use audioipc::{PlatformHandleType, PlatformHandle}; use context::ClientContext; use cubeb_backend::{capi, ffi}; use std::os::raw::{c_char, c_int}; -use std::os::unix::io::RawFd; use stream::ClientStream; type InitParamsTls = std::cell::RefCell>; @@ -83,7 +82,7 @@ where }); } -static mut G_SERVER_FD: Option = None; +static mut G_SERVER_FD: Option = None; #[no_mangle] /// Entry point from C code. @@ -98,13 +97,13 @@ pub unsafe extern "C" fn audioipc_client_init( let init_params = &*init_params; - // TODO: Windows portability (for fd). // TODO: Better way to pass extra parameters to Context impl. if G_SERVER_FD.is_some() { - panic!("audioipc client's server connection already initialized."); + return cubeb_backend::ffi::CUBEB_ERROR; } - if init_params.server_connection >= 0 { - G_SERVER_FD = Some(init_params.server_connection); + G_SERVER_FD = PlatformHandle::try_new(init_params.server_connection); + if G_SERVER_FD.is_none() { + return cubeb_backend::ffi::CUBEB_ERROR; } let cpupool_init_params = CpuPoolInitParams::init_with(&init_params); diff --git a/media/audioipc/client/src/stream.rs b/media/audioipc/client/src/stream.rs index 12847686d28e8..5511d00e87a8a 100644 --- a/media/audioipc/client/src/stream.rs +++ b/media/audioipc/client/src/stream.rs @@ -12,13 +12,9 @@ use cubeb_backend::{ffi, DeviceRef, Error, Result, Stream, StreamOps}; use futures::Future; use futures_cpupool::{CpuFuture, CpuPool}; use std::ffi::CString; -use std::fs::File; use std::os::raw::c_void; -use std::os::unix::io::FromRawFd; -use std::os::unix::net; use std::ptr; use std::sync::mpsc; -use tokio_uds::UnixStream; use ClientContext; use {assert_not_in_callback, set_in_callback}; @@ -65,7 +61,7 @@ impl rpc::Server for CallbackServer { type Request = CallbackReq; type Response = CallbackResp; type Future = CpuFuture; - type Transport = Framed>; + type Transport = Framed>; fn process(&mut self, req: Self::Request) -> Self::Future { match req { @@ -155,21 +151,21 @@ impl<'ctx> ClientStream<'ctx> { let rpc = ctx.rpc(); let data = try!(send_recv!(rpc, StreamInit(init_params) => StreamCreated())); - debug!("token = {}, fds = {:?}", data.token, data.fds); + debug!("token = {}, handles = {:?}", data.token, data.platform_handles); - let stm = data.fds[0]; - let stream = unsafe { net::UnixStream::from_raw_fd(stm) }; + let stm = data.platform_handles[0]; + let stream = unsafe { audioipc::MessageStream::from_raw_fd(stm.as_raw()) }; - let input = data.fds[1]; - let input_file = unsafe { File::from_raw_fd(input) }; + let input = data.platform_handles[1]; + let input_file = unsafe { input.into_file() }; let input_shm = if has_input { Some(SharedMemSlice::from(&input_file, SHM_AREA_SIZE).unwrap()) } else { None }; - let output = data.fds[2]; - let output_file = unsafe { File::from_raw_fd(output) }; + let output = data.platform_handles[2]; + let output_file = unsafe { output.into_file() }; let output_shm = if has_output { Some(SharedMemMutSlice::from(&output_file, SHM_AREA_SIZE).unwrap()) } else { @@ -191,7 +187,7 @@ impl<'ctx> ClientStream<'ctx> { let (wait_tx, wait_rx) = mpsc::channel(); ctx.remote().spawn(move |handle| { - let stream = UnixStream::from_stream(stream, handle).unwrap(); + let stream = stream.into_tokio_ipc(handle).unwrap(); let transport = framed(stream, Default::default()); rpc::bind_server(transport, server, handle); wait_tx.send(()).unwrap(); diff --git a/media/audioipc/register-collection-not-supported.patch b/media/audioipc/register-collection-not-supported.patch deleted file mode 100644 index 6f9f9544bfdd1..0000000000000 --- a/media/audioipc/register-collection-not-supported.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/media/audioipc/client/src/context.rs b/media/audioipc/client/src/context.rs ---- a/media/audioipc/client/src/context.rs -+++ b/media/audioipc/client/src/context.rs -@@ -265,17 +265,17 @@ impl ContextOps for ClientContext { - - fn register_device_collection_changed( - &mut self, - _dev_type: DeviceType, - _collection_changed_callback: ffi::cubeb_device_collection_changed_callback, - _user_ptr: *mut c_void, - ) -> Result<()> { - assert_not_in_callback(); -- Ok(()) -+ Err(Error::not_supported()) - } - } - - impl Drop for ClientContext { - fn drop(&mut self) { - debug!("ClientContext dropped..."); - let _ = send_recv!(self.rpc(), ClientDisconnect => ClientDisconnected); - unsafe { diff --git a/media/audioipc/server/Cargo.toml b/media/audioipc/server/Cargo.toml index 0e12913f0cb5a..62b6d838eab59 100644 --- a/media/audioipc/server/Cargo.toml +++ b/media/audioipc/server/Cargo.toml @@ -9,7 +9,7 @@ description = "Remote cubeb server" [dependencies] audioipc = { path = "../audioipc" } -cubeb-core = "0.5.1" +cubeb-core = "0.5.4" bytes = "0.4" lazycell = "^0.4" libc = "0.2" diff --git a/media/audioipc/server/src/lib.rs b/media/audioipc/server/src/lib.rs index 4f4e942ecbbc0..df1a6a3396699 100644 --- a/media/audioipc/server/src/lib.rs +++ b/media/audioipc/server/src/lib.rs @@ -20,17 +20,14 @@ extern crate tokio_core; extern crate tokio_uds; use audioipc::core; -use audioipc::fd_passing::framed_with_fds; +use audioipc::platformhandle_passing::framed_with_platformhandles; use audioipc::rpc; -use audioipc::PlatformHandleType; +use audioipc::{MessageStream, PlatformHandle, PlatformHandleType}; use futures::sync::oneshot; use futures::Future; use std::error::Error; use std::os::raw::c_void; -use std::os::unix::io::IntoRawFd; -use std::os::unix::net; use std::ptr; -use tokio_uds::UnixStream; mod server; @@ -102,18 +99,18 @@ pub extern "C" fn audioipc_server_new_client(p: *mut c_void) -> PlatformHandleTy let cb_remote = wrapper.callback_thread.remote(); - // We create a pair of connected unix domain sockets. One socket is - // registered with the reactor core, the other is returned to the - // caller. - net::UnixStream::pair() + // We create a connected pair of anonymous IPC endpoints. One side + // is registered with the reactor core, the other side is returned + // to the caller. + MessageStream::anonymous_ipc_pair() .and_then(|(sock1, sock2)| { // Spawn closure to run on same thread as reactor::Core // via remote handle. wrapper.core_thread.remote().spawn(|handle| { trace!("Incoming connection"); - UnixStream::from_stream(sock2, handle) + sock2.into_tokio_ipc(handle) .and_then(|sock| { - let transport = framed_with_fds(sock, Default::default()); + let transport = framed_with_platformhandles(sock, Default::default()); rpc::bind_server(transport, server::CubebServer::new(cb_remote), handle); Ok(()) }).map_err(|_| ()) @@ -123,8 +120,8 @@ pub extern "C" fn audioipc_server_new_client(p: *mut c_void) -> PlatformHandleTy // Wait for notification that sock2 has been registered // with reactor::Core. let _ = wait_rx.wait(); - Ok(sock1.into_raw_fd()) - }).unwrap_or(-1) + Ok(PlatformHandle::from(sock1).as_raw()) + }).unwrap_or(-1isize as PlatformHandleType) } #[no_mangle] diff --git a/media/audioipc/server/src/server.rs b/media/audioipc/server/src/server.rs index 13f5342bb617c..e4eacb693491b 100644 --- a/media/audioipc/server/src/server.rs +++ b/media/audioipc/server/src/server.rs @@ -4,9 +4,10 @@ // accompanying file LICENSE for details use audioipc; +use audioipc::{MessageStream, PlatformHandle}; use audioipc::codec::LengthDelimitedCodec; use audioipc::core; -use audioipc::fd_passing::FramedWithFds; +use audioipc::platformhandle_passing::FramedWithPlatformHandles; use audioipc::frame::{framed, Framed}; use audioipc::messages::{ CallbackReq, CallbackResp, ClientMessage, Device, DeviceInfo, ServerMessage, StreamCreate, @@ -25,11 +26,8 @@ use std::convert::From; use std::ffi::{CStr, CString}; use std::mem::{size_of, ManuallyDrop}; use std::os::raw::{c_long, c_void}; -use std::os::unix::io::IntoRawFd; -use std::os::unix::net; use std::{panic, slice}; use tokio_core::reactor::Remote; -use tokio_uds::UnixStream; use errors::*; @@ -65,7 +63,7 @@ struct CallbackClient; impl rpc::Client for CallbackClient { type Request = CallbackReq; type Response = CallbackResp; - type Transport = Framed>; + type Transport = Framed>; } struct ServerStreamCallbacks { @@ -142,13 +140,14 @@ type StreamSlab = slab::Slab; pub struct CubebServer { cb_remote: Remote, streams: StreamSlab, + remote_pid: Option, } impl rpc::Server for CubebServer { type Request = ServerMessage; type Response = ClientMessage; type Future = FutureResult; - type Transport = FramedWithFds>; + type Transport = FramedWithPlatformHandles>; fn process(&mut self, req: Self::Request) -> Self::Future { let resp = with_local_context(|context| match *context { @@ -164,13 +163,17 @@ impl CubebServer { CubebServer { cb_remote: cb_remote, streams: StreamSlab::with_capacity(STREAM_CONN_CHUNK_SIZE), + remote_pid: None, } } // Process a request coming from the client. fn process_msg(&mut self, context: &cubeb::Context, msg: &ServerMessage) -> ClientMessage { let resp: ClientMessage = match *msg { - ServerMessage::ClientConnect => panic!("already connected"), + ServerMessage::ClientConnect(pid) => { + self.remote_pid = Some(pid); + ClientMessage::ClientConnected + } ServerMessage::ClientDisconnect => { // TODO: @@ -304,7 +307,7 @@ impl CubebServer { let input_frame_size = frame_size_in_bytes(params.input_stream_params.as_ref()); let output_frame_size = frame_size_in_bytes(params.output_stream_params.as_ref()); - let (stm1, stm2) = net::UnixStream::pair()?; + let (stm1, stm2) = MessageStream::anonymous_ipc_pair()?; debug!("Created callback pair: {:?}-{:?}", stm1, stm2); let (input_shm, input_file) = SharedMemWriter::new(&audioipc::get_shm_path("input"), SHM_AREA_SIZE)?; @@ -323,7 +326,7 @@ impl CubebServer { // Ensure we're running on a loop different to the one // invoking spawn_fn. assert_ne!(id, handle.id()); - let stream = UnixStream::from_stream(stm2, handle).unwrap(); + let stream = stm2.into_tokio_ipc(handle).unwrap(); let transport = framed(stream, Default::default()); let rpc = rpc::bind_client::(transport, handle); drop(tx.send(rpc)); @@ -402,11 +405,12 @@ impl CubebServer { Ok(ClientMessage::StreamCreated(StreamCreate { token: stm_tok, - fds: [ - stm1.into_raw_fd(), - input_file.into_raw_fd(), - output_file.into_raw_fd(), + platform_handles: [ + PlatformHandle::from(stm1), + PlatformHandle::from(input_file), + PlatformHandle::from(output_file), ], + target_pid: self.remote_pid.unwrap() })) }).map_err(|e| e.into()) } diff --git a/media/audioipc/update.sh b/media/audioipc/update.sh index 3226ba7e128ae..82b505d93fa29 100755 --- a/media/audioipc/update.sh +++ b/media/audioipc/update.sh @@ -11,6 +11,8 @@ for crate in audioipc client server; do cp -pr $1/$crate/src/ $crate/src/ done +rm audioipc/src/cmsghdr.c + if [ -d $1/.git ]; then rev=$(cd $1 && git rev-parse --verify HEAD) date=$(cd $1 && git show -s --format=%ci HEAD) @@ -32,5 +34,3 @@ fi echo "Applying gecko.patch on top of $rev" patch -p3 < gecko.patch -echo "Applying register-collection-not-supported.patch on top of $rev" -patch -p3 < register-collection-not-supported.patch From 3bc23059fe4b32082085e5a4d5eb11efa36c235e Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Thu, 7 Mar 2019 02:04:54 +0000 Subject: [PATCH 38/48] Bug 1512445 - Re-vendor Rust dependencies for AudioIPC. r=chunmin Differential Revision: https://phabricator.services.mozilla.com/D22154 --HG-- extra : moz-landing-system : lando --- Cargo.lock | 49 +- .../rust/cubeb-backend/.cargo-checksum.json | 2 +- third_party/rust/cubeb-backend/Cargo.toml | 4 +- .../rust/cubeb-core/.cargo-checksum.json | 2 +- third_party/rust/cubeb-core/Cargo.toml | 4 +- .../rust/cubeb-sys/.cargo-checksum.json | 2 +- third_party/rust/cubeb-sys/Cargo.toml | 5 +- third_party/rust/cubeb-sys/build.rs | 1 - .../cubeb-sys/libcubeb/src/cubeb_wasapi.cpp | 1 + third_party/rust/cubeb-sys/src/channel.rs | 7 +- third_party/rust/cubeb/.cargo-checksum.json | 2 +- third_party/rust/cubeb/Cargo.toml | 4 +- .../rust/mio-named-pipes/.cargo-checksum.json | 1 + third_party/rust/mio-named-pipes/Cargo.toml | 23 + .../rust/mio-named-pipes/LICENSE-APACHE | 201 ++++++ third_party/rust/mio-named-pipes/LICENSE-MIT | 25 + third_party/rust/mio-named-pipes/README.md | 42 ++ third_party/rust/mio-named-pipes/appveyor.yml | 18 + .../rust/mio-named-pipes/src/from_raw_arc.rs | 116 +++ third_party/rust/mio-named-pipes/src/lib.rs | 681 ++++++++++++++++++ .../rust/mio-named-pipes/tests/smoke.rs | 273 +++++++ 21 files changed, 1429 insertions(+), 34 deletions(-) create mode 100644 third_party/rust/mio-named-pipes/.cargo-checksum.json create mode 100644 third_party/rust/mio-named-pipes/Cargo.toml create mode 100644 third_party/rust/mio-named-pipes/LICENSE-APACHE create mode 100644 third_party/rust/mio-named-pipes/LICENSE-MIT create mode 100644 third_party/rust/mio-named-pipes/README.md create mode 100644 third_party/rust/mio-named-pipes/appveyor.yml create mode 100644 third_party/rust/mio-named-pipes/src/from_raw_arc.rs create mode 100644 third_party/rust/mio-named-pipes/src/lib.rs create mode 100644 third_party/rust/mio-named-pipes/tests/smoke.rs diff --git a/Cargo.lock b/Cargo.lock index 299932d6039e2..e42477a4cb62a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,19 +90,22 @@ version = "0.2.4" dependencies = [ "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "cubeb 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.23 (git+https://github.com/glandium/cc-rs?branch=1.0.23-clang-cl-aarch64)", + "cubeb 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (git+https://github.com/froydnj/winapi-rs?branch=aarch64)", ] [[package]] @@ -110,7 +113,7 @@ name = "audioipc-client" version = "0.4.0" dependencies = [ "audioipc 0.2.4", - "cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-backend 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -126,7 +129,7 @@ version = "0.2.3" dependencies = [ "audioipc 0.2.4", "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-core 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -671,34 +674,34 @@ dependencies = [ [[package]] name = "cubeb" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-core 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cubeb-backend" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-core 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cubeb-core" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cubeb-pulse" version = "0.2.0" dependencies = [ - "cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-backend 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "pulse 0.2.0", "pulse-ffi 0.1.0", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -706,11 +709,10 @@ dependencies = [ [[package]] name = "cubeb-sys" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1118,7 +1120,7 @@ dependencies = [ "audioipc-server 0.2.3", "cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "cubeb-pulse 0.2.0", - "cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_c 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_glue 0.1.0", "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1626,6 +1628,18 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mio-named-pipes" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio-uds" version = "0.6.4" @@ -3354,10 +3368,10 @@ dependencies = [ "checksum cssparser-macros 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a5383ae18dbfdeb569ed62019f5bddb2a95cd2d3833313c475a0d014777805" "checksum cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea" "checksum cstr-macros 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0472c17c83d3ec1af32fb6ee2b3ad56ae0b6e69355d63d1d30602055c34324a8" -"checksum cubeb 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8a3502aafa1bf95c524f65d2ba46d8741700c6a8a9543ea52c6da3d8b69a2896" -"checksum cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0432a0d08c3f9a778a2b0b6214c87ec2eb17e8639eb68baf0686bdafc4fd11f1" -"checksum cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37f7b20f757a4e4b6aa28863236551bff77682dc6db192eba15af615492b5445" -"checksum cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "653b9e245d35dbe2a2da7c4586275cee75ff656ddeb02d4a73b4afdfa6d67502" +"checksum cubeb 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "db3f0df2ad5cb453126364a77921466ba6c1034e8bd9247f326cdb31430dbc2a" +"checksum cubeb-backend 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "442cd5cfb980ff62730525278ce320d9b2ff635b725857ad3176832664262fec" +"checksum cubeb-core 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0161f9327864922ba7a172c90bd86bc9094938433eca415e2c75629954045022" +"checksum cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba7540c17b90159cf7d7854da370998ff0560d9b90e2c9290bb588afa0edf95" "checksum darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f593353cad5af2df6d54810de2b61aa8acba5b5fbc70b0d75e7cc5bdd80aca73" "checksum darling_core 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "168c246e87e727d58575d9b4595491010627f0cdc910e3e6ea3b36db2b9a9d9a" "checksum darling_macro 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "99c4eff4bcbeaf6a22578012ff79c95910338668278d1901e528bd34a22f575d" @@ -3439,6 +3453,7 @@ dependencies = [ "checksum miniz_oxide 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aaa2d3ad070f428fffbd7d3ca2ea20bb0d8cffe9024405c44e1840bc1418b398" "checksum miniz_oxide_c_api 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "92d98fdbd6145645828069b37ea92ca3de225e000d80702da25c20d3584b38a5" "checksum mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)" = "4fcfcb32d63961fb6f367bfd5d21e4600b92cd310f71f9dca25acae196eb1560" +"checksum mio-named-pipes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "82f43a815b57d2d652550f3d20cec88a495bb2d0956aa873dc43040278455677" "checksum mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1731a873077147b626d89cc6c2a0db6288d607496c5d10c0cfcf3adc697ec673" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum moz_cbor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20c82a57087fd5990d7122dbff1607c3b20c3d2958e9d9ad9765aab415e2c91c" diff --git a/third_party/rust/cubeb-backend/.cargo-checksum.json b/third_party/rust/cubeb-backend/.cargo-checksum.json index 3ddd5cf22c32c..af319c74ef07b 100644 --- a/third_party/rust/cubeb-backend/.cargo-checksum.json +++ b/third_party/rust/cubeb-backend/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"5009330f8a03fc0cf4b10540514496db0281bb92541f9850217c5de7d12dc8b7","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"300e76bd3901de540b21a2cfc8d15dbcd1b2940d5fbb517fc5fe568af2ec2775","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/ops.rs":"55cbf9bdccdd854834eba72e8bde3e59a9a4193e65209769a1a6e0d8a320b8f6","src/traits.rs":"1a6e3401bb25088d355041704bd89099d62b51eda94da177e7e860646c52b955","tests/test_capi.rs":"9d949cbdb1c19e229ce4f652999a058c283cf7d5a882a669dbca08b71ac2fb62"},"package":"0432a0d08c3f9a778a2b0b6214c87ec2eb17e8639eb68baf0686bdafc4fd11f1"} \ No newline at end of file +{"files":{"Cargo.toml":"1933f3fab97c50556ade6cc02e82b911aa7d7787be13501e9ea8dc09b85b2739","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"300e76bd3901de540b21a2cfc8d15dbcd1b2940d5fbb517fc5fe568af2ec2775","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/ops.rs":"55cbf9bdccdd854834eba72e8bde3e59a9a4193e65209769a1a6e0d8a320b8f6","src/traits.rs":"1a6e3401bb25088d355041704bd89099d62b51eda94da177e7e860646c52b955","tests/test_capi.rs":"9d949cbdb1c19e229ce4f652999a058c283cf7d5a882a669dbca08b71ac2fb62"},"package":"442cd5cfb980ff62730525278ce320d9b2ff635b725857ad3176832664262fec"} \ No newline at end of file diff --git a/third_party/rust/cubeb-backend/Cargo.toml b/third_party/rust/cubeb-backend/Cargo.toml index 6f2b141ac45aa..b7e94c3ea4aad 100644 --- a/third_party/rust/cubeb-backend/Cargo.toml +++ b/third_party/rust/cubeb-backend/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "cubeb-backend" -version = "0.5.1" +version = "0.5.4" authors = ["Dan Glastonbury "] description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n" homepage = "https://github.com/djg/cubeb-rs" @@ -21,7 +21,7 @@ categories = ["api-bindings"] license = "ISC" repository = "https://github.com/djg/cubeb-rs" [dependencies.cubeb-core] -version = "0.5.0" +version = "0.5.4" [features] gecko-in-tree = ["cubeb-core/gecko-in-tree"] diff --git a/third_party/rust/cubeb-core/.cargo-checksum.json b/third_party/rust/cubeb-core/.cargo-checksum.json index 28202dcd70a50..b38dffbd51ecd 100644 --- a/third_party/rust/cubeb-core/.cargo-checksum.json +++ b/third_party/rust/cubeb-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"c379f4deb07a056d5d1679f4641c3a29dec6c74a82b2304cbf5ec65488e5a9bc","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"ca97e3a3d1f3fc451c17851c8538964ec67f3964dfe29e902d904ee7445becca","src/channel.rs":"c8d5a76ef3ecdd96cd4de516e3d4d139bbb83c4690d1c3f5fd07fffc47be51f1","src/context.rs":"09625b75070ec88d566a907ab2e574e2d85df4c6df295f798b3372df2cdc8f7a","src/device.rs":"490d2e94ecae1e149476c2e8d9aa03c4163987c3efccc962b2d3123e4c09dedf","src/device_collection.rs":"f6d0c1628cc34b524f86b84a1e1c79971c3f64ebc4ac64eeb10a1330bbe8c238","src/error.rs":"855ff3d3597753f832ecea00e403c71129afd80db3d39456cf3e23cb9aeb91e7","src/ffi_types.rs":"d815d7a80895b5e86907e708dc0219fca4ac4668cde114afee434e7d702a145d","src/format.rs":"5513c537a72af1c222ee7c30b26d4de9d368a69772688b95d88b1a99f6892d5c","src/lib.rs":"6010a5e20b836b8e5c9fba382fde819e6f3c18c0ec2016e6e7e118eabedbcd51","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"775b9af0e3d8c1a7a38f96b8365a632a9d52a43541d96ede9a4ed9688c2dc914","src/try_call.rs":"231bfa3f3448f7531427bb228beb2bcd4fd711f0b13d2d8f412af013470f40c7","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"37f7b20f757a4e4b6aa28863236551bff77682dc6db192eba15af615492b5445"} \ No newline at end of file +{"files":{"Cargo.toml":"5606a2dfca9a44892ebfbc7caa0a96a50e8bb96676f7a9aaf584b3d459843d86","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"ca97e3a3d1f3fc451c17851c8538964ec67f3964dfe29e902d904ee7445becca","src/channel.rs":"c8d5a76ef3ecdd96cd4de516e3d4d139bbb83c4690d1c3f5fd07fffc47be51f1","src/context.rs":"09625b75070ec88d566a907ab2e574e2d85df4c6df295f798b3372df2cdc8f7a","src/device.rs":"490d2e94ecae1e149476c2e8d9aa03c4163987c3efccc962b2d3123e4c09dedf","src/device_collection.rs":"f6d0c1628cc34b524f86b84a1e1c79971c3f64ebc4ac64eeb10a1330bbe8c238","src/error.rs":"855ff3d3597753f832ecea00e403c71129afd80db3d39456cf3e23cb9aeb91e7","src/ffi_types.rs":"d815d7a80895b5e86907e708dc0219fca4ac4668cde114afee434e7d702a145d","src/format.rs":"5513c537a72af1c222ee7c30b26d4de9d368a69772688b95d88b1a99f6892d5c","src/lib.rs":"6010a5e20b836b8e5c9fba382fde819e6f3c18c0ec2016e6e7e118eabedbcd51","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"775b9af0e3d8c1a7a38f96b8365a632a9d52a43541d96ede9a4ed9688c2dc914","src/try_call.rs":"231bfa3f3448f7531427bb228beb2bcd4fd711f0b13d2d8f412af013470f40c7","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"0161f9327864922ba7a172c90bd86bc9094938433eca415e2c75629954045022"} \ No newline at end of file diff --git a/third_party/rust/cubeb-core/Cargo.toml b/third_party/rust/cubeb-core/Cargo.toml index 305e1e243b04c..3296a6ebabbe0 100644 --- a/third_party/rust/cubeb-core/Cargo.toml +++ b/third_party/rust/cubeb-core/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "cubeb-core" -version = "0.5.1" +version = "0.5.4" authors = ["Dan Glastonbury "] description = "Common types and definitions for cubeb rust and C bindings. Not intended for direct use.\n" homepage = "https://github.com/djg/cubeb-rs" @@ -24,7 +24,7 @@ repository = "https://github.com/djg/cubeb-rs" version = "1.0" [dependencies.cubeb-sys] -version = "0.5.0" +version = "0.5.4" [features] gecko-in-tree = ["cubeb-sys/gecko-in-tree"] diff --git a/third_party/rust/cubeb-sys/.cargo-checksum.json b/third_party/rust/cubeb-sys/.cargo-checksum.json index 967b662d420fd..38e49c5af36a9 100644 --- a/third_party/rust/cubeb-sys/.cargo-checksum.json +++ b/third_party/rust/cubeb-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b43b0c932a03f5d8372da2147b0d505f051a3f39eaa3b0f0de876256fa842ed7","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","build.rs":"49985a30631de0015517fc260321aa03a003eaf26d80650bebd928d55edc9444","libcubeb/AUTHORS":"829e45d138c7c8827799f302806fa4be8cd8bd4bad70a2fe26c3a27a5cf36948","libcubeb/CMakeLists.txt":"381886472be5fc0f925aa42268fd2df9f17f5613ee7db489849af474189f0358","libcubeb/Config.cmake.in":"88019286c96ef3d5d3a673b183c8655dfc97ceede07d3eb6c18f0c51bb896388","libcubeb/INSTALL.md":"7a84cdfbe86e7d3180e2203603b88571df61b369421fa97ee86740ffd4d4db8e","libcubeb/LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","libcubeb/README.md":"aa417156dc65069264901b75fc3c792c73021ec61c909de04e109bd4184c07ab","libcubeb/TODO":"6f8065136e005d2becee810e3d8697a94f2c755f8c79687adfac7136ad165e80","libcubeb/appveyor.yml":"9a87fdc18b76fca1167289ecb2ec3a210b76984c1d7e92268b2cd36f1e00f541","libcubeb/cmake/sanitizers-cmake/CMakeLists.txt":"89b282c19b3897ff666f7847d5e679ae928ca7e76ffd0d23f7c58c9464048b61","libcubeb/cmake/sanitizers-cmake/LICENSE":"4b67e7ae8c91e68e1a929eb1cbaa4c773c6d19aa91aaa12c390cf9560d1c9799","libcubeb/cmake/sanitizers-cmake/README.md":"30ab1524618ac828b75f9b83c665a0bd50b839b42ce61519a8048d73f401da6e","libcubeb/cmake/sanitizers-cmake/cmake/FindASan.cmake":"cba07ffe438c57bef0840ed6a2d2890676530b66509da3c616438c53018baa4f","libcubeb/cmake/sanitizers-cmake/cmake/FindMSan.cmake":"1303aac5028fe9f64d42be0afd47f1291e679d74f8280b3dc5271f20ebf4d7a4","libcubeb/cmake/sanitizers-cmake/cmake/FindSanitizers.cmake":"ce1971b943bbef08fb9aba958cf28e3cbdff075406c85a3cfed22e00c9f8d9a8","libcubeb/cmake/sanitizers-cmake/cmake/FindTSan.cmake":"edca39b287312e9a8fc718f6ec791d2520515900b37426091310fe1bd52dc6a1","libcubeb/cmake/sanitizers-cmake/cmake/FindUBSan.cmake":"5b9d3621f629c807a1345a7cb053677a8bf25782a079e345dda53d04aecdc4b7","libcubeb/cmake/sanitizers-cmake/cmake/asan-wrapper":"4e543936e6374e24b80a0f92135c07c2e2101c0d110e51bddaf0e70ae8ec391e","libcubeb/cmake/sanitizers-cmake/cmake/sanitize-helpers.cmake":"282620734c2a8062f1280d0dde3121b8b01af26e5ecaa7d4308e145f80ecd115","libcubeb/cmake/sanitizers-cmake/tests/CMakeLists.txt":"fb983bab7040be002847db59c2493abfd249f67ad06e3a9270fbceb9fabda11c","libcubeb/cmake/sanitizers-cmake/tests/asan_test.cpp":"8b351c7c8668b4a2438286df426f0ad322cade6d1c6199a74668ccbd1c5204a4","libcubeb/cmake/toolchain-cross-android.cmake":"59d2355845a71647b353fb8b18fca630db8ffee7bb8500143e2d6fbc409cec97","libcubeb/cmake/toolchain-cross-mingw.cmake":"b09dc261981c0d4a0f8430f05aae9c8fc545651cd9cbfacd09754277b776b532","libcubeb/cubeb.supp":"19f33e59f8dc91a327c923e44c2c3f9af0a043ce1d6a8cac275ba094b4bfe0da","libcubeb/docs/Doxyfile.in":"0815f19789cedd310652a133bab260c27b57e95f7a65458df2dfca38ea4f1041","libcubeb/googletest/CHANGES":"72c8a289bfe4dd9160074a3a2238c8067a5bc7ca49fd87f70a134c3f373932a4","libcubeb/googletest/CMakeLists.txt":"cdf938ce79ea066866dc614de3925bfaa48d9e19e04049db2ec8c5443abaaa9b","libcubeb/googletest/CONTRIBUTORS":"4d911cd5e6d71f3f4bbcb2788b2f916df4b0ce1e088752a159457a1d936ae0ce","libcubeb/googletest/COPYING":"9702de7e4117a8e2b20dafab11ffda58c198aede066406496bef670d40a22138","libcubeb/googletest/Makefile.am":"a795e5a18e82ba06fd97509d92d773b7fafd0dd7086db8a1211fbd151b503bac","libcubeb/googletest/README":"484b19654362942fac9734c8fab0ed3d99249b81c69027bdb7de46054abada6b","libcubeb/googletest/cmake/internal_utils.cmake":"6f4670a5825cf8ae0415be9dd43d82a7f30316d75cab20a4c60afb6d9db2a01d","libcubeb/googletest/codegear/gtest.cbproj":"9fa07a66b8c01773256e508187775407c465ed9055651e93d390426d1888721a","libcubeb/googletest/codegear/gtest.groupproj":"76c001cb2ee0070e26d1570fb6db5250f2585179c707496c5ef6d12e582cf205","libcubeb/googletest/codegear/gtest_all.cc":"c8750dc2b7b3612edb60e8d23fc2f60ae264451916c4b15f81cbf60ea30eb75d","libcubeb/googletest/codegear/gtest_link.cc":"e5e47c086f932471e0ca748a62b3b1597e5e731f4d34fb8cb8b2ca2db7ba3ed0","libcubeb/googletest/codegear/gtest_main.cbproj":"056448ba7f41fae3f704b1001922d9f6e419cf8cbcf3a55bf0ecc59ece1fa9a1","libcubeb/googletest/codegear/gtest_unittest.cbproj":"2c48be90b0dbc3224a8bd6c4dc21f78dd1b08c81685e6bd4952bb6df6ee38701","libcubeb/googletest/configure.ac":"fadebffdaeaccebb60fbe4a501c1138c296e01348a5da45fabf5e4233248baa8","libcubeb/googletest/include/gtest/gtest-death-test.h":"fdd087f700cd04a3ce4bdd36f35769de52a44bfc0c5bae2dc9681d4cbcd3c44a","libcubeb/googletest/include/gtest/gtest-message.h":"eaf44df1284d94333507c47091c84eaaf43814e6a02a1b1c0061ca7b363e74d6","libcubeb/googletest/include/gtest/gtest-param-test.h":"f226f0a24c04cddbceaaa45d8a5e575ce18c3392349f9b8ba73317e37e62368d","libcubeb/googletest/include/gtest/gtest-param-test.h.pump":"17c65fd5cc5218279044a61f3873c9c952b0924a7ba5147d4999d400b122207f","libcubeb/googletest/include/gtest/gtest-printers.h":"7046f611398d63ee0f1c37bdb4fd08d9931979b2fedf13b781e6d85d4b3b5d60","libcubeb/googletest/include/gtest/gtest-spi.h":"560407dd45e8e57fa6927504c9e4a4cfdecf30f8cada975c1ffddce765e6a88a","libcubeb/googletest/include/gtest/gtest-test-part.h":"c4d6d840284728740c284646075e8ffc85b63b9f74f3ed488b18ef3c2c2b9005","libcubeb/googletest/include/gtest/gtest-typed-test.h":"1ec858bbb9ed8a8bb553232df016437c080b2670f00453b4de297c286eb78c21","libcubeb/googletest/include/gtest/gtest.h":"47433ca72a43bda7a380c34fe6d4ff451797c687e9bbd74d1f366bcdfa0cb013","libcubeb/googletest/include/gtest/gtest_pred_impl.h":"f03a3f77e3c231889c0ace6f63b2c4e410e4a9330287ea09443b23b9a3cf9092","libcubeb/googletest/include/gtest/gtest_prod.h":"4a99a3d986a45b4d6d9b3af54809f015c54aa98274793a4ae173f5010d0ad33c","libcubeb/googletest/include/gtest/internal/gtest-death-test-internal.h":"0b3abead866363f3e6b4201acc8d2763072e033826b22ae5ebffd790e1415235","libcubeb/googletest/include/gtest/internal/gtest-filepath.h":"638d2bb6c06a894513b03311a8e931ac835fc00afc4bd21fab3afc05732c23a0","libcubeb/googletest/include/gtest/internal/gtest-internal.h":"12c2c83df0a9dc5b46697ccd8271dfa34ee5f3d1972dcb56585bc1459d9583c9","libcubeb/googletest/include/gtest/internal/gtest-linked_ptr.h":"9bd319548dd073630dfd349c06a440c6a582feec47d4ff14f348ec32f8b4c1f3","libcubeb/googletest/include/gtest/internal/gtest-param-util-generated.h":"10db93fa7e98820192bae6f560664469dd33b265036fca64253c89b6801f96cb","libcubeb/googletest/include/gtest/internal/gtest-param-util-generated.h.pump":"abb72365d94d2811b34c195dc520fbf41c7dcb42aae5a1cfa0502cf619b21e70","libcubeb/googletest/include/gtest/internal/gtest-param-util.h":"7f9311f033ef6916217d87cef53b1db6c4e8733be930e4b48fe7e11d21b33da0","libcubeb/googletest/include/gtest/internal/gtest-port.h":"612932c2930a7cf2c3514d89a8d6b51a2c0030d251309b71765ed1c9954e20c5","libcubeb/googletest/include/gtest/internal/gtest-string.h":"a46aa36165c400d1e926f942be03fe04cd7ccb1e59f7a2a03b919c4eea05b997","libcubeb/googletest/include/gtest/internal/gtest-tuple.h":"43e7e3c92f8e4258cf3927a9204b214d4d03e6c796f88f3ad4e66b1ac20aa938","libcubeb/googletest/include/gtest/internal/gtest-tuple.h.pump":"16fa027ed3c5940699e0ac906815e66620993bcf75b0acaf826d4f09348d4b83","libcubeb/googletest/include/gtest/internal/gtest-type-util.h":"6d177af46a9b1e14b969972a8b886667f95e69037aba411433a44fb9b92e7037","libcubeb/googletest/include/gtest/internal/gtest-type-util.h.pump":"22092f44127af91651f57ce222e20914d5d32ae02f1c0964f6d5d7bc019af339","libcubeb/googletest/m4/acx_pthread.m4":"3326e3746b6b351d1671fe31f798269cda8de92c365b8a8305404ec0fa6c6b32","libcubeb/googletest/m4/gtest.m4":"d3c37ebd1aa792c967d4357755cc670bc6deb30091d9e6db498871d90a30ea4c","libcubeb/googletest/make/Makefile":"9b86e2a112dd55c6bf6a2b39e6f4078faf60cfecb8282ebf9b025167ed233420","libcubeb/googletest/msvc/gtest-md.sln":"0beab679b42cf0c431eaf4fe143bbf3b01fc064e20c74d9e33e7e437a70487d4","libcubeb/googletest/msvc/gtest-md.vcproj":"52e873e964daf9d5409b4e9bb471ddf2827be04985cd96c40620f9275d17a256","libcubeb/googletest/msvc/gtest.sln":"be21c2340650ec2259a2fbaeb8608ae6d3e982a0626a0f91128a771dc88e6bea","libcubeb/googletest/msvc/gtest.vcproj":"0064616c7d88a284c1b7c05baab038f239134ea9c6c563628f286f9600b3f921","libcubeb/googletest/msvc/gtest_main-md.vcproj":"f83a294a92b616bf34ccae6743ff916297bdba61d6125a9637a813d467a30372","libcubeb/googletest/msvc/gtest_main.vcproj":"9f03270a00896eab0c7015c6fb1a73818d024e462d3944ba1d3ceb313a051649","libcubeb/googletest/msvc/gtest_prod_test-md.vcproj":"7caa108733e2d5f140da004d2133e04a9a105811909c0e2d4ec06e2971983592","libcubeb/googletest/msvc/gtest_prod_test.vcproj":"cf5bfb7f3de9a59a0eba5535067845d12c33c3fd8fecc3d03aa702665db29578","libcubeb/googletest/msvc/gtest_unittest-md.vcproj":"e7949b21cf0418f2a7afe8aa94616e2c40e3ba0801c2f0826f3a3a3d2e6f48b0","libcubeb/googletest/msvc/gtest_unittest.vcproj":"5b097d596fbbc1c4090fd518008a0961b29661194e1c02d8a2d3daaa557e626f","libcubeb/googletest/samples/prime_tables.h":"2903df1d1e6643a5f624fe3ea3f931c3410eb1858ac347c5df278273c6c91ca4","libcubeb/googletest/samples/sample1.cc":"dc106c5940d87bb4bbef3d77815eab642ee173a3340b2b9c532b5c711c4c2d0e","libcubeb/googletest/samples/sample1.h":"7a7bf9a0fbd2401e8b2cb554bfcb9bd0ed228212f3b970675c1b1d38d4e188bb","libcubeb/googletest/samples/sample10_unittest.cc":"ccebb6393a5a8468399f7e511219b667a2233f82312ce59834a4bb0997d8700e","libcubeb/googletest/samples/sample1_unittest.cc":"904be0d4a095e74393515195392bd10e1e916bb2ca61f3f94b1bd6aebea29cb6","libcubeb/googletest/samples/sample2.cc":"f14b8a1e69d52eef1a70053fb256818c7eca64e8eda08de43cf46e896e57fcc2","libcubeb/googletest/samples/sample2.h":"df956ba520dafca068dbc1e28f36567db3cba36293e06762318af8cda6a12bd4","libcubeb/googletest/samples/sample2_unittest.cc":"abe7e0b253d328cb82ae67623fbe3c89eb94699102510c64a0b568eaca101e05","libcubeb/googletest/samples/sample3-inl.h":"3fe482bbd4f725f5820f5d6beab4d0d4a524be8addf4b344a9a470ec5aabc451","libcubeb/googletest/samples/sample3_unittest.cc":"252c06b4531dc35213ebdd7311700b9b4057bc1bdeeba0cd767b2bc86c456639","libcubeb/googletest/samples/sample4.cc":"b4260f5fa35d78ac114a9abb59fce12403faf0273df41f57e83c341ae7979222","libcubeb/googletest/samples/sample4.h":"604905cae7e5587805c3b884a36eda7a2bebdfedb53b24b0fd9a220eec0ef1a9","libcubeb/googletest/samples/sample4_unittest.cc":"6cfb4821d8cb1c77fbb5af4f8aec569948762d8ea314827e3ead967b5b6a223e","libcubeb/googletest/samples/sample5_unittest.cc":"73646d9038873a68bb2e56b12495d7f7b65b5c23901109701da446af454ba2ec","libcubeb/googletest/samples/sample6_unittest.cc":"833fee399954f908cf0f3b789832e505329787f4cf73607a7b31ca0f62f368d7","libcubeb/googletest/samples/sample7_unittest.cc":"8013ee68d61c181e4e936cdae3a9a635646274f8512033ef11bff7214e03e4a6","libcubeb/googletest/samples/sample8_unittest.cc":"7b7510fadf4955d2f934d23d652dbd35add832e50bdfcc98421fb9be4588d808","libcubeb/googletest/samples/sample9_unittest.cc":"8b827040dea37b460cbcaea0b255b98974a9840f6ef7bd82aaa7d4ad2c724335","libcubeb/googletest/scripts/fuse_gtest_files.py":"adecf64c6bab65b31740c321e568cf174f753d5617745aa5762d842339d68b53","libcubeb/googletest/scripts/gen_gtest_pred_impl.py":"78fb7e20a014c251d723186eb58040e4eb32405b73c9288d787ea0a0e4ff5183","libcubeb/googletest/scripts/gtest-config.in":"9a43978eeee88e188845d737c17f4d024d4e74feae09da7997e8fbe4ea6cc176","libcubeb/googletest/scripts/pump.py":"3856a3d7be37f78e0f214ee7d4f29d05f1ca14218b67539d67c9a16e992f670c","libcubeb/googletest/scripts/test/Makefile":"3576b257594a2d8e843b9e4de8c83353d837833bb86431fb1b4198022b1bcddc","libcubeb/googletest/scripts/upload.py":"f75d0712e3b13bebd8daa0a15e4eb32c9e3034a933f4fcccf65b1e999a7ae066","libcubeb/googletest/scripts/upload_gtest.py":"6e76fc0a7a3831c01cfffd18c220d44438073a66338d91ca61fc84b924021e61","libcubeb/googletest/src/gtest-all.cc":"568ac119f5e6418f1fbcfbdf185d724657d7f3539b47822da229ac5d015626b2","libcubeb/googletest/src/gtest-death-test.cc":"eec1b3c8252670c76acbbaf63483946897ce625139b53a566406b6313f023896","libcubeb/googletest/src/gtest-filepath.cc":"31b7fcda5d11346f8a487597c6a70ff057f1192e0cb11f27eb7841a9f3aa8b86","libcubeb/googletest/src/gtest-internal-inl.h":"c9d428a6b5990ace091e40c4ce8b7bf6c50c186a8314b1c4a4cdc988ca0ac1a4","libcubeb/googletest/src/gtest-port.cc":"95bcf473622d1b901c734e5c2aeb8efb058555ec924212a61bb04f049bb5a069","libcubeb/googletest/src/gtest-printers.cc":"6f191a7fc7f5a0a967fd11964057f2e2d2eaf2f37ccece16bd816531f52b3154","libcubeb/googletest/src/gtest-test-part.cc":"e489868b4cdc66f4fc33bc2326ac86bc1acc5808ab58bbb288c9dcfc330faddc","libcubeb/googletest/src/gtest-typed-test.cc":"ca9e819df728c25a6a1fc072806c22f3494e1dffe4bd0d48284f38dbdd3a0dd5","libcubeb/googletest/src/gtest.cc":"5cf9a3e897892c9f0e5c887f91d3c8c8c5665bd7348560441fc0b946c254873c","libcubeb/googletest/src/gtest_main.cc":"22fa1f77542b882d1798d7f696045c5895942a626e26200a175fa4382e1fa5b5","libcubeb/googletest/test/gtest-death-test_ex_test.cc":"613ccf50a3ff8f84c975a13e86ea01ea4e36933072388a3738b4acf9ed3ed7cf","libcubeb/googletest/test/gtest-death-test_test.cc":"df8384a847bdf889233c3d45d171f784991def7a9b6a08442138569fbae32b9d","libcubeb/googletest/test/gtest-filepath_test.cc":"49760f91723845b113bb60bb9b1a1426ed1da1f4ebfef2462128980ea5692cc9","libcubeb/googletest/test/gtest-linked_ptr_test.cc":"1b9cb4ff67475900db9de34ae9749b94193048a1f7a741091ba5a2dd7fc7a79b","libcubeb/googletest/test/gtest-listener_test.cc":"acf78f2c9a730525ea5adc93e9196a42de8fbfe488db1dfd02656bdbd477b2c0","libcubeb/googletest/test/gtest-message_test.cc":"b1fc68f8b75ce25fbd79b3f7d3c9c793381ef07b3203e1a2d9b610cb597542be","libcubeb/googletest/test/gtest-options_test.cc":"74e3ae0c310edb3139b0032266219d3ce7f386ded6feafa57fef03f4493ed7fa","libcubeb/googletest/test/gtest-param-test2_test.cc":"a0f1efbcab3f7e49df639383157626931f64756f7e738be081760f93f7308332","libcubeb/googletest/test/gtest-param-test_test.cc":"ef8bd344e959053f562b0c9e0d15e2fb6c1e534772a67aaf3f90bd6bad0bf99f","libcubeb/googletest/test/gtest-param-test_test.h":"9d7f47b79d54df7cc050aa6038b0464aa684dfca669a847bf70ea16e4a000628","libcubeb/googletest/test/gtest-port_test.cc":"1600f78ef0860a0f5b5525e5e5041ff32a216cc6ae948b1ea61fe04ec603f67d","libcubeb/googletest/test/gtest-printers_test.cc":"7898e4b4163ee0821fed248e1c75d9f4a0a511a2b4bbfad1ef2f4a11a099f6e7","libcubeb/googletest/test/gtest-test-part_test.cc":"62c8906bb0d12ea84d60217b3773cd8e1768db4aab934880db2316df7026cab8","libcubeb/googletest/test/gtest-tuple_test.cc":"2850dc1f73a3f8020d8a4d80688a28d9b736eae6d677222c3f871d8d33b25501","libcubeb/googletest/test/gtest-typed-test2_test.cc":"c52b65e7181610d6e577631cd50177399884913ff28d08aedfedc92f05185044","libcubeb/googletest/test/gtest-typed-test_test.cc":"c7daff5211028da79b3ca0473dca18ada9197f38e710f72d0493ad3332ce3ec9","libcubeb/googletest/test/gtest-typed-test_test.h":"3145698534d8869beb624c9c8ed114f75bead046b2eeb92ada5a724993ee7786","libcubeb/googletest/test/gtest-unittest-api_test.cc":"e3f54c28ef2849e8b12af666ed46aace50c3e047845072ee6f974ce4528bd297","libcubeb/googletest/test/gtest_all_test.cc":"db0c3c42b385570b1d517e3ee927671b8fad4e206247fca738ec477222ac3d97","libcubeb/googletest/test/gtest_break_on_failure_unittest.py":"11c91bc1c68cfdb913e2affb01261b55fb3b0c18773a45875e9c25cb330a4dcd","libcubeb/googletest/test/gtest_break_on_failure_unittest_.cc":"1da12e4bdda2a0bc7b59d4638fe34b2d3798134224fd9237eeebdd09c3326011","libcubeb/googletest/test/gtest_catch_exceptions_test.py":"305cef45c6dc034bdf72fd91aba1e89e1c6b5d222c3d6baffff5acdfd9b3873e","libcubeb/googletest/test/gtest_catch_exceptions_test_.cc":"b297a4f4d5bc0285ea9eb8869741631658305e49d4513bca904842aacb82128b","libcubeb/googletest/test/gtest_color_test.py":"c4cb006682a40f2d88759a4bcabf0d4be623720b135c71447f1788d17ea23d0f","libcubeb/googletest/test/gtest_color_test_.cc":"f263ba349afe58a558bf0fee98a98bb9207a648e7cd4f908a87799bd13d001ea","libcubeb/googletest/test/gtest_env_var_test.py":"79819598cd1e366eaa8f2a4fee2d638b6ef0686e490402fae792ccce58d876c0","libcubeb/googletest/test/gtest_env_var_test_.cc":"0eee5dfbb2a2598f4e76626346b921928ec1e052e38f254cc97c60d05611ab46","libcubeb/googletest/test/gtest_environment_test.cc":"a52a21ea29c2203b03fa93922733546d171f98d3b2fcd42972269e98fd124715","libcubeb/googletest/test/gtest_filter_unittest.py":"edc7d278803bba41626eacd050d91d7247f1c5999f9dceb99a8877e238bc73d6","libcubeb/googletest/test/gtest_filter_unittest_.cc":"996ac528ad75c293d8201ce28cf6acccee266286bd369b4cf43f05b8d67a4559","libcubeb/googletest/test/gtest_help_test.py":"b43ab690c08e4bffd84a47b361167496298697f9511bdf4a745bf305b5cfbdfc","libcubeb/googletest/test/gtest_help_test_.cc":"ff4b121098f0fe7cb4abf11fdd31f2fe7a477286ec9175482138bc038d61c807","libcubeb/googletest/test/gtest_list_tests_unittest.py":"7caebc175b44b3c727fc50420ada1a6a9500f3e4ce9e2839f69205437aa85e7a","libcubeb/googletest/test/gtest_list_tests_unittest_.cc":"d82d8b72914897232c2ff9fd091a7b0add68b7cf75f3f210d3a487ebeea84cfe","libcubeb/googletest/test/gtest_main_unittest.cc":"0f66f318809c88f0fbe034a340a75331720c4e33be5378022baffaf588ef1202","libcubeb/googletest/test/gtest_no_test_unittest.cc":"7cf487e07c3d27376c2cb8af33d02239b7966623875d37b7aa0259e927a9c2f6","libcubeb/googletest/test/gtest_output_test.py":"cf0dc1979572d94450a5e611b44f3fdb88d9cd980d669a723f0ed63057b5e2c4","libcubeb/googletest/test/gtest_output_test_.cc":"f69569374c2b3d06aa04a38ebc4f92ddc303e6af503f8b533cd8e6bf9f104899","libcubeb/googletest/test/gtest_output_test_golden_lin.txt":"4f3e49c10a524a99437cdcb5294e3335a7f3c07ea8462e65730f703a5fe4fec3","libcubeb/googletest/test/gtest_pred_impl_unittest.cc":"e406eccf75b6b58746a95d1c7ea7bc8e80ff974e438ef7c83074a46d4e62db9a","libcubeb/googletest/test/gtest_prod_test.cc":"b42ca1a6d0a1e43bc576b4ff7776c6d2c37234f6dc2a76f2735f261b4a47a526","libcubeb/googletest/test/gtest_repeat_test.cc":"e10abbb71595920aa3bb415029eed74106335fc9ea3d58c417ccfc7cba6a4cdb","libcubeb/googletest/test/gtest_shuffle_test.py":"12dd94eb5f30260ba37059fa74658bda57dffa821f3ba6a2a8b52ff14b1ad029","libcubeb/googletest/test/gtest_shuffle_test_.cc":"af1b2b01ae275f1a9fee7e7940c0f88f39ded063008994d585aad87e3ffadb39","libcubeb/googletest/test/gtest_sole_header_test.cc":"538414c27a593ab8dc34c37b5c877eb3a022d75d1b481ef14ceca00914929754","libcubeb/googletest/test/gtest_stress_test.cc":"0b02fc12f87944226915a999bdcc8a3eaafb34a1ea5bb0df128774abf8667f09","libcubeb/googletest/test/gtest_test_utils.py":"d4a76930aee6658ad8734981ca0c4ea14f34dbe8fdd31d5afe41f6d98f9779ee","libcubeb/googletest/test/gtest_throw_on_failure_ex_test.cc":"11ae790028da20bc7b7af1572eff3cfe8499be43ab64c110e18e1892612a183f","libcubeb/googletest/test/gtest_throw_on_failure_test.py":"ebe18ca0b07f90c53b9b3f9a54ed02df94facf8995cfa90dd41c6f5474537c13","libcubeb/googletest/test/gtest_throw_on_failure_test_.cc":"f8cbf75d8bf9e9ae068a17ff968434c3aec7b7f1137c994d8f14af1a84361aa9","libcubeb/googletest/test/gtest_uninitialized_test.py":"da8e6ce34930753e36fc1dfa2c3e20e48d02bda2a27d3d03a07364312c5f3bd9","libcubeb/googletest/test/gtest_uninitialized_test_.cc":"0b6a9d4983480f87352ca4da946089264b401f7a4a3b1282253fd6cc861bf483","libcubeb/googletest/test/gtest_unittest.cc":"c0c7d1f691ce1e10c3d1647ed5f7a66510725808ad58bb6da4bc03a7a08fb2fc","libcubeb/googletest/test/gtest_xml_outfile1_test_.cc":"29341d777a9c9d25f360d13ed966b30f0cbef1fc88aefe2f01bb88b82cf1ed93","libcubeb/googletest/test/gtest_xml_outfile2_test_.cc":"da7ab3cf0e9b2a293eceed7c5691233d6b61afb557e3c1176dfb75390f85be46","libcubeb/googletest/test/gtest_xml_outfiles_test.py":"b07927b43f44afbfd61761c2cc69f1b68c4fbdeddb992db03ff0c73052518cd4","libcubeb/googletest/test/gtest_xml_output_unittest.py":"b5ff0c0207238d01cada961b8f4656f2ec30a3e1e5bf9d22efdf1745af423031","libcubeb/googletest/test/gtest_xml_output_unittest_.cc":"ad0b9ebe63a146e386df3c5c51916869f6d4647b9832ceacc912fb1272d15f82","libcubeb/googletest/test/gtest_xml_test_utils.py":"ad89a39a6cd5b08e87082341f3e7800dbf1150ea0f1386e0b8cd374aa6832f00","libcubeb/googletest/test/production.cc":"56fef77c3a8e62073ec11653d740a8e534008a0d57925ab0877b843f4fdd6be8","libcubeb/googletest/test/production.h":"a36d10545d12ead5e93a3b0fdca6ff73405f29091cfe38164415e9038888ba8d","libcubeb/googletest/xcode/Config/DebugProject.xcconfig":"fb42302df29bd8e8b5237194c0c04941f0e578527037930d88469baeb7a7f62b","libcubeb/googletest/xcode/Config/FrameworkTarget.xcconfig":"9935ddabe221f074d2f3b969a137d12b0dc0f845a460f58b63232987cb0f37ff","libcubeb/googletest/xcode/Config/General.xcconfig":"0fb768924daba1048f8db28b3a1fbf915b6f788d49d9d37e85979aa4ee92e02d","libcubeb/googletest/xcode/Config/ReleaseProject.xcconfig":"a4878ddd1ed78fb411906623cb51bc0ab4aea1cc3feb5379d2ae2862d8bf3bf5","libcubeb/googletest/xcode/Config/StaticLibraryTarget.xcconfig":"5886291788b3e9d5aadcb979ff055fd26a2413be81016e7afffb813b627d177c","libcubeb/googletest/xcode/Config/TestTarget.xcconfig":"f074e6c2516a6063b253ec6b842d74f5c2abefc7bcf8d8da54097a7bfe016480","libcubeb/googletest/xcode/Resources/Info.plist":"5b7f78a6d5810ce5490649793175c8982d41e6b49af06bc0705bc061567cc9aa","libcubeb/googletest/xcode/Samples/FrameworkSample/Info.plist":"1c13d83e5eed45689d7fe4bf4681030366474bc40608e39e1623c1350513a0cd","libcubeb/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj":"1cf0e1b1abf84414372faf9c8bf634e01fe5750bb3ca769b1eb25fc530b21358","libcubeb/googletest/xcode/Samples/FrameworkSample/runtests.sh":"a587e5b00a8353dee0aca5a4c59b28301ccf7648dee8c79b62a9223f9fc3c8cf","libcubeb/googletest/xcode/Samples/FrameworkSample/widget.cc":"562a2bb615e93186012823c9b41761769638a11e38b54498ad5f699038c8fd32","libcubeb/googletest/xcode/Samples/FrameworkSample/widget.h":"0c7915e45cf7cb8d67db24e49cd0b277f23f967578f917f8e859a6adc4b156f9","libcubeb/googletest/xcode/Samples/FrameworkSample/widget_test.cc":"6a1a49d64912d9829ef3d991faf5a3f0e1e081126a1d8d387cdfa84fab70dc77","libcubeb/googletest/xcode/Scripts/runtests.sh":"1a0672a4151b16f3c797478ba26c534e82b2faa603f90b9aa14e785805f7683a","libcubeb/googletest/xcode/Scripts/versiongenerate.py":"4b9d5c0f4e1b556084109311d156bee6d781968dc5b1dfdc8702364508f1dd43","libcubeb/googletest/xcode/gtest.xcodeproj/project.pbxproj":"a1224decff058bfed01b8eefaee13cab0129492615548c6d0d878003a154f7ff","libcubeb/include/cubeb/cubeb.h":"a73748e7fafc73122a81f0639e9148179ca29b6582f225000a60283bf68417ab","libcubeb/scan-build-install.sh":"1ecf22aca367a4d02f810c4cb78db8636e08a12787e94e30c441ce439cf4a265","libcubeb/src/android/audiotrack_definitions.h":"0d5ec772f9ebf61333bc16e61a081a7e3b4cc02342ec4f8f417e220d032fbbc6","libcubeb/src/android/cubeb-output-latency.h":"000fb7bec38105f54b9d40fc436440c637d63390b219775d335216d29d767226","libcubeb/src/android/cubeb_media_library.h":"f67965fb2ea38f0023eb4c76024341ba9563ac1a135507b6f12a9aabd85e30a9","libcubeb/src/android/sles_definitions.h":"24e400ca2330ec16d3a37b69b74144697b51dce17f9ead763b1a6ffedc5633ac","libcubeb/src/cubeb-internal.h":"ef7e7e19c40f743c814a39b8a47b9f03df054894018ad88b49129ffad2564bfa","libcubeb/src/cubeb-jni-instances.h":"8195554372bf60dea569873c9e5fb1106a2cf5dedc66a13d2bc967da0ff48a12","libcubeb/src/cubeb-jni.cpp":"81f001720c41c69b5927e32bd19b9e8e7176d7c33d63c2a58bd0d695dace4fd2","libcubeb/src/cubeb-jni.h":"73f810a32087a6062fd49ba89542655a7e19cecac6f40f8411e1d77ce42a45d1","libcubeb/src/cubeb-sles.h":"dc84a01ba4de9db1ff108609930b36ba442020ccc3e3d6f16528f429426c430c","libcubeb/src/cubeb-speex-resampler.h":"dbf543eee4cc6e40ba3531a39d327e2cec884c19e26c570aa7eae0647e5f7420","libcubeb/src/cubeb.c":"2de6d02fefd308dcc755dc9009cdb42d2d60f900237b4eda305ddcaa180f13db","libcubeb/src/cubeb_alsa.c":"6c833e379eea5d64a65a209f8e60c2aa2d6e038ea855554cd3f2664c463abbcd","libcubeb/src/cubeb_array_queue.h":"5264ae02799c540ff73e8eb8efa55986772b22562a025ae227c2603b6b8d1036","libcubeb/src/cubeb_assert.h":"ab8ed4fe7070a3aed9419c5f9695fce2318c4dafd91213ae61cac476e64adaa7","libcubeb/src/cubeb_audiotrack.c":"fe66d36dfecbfaad164ee8c871b39fd6e708a2f8f1f8524a5c0148ab86bab467","libcubeb/src/cubeb_audiounit.cpp":"8c127f884bb773e3856cc7c1f74b85210d1c589b199b61a6d6322a9c0bc1fbd0","libcubeb/src/cubeb_jack.cpp":"129c011feb01e8c6d573862218c31a8bf90522539a28a5ece8bcf87867be9daf","libcubeb/src/cubeb_kai.c":"a71e1de94211ff0e5667a218d71588f1e74102ccf0140b80925c277949871095","libcubeb/src/cubeb_log.cpp":"74bdc0d92a31d6b4ce3c376c6d310db583b869d673e40e6bd0ea795a1e2f937a","libcubeb/src/cubeb_log.h":"ee05fd22ed9820bed79247b8603cdc64f67bcb145be47e78bf0a0e99fb6c0806","libcubeb/src/cubeb_mixer.cpp":"4fd0b0ba6bcf13ae9cede517e427eae38fd7bd6c373deac0d5856a8de65f6a92","libcubeb/src/cubeb_mixer.h":"e94205c1b98859e41eeab2cad53f635f34f57a2ae95aa23a36461a2619abf81b","libcubeb/src/cubeb_opensl.c":"d10d2d35667a48c8fc31f0ecdd47a8c62d7988bc83fb53d4186d0f37c0fc2ad3","libcubeb/src/cubeb_osx_run_loop.cpp":"13c029f7ea04808597b8841b13f248c4476fb7425762f01a59bc6c944cab3a78","libcubeb/src/cubeb_osx_run_loop.h":"ffe80df60b8ea3d0341715b72cc60aae2e0df45141887c01117df543260a0ef8","libcubeb/src/cubeb_panner.cpp":"405a115ff0eb5f00dbab6bc8f2999b02ee4ea4792a87bad7ebd7218ee7980438","libcubeb/src/cubeb_panner.h":"5679df1b9d138c91f6ea642d51e6230cdf3163bdd65db156ad45906916cb74b0","libcubeb/src/cubeb_pulse.c":"7ff5378b793f16fe3a238cff655ad464c94c7a7fc86258bc6588fc3f429e281f","libcubeb/src/cubeb_resampler.cpp":"2d5f5f4ff242d61897b62b4aeaeee85633be54c1eb155c9e35a2c67d8d5b7043","libcubeb/src/cubeb_resampler.h":"ad9800a40c0272fb2a451c02367cc5a516a3067d4acf963d35eb31be367f9224","libcubeb/src/cubeb_resampler_internal.h":"4b4eb6aee343b9c1f73cf17b201329d3714ba44b06ecb1cebf950fdf93a9dfe6","libcubeb/src/cubeb_ring_array.h":"db8dec7a6d778a424045e5ac61c2bc3a3cec8c4fe8e4780f383db4b6f1b2438c","libcubeb/src/cubeb_ringbuffer.h":"2296255ca7835a3ace2fe1852054f43428b677f432b4174bd832ad0224a409eb","libcubeb/src/cubeb_sndio.c":"d64d6ed34987d89a3041988274834a8346c3af6f08e3dd641a0cef2c71eab6c3","libcubeb/src/cubeb_strings.c":"60f2b8c03a5a01925f9777eec0ab84b0e704b40c03e0d6b9c0e7a16246c81fde","libcubeb/src/cubeb_strings.h":"00e5dc97cf16e28cfb53aaae50ac0e3c0ae8a82aad0720ab6842ce5d9785c39f","libcubeb/src/cubeb_utils.cpp":"5bd7de8bbf7bbdc3a275525edd92bad590fb90fb4d35e77017fdd5d25a5769e6","libcubeb/src/cubeb_utils.h":"27baa42747771bf9232741382b83722f5c731e5dcd4dc2e9b595aca91c5647a5","libcubeb/src/cubeb_utils_unix.h":"2a48bd2aefa1b4e4e4968121512bcaaa6be3bca6597ea390b8203c338f5c49b5","libcubeb/src/cubeb_utils_win.h":"74658b6266a8a223c681b0fd06fcc9c891c7b0b95377635c6f1763b240c2ab27","libcubeb/src/cubeb_wasapi.cpp":"1d476782be50c0944ed0ef4b24f8c64b17e315e1051941aed21b79d7bd06aeb0","libcubeb/src/cubeb_winmm.c":"3f59675847c8ff899d34898616d813b12bd3b6c925cb32fb43f6f9357d0cced5","libcubeb/src/speex/arch.h":"2300bce68c588270cdc684dc7f01377e5e251529f4545d93771e111c56d51b0f","libcubeb/src/speex/fixed_generic.h":"306ee7453677fa6067f16c79d358c6c90a9d3d008850b493cdaa59c07e6375c1","libcubeb/src/speex/resample.c":"9c3a1c64ecf3750af82c980d01ea73d3682f73c332a580465d1e787e5c54cd00","libcubeb/src/speex/resample_neon.h":"7d3fd7af9a1ddde22518b9c7b4419073b72b2dfa5be4c3bc8796992bc87b3da0","libcubeb/src/speex/resample_sse.h":"5a196d8e2d8ab5c956f5252f09f5ddc55aee1f99b1341af3fa54a1f4c2157924","libcubeb/src/speex/speex_config_types.h":"24e3ffbf29e5519611a48e5acb959645b01d166dcb4369380d5f776c3f53d4cd","libcubeb/src/speex/speex_resampler.h":"7e439ec0dd30c32216b3ced17135f8992e5aaf53389d3f5996a7d900c453e65f","libcubeb/src/speex/stack_alloc.h":"e8a2fc0874942d2c7177475fcc141fdd0c0156200b8a4e7656d4a20313e2e569","libcubeb/test/README.md":"1c11b038f87daf10ea78abc17bdbdd157940c241df548c24d5872d142a98c1af","libcubeb/test/common.h":"45eccf0f0c506f2f424149bc434180e296f85ed682b3ffca78cd53f91487d210","libcubeb/test/test_audio.cpp":"c10a9f438d8667153cde2ca13e4b2eebda22d0db93a045299fdbd8c924c44c6c","libcubeb/test/test_callback_ret.cpp":"fdcd25f6da30f2e1dba147d2a790994737d61afbaa30e0e0e9bf41dd5fa41953","libcubeb/test/test_deadlock.cpp":"c311519f30c05300715e91b529685a0c61b8e6b67161fa1f4aeb7030587d86f9","libcubeb/test/test_devices.cpp":"eec312a08667d053216a4266ef9e2b04dcdfa487cc4d34a811bb64cb33ed2937","libcubeb/test/test_duplex.cpp":"add22390fe2dbba09def4cece9a0a6a8e69b24a97f874312b931ece43b1ec4c3","libcubeb/test/test_latency.cpp":"0ace31644f499d69adcfa0aa3bad8c859ad51e97b622e2fa6d26374b8af12894","libcubeb/test/test_loopback.cpp":"e5dfcd868b25468a43dd4d8482702b9494e807db05c041b6fdcb295c59f1f01c","libcubeb/test/test_overload_callback.cpp":"8a05771e5bedfabf9f8a2e5a9266df90f5e964ead3b07782e2e435d7b69b0beb","libcubeb/test/test_record.cpp":"76d5b4f738ca7c30836ef6cc5851f3e04e396b21cf26511e0eeb7a616049fa04","libcubeb/test/test_resampler.cpp":"ca4bc0493ce0c3a5f02f389ac6e37bc2cdb9a752faad2b6fbc5af0a2223ef645","libcubeb/test/test_ring_array.cpp":"27836d716616abf8b020a710659c10ac5e1d4b64149d22cb89bd7a7a5a5669d1","libcubeb/test/test_ring_buffer.cpp":"f6e5a9f552f15808eb8ac3405559bf0ea61e7da4219cd14ac49fff3bfbf49ca7","libcubeb/test/test_sanity.cpp":"f978de12e7046518fbf848fcb5dbb2b5033c7624d5f4b59c0f3e02e7155c3884","libcubeb/test/test_tone.cpp":"3938250700c708c9c742ec8d0c9c2984f3e11860ff8dcacdf0ce785d4668f789","libcubeb/test/test_utils.cpp":"e8d7a02a9096dbc0fd15d71f9849415d52958d2ed82cbc7b8507d3228e08d382","src/callbacks.rs":"b4b4eb3f370475488d7c77b338b0bceee94ef59ede8ff41fa797a3d35ea98b5d","src/channel.rs":"1ae3c22ccc848d6d7b5d312e5a6e64b41871d5bb611d34192651356b57c253c2","src/context.rs":"96bf3442b1dd40262d3088dbb6c473f5451fd91320cef93c522b40f284599803","src/device.rs":"5b65e1c1fdd53fa5208f20bfb809475cbb3c434e02db7d0e4771d13c86f8e369","src/error.rs":"406e3b843ed2d263fe677c4b34fb96a6d780a68bcb56a6f85f041d20d70227bd","src/format.rs":"d4d27790c20eab0b16592f60d5e487425a45a268cf4c74cf843c10ac91bbff4c","src/internal.rs":"c3af5f53dc7957860bf3bc0cd9737d094fb8ac000e7b40c569304cfa76a43145","src/lib.rs":"cb49a3dd8782369172a2f8a61d5c74b4615bfb5fba3677af7d5c149e47d71815","src/log.rs":"6694178177775f2ce5449435d00609e9361c836e23119c07d04892000587dc55","src/macros.rs":"caef13f5d23f7a3ec1a54ec3ca2390ac4ad89d521893f1d0864daf70d57a20aa","src/mixer.rs":"e72e92855614da187da6419ed0a115062a05670cb73443b2ea4313d8f5108a68","src/panner.rs":"341af4b5a5331a3c1a4ab5396125a3600945e588ea33350431dfe6f1a9a0bd80","src/resampler.rs":"762070f8afde2256715b8764380cdfa1204a1a39d98a9da0b2efe88699792f2c","src/stream.rs":"ea3080b6225949938098e3ac38c42939c49a91b322b327ea66e959fe41f51763"},"package":"653b9e245d35dbe2a2da7c4586275cee75ff656ddeb02d4a73b4afdfa6d67502"} \ No newline at end of file +{"files":{"Cargo.toml":"f3facab1f968b8c6bd6b3e2ebf88064bb3d6661a50080e753152b262fc96c4dc","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","build.rs":"84f01f6c5f4559b87e348f6bc04d840a405889549dddf5e74cb486ad8b71bef2","libcubeb/AUTHORS":"829e45d138c7c8827799f302806fa4be8cd8bd4bad70a2fe26c3a27a5cf36948","libcubeb/CMakeLists.txt":"381886472be5fc0f925aa42268fd2df9f17f5613ee7db489849af474189f0358","libcubeb/Config.cmake.in":"88019286c96ef3d5d3a673b183c8655dfc97ceede07d3eb6c18f0c51bb896388","libcubeb/INSTALL.md":"7a84cdfbe86e7d3180e2203603b88571df61b369421fa97ee86740ffd4d4db8e","libcubeb/LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","libcubeb/README.md":"aa417156dc65069264901b75fc3c792c73021ec61c909de04e109bd4184c07ab","libcubeb/TODO":"6f8065136e005d2becee810e3d8697a94f2c755f8c79687adfac7136ad165e80","libcubeb/appveyor.yml":"9a87fdc18b76fca1167289ecb2ec3a210b76984c1d7e92268b2cd36f1e00f541","libcubeb/cmake/sanitizers-cmake/CMakeLists.txt":"89b282c19b3897ff666f7847d5e679ae928ca7e76ffd0d23f7c58c9464048b61","libcubeb/cmake/sanitizers-cmake/LICENSE":"4b67e7ae8c91e68e1a929eb1cbaa4c773c6d19aa91aaa12c390cf9560d1c9799","libcubeb/cmake/sanitizers-cmake/README.md":"30ab1524618ac828b75f9b83c665a0bd50b839b42ce61519a8048d73f401da6e","libcubeb/cmake/sanitizers-cmake/cmake/FindASan.cmake":"cba07ffe438c57bef0840ed6a2d2890676530b66509da3c616438c53018baa4f","libcubeb/cmake/sanitizers-cmake/cmake/FindMSan.cmake":"1303aac5028fe9f64d42be0afd47f1291e679d74f8280b3dc5271f20ebf4d7a4","libcubeb/cmake/sanitizers-cmake/cmake/FindSanitizers.cmake":"ce1971b943bbef08fb9aba958cf28e3cbdff075406c85a3cfed22e00c9f8d9a8","libcubeb/cmake/sanitizers-cmake/cmake/FindTSan.cmake":"edca39b287312e9a8fc718f6ec791d2520515900b37426091310fe1bd52dc6a1","libcubeb/cmake/sanitizers-cmake/cmake/FindUBSan.cmake":"5b9d3621f629c807a1345a7cb053677a8bf25782a079e345dda53d04aecdc4b7","libcubeb/cmake/sanitizers-cmake/cmake/asan-wrapper":"4e543936e6374e24b80a0f92135c07c2e2101c0d110e51bddaf0e70ae8ec391e","libcubeb/cmake/sanitizers-cmake/cmake/sanitize-helpers.cmake":"282620734c2a8062f1280d0dde3121b8b01af26e5ecaa7d4308e145f80ecd115","libcubeb/cmake/sanitizers-cmake/tests/CMakeLists.txt":"fb983bab7040be002847db59c2493abfd249f67ad06e3a9270fbceb9fabda11c","libcubeb/cmake/sanitizers-cmake/tests/asan_test.cpp":"8b351c7c8668b4a2438286df426f0ad322cade6d1c6199a74668ccbd1c5204a4","libcubeb/cmake/toolchain-cross-android.cmake":"59d2355845a71647b353fb8b18fca630db8ffee7bb8500143e2d6fbc409cec97","libcubeb/cmake/toolchain-cross-mingw.cmake":"b09dc261981c0d4a0f8430f05aae9c8fc545651cd9cbfacd09754277b776b532","libcubeb/cubeb.supp":"19f33e59f8dc91a327c923e44c2c3f9af0a043ce1d6a8cac275ba094b4bfe0da","libcubeb/docs/Doxyfile.in":"0815f19789cedd310652a133bab260c27b57e95f7a65458df2dfca38ea4f1041","libcubeb/googletest/CHANGES":"72c8a289bfe4dd9160074a3a2238c8067a5bc7ca49fd87f70a134c3f373932a4","libcubeb/googletest/CMakeLists.txt":"cdf938ce79ea066866dc614de3925bfaa48d9e19e04049db2ec8c5443abaaa9b","libcubeb/googletest/CONTRIBUTORS":"4d911cd5e6d71f3f4bbcb2788b2f916df4b0ce1e088752a159457a1d936ae0ce","libcubeb/googletest/COPYING":"9702de7e4117a8e2b20dafab11ffda58c198aede066406496bef670d40a22138","libcubeb/googletest/Makefile.am":"a795e5a18e82ba06fd97509d92d773b7fafd0dd7086db8a1211fbd151b503bac","libcubeb/googletest/README":"484b19654362942fac9734c8fab0ed3d99249b81c69027bdb7de46054abada6b","libcubeb/googletest/cmake/internal_utils.cmake":"6f4670a5825cf8ae0415be9dd43d82a7f30316d75cab20a4c60afb6d9db2a01d","libcubeb/googletest/codegear/gtest.cbproj":"9fa07a66b8c01773256e508187775407c465ed9055651e93d390426d1888721a","libcubeb/googletest/codegear/gtest.groupproj":"76c001cb2ee0070e26d1570fb6db5250f2585179c707496c5ef6d12e582cf205","libcubeb/googletest/codegear/gtest_all.cc":"c8750dc2b7b3612edb60e8d23fc2f60ae264451916c4b15f81cbf60ea30eb75d","libcubeb/googletest/codegear/gtest_link.cc":"e5e47c086f932471e0ca748a62b3b1597e5e731f4d34fb8cb8b2ca2db7ba3ed0","libcubeb/googletest/codegear/gtest_main.cbproj":"056448ba7f41fae3f704b1001922d9f6e419cf8cbcf3a55bf0ecc59ece1fa9a1","libcubeb/googletest/codegear/gtest_unittest.cbproj":"2c48be90b0dbc3224a8bd6c4dc21f78dd1b08c81685e6bd4952bb6df6ee38701","libcubeb/googletest/configure.ac":"fadebffdaeaccebb60fbe4a501c1138c296e01348a5da45fabf5e4233248baa8","libcubeb/googletest/include/gtest/gtest-death-test.h":"fdd087f700cd04a3ce4bdd36f35769de52a44bfc0c5bae2dc9681d4cbcd3c44a","libcubeb/googletest/include/gtest/gtest-message.h":"eaf44df1284d94333507c47091c84eaaf43814e6a02a1b1c0061ca7b363e74d6","libcubeb/googletest/include/gtest/gtest-param-test.h":"f226f0a24c04cddbceaaa45d8a5e575ce18c3392349f9b8ba73317e37e62368d","libcubeb/googletest/include/gtest/gtest-param-test.h.pump":"17c65fd5cc5218279044a61f3873c9c952b0924a7ba5147d4999d400b122207f","libcubeb/googletest/include/gtest/gtest-printers.h":"7046f611398d63ee0f1c37bdb4fd08d9931979b2fedf13b781e6d85d4b3b5d60","libcubeb/googletest/include/gtest/gtest-spi.h":"560407dd45e8e57fa6927504c9e4a4cfdecf30f8cada975c1ffddce765e6a88a","libcubeb/googletest/include/gtest/gtest-test-part.h":"c4d6d840284728740c284646075e8ffc85b63b9f74f3ed488b18ef3c2c2b9005","libcubeb/googletest/include/gtest/gtest-typed-test.h":"1ec858bbb9ed8a8bb553232df016437c080b2670f00453b4de297c286eb78c21","libcubeb/googletest/include/gtest/gtest.h":"47433ca72a43bda7a380c34fe6d4ff451797c687e9bbd74d1f366bcdfa0cb013","libcubeb/googletest/include/gtest/gtest_pred_impl.h":"f03a3f77e3c231889c0ace6f63b2c4e410e4a9330287ea09443b23b9a3cf9092","libcubeb/googletest/include/gtest/gtest_prod.h":"4a99a3d986a45b4d6d9b3af54809f015c54aa98274793a4ae173f5010d0ad33c","libcubeb/googletest/include/gtest/internal/gtest-death-test-internal.h":"0b3abead866363f3e6b4201acc8d2763072e033826b22ae5ebffd790e1415235","libcubeb/googletest/include/gtest/internal/gtest-filepath.h":"638d2bb6c06a894513b03311a8e931ac835fc00afc4bd21fab3afc05732c23a0","libcubeb/googletest/include/gtest/internal/gtest-internal.h":"12c2c83df0a9dc5b46697ccd8271dfa34ee5f3d1972dcb56585bc1459d9583c9","libcubeb/googletest/include/gtest/internal/gtest-linked_ptr.h":"9bd319548dd073630dfd349c06a440c6a582feec47d4ff14f348ec32f8b4c1f3","libcubeb/googletest/include/gtest/internal/gtest-param-util-generated.h":"10db93fa7e98820192bae6f560664469dd33b265036fca64253c89b6801f96cb","libcubeb/googletest/include/gtest/internal/gtest-param-util-generated.h.pump":"abb72365d94d2811b34c195dc520fbf41c7dcb42aae5a1cfa0502cf619b21e70","libcubeb/googletest/include/gtest/internal/gtest-param-util.h":"7f9311f033ef6916217d87cef53b1db6c4e8733be930e4b48fe7e11d21b33da0","libcubeb/googletest/include/gtest/internal/gtest-port.h":"612932c2930a7cf2c3514d89a8d6b51a2c0030d251309b71765ed1c9954e20c5","libcubeb/googletest/include/gtest/internal/gtest-string.h":"a46aa36165c400d1e926f942be03fe04cd7ccb1e59f7a2a03b919c4eea05b997","libcubeb/googletest/include/gtest/internal/gtest-tuple.h":"43e7e3c92f8e4258cf3927a9204b214d4d03e6c796f88f3ad4e66b1ac20aa938","libcubeb/googletest/include/gtest/internal/gtest-tuple.h.pump":"16fa027ed3c5940699e0ac906815e66620993bcf75b0acaf826d4f09348d4b83","libcubeb/googletest/include/gtest/internal/gtest-type-util.h":"6d177af46a9b1e14b969972a8b886667f95e69037aba411433a44fb9b92e7037","libcubeb/googletest/include/gtest/internal/gtest-type-util.h.pump":"22092f44127af91651f57ce222e20914d5d32ae02f1c0964f6d5d7bc019af339","libcubeb/googletest/m4/acx_pthread.m4":"3326e3746b6b351d1671fe31f798269cda8de92c365b8a8305404ec0fa6c6b32","libcubeb/googletest/m4/gtest.m4":"d3c37ebd1aa792c967d4357755cc670bc6deb30091d9e6db498871d90a30ea4c","libcubeb/googletest/make/Makefile":"9b86e2a112dd55c6bf6a2b39e6f4078faf60cfecb8282ebf9b025167ed233420","libcubeb/googletest/msvc/gtest-md.sln":"0beab679b42cf0c431eaf4fe143bbf3b01fc064e20c74d9e33e7e437a70487d4","libcubeb/googletest/msvc/gtest-md.vcproj":"52e873e964daf9d5409b4e9bb471ddf2827be04985cd96c40620f9275d17a256","libcubeb/googletest/msvc/gtest.sln":"be21c2340650ec2259a2fbaeb8608ae6d3e982a0626a0f91128a771dc88e6bea","libcubeb/googletest/msvc/gtest.vcproj":"0064616c7d88a284c1b7c05baab038f239134ea9c6c563628f286f9600b3f921","libcubeb/googletest/msvc/gtest_main-md.vcproj":"f83a294a92b616bf34ccae6743ff916297bdba61d6125a9637a813d467a30372","libcubeb/googletest/msvc/gtest_main.vcproj":"9f03270a00896eab0c7015c6fb1a73818d024e462d3944ba1d3ceb313a051649","libcubeb/googletest/msvc/gtest_prod_test-md.vcproj":"7caa108733e2d5f140da004d2133e04a9a105811909c0e2d4ec06e2971983592","libcubeb/googletest/msvc/gtest_prod_test.vcproj":"cf5bfb7f3de9a59a0eba5535067845d12c33c3fd8fecc3d03aa702665db29578","libcubeb/googletest/msvc/gtest_unittest-md.vcproj":"e7949b21cf0418f2a7afe8aa94616e2c40e3ba0801c2f0826f3a3a3d2e6f48b0","libcubeb/googletest/msvc/gtest_unittest.vcproj":"5b097d596fbbc1c4090fd518008a0961b29661194e1c02d8a2d3daaa557e626f","libcubeb/googletest/samples/prime_tables.h":"2903df1d1e6643a5f624fe3ea3f931c3410eb1858ac347c5df278273c6c91ca4","libcubeb/googletest/samples/sample1.cc":"dc106c5940d87bb4bbef3d77815eab642ee173a3340b2b9c532b5c711c4c2d0e","libcubeb/googletest/samples/sample1.h":"7a7bf9a0fbd2401e8b2cb554bfcb9bd0ed228212f3b970675c1b1d38d4e188bb","libcubeb/googletest/samples/sample10_unittest.cc":"ccebb6393a5a8468399f7e511219b667a2233f82312ce59834a4bb0997d8700e","libcubeb/googletest/samples/sample1_unittest.cc":"904be0d4a095e74393515195392bd10e1e916bb2ca61f3f94b1bd6aebea29cb6","libcubeb/googletest/samples/sample2.cc":"f14b8a1e69d52eef1a70053fb256818c7eca64e8eda08de43cf46e896e57fcc2","libcubeb/googletest/samples/sample2.h":"df956ba520dafca068dbc1e28f36567db3cba36293e06762318af8cda6a12bd4","libcubeb/googletest/samples/sample2_unittest.cc":"abe7e0b253d328cb82ae67623fbe3c89eb94699102510c64a0b568eaca101e05","libcubeb/googletest/samples/sample3-inl.h":"3fe482bbd4f725f5820f5d6beab4d0d4a524be8addf4b344a9a470ec5aabc451","libcubeb/googletest/samples/sample3_unittest.cc":"252c06b4531dc35213ebdd7311700b9b4057bc1bdeeba0cd767b2bc86c456639","libcubeb/googletest/samples/sample4.cc":"b4260f5fa35d78ac114a9abb59fce12403faf0273df41f57e83c341ae7979222","libcubeb/googletest/samples/sample4.h":"604905cae7e5587805c3b884a36eda7a2bebdfedb53b24b0fd9a220eec0ef1a9","libcubeb/googletest/samples/sample4_unittest.cc":"6cfb4821d8cb1c77fbb5af4f8aec569948762d8ea314827e3ead967b5b6a223e","libcubeb/googletest/samples/sample5_unittest.cc":"73646d9038873a68bb2e56b12495d7f7b65b5c23901109701da446af454ba2ec","libcubeb/googletest/samples/sample6_unittest.cc":"833fee399954f908cf0f3b789832e505329787f4cf73607a7b31ca0f62f368d7","libcubeb/googletest/samples/sample7_unittest.cc":"8013ee68d61c181e4e936cdae3a9a635646274f8512033ef11bff7214e03e4a6","libcubeb/googletest/samples/sample8_unittest.cc":"7b7510fadf4955d2f934d23d652dbd35add832e50bdfcc98421fb9be4588d808","libcubeb/googletest/samples/sample9_unittest.cc":"8b827040dea37b460cbcaea0b255b98974a9840f6ef7bd82aaa7d4ad2c724335","libcubeb/googletest/scripts/fuse_gtest_files.py":"adecf64c6bab65b31740c321e568cf174f753d5617745aa5762d842339d68b53","libcubeb/googletest/scripts/gen_gtest_pred_impl.py":"78fb7e20a014c251d723186eb58040e4eb32405b73c9288d787ea0a0e4ff5183","libcubeb/googletest/scripts/gtest-config.in":"9a43978eeee88e188845d737c17f4d024d4e74feae09da7997e8fbe4ea6cc176","libcubeb/googletest/scripts/pump.py":"3856a3d7be37f78e0f214ee7d4f29d05f1ca14218b67539d67c9a16e992f670c","libcubeb/googletest/scripts/test/Makefile":"3576b257594a2d8e843b9e4de8c83353d837833bb86431fb1b4198022b1bcddc","libcubeb/googletest/scripts/upload.py":"f75d0712e3b13bebd8daa0a15e4eb32c9e3034a933f4fcccf65b1e999a7ae066","libcubeb/googletest/scripts/upload_gtest.py":"6e76fc0a7a3831c01cfffd18c220d44438073a66338d91ca61fc84b924021e61","libcubeb/googletest/src/gtest-all.cc":"568ac119f5e6418f1fbcfbdf185d724657d7f3539b47822da229ac5d015626b2","libcubeb/googletest/src/gtest-death-test.cc":"eec1b3c8252670c76acbbaf63483946897ce625139b53a566406b6313f023896","libcubeb/googletest/src/gtest-filepath.cc":"31b7fcda5d11346f8a487597c6a70ff057f1192e0cb11f27eb7841a9f3aa8b86","libcubeb/googletest/src/gtest-internal-inl.h":"c9d428a6b5990ace091e40c4ce8b7bf6c50c186a8314b1c4a4cdc988ca0ac1a4","libcubeb/googletest/src/gtest-port.cc":"95bcf473622d1b901c734e5c2aeb8efb058555ec924212a61bb04f049bb5a069","libcubeb/googletest/src/gtest-printers.cc":"6f191a7fc7f5a0a967fd11964057f2e2d2eaf2f37ccece16bd816531f52b3154","libcubeb/googletest/src/gtest-test-part.cc":"e489868b4cdc66f4fc33bc2326ac86bc1acc5808ab58bbb288c9dcfc330faddc","libcubeb/googletest/src/gtest-typed-test.cc":"ca9e819df728c25a6a1fc072806c22f3494e1dffe4bd0d48284f38dbdd3a0dd5","libcubeb/googletest/src/gtest.cc":"5cf9a3e897892c9f0e5c887f91d3c8c8c5665bd7348560441fc0b946c254873c","libcubeb/googletest/src/gtest_main.cc":"22fa1f77542b882d1798d7f696045c5895942a626e26200a175fa4382e1fa5b5","libcubeb/googletest/test/gtest-death-test_ex_test.cc":"613ccf50a3ff8f84c975a13e86ea01ea4e36933072388a3738b4acf9ed3ed7cf","libcubeb/googletest/test/gtest-death-test_test.cc":"df8384a847bdf889233c3d45d171f784991def7a9b6a08442138569fbae32b9d","libcubeb/googletest/test/gtest-filepath_test.cc":"49760f91723845b113bb60bb9b1a1426ed1da1f4ebfef2462128980ea5692cc9","libcubeb/googletest/test/gtest-linked_ptr_test.cc":"1b9cb4ff67475900db9de34ae9749b94193048a1f7a741091ba5a2dd7fc7a79b","libcubeb/googletest/test/gtest-listener_test.cc":"acf78f2c9a730525ea5adc93e9196a42de8fbfe488db1dfd02656bdbd477b2c0","libcubeb/googletest/test/gtest-message_test.cc":"b1fc68f8b75ce25fbd79b3f7d3c9c793381ef07b3203e1a2d9b610cb597542be","libcubeb/googletest/test/gtest-options_test.cc":"74e3ae0c310edb3139b0032266219d3ce7f386ded6feafa57fef03f4493ed7fa","libcubeb/googletest/test/gtest-param-test2_test.cc":"a0f1efbcab3f7e49df639383157626931f64756f7e738be081760f93f7308332","libcubeb/googletest/test/gtest-param-test_test.cc":"ef8bd344e959053f562b0c9e0d15e2fb6c1e534772a67aaf3f90bd6bad0bf99f","libcubeb/googletest/test/gtest-param-test_test.h":"9d7f47b79d54df7cc050aa6038b0464aa684dfca669a847bf70ea16e4a000628","libcubeb/googletest/test/gtest-port_test.cc":"1600f78ef0860a0f5b5525e5e5041ff32a216cc6ae948b1ea61fe04ec603f67d","libcubeb/googletest/test/gtest-printers_test.cc":"7898e4b4163ee0821fed248e1c75d9f4a0a511a2b4bbfad1ef2f4a11a099f6e7","libcubeb/googletest/test/gtest-test-part_test.cc":"62c8906bb0d12ea84d60217b3773cd8e1768db4aab934880db2316df7026cab8","libcubeb/googletest/test/gtest-tuple_test.cc":"2850dc1f73a3f8020d8a4d80688a28d9b736eae6d677222c3f871d8d33b25501","libcubeb/googletest/test/gtest-typed-test2_test.cc":"c52b65e7181610d6e577631cd50177399884913ff28d08aedfedc92f05185044","libcubeb/googletest/test/gtest-typed-test_test.cc":"c7daff5211028da79b3ca0473dca18ada9197f38e710f72d0493ad3332ce3ec9","libcubeb/googletest/test/gtest-typed-test_test.h":"3145698534d8869beb624c9c8ed114f75bead046b2eeb92ada5a724993ee7786","libcubeb/googletest/test/gtest-unittest-api_test.cc":"e3f54c28ef2849e8b12af666ed46aace50c3e047845072ee6f974ce4528bd297","libcubeb/googletest/test/gtest_all_test.cc":"db0c3c42b385570b1d517e3ee927671b8fad4e206247fca738ec477222ac3d97","libcubeb/googletest/test/gtest_break_on_failure_unittest.py":"11c91bc1c68cfdb913e2affb01261b55fb3b0c18773a45875e9c25cb330a4dcd","libcubeb/googletest/test/gtest_break_on_failure_unittest_.cc":"1da12e4bdda2a0bc7b59d4638fe34b2d3798134224fd9237eeebdd09c3326011","libcubeb/googletest/test/gtest_catch_exceptions_test.py":"305cef45c6dc034bdf72fd91aba1e89e1c6b5d222c3d6baffff5acdfd9b3873e","libcubeb/googletest/test/gtest_catch_exceptions_test_.cc":"b297a4f4d5bc0285ea9eb8869741631658305e49d4513bca904842aacb82128b","libcubeb/googletest/test/gtest_color_test.py":"c4cb006682a40f2d88759a4bcabf0d4be623720b135c71447f1788d17ea23d0f","libcubeb/googletest/test/gtest_color_test_.cc":"f263ba349afe58a558bf0fee98a98bb9207a648e7cd4f908a87799bd13d001ea","libcubeb/googletest/test/gtest_env_var_test.py":"79819598cd1e366eaa8f2a4fee2d638b6ef0686e490402fae792ccce58d876c0","libcubeb/googletest/test/gtest_env_var_test_.cc":"0eee5dfbb2a2598f4e76626346b921928ec1e052e38f254cc97c60d05611ab46","libcubeb/googletest/test/gtest_environment_test.cc":"a52a21ea29c2203b03fa93922733546d171f98d3b2fcd42972269e98fd124715","libcubeb/googletest/test/gtest_filter_unittest.py":"edc7d278803bba41626eacd050d91d7247f1c5999f9dceb99a8877e238bc73d6","libcubeb/googletest/test/gtest_filter_unittest_.cc":"996ac528ad75c293d8201ce28cf6acccee266286bd369b4cf43f05b8d67a4559","libcubeb/googletest/test/gtest_help_test.py":"b43ab690c08e4bffd84a47b361167496298697f9511bdf4a745bf305b5cfbdfc","libcubeb/googletest/test/gtest_help_test_.cc":"ff4b121098f0fe7cb4abf11fdd31f2fe7a477286ec9175482138bc038d61c807","libcubeb/googletest/test/gtest_list_tests_unittest.py":"7caebc175b44b3c727fc50420ada1a6a9500f3e4ce9e2839f69205437aa85e7a","libcubeb/googletest/test/gtest_list_tests_unittest_.cc":"d82d8b72914897232c2ff9fd091a7b0add68b7cf75f3f210d3a487ebeea84cfe","libcubeb/googletest/test/gtest_main_unittest.cc":"0f66f318809c88f0fbe034a340a75331720c4e33be5378022baffaf588ef1202","libcubeb/googletest/test/gtest_no_test_unittest.cc":"7cf487e07c3d27376c2cb8af33d02239b7966623875d37b7aa0259e927a9c2f6","libcubeb/googletest/test/gtest_output_test.py":"cf0dc1979572d94450a5e611b44f3fdb88d9cd980d669a723f0ed63057b5e2c4","libcubeb/googletest/test/gtest_output_test_.cc":"f69569374c2b3d06aa04a38ebc4f92ddc303e6af503f8b533cd8e6bf9f104899","libcubeb/googletest/test/gtest_output_test_golden_lin.txt":"4f3e49c10a524a99437cdcb5294e3335a7f3c07ea8462e65730f703a5fe4fec3","libcubeb/googletest/test/gtest_pred_impl_unittest.cc":"e406eccf75b6b58746a95d1c7ea7bc8e80ff974e438ef7c83074a46d4e62db9a","libcubeb/googletest/test/gtest_prod_test.cc":"b42ca1a6d0a1e43bc576b4ff7776c6d2c37234f6dc2a76f2735f261b4a47a526","libcubeb/googletest/test/gtest_repeat_test.cc":"e10abbb71595920aa3bb415029eed74106335fc9ea3d58c417ccfc7cba6a4cdb","libcubeb/googletest/test/gtest_shuffle_test.py":"12dd94eb5f30260ba37059fa74658bda57dffa821f3ba6a2a8b52ff14b1ad029","libcubeb/googletest/test/gtest_shuffle_test_.cc":"af1b2b01ae275f1a9fee7e7940c0f88f39ded063008994d585aad87e3ffadb39","libcubeb/googletest/test/gtest_sole_header_test.cc":"538414c27a593ab8dc34c37b5c877eb3a022d75d1b481ef14ceca00914929754","libcubeb/googletest/test/gtest_stress_test.cc":"0b02fc12f87944226915a999bdcc8a3eaafb34a1ea5bb0df128774abf8667f09","libcubeb/googletest/test/gtest_test_utils.py":"d4a76930aee6658ad8734981ca0c4ea14f34dbe8fdd31d5afe41f6d98f9779ee","libcubeb/googletest/test/gtest_throw_on_failure_ex_test.cc":"11ae790028da20bc7b7af1572eff3cfe8499be43ab64c110e18e1892612a183f","libcubeb/googletest/test/gtest_throw_on_failure_test.py":"ebe18ca0b07f90c53b9b3f9a54ed02df94facf8995cfa90dd41c6f5474537c13","libcubeb/googletest/test/gtest_throw_on_failure_test_.cc":"f8cbf75d8bf9e9ae068a17ff968434c3aec7b7f1137c994d8f14af1a84361aa9","libcubeb/googletest/test/gtest_uninitialized_test.py":"da8e6ce34930753e36fc1dfa2c3e20e48d02bda2a27d3d03a07364312c5f3bd9","libcubeb/googletest/test/gtest_uninitialized_test_.cc":"0b6a9d4983480f87352ca4da946089264b401f7a4a3b1282253fd6cc861bf483","libcubeb/googletest/test/gtest_unittest.cc":"c0c7d1f691ce1e10c3d1647ed5f7a66510725808ad58bb6da4bc03a7a08fb2fc","libcubeb/googletest/test/gtest_xml_outfile1_test_.cc":"29341d777a9c9d25f360d13ed966b30f0cbef1fc88aefe2f01bb88b82cf1ed93","libcubeb/googletest/test/gtest_xml_outfile2_test_.cc":"da7ab3cf0e9b2a293eceed7c5691233d6b61afb557e3c1176dfb75390f85be46","libcubeb/googletest/test/gtest_xml_outfiles_test.py":"b07927b43f44afbfd61761c2cc69f1b68c4fbdeddb992db03ff0c73052518cd4","libcubeb/googletest/test/gtest_xml_output_unittest.py":"b5ff0c0207238d01cada961b8f4656f2ec30a3e1e5bf9d22efdf1745af423031","libcubeb/googletest/test/gtest_xml_output_unittest_.cc":"ad0b9ebe63a146e386df3c5c51916869f6d4647b9832ceacc912fb1272d15f82","libcubeb/googletest/test/gtest_xml_test_utils.py":"ad89a39a6cd5b08e87082341f3e7800dbf1150ea0f1386e0b8cd374aa6832f00","libcubeb/googletest/test/production.cc":"56fef77c3a8e62073ec11653d740a8e534008a0d57925ab0877b843f4fdd6be8","libcubeb/googletest/test/production.h":"a36d10545d12ead5e93a3b0fdca6ff73405f29091cfe38164415e9038888ba8d","libcubeb/googletest/xcode/Config/DebugProject.xcconfig":"fb42302df29bd8e8b5237194c0c04941f0e578527037930d88469baeb7a7f62b","libcubeb/googletest/xcode/Config/FrameworkTarget.xcconfig":"9935ddabe221f074d2f3b969a137d12b0dc0f845a460f58b63232987cb0f37ff","libcubeb/googletest/xcode/Config/General.xcconfig":"0fb768924daba1048f8db28b3a1fbf915b6f788d49d9d37e85979aa4ee92e02d","libcubeb/googletest/xcode/Config/ReleaseProject.xcconfig":"a4878ddd1ed78fb411906623cb51bc0ab4aea1cc3feb5379d2ae2862d8bf3bf5","libcubeb/googletest/xcode/Config/StaticLibraryTarget.xcconfig":"5886291788b3e9d5aadcb979ff055fd26a2413be81016e7afffb813b627d177c","libcubeb/googletest/xcode/Config/TestTarget.xcconfig":"f074e6c2516a6063b253ec6b842d74f5c2abefc7bcf8d8da54097a7bfe016480","libcubeb/googletest/xcode/Resources/Info.plist":"5b7f78a6d5810ce5490649793175c8982d41e6b49af06bc0705bc061567cc9aa","libcubeb/googletest/xcode/Samples/FrameworkSample/Info.plist":"1c13d83e5eed45689d7fe4bf4681030366474bc40608e39e1623c1350513a0cd","libcubeb/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj":"1cf0e1b1abf84414372faf9c8bf634e01fe5750bb3ca769b1eb25fc530b21358","libcubeb/googletest/xcode/Samples/FrameworkSample/runtests.sh":"a587e5b00a8353dee0aca5a4c59b28301ccf7648dee8c79b62a9223f9fc3c8cf","libcubeb/googletest/xcode/Samples/FrameworkSample/widget.cc":"562a2bb615e93186012823c9b41761769638a11e38b54498ad5f699038c8fd32","libcubeb/googletest/xcode/Samples/FrameworkSample/widget.h":"0c7915e45cf7cb8d67db24e49cd0b277f23f967578f917f8e859a6adc4b156f9","libcubeb/googletest/xcode/Samples/FrameworkSample/widget_test.cc":"6a1a49d64912d9829ef3d991faf5a3f0e1e081126a1d8d387cdfa84fab70dc77","libcubeb/googletest/xcode/Scripts/runtests.sh":"1a0672a4151b16f3c797478ba26c534e82b2faa603f90b9aa14e785805f7683a","libcubeb/googletest/xcode/Scripts/versiongenerate.py":"4b9d5c0f4e1b556084109311d156bee6d781968dc5b1dfdc8702364508f1dd43","libcubeb/googletest/xcode/gtest.xcodeproj/project.pbxproj":"a1224decff058bfed01b8eefaee13cab0129492615548c6d0d878003a154f7ff","libcubeb/include/cubeb/cubeb.h":"a73748e7fafc73122a81f0639e9148179ca29b6582f225000a60283bf68417ab","libcubeb/scan-build-install.sh":"1ecf22aca367a4d02f810c4cb78db8636e08a12787e94e30c441ce439cf4a265","libcubeb/src/android/audiotrack_definitions.h":"0d5ec772f9ebf61333bc16e61a081a7e3b4cc02342ec4f8f417e220d032fbbc6","libcubeb/src/android/cubeb-output-latency.h":"000fb7bec38105f54b9d40fc436440c637d63390b219775d335216d29d767226","libcubeb/src/android/cubeb_media_library.h":"f67965fb2ea38f0023eb4c76024341ba9563ac1a135507b6f12a9aabd85e30a9","libcubeb/src/android/sles_definitions.h":"24e400ca2330ec16d3a37b69b74144697b51dce17f9ead763b1a6ffedc5633ac","libcubeb/src/cubeb-internal.h":"ef7e7e19c40f743c814a39b8a47b9f03df054894018ad88b49129ffad2564bfa","libcubeb/src/cubeb-jni-instances.h":"8195554372bf60dea569873c9e5fb1106a2cf5dedc66a13d2bc967da0ff48a12","libcubeb/src/cubeb-jni.cpp":"81f001720c41c69b5927e32bd19b9e8e7176d7c33d63c2a58bd0d695dace4fd2","libcubeb/src/cubeb-jni.h":"73f810a32087a6062fd49ba89542655a7e19cecac6f40f8411e1d77ce42a45d1","libcubeb/src/cubeb-sles.h":"dc84a01ba4de9db1ff108609930b36ba442020ccc3e3d6f16528f429426c430c","libcubeb/src/cubeb-speex-resampler.h":"dbf543eee4cc6e40ba3531a39d327e2cec884c19e26c570aa7eae0647e5f7420","libcubeb/src/cubeb.c":"2de6d02fefd308dcc755dc9009cdb42d2d60f900237b4eda305ddcaa180f13db","libcubeb/src/cubeb_alsa.c":"6c833e379eea5d64a65a209f8e60c2aa2d6e038ea855554cd3f2664c463abbcd","libcubeb/src/cubeb_array_queue.h":"5264ae02799c540ff73e8eb8efa55986772b22562a025ae227c2603b6b8d1036","libcubeb/src/cubeb_assert.h":"ab8ed4fe7070a3aed9419c5f9695fce2318c4dafd91213ae61cac476e64adaa7","libcubeb/src/cubeb_audiotrack.c":"fe66d36dfecbfaad164ee8c871b39fd6e708a2f8f1f8524a5c0148ab86bab467","libcubeb/src/cubeb_audiounit.cpp":"8c127f884bb773e3856cc7c1f74b85210d1c589b199b61a6d6322a9c0bc1fbd0","libcubeb/src/cubeb_jack.cpp":"129c011feb01e8c6d573862218c31a8bf90522539a28a5ece8bcf87867be9daf","libcubeb/src/cubeb_kai.c":"a71e1de94211ff0e5667a218d71588f1e74102ccf0140b80925c277949871095","libcubeb/src/cubeb_log.cpp":"74bdc0d92a31d6b4ce3c376c6d310db583b869d673e40e6bd0ea795a1e2f937a","libcubeb/src/cubeb_log.h":"ee05fd22ed9820bed79247b8603cdc64f67bcb145be47e78bf0a0e99fb6c0806","libcubeb/src/cubeb_mixer.cpp":"4fd0b0ba6bcf13ae9cede517e427eae38fd7bd6c373deac0d5856a8de65f6a92","libcubeb/src/cubeb_mixer.h":"e94205c1b98859e41eeab2cad53f635f34f57a2ae95aa23a36461a2619abf81b","libcubeb/src/cubeb_opensl.c":"d10d2d35667a48c8fc31f0ecdd47a8c62d7988bc83fb53d4186d0f37c0fc2ad3","libcubeb/src/cubeb_osx_run_loop.cpp":"13c029f7ea04808597b8841b13f248c4476fb7425762f01a59bc6c944cab3a78","libcubeb/src/cubeb_osx_run_loop.h":"ffe80df60b8ea3d0341715b72cc60aae2e0df45141887c01117df543260a0ef8","libcubeb/src/cubeb_panner.cpp":"405a115ff0eb5f00dbab6bc8f2999b02ee4ea4792a87bad7ebd7218ee7980438","libcubeb/src/cubeb_panner.h":"5679df1b9d138c91f6ea642d51e6230cdf3163bdd65db156ad45906916cb74b0","libcubeb/src/cubeb_pulse.c":"7ff5378b793f16fe3a238cff655ad464c94c7a7fc86258bc6588fc3f429e281f","libcubeb/src/cubeb_resampler.cpp":"2d5f5f4ff242d61897b62b4aeaeee85633be54c1eb155c9e35a2c67d8d5b7043","libcubeb/src/cubeb_resampler.h":"ad9800a40c0272fb2a451c02367cc5a516a3067d4acf963d35eb31be367f9224","libcubeb/src/cubeb_resampler_internal.h":"4b4eb6aee343b9c1f73cf17b201329d3714ba44b06ecb1cebf950fdf93a9dfe6","libcubeb/src/cubeb_ring_array.h":"db8dec7a6d778a424045e5ac61c2bc3a3cec8c4fe8e4780f383db4b6f1b2438c","libcubeb/src/cubeb_ringbuffer.h":"2296255ca7835a3ace2fe1852054f43428b677f432b4174bd832ad0224a409eb","libcubeb/src/cubeb_sndio.c":"d64d6ed34987d89a3041988274834a8346c3af6f08e3dd641a0cef2c71eab6c3","libcubeb/src/cubeb_strings.c":"60f2b8c03a5a01925f9777eec0ab84b0e704b40c03e0d6b9c0e7a16246c81fde","libcubeb/src/cubeb_strings.h":"00e5dc97cf16e28cfb53aaae50ac0e3c0ae8a82aad0720ab6842ce5d9785c39f","libcubeb/src/cubeb_utils.cpp":"5bd7de8bbf7bbdc3a275525edd92bad590fb90fb4d35e77017fdd5d25a5769e6","libcubeb/src/cubeb_utils.h":"27baa42747771bf9232741382b83722f5c731e5dcd4dc2e9b595aca91c5647a5","libcubeb/src/cubeb_utils_unix.h":"2a48bd2aefa1b4e4e4968121512bcaaa6be3bca6597ea390b8203c338f5c49b5","libcubeb/src/cubeb_utils_win.h":"74658b6266a8a223c681b0fd06fcc9c891c7b0b95377635c6f1763b240c2ab27","libcubeb/src/cubeb_wasapi.cpp":"4a734b57d344b7cd6e430fe4e4fe42a673a7a4815fa569296d2f9faf5a833e15","libcubeb/src/cubeb_winmm.c":"3f59675847c8ff899d34898616d813b12bd3b6c925cb32fb43f6f9357d0cced5","libcubeb/src/speex/arch.h":"2300bce68c588270cdc684dc7f01377e5e251529f4545d93771e111c56d51b0f","libcubeb/src/speex/fixed_generic.h":"306ee7453677fa6067f16c79d358c6c90a9d3d008850b493cdaa59c07e6375c1","libcubeb/src/speex/resample.c":"9c3a1c64ecf3750af82c980d01ea73d3682f73c332a580465d1e787e5c54cd00","libcubeb/src/speex/resample_neon.h":"7d3fd7af9a1ddde22518b9c7b4419073b72b2dfa5be4c3bc8796992bc87b3da0","libcubeb/src/speex/resample_sse.h":"5a196d8e2d8ab5c956f5252f09f5ddc55aee1f99b1341af3fa54a1f4c2157924","libcubeb/src/speex/speex_config_types.h":"24e3ffbf29e5519611a48e5acb959645b01d166dcb4369380d5f776c3f53d4cd","libcubeb/src/speex/speex_resampler.h":"7e439ec0dd30c32216b3ced17135f8992e5aaf53389d3f5996a7d900c453e65f","libcubeb/src/speex/stack_alloc.h":"e8a2fc0874942d2c7177475fcc141fdd0c0156200b8a4e7656d4a20313e2e569","libcubeb/test/README.md":"1c11b038f87daf10ea78abc17bdbdd157940c241df548c24d5872d142a98c1af","libcubeb/test/common.h":"45eccf0f0c506f2f424149bc434180e296f85ed682b3ffca78cd53f91487d210","libcubeb/test/test_audio.cpp":"c10a9f438d8667153cde2ca13e4b2eebda22d0db93a045299fdbd8c924c44c6c","libcubeb/test/test_callback_ret.cpp":"fdcd25f6da30f2e1dba147d2a790994737d61afbaa30e0e0e9bf41dd5fa41953","libcubeb/test/test_deadlock.cpp":"c311519f30c05300715e91b529685a0c61b8e6b67161fa1f4aeb7030587d86f9","libcubeb/test/test_devices.cpp":"eec312a08667d053216a4266ef9e2b04dcdfa487cc4d34a811bb64cb33ed2937","libcubeb/test/test_duplex.cpp":"add22390fe2dbba09def4cece9a0a6a8e69b24a97f874312b931ece43b1ec4c3","libcubeb/test/test_latency.cpp":"0ace31644f499d69adcfa0aa3bad8c859ad51e97b622e2fa6d26374b8af12894","libcubeb/test/test_loopback.cpp":"e5dfcd868b25468a43dd4d8482702b9494e807db05c041b6fdcb295c59f1f01c","libcubeb/test/test_overload_callback.cpp":"8a05771e5bedfabf9f8a2e5a9266df90f5e964ead3b07782e2e435d7b69b0beb","libcubeb/test/test_record.cpp":"76d5b4f738ca7c30836ef6cc5851f3e04e396b21cf26511e0eeb7a616049fa04","libcubeb/test/test_resampler.cpp":"ca4bc0493ce0c3a5f02f389ac6e37bc2cdb9a752faad2b6fbc5af0a2223ef645","libcubeb/test/test_ring_array.cpp":"27836d716616abf8b020a710659c10ac5e1d4b64149d22cb89bd7a7a5a5669d1","libcubeb/test/test_ring_buffer.cpp":"f6e5a9f552f15808eb8ac3405559bf0ea61e7da4219cd14ac49fff3bfbf49ca7","libcubeb/test/test_sanity.cpp":"f978de12e7046518fbf848fcb5dbb2b5033c7624d5f4b59c0f3e02e7155c3884","libcubeb/test/test_tone.cpp":"3938250700c708c9c742ec8d0c9c2984f3e11860ff8dcacdf0ce785d4668f789","libcubeb/test/test_utils.cpp":"e8d7a02a9096dbc0fd15d71f9849415d52958d2ed82cbc7b8507d3228e08d382","src/callbacks.rs":"b4b4eb3f370475488d7c77b338b0bceee94ef59ede8ff41fa797a3d35ea98b5d","src/channel.rs":"555bc8d5257496cf6e5b4c786df84755327d88a9dc07202746e35f3b7b7e4e0b","src/context.rs":"96bf3442b1dd40262d3088dbb6c473f5451fd91320cef93c522b40f284599803","src/device.rs":"5b65e1c1fdd53fa5208f20bfb809475cbb3c434e02db7d0e4771d13c86f8e369","src/error.rs":"406e3b843ed2d263fe677c4b34fb96a6d780a68bcb56a6f85f041d20d70227bd","src/format.rs":"d4d27790c20eab0b16592f60d5e487425a45a268cf4c74cf843c10ac91bbff4c","src/internal.rs":"c3af5f53dc7957860bf3bc0cd9737d094fb8ac000e7b40c569304cfa76a43145","src/lib.rs":"cb49a3dd8782369172a2f8a61d5c74b4615bfb5fba3677af7d5c149e47d71815","src/log.rs":"6694178177775f2ce5449435d00609e9361c836e23119c07d04892000587dc55","src/macros.rs":"caef13f5d23f7a3ec1a54ec3ca2390ac4ad89d521893f1d0864daf70d57a20aa","src/mixer.rs":"e72e92855614da187da6419ed0a115062a05670cb73443b2ea4313d8f5108a68","src/panner.rs":"341af4b5a5331a3c1a4ab5396125a3600945e588ea33350431dfe6f1a9a0bd80","src/resampler.rs":"762070f8afde2256715b8764380cdfa1204a1a39d98a9da0b2efe88699792f2c","src/stream.rs":"ea3080b6225949938098e3ac38c42939c49a91b322b327ea66e959fe41f51763"},"package":"3ba7540c17b90159cf7d7854da370998ff0560d9b90e2c9290bb588afa0edf95"} \ No newline at end of file diff --git a/third_party/rust/cubeb-sys/Cargo.toml b/third_party/rust/cubeb-sys/Cargo.toml index 90d4ec5daeca7..32279386e3c89 100644 --- a/third_party/rust/cubeb-sys/Cargo.toml +++ b/third_party/rust/cubeb-sys/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "cubeb-sys" -version = "0.5.1" +version = "0.5.4" authors = ["Dan Glastonbury "] build = "build.rs" links = "cubeb" @@ -22,9 +22,6 @@ repository = "https://github.com/djg/cubeb-rs" [build-dependencies.cmake] version = "0.1.2" -[build-dependencies.gcc] -version = "0.3" - [build-dependencies.pkg-config] version = "0.3" diff --git a/third_party/rust/cubeb-sys/build.rs b/third_party/rust/cubeb-sys/build.rs index f9fd61a51e04e..321917cba7c4f 100644 --- a/third_party/rust/cubeb-sys/build.rs +++ b/third_party/rust/cubeb-sys/build.rs @@ -4,7 +4,6 @@ // accompanying file LICENSE for details. extern crate cmake; -extern crate gcc; extern crate pkg_config; use std::env; diff --git a/third_party/rust/cubeb-sys/libcubeb/src/cubeb_wasapi.cpp b/third_party/rust/cubeb-sys/libcubeb/src/cubeb_wasapi.cpp index ac6c6b416c2ad..09c4123f5efdc 100644 --- a/third_party/rust/cubeb-sys/libcubeb/src/cubeb_wasapi.cpp +++ b/third_party/rust/cubeb-sys/libcubeb/src/cubeb_wasapi.cpp @@ -4,6 +4,7 @@ * This program is made available under an ISC-style license. See the * accompanying file LICENSE for details. */ +#define MINGW_HAS_SECURE_API 1 #define _WIN32_WINNT 0x0600 #define NOMINMAX diff --git a/third_party/rust/cubeb-sys/src/channel.rs b/third_party/rust/cubeb-sys/src/channel.rs index d802c1f1e3284..c4fef44bce247 100644 --- a/third_party/rust/cubeb-sys/src/channel.rs +++ b/third_party/rust/cubeb-sys/src/channel.rs @@ -3,10 +3,13 @@ // This program is made available under an ISC-style license. See the // accompanying file LICENSE for details. -use std::os::raw::c_uint; +#[cfg(all(windows, not(target_env = "gnu")))] +use std::os::raw::c_int as c_enum; +#[cfg(any(not(windows), all(windows, target_env = "gnu")))] +use std::os::raw::c_uint as c_enum; cubeb_enum! { - pub enum cubeb_channel : c_uint { + pub enum cubeb_channel : c_enum { CHANNEL_UNKNOWN = 0, CHANNEL_FRONT_LEFT = 1 << 0, CHANNEL_FRONT_RIGHT = 1 << 1, diff --git a/third_party/rust/cubeb/.cargo-checksum.json b/third_party/rust/cubeb/.cargo-checksum.json index 5312c4bc906ef..bee3f7dc439cf 100644 --- a/third_party/rust/cubeb/.cargo-checksum.json +++ b/third_party/rust/cubeb/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"7c56fd36743a0c83f3977d8b24e67abff5ecd34e4e6043742ff331746165c60a","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"a5e1b79fc2b4addff1e442879ba3dbcb1cf5973e76b9a62d97dd0042597480db","examples/devices.rs":"89e13542853995d1ae4a49d6829156efb29dd25c6caffdf22496c28c8263ffeb","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"03511fa960a411728163e700edc2fd6cfbfcf09766ffe62ee82a2cbd08fdf243","src/frame.rs":"ed1e8f4576022d0c23106bb115125e5a2967b0375a10d0c54bbe99f04a70cc3f","src/lib.rs":"98e9280890551ac9305f2f808e315b6aa6bcd5781b8e96a078787ded0ef91e2a","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"e23be3b691052001916f920ce9c1a0051bd097e39c9d34cbcb80ab8120265f45","src/stream.rs":"3ee0432f655cd42959cd5d8e75cb4fe2322e1f88fa5d9cc83e615ae229cdeb8a"},"package":"8a3502aafa1bf95c524f65d2ba46d8741700c6a8a9543ea52c6da3d8b69a2896"} \ No newline at end of file +{"files":{"Cargo.toml":"fbfad79bbb62cf1ff067b5c73d239d7d9acf84be48492af1af55b55acc52904a","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"a5e1b79fc2b4addff1e442879ba3dbcb1cf5973e76b9a62d97dd0042597480db","examples/devices.rs":"89e13542853995d1ae4a49d6829156efb29dd25c6caffdf22496c28c8263ffeb","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"03511fa960a411728163e700edc2fd6cfbfcf09766ffe62ee82a2cbd08fdf243","src/frame.rs":"ed1e8f4576022d0c23106bb115125e5a2967b0375a10d0c54bbe99f04a70cc3f","src/lib.rs":"98e9280890551ac9305f2f808e315b6aa6bcd5781b8e96a078787ded0ef91e2a","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"e23be3b691052001916f920ce9c1a0051bd097e39c9d34cbcb80ab8120265f45","src/stream.rs":"3ee0432f655cd42959cd5d8e75cb4fe2322e1f88fa5d9cc83e615ae229cdeb8a"},"package":"db3f0df2ad5cb453126364a77921466ba6c1034e8bd9247f326cdb31430dbc2a"} \ No newline at end of file diff --git a/third_party/rust/cubeb/Cargo.toml b/third_party/rust/cubeb/Cargo.toml index a8486d0766bc1..3a136ea6cfb67 100644 --- a/third_party/rust/cubeb/Cargo.toml +++ b/third_party/rust/cubeb/Cargo.toml @@ -12,7 +12,7 @@ [package] name = "cubeb" -version = "0.5.2" +version = "0.5.4" authors = ["Dan Glastonbury "] description = "Bindings to libcubeb for interacting with system audio from rust.\n" homepage = "https://github.com/djg/cubeb-rs" @@ -22,7 +22,7 @@ categories = ["api-bindings"] license = "ISC" repository = "https://github.com/djg/cubeb-rs" [dependencies.cubeb-core] -version = "0.5.1" +version = "0.5.4" [features] gecko-in-tree = ["cubeb-core/gecko-in-tree"] diff --git a/third_party/rust/mio-named-pipes/.cargo-checksum.json b/third_party/rust/mio-named-pipes/.cargo-checksum.json new file mode 100644 index 0000000000000..c69144448e787 --- /dev/null +++ b/third_party/rust/mio-named-pipes/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d0a5c57e548259b2ef7d6e443f72a91775cfd20b926ccd88d7505ce24400faa1","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"76068a8cb49c12b1f45599fe8ed1ed53554485afe1cc5302360cc73687458a1a","appveyor.yml":"0bd9b8e5a94a36972b37227cc59984fc6ec01b4ee4b617ef20d0e3acd19f44b1","src/from_raw_arc.rs":"c2cee14a0355256beb55a1feb54ccdcc50c8ab2d9abb3b7f114be00ed8a5583f","src/lib.rs":"1eaafb6635a525abfea3eefdeba831e3bae2f80dda847f8a7102f26f32cbddad","tests/smoke.rs":"b1bd2ecbaae2a6458fdc2c50b8b1607277108196b607c12f47f4c5c78b9a250e"},"package":"82f43a815b57d2d652550f3d20cec88a495bb2d0956aa873dc43040278455677"} \ No newline at end of file diff --git a/third_party/rust/mio-named-pipes/Cargo.toml b/third_party/rust/mio-named-pipes/Cargo.toml new file mode 100644 index 0000000000000..3af4ea2eb809d --- /dev/null +++ b/third_party/rust/mio-named-pipes/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "mio-named-pipes" +version = "0.1.5" +authors = ["Alex Crichton "] +license = "MIT/Apache-2.0" +readme = "README.md" +repository = "https://github.com/alexcrichton/mio-named-pipes" +homepage = "https://github.com/alexcrichton/mio-named-pipes" +documentation = "https://docs.rs/mio-named-pipes/0.1/x86_64-pc-windows-msvc/mio_named_pipes/" +description = """ +Windows named pipe bindings for mio. +""" + +[target.'cfg(windows)'.dependencies] +kernel32-sys = "0.2" +log = "0.3" +mio = "0.6.5" +miow = "0.2" +winapi = "0.2" + +[dev-dependencies] +env_logger = { version = "0.3", default-features = false } +rand = "0.3" diff --git a/third_party/rust/mio-named-pipes/LICENSE-APACHE b/third_party/rust/mio-named-pipes/LICENSE-APACHE new file mode 100644 index 0000000000000..16fe87b06e802 --- /dev/null +++ b/third_party/rust/mio-named-pipes/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/third_party/rust/mio-named-pipes/LICENSE-MIT b/third_party/rust/mio-named-pipes/LICENSE-MIT new file mode 100644 index 0000000000000..39e0ed6602151 --- /dev/null +++ b/third_party/rust/mio-named-pipes/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/third_party/rust/mio-named-pipes/README.md b/third_party/rust/mio-named-pipes/README.md new file mode 100644 index 0000000000000..624dbac2edc46 --- /dev/null +++ b/third_party/rust/mio-named-pipes/README.md @@ -0,0 +1,42 @@ +# mio-named-pipes + +[![Build status](https://ci.appveyor.com/api/projects/status/y0ct01srewnhhesn?svg=true)](https://ci.appveyor.com/project/alexcrichton/mio-named-pipes) + +[Documentation](https://docs.rs/mio-named-pipes/0.1/x86_64-pc-windows-msvc/mio_named_pipes/) + +A library for integrating Windows [Named Pipes] with [mio]. + +[Named Pipes]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365590(v=vs.85).aspx +[mio]: https://github.com/carllerche/mio + +```toml +# Cargo.toml +[dependencies] +mio-named-pipes = "0.6" +mio = "0.6" +``` + +## Usage + +The primary type, `NamedPipe`, can be constructed with `NamedPipe::new` or +through the `IntoRawHandle` type. All operations on `NamedPipe` are nonblocking +and will return an I/O error if they'd block (with the error indicating so). + +Typically you can use a `NamedPipe` in the same way you would a TCP socket on +Windows with mio. + +> **Note**: Named pipes on Windows do not have a zero-cost abstraction when +> working with the mio interface (readiness, not completion). As a result, this +> library internally has some buffer management that hasn't been optimized yet. +> It's recommended you benchmark this library for your application, and feel +> free to contact me if anything looks awry. + +# License + +`mio-named-pipes` is primarily distributed under the terms of both the MIT +license and the Apache License (Version 2.0), with portions covered by various +BSD-like licenses. + +See LICENSE-APACHE, and LICENSE-MIT for details. + + diff --git a/third_party/rust/mio-named-pipes/appveyor.yml b/third_party/rust/mio-named-pipes/appveyor.yml new file mode 100644 index 0000000000000..ed39b903867e7 --- /dev/null +++ b/third_party/rust/mio-named-pipes/appveyor.yml @@ -0,0 +1,18 @@ +environment: + matrix: + - TARGET: x86_64-pc-windows-msvc + GH_TOKEN: + secure: nHB4fVo+y/Aak+L0nYfrT8Rcs8OfUNm0F2xcIVFVYJ9ehf0CzvCmSMUvWguM0kKp + +install: + - curl -sSf -o rustup-init.exe https://win.rustup.rs/ + - rustup-init.exe -y --default-host %TARGET% + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin;C:\MinGW\bin + + - rustc -vV + - cargo -vV + +build: false + +test_script: + - cargo test diff --git a/third_party/rust/mio-named-pipes/src/from_raw_arc.rs b/third_party/rust/mio-named-pipes/src/from_raw_arc.rs new file mode 100644 index 0000000000000..f7b301b3ef4e7 --- /dev/null +++ b/third_party/rust/mio-named-pipes/src/from_raw_arc.rs @@ -0,0 +1,116 @@ +//! A "Manual Arc" which allows manually frobbing the reference count +//! +//! This module contains a copy of the `Arc` found in the standard library, +//! stripped down to the bare bones of what we actually need. The reason this is +//! done is for the ability to concretely know the memory layout of the `Inner` +//! structure of the arc pointer itself (e.g. `ArcInner` in the standard +//! library). +//! +//! We do some unsafe casting from `*mut OVERLAPPED` to a `FromRawArc` to +//! ensure that data lives for the length of an I/O operation, but this means +//! that we have to know the layouts of the structures involved. This +//! representation primarily guarantees that the data, `T` is at the front of +//! the inner pointer always. +//! +//! Note that we're missing out on some various optimizations implemented in the +//! standard library: +//! +//! * The size of `FromRawArc` is actually two words because of the drop flag +//! * The compiler doesn't understand that the pointer in `FromRawArc` is never +//! null, so Option> is not a nullable pointer. + +use std::ops::Deref; +use std::mem; +use std::sync::atomic::{self, AtomicUsize, Ordering}; + +pub struct FromRawArc { + _inner: *mut Inner, +} + +unsafe impl Send for FromRawArc { } +unsafe impl Sync for FromRawArc { } + +#[repr(C)] +struct Inner { + data: T, + cnt: AtomicUsize, +} + +impl FromRawArc { + pub fn new(data: T) -> FromRawArc { + let x = Box::new(Inner { + data: data, + cnt: AtomicUsize::new(1), + }); + FromRawArc { _inner: unsafe { mem::transmute(x) } } + } + + pub unsafe fn from_raw(ptr: *mut T) -> FromRawArc { + // Note that if we could use `mem::transmute` here to get a libstd Arc + // (guaranteed) then we could just use std::sync::Arc, but this is the + // crucial reason this currently exists. + FromRawArc { _inner: ptr as *mut Inner } + } +} + +impl Clone for FromRawArc { + fn clone(&self) -> FromRawArc { + // Atomic ordering of Relaxed lifted from libstd, but the general idea + // is that you need synchronization to communicate this increment to + // another thread, so this itself doesn't need to be synchronized. + unsafe { + (*self._inner).cnt.fetch_add(1, Ordering::Relaxed); + } + FromRawArc { _inner: self._inner } + } +} + +impl Deref for FromRawArc { + type Target = T; + + fn deref(&self) -> &T { + unsafe { &(*self._inner).data } + } +} + +impl Drop for FromRawArc { + fn drop(&mut self) { + unsafe { + // Atomic orderings lifted from the standard library + if (*self._inner).cnt.fetch_sub(1, Ordering::Release) != 1 { + return + } + atomic::fence(Ordering::Acquire); + drop(mem::transmute::<_, Box>(self._inner)); + } + } +} + +#[cfg(test)] +mod tests { + use super::FromRawArc; + + #[test] + fn smoke() { + let a = FromRawArc::new(1); + assert_eq!(*a, 1); + assert_eq!(*a.clone(), 1); + } + + #[test] + fn drops() { + struct A<'a>(&'a mut bool); + impl<'a> Drop for A<'a> { + fn drop(&mut self) { + *self.0 = true; + } + } + let mut a = false; + { + let a = FromRawArc::new(A(&mut a)); + a.clone(); + assert!(!*a.0); + } + assert!(a); + } +} diff --git a/third_party/rust/mio-named-pipes/src/lib.rs b/third_party/rust/mio-named-pipes/src/lib.rs new file mode 100644 index 0000000000000..28dcb8b095fa3 --- /dev/null +++ b/third_party/rust/mio-named-pipes/src/lib.rs @@ -0,0 +1,681 @@ +//! Windows named pipes bindings for mio. +//! +//! This crate implements bindings for named pipes for the mio crate. This +//! crate compiles on all platforms but only contains anything on Windows. +//! Currently this crate requires mio 0.6.2. +//! +//! On Windows, mio is implemented with an IOCP object at the heart of its +//! `Poll` implementation. For named pipes, this means that all I/O is done in +//! an overlapped fashion and the named pipes themselves are registered with +//! mio's internal IOCP object. Essentially, this crate is using IOCP for +//! bindings with named pipes. +//! +//! Note, though, that IOCP is a *completion* based model whereas mio expects a +//! *readiness* based model. As a result this crate, like with TCP objects in +//! mio, has internal buffering to translate the completion model to a readiness +//! model. This means that this crate is not a zero-cost binding over named +//! pipes on Windows, but rather approximates the performance of mio's TCP +//! implementation on Windows. +//! +//! # Trait implementations +//! +//! The `Read` and `Write` traits are implemented for `NamedPipe` and for +//! `&NamedPipe`. This represents that a named pipe can be concurrently read and +//! written to and also can be read and written to at all. Typically a named +//! pipe needs to be connected to a client before it can be read or written, +//! however. +//! +//! Note that for I/O operations on a named pipe to succeed then the named pipe +//! needs to be associated with an event loop. Until this happens all I/O +//! operations will return a "would block" error. +//! +//! # Managing connections +//! +//! The `NamedPipe` type supports a `connect` method to connect to a client and +//! a `disconnect` method to disconnect from that client. These two methods only +//! work once a named pipe is associated with an event loop. +//! +//! The `connect` method will succeed asynchronously and a completion can be +//! detected once the object receives a writable notification. +//! +//! # Named pipe clients +//! +//! Currently to create a client of a named pipe server then you can use the +//! `OpenOptions` type in the standard library to create a `File` that connects +//! to a named pipe. Afterwards you can use the `into_raw_handle` method coupled +//! with the `NamedPipe::from_raw_handle` method to convert that to a named pipe +//! that can operate asynchronously. Don't forget to pass the +//! `FILE_FLAG_OVERLAPPED` flag when opening the `File`. + +#![cfg(windows)] +#![deny(missing_docs)] + +extern crate kernel32; +#[macro_use] +extern crate log; +extern crate mio; +extern crate miow; +extern crate winapi; + +use std::ffi::OsStr; +use std::fmt; +use std::io::prelude::*; +use std::io; +use std::mem; +use std::os::windows::io::*; +use std::slice; +use std::sync::Mutex; +use std::sync::atomic::AtomicBool; +use std::sync::atomic::Ordering::SeqCst; + +use mio::windows; +use mio::{Registration, Poll, Token, PollOpt, Ready, Evented, SetReadiness}; +use miow::iocp::CompletionStatus; +use miow::pipe; +use winapi::{ERROR_PIPE_LISTENING, OVERLAPPED_ENTRY, ERROR_BROKEN_PIPE}; + +mod from_raw_arc; +use from_raw_arc::FromRawArc; + +macro_rules! offset_of { + ($t:ty, $($field:ident).+) => ( + &(*(0 as *const $t)).$($field).+ as *const _ as usize + ) +} + +macro_rules! overlapped2arc { + ($e:expr, $t:ty, $($field:ident).+) => ({ + let offset = offset_of!($t, $($field).+); + debug_assert!(offset < mem::size_of::<$t>()); + FromRawArc::from_raw(($e as usize - offset) as *mut $t) + }) +} + +fn would_block() -> io::Error { + io::Error::new(io::ErrorKind::WouldBlock, "would block") +} + +/// Representation of a named pipe on Windows. +/// +/// This structure internally contains a `HANDLE` which represents the named +/// pipe, and also maintains state associated with the mio event loop and active +/// I/O operations that have been scheduled to translate IOCP to a readiness +/// model. +pub struct NamedPipe { + registered: AtomicBool, + ready_registration: Registration, + poll_registration: windows::Binding, + inner: FromRawArc, +} + +struct Inner { + handle: pipe::NamedPipe, + readiness: SetReadiness, + + connect: windows::Overlapped, + connecting: AtomicBool, + + read: windows::Overlapped, + write: windows::Overlapped, + + io: Mutex, +} + +struct Io { + read: State, + write: State, + connect_error: Option, +} + +enum State { + None, + Pending(Vec, usize), + Ok(Vec, usize), + Err(io::Error), +} + +fn _assert_kinds() { + fn _assert_send() {} + fn _assert_sync() {} + _assert_send::(); + _assert_sync::(); +} + +impl NamedPipe { + /// Creates a new named pipe at the specified `addr` given a "reasonable + /// set" of initial configuration options. + /// + /// Currently the configuration options are the [same as miow]. To change + /// these options, you can create a custom named pipe yourself and then use + /// the `FromRawHandle` constructor to convert that type to an instance of a + /// `NamedPipe` in this crate. + /// + /// [same as miow]: https://docs.rs/miow/0.1.4/x86_64-pc-windows-msvc/miow/pipe/struct.NamedPipe.html#method.new + pub fn new>(addr: A) -> io::Result { + NamedPipe::_new(addr.as_ref()) + } + + fn _new(addr: &OsStr) -> io::Result { + let pipe = try!(pipe::NamedPipe::new(addr)); + unsafe { + Ok(NamedPipe::from_raw_handle(pipe.into_raw_handle())) + } + } + + /// Attempts to call `ConnectNamedPipe`, if possible. + /// + /// This function will attempt to connect this pipe to a client in an + /// asynchronous fashion. If the function immediately establishes a + /// connection to a client then `Ok(())` is returned. Otherwise if a + /// connection attempt was issued and is now in progress then a "would + /// block" error is returned. + /// + /// When the connection is finished then this object will be flagged as + /// being ready for a write, or otherwise in the writable state. + /// + /// # Errors + /// + /// This function will return a "would block" error if the pipe has not yet + /// been registered with an event loop, if the connection operation has + /// previously been issued but has not yet completed, or if the connect + /// itself was issued and didn't finish immediately. + /// + /// Normal I/O errors from the call to `ConnectNamedPipe` are returned + /// immediately. + pub fn connect(&self) -> io::Result<()> { + // Make sure we're associated with an IOCP object + if !self.registered() { + return Err(would_block()) + } + + // "Acquire the connecting lock" or otherwise just make sure we're the + // only operation that's using the `connect` overlapped instance. + if self.inner.connecting.swap(true, SeqCst) { + return Err(would_block()) + } + + // Now that we've flagged ourselves in the connecting state, issue the + // connection attempt. Afterwards interpret the return value and set + // internal state accordingly. + let res = unsafe { + let overlapped = self.inner.connect.as_mut_ptr(); + self.inner.handle.connect_overlapped(overlapped) + }; + + match res { + // The connection operation finished immediately, so let's schedule + // reads/writes and such. + Ok(true) => { + trace!("connect done immediately"); + self.inner.connecting.store(false, SeqCst); + Inner::post_register(&self.inner); + Ok(()) + } + + // If the overlapped operation was successful and didn't finish + // immediately then we forget a copy of the arc we hold + // internally. This ensures that when the completion status comes + // in for the I/O operation finishing it'll have a reference + // associated with it and our data will still be valid. The + // `connect_done` function will "reify" this forgotten pointer to + // drop the refcount on the other side. + Ok(false) => { + trace!("connect in progress"); + mem::forget(self.inner.clone()); + Err(would_block()) + } + + // TODO: are we sure no IOCP notification comes in here? + Err(e) => { + trace!("connect error: {}", e); + self.inner.connecting.store(false, SeqCst); + Err(e) + } + } + } + + /// Takes any internal error that has happened after the last I/O operation + /// which hasn't been retrieved yet. + /// + /// This is particularly useful when detecting failed attempts to `connect`. + /// After a completed `connect` flags this pipe as writable then callers + /// must invoke this method to determine whether the connection actually + /// succeeded. If this function returns `None` then a client is connected, + /// otherwise it returns an error of what happened and a client shouldn't be + /// connected. + pub fn take_error(&self) -> io::Result> { + Ok(self.inner.io.lock().unwrap().connect_error.take()) + } + + /// Disconnects this named pipe from a connected client. + /// + /// This function will disconnect the pipe from a connected client, if any, + /// transitively calling the `DisconnectNamedPipe` function. If the + /// disconnection is successful then this object will no longer be readable + /// or writable. + /// + /// After a `disconnect` is issued, then a `connect` may be called again to + /// connect to another client. + pub fn disconnect(&self) -> io::Result<()> { + try!(self.inner.handle.disconnect()); + self.inner.readiness.set_readiness(Ready::empty()) + .expect("event loop seems gone"); + Ok(()) + } + + fn registered(&self) -> bool { + self.registered.load(SeqCst) + } +} + +impl Read for NamedPipe { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + <&NamedPipe as Read>::read(&mut &*self, buf) + } +} + +impl Write for NamedPipe { + fn write(&mut self, buf: &[u8]) -> io::Result { + <&NamedPipe as Write>::write(&mut &*self, buf) + } + + fn flush(&mut self) -> io::Result<()> { + <&NamedPipe as Write>::flush(&mut &*self) + } +} + +impl<'a> Read for &'a NamedPipe { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + // Make sure we're registered + if !self.registered() { + return Err(would_block()) + } + + let mut state = self.inner.io.lock().unwrap(); + match mem::replace(&mut state.read, State::None) { + // In theory not possible with `ready_registration` checked above, + // but return would block for now. + State::None => Err(would_block()), + + // A read is in flight, still waiting for it to finish + State::Pending(buf, amt) => { + state.read = State::Pending(buf, amt); + Err(would_block()) + } + + // We previously read something into `data`, try to copy out some + // data. If we copy out all the data schedule a new read and + // otherwise store the buffer to get read later. + State::Ok(data, cur) => { + let n = { + let mut remaining = &data[cur..]; + try!(remaining.read(buf)) + }; + let next = cur + n; + if next != data.len() { + state.read = State::Ok(data, next); + } else { + Inner::schedule_read(&self.inner, &mut state); + } + Ok(n) + } + + // Looks like an in-flight read hit an error, return that here while + // we schedule a new one. + State::Err(e) => { + Inner::schedule_read(&self.inner, &mut state); + if e.raw_os_error() == Some(ERROR_BROKEN_PIPE as i32) { + Ok(0) + } else { + Err(e) + } + } + } + } +} + +impl<'a> Write for &'a NamedPipe { + fn write(&mut self, buf: &[u8]) -> io::Result { + // Make sure we're registered + if !self.registered() { + return Err(would_block()) + } + + // Make sure there's no writes pending + let mut io = self.inner.io.lock().unwrap(); + match io.write { + State::None => {} + _ => return Err(would_block()) + } + + // Move `buf` onto the heap and fire off the write + // + // TODO: need to be smarter about buffer management here + Inner::schedule_write(&self.inner, buf.to_vec(), 0, &mut io); + Ok(buf.len()) + } + + fn flush(&mut self) -> io::Result<()> { + // TODO: `FlushFileBuffers` somehow? + Ok(()) + } +} + +impl Evented for NamedPipe { + fn register(&self, + poll: &Poll, + token: Token, + interest: Ready, + opts: PollOpt) -> io::Result<()> { + // First, register the handle with the event loop + unsafe { + try!(self.poll_registration.register_handle(&self.inner.handle, + token, + poll)); + } + try!(poll.register(&self.ready_registration, token, interest, opts)); + self.registered.store(true, SeqCst); + Inner::post_register(&self.inner); + Ok(()) + } + + fn reregister(&self, + poll: &Poll, + token: Token, + interest: Ready, + opts: PollOpt) -> io::Result<()> { + // Validate `Poll` and that we were previously registered + unsafe { + try!(self.poll_registration.reregister_handle(&self.inner.handle, + token, + poll)); + } + + // At this point we should for sure have `ready_registration` unless + // we're racing with `register` above, so just return a bland error if + // the borrow fails. + try!(poll.reregister(&self.ready_registration, token, interest, opts)); + + Inner::post_register(&self.inner); + + Ok(()) + } + + fn deregister(&self, poll: &Poll) -> io::Result<()> { + // Validate `Poll` and deregister ourselves + unsafe { + try!(self.poll_registration.deregister_handle(&self.inner.handle, poll)); + } + poll.deregister(&self.ready_registration) + } +} + +impl AsRawHandle for NamedPipe { + fn as_raw_handle(&self) -> RawHandle { + self.inner.handle.as_raw_handle() + } +} + +impl FromRawHandle for NamedPipe { + unsafe fn from_raw_handle(handle: RawHandle) -> NamedPipe { + let (r, s) = Registration::new2(); + NamedPipe { + registered: AtomicBool::new(false), + ready_registration: r, + poll_registration: windows::Binding::new(), + inner: FromRawArc::new(Inner { + handle: pipe::NamedPipe::from_raw_handle(handle), + readiness: s, + connect: windows::Overlapped::new(connect_done), + connecting: AtomicBool::new(false), + read: windows::Overlapped::new(read_done), + write: windows::Overlapped::new(write_done), + io: Mutex::new(Io { + read: State::None, + write: State::None, + connect_error: None, + }), + }), + } + } +} + +impl fmt::Debug for NamedPipe { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.handle.fmt(f) + } +} + +impl Drop for NamedPipe { + fn drop(&mut self) { + // Cancel pending reads/connects, but don't cancel writes to ensure that + // everything is flushed out. + unsafe { + if self.inner.connecting.load(SeqCst) { + drop(cancel(&self.inner.handle, &self.inner.connect)); + } + let io = self.inner.io.lock().unwrap(); + match io.read { + State::Pending(..) => { + drop(cancel(&self.inner.handle, &self.inner.read)); + } + _ => {} + } + } + } +} + +impl Inner { + /// Schedules a read to happen in the background, executing an overlapped + /// operation. + /// + /// This function returns `true` if a normal error happens or if the read + /// is scheduled in the background. If the pipe is no longer connected + /// (ERROR_PIPE_LISTENING) then `false` is returned and no read is + /// scheduled. + fn schedule_read(me: &FromRawArc, io: &mut Io) -> bool { + // Check to see if a read is already scheduled/completed + match io.read { + State::None => {} + _ => return true, + } + + // Turn off our read readiness + let ready = me.readiness.readiness(); + me.readiness.set_readiness(ready & !Ready::readable()) + .expect("event loop seems gone"); + + // Allocate a buffer and schedule the read. + // + // TODO: need to be smarter about buffer management here + let mut buf = Vec::with_capacity(8 * 1024); + let e = unsafe { + let overlapped = me.read.as_mut_ptr(); + let slice = slice::from_raw_parts_mut(buf.as_mut_ptr(), + buf.capacity()); + me.handle.read_overlapped(slice, overlapped) + }; + + match e { + // See `connect` above for the rationale behind `forget` + Ok(e) => { + trace!("schedule read success: {:?}", e); + io.read = State::Pending(buf, 0); // 0 is ignored on read side + mem::forget(me.clone()); + true + } + + // If ERROR_PIPE_LISTENING happens then it's not a real read error, + // we just need to wait for a connect. + Err(ref e) if e.raw_os_error() == Some(ERROR_PIPE_LISTENING as i32) => { + false + } + + // If some other error happened, though, we're now readable to give + // out the error. + Err(e) => { + trace!("schedule read error: {}", e); + io.read = State::Err(e); + me.readiness.set_readiness(ready | Ready::readable()) + .expect("event loop still seems gone"); + true + } + } + } + + fn schedule_write(me: &FromRawArc, + buf: Vec, + pos: usize, + io: &mut Io) { + // Very similar to `schedule_read` above, just done for the write half. + let ready = me.readiness.readiness(); + me.readiness.set_readiness(ready & !Ready::writable()) + .expect("event loop seems gone"); + + let e = unsafe { + let overlapped = me.write.as_mut_ptr(); + me.handle.write_overlapped(&buf[pos..], overlapped) + }; + + match e { + // See `connect` above for the rationale behind `forget` + Ok(e) => { + trace!("schedule write success: {:?}", e); + io.write = State::Pending(buf, pos); + mem::forget(me.clone()) + } + Err(e) => { + trace!("schedule write error: {}", e); + io.write = State::Err(e); + me.add_readiness(Ready::writable()); + } + } + } + + fn add_readiness(&self, ready: Ready) { + self.readiness.set_readiness(ready | self.readiness.readiness()) + .expect("event loop still seems gone"); + } + + fn post_register(me: &FromRawArc) { + let mut io = me.io.lock().unwrap(); + if Inner::schedule_read(&me, &mut io) { + if let State::None = io.write { + me.add_readiness(Ready::writable()); + } + } + } +} + +unsafe fn cancel(handle: &AsRawHandle, + overlapped: &windows::Overlapped) -> io::Result<()> { + let ret = kernel32::CancelIoEx(handle.as_raw_handle(), + overlapped.as_mut_ptr()); + if ret == 0 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } +} + +fn connect_done(status: &OVERLAPPED_ENTRY) { + let status = CompletionStatus::from_entry(status); + trace!("connect done"); + + // Acquire the `FromRawArc`. Note that we should be guaranteed that + // the refcount is available to us due to the `mem::forget` in + // `connect` above. + let me = unsafe { + overlapped2arc!(status.overlapped(), Inner, connect) + }; + + // Flag ourselves as no longer using the `connect` overlapped instances. + let prev = me.connecting.swap(false, SeqCst); + assert!(prev, "wasn't previously connecting"); + + // Stash away our connect error if one happened + debug_assert_eq!(status.bytes_transferred(), 0); + unsafe { + match me.handle.result(status.overlapped()) { + Ok(n) => debug_assert_eq!(n, 0), + Err(e) => me.io.lock().unwrap().connect_error = Some(e), + } + } + + // We essentially just finished a registration, so kick off a + // read and register write readiness. + Inner::post_register(&me); +} + +fn read_done(status: &OVERLAPPED_ENTRY) { + let status = CompletionStatus::from_entry(status); + trace!("read finished, bytes={}", status.bytes_transferred()); + + // Acquire the `FromRawArc`. Note that we should be guaranteed that + // the refcount is available to us due to the `mem::forget` in + // `schedule_read` above. + let me = unsafe { + overlapped2arc!(status.overlapped(), Inner, read) + }; + + // Move from the `Pending` to `Ok` state. + let mut io = me.io.lock().unwrap(); + let mut buf = match mem::replace(&mut io.read, State::None) { + State::Pending(buf, _) => buf, + _ => unreachable!(), + }; + unsafe { + match me.handle.result(status.overlapped()) { + Ok(n) => { + debug_assert_eq!(status.bytes_transferred() as usize, n); + buf.set_len(status.bytes_transferred() as usize); + io.read = State::Ok(buf, 0); + } + Err(e) => { + debug_assert_eq!(status.bytes_transferred(), 0); + io.read = State::Err(e); + } + } + } + + // Flag our readiness that we've got data. + me.add_readiness(Ready::readable()); +} + +fn write_done(status: &OVERLAPPED_ENTRY) { + let status = CompletionStatus::from_entry(status); + trace!("write finished, bytes={}", status.bytes_transferred()); + // Acquire the `FromRawArc`. Note that we should be guaranteed that + // the refcount is available to us due to the `mem::forget` in + // `schedule_write` above. + let me = unsafe { + overlapped2arc!(status.overlapped(), Inner, write) + }; + + // Make the state change out of `Pending`. If we wrote the entire buffer + // then we're writable again and otherwise we schedule another write. + let mut io = me.io.lock().unwrap(); + let (buf, pos) = match mem::replace(&mut io.write, State::None) { + State::Pending(buf, pos) => (buf, pos), + _ => unreachable!(), + }; + + unsafe { + match me.handle.result(status.overlapped()) { + Ok(n) => { + debug_assert_eq!(status.bytes_transferred() as usize, n); + let new_pos = pos + (status.bytes_transferred() as usize); + if new_pos == buf.len() { + me.add_readiness(Ready::writable()); + } else { + Inner::schedule_write(&me, buf, new_pos, &mut io); + } + } + Err(e) => { + debug_assert_eq!(status.bytes_transferred(), 0); + io.write = State::Err(e); + me.add_readiness(Ready::writable()); + } + } + } +} diff --git a/third_party/rust/mio-named-pipes/tests/smoke.rs b/third_party/rust/mio-named-pipes/tests/smoke.rs new file mode 100644 index 0000000000000..f2d7988a1ad25 --- /dev/null +++ b/third_party/rust/mio-named-pipes/tests/smoke.rs @@ -0,0 +1,273 @@ +extern crate mio; +extern crate mio_named_pipes; +extern crate env_logger; +extern crate rand; +extern crate winapi; + +#[macro_use] +extern crate log; + +use std::fs::OpenOptions; +use std::io::prelude::*; +use std::io; +use std::os::windows::fs::*; +use std::os::windows::io::*; +use std::time::Duration; + +use mio_named_pipes::NamedPipe; +use mio::{Poll, Ready, Token, PollOpt, Events}; +use rand::Rng; + +macro_rules! t { + ($e:expr) => (match $e { + Ok(e) => e, + Err(e) => panic!("{} failed with {}", stringify!($e), e), + }) +} + +fn server() -> (NamedPipe, String) { + let num: u64 = rand::thread_rng().gen(); + let name = format!(r"\\.\pipe\my-pipe-{}", num); + let pipe = t!(NamedPipe::new(&name)); + (pipe, name) +} + +fn client(name: &str) -> NamedPipe { + let mut opts = OpenOptions::new(); + opts.read(true) + .write(true) + .custom_flags(winapi::FILE_FLAG_OVERLAPPED); + let file = t!(opts.open(name)); + unsafe { + NamedPipe::from_raw_handle(file.into_raw_handle()) + } +} + +fn pipe() -> (NamedPipe, NamedPipe) { + let (pipe, name) = server(); + (pipe, client(&name)) +} + +#[test] +fn writable_after_register() { + drop(env_logger::init()); + + let (server, client) = pipe(); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::writable() | Ready::readable(), + PollOpt::edge())); + t!(poll.register(&client, + Token(1), + Ready::writable(), + PollOpt::edge())); + + let mut events = Events::with_capacity(128); + t!(poll.poll(&mut events, None)); + + let events = events.iter().collect::>(); + debug!("events {:?}", events); + assert!(events.iter().any(|e| { + e.token() == Token(0) && e.readiness() == Ready::writable() + })); + assert!(events.iter().any(|e| { + e.token() == Token(1) && e.readiness() == Ready::writable() + })); +} + +#[test] +fn write_then_read() { + drop(env_logger::init()); + + let (mut server, mut client) = pipe(); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + t!(poll.register(&client, + Token(1), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + + let mut events = Events::with_capacity(128); + t!(poll.poll(&mut events, None)); + + assert_eq!(t!(client.write(b"1234")), 4); + + loop { + t!(poll.poll(&mut events, None)); + let events = events.iter().collect::>(); + debug!("events {:?}", events); + if let Some(event) = events.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_readable() { + break + } + } + } + + let mut buf = [0; 10]; + assert_eq!(t!(server.read(&mut buf)), 4); + assert_eq!(&buf[..4], b"1234"); +} + +#[test] +fn connect_before_client() { + drop(env_logger::init()); + + let (server, name) = server(); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + + let mut events = Events::with_capacity(128); + t!(poll.poll(&mut events, Some(Duration::new(0, 0)))); + let e = events.iter().collect::>(); + debug!("events {:?}", e); + assert_eq!(e.len(), 0); + assert_eq!(server.connect().err().unwrap().kind(), + io::ErrorKind::WouldBlock); + + let client = client(&name); + t!(poll.register(&client, + Token(1), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + loop { + t!(poll.poll(&mut events, None)); + let e = events.iter().collect::>(); + debug!("events {:?}", e); + if let Some(event) = e.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_writable() { + break + } + } + } +} + +#[test] +fn connect_after_client() { + drop(env_logger::init()); + + let (server, name) = server(); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + + let mut events = Events::with_capacity(128); + t!(poll.poll(&mut events, Some(Duration::new(0, 0)))); + let e = events.iter().collect::>(); + debug!("events {:?}", e); + assert_eq!(e.len(), 0); + + let client = client(&name); + t!(poll.register(&client, + Token(1), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + t!(server.connect()); + loop { + t!(poll.poll(&mut events, None)); + let e = events.iter().collect::>(); + debug!("events {:?}", e); + if let Some(event) = e.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_writable() { + break + } + } + } +} + +#[test] +fn write_then_drop() { + drop(env_logger::init()); + + let (mut server, mut client) = pipe(); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + t!(poll.register(&client, + Token(1), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + assert_eq!(t!(client.write(b"1234")), 4); + drop(client); + + let mut events = Events::with_capacity(128); + + loop { + t!(poll.poll(&mut events, None)); + let events = events.iter().collect::>(); + debug!("events {:?}", events); + if let Some(event) = events.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_readable() { + break + } + } + } + + let mut buf = [0; 10]; + assert_eq!(t!(server.read(&mut buf)), 4); + assert_eq!(&buf[..4], b"1234"); +} + +#[test] +fn connect_twice() { + drop(env_logger::init()); + + let (mut server, name) = server(); + let c1 = client(&name); + let poll = t!(Poll::new()); + t!(poll.register(&server, + Token(0), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + t!(poll.register(&c1, + Token(1), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + drop(c1); + + let mut events = Events::with_capacity(128); + + loop { + t!(poll.poll(&mut events, None)); + let events = events.iter().collect::>(); + debug!("events {:?}", events); + if let Some(event) = events.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_readable() { + break + } + } + } + + let mut buf = [0; 10]; + assert_eq!(t!(server.read(&mut buf)), 0); + t!(server.disconnect()); + assert_eq!(server.connect().err().unwrap().kind(), + io::ErrorKind::WouldBlock); + + let c2 = client(&name); + t!(poll.register(&c2, + Token(2), + Ready::readable() | Ready::writable(), + PollOpt::edge())); + + loop { + t!(poll.poll(&mut events, None)); + let events = events.iter().collect::>(); + debug!("events {:?}", events); + if let Some(event) = events.iter().find(|e| e.token() == Token(0)) { + if event.readiness().is_writable() { + break + } + } + } +} From d8e4a8a825c0a0a9e5b17c3a1005e3032720d9c4 Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Thu, 7 Mar 2019 02:05:18 +0000 Subject: [PATCH 39/48] Bug 1512445 - Enable AudioIPC build on Windows (default off via pref). r=chunmin Differential Revision: https://phabricator.services.mozilla.com/D22155 --HG-- extra : moz-landing-system : lando --- dom/media/CubebUtils.cpp | 2 +- toolkit/library/rust/gkrust-features.mozbuild | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp index 7eaf8b15faa44..fddbab4c07b03 100644 --- a/dom/media/CubebUtils.cpp +++ b/dom/media/CubebUtils.cpp @@ -54,7 +54,7 @@ #define PREF_AUDIOIPC_POOL_SIZE "media.audioipc.pool_size" #define PREF_AUDIOIPC_STACK_SIZE "media.audioipc.stack_size" -#if (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)) || defined(XP_MACOSX) +#if (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)) || defined(XP_MACOSX) || (defined(XP_WIN) && !defined(_ARM64_)) # define MOZ_CUBEB_REMOTING #endif diff --git a/toolkit/library/rust/gkrust-features.mozbuild b/toolkit/library/rust/gkrust-features.mozbuild index e2bd66119660c..c2c6e28957856 100644 --- a/toolkit/library/rust/gkrust-features.mozbuild +++ b/toolkit/library/rust/gkrust-features.mozbuild @@ -18,9 +18,9 @@ if CONFIG['MOZ_PULSEAUDIO']: if CONFIG['MOZ_RUST_SIMD']: gkrust_features += ['simd-accel'] -# This feature is only supported on Linux and macOS, and this check needs to +# This feature is not yet supported on all platforms, and this check needs to # match MOZ_CUBEB_REMOTING in CubebUtils.cpp. -if (CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android') or CONFIG['OS_ARCH'] == 'Darwin': +if (CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android') or CONFIG['OS_ARCH'] == 'Darwin' or (CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CPU_ARCH'] != 'aarch64'): gkrust_features += ['cubeb-remoting'] if CONFIG['MOZ_MEMORY']: From 15f9c74d8d84bc09b54bd00509571acf23ff9f01 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Thu, 7 Mar 2019 02:07:06 +0000 Subject: [PATCH 40/48] Bug 1532526 - Add ATOK Professional to workaround list. r=masayuki Differential Revision: https://phabricator.services.mozilla.com/D22071 --HG-- extra : moz-landing-system : lando --- .../geckoview/src/main/java/org/mozilla/gecko/InputMethods.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java index 8015fa21a5e7f..f17276c2c7797 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java @@ -17,7 +17,7 @@ final public class InputMethods { public static final String METHOD_ANDROID_LATINIME = "com.android.inputmethod.latin/.LatinIME"; // ATOK has a lot of package names since they release custom versions. - public static final String METHOD_ATOK_PREFIX = "com.justsystems.atokmobile."; + public static final String METHOD_ATOK_PREFIX = "com.justsystems.atokmobile"; public static final String METHOD_ATOK_OEM_PREFIX = "com.atok.mobile."; public static final String METHOD_GOOGLE_JAPANESE_INPUT = "com.google.android.inputmethod.japanese/.MozcService"; public static final String METHOD_ATOK_OEM_SOFTBANK = "com.mobiroo.n.justsystems.atok/.AtokInputMethodService"; From f233fae32cbafd1fb961efb454fb31678d236b49 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Thu, 7 Mar 2019 04:43:59 +0200 Subject: [PATCH 41/48] Backed out changeset b52eb25bbe9c (bug 1529340) for Browser-Chrome failures in browser/base/content/test/static/browser_parsable_css.js --- browser/base/content/popup-notifications.inc | 18 +++---- browser/themes/shared/browser.inc.css | 57 +------------------- 2 files changed, 9 insertions(+), 66 deletions(-) diff --git a/browser/base/content/popup-notifications.inc b/browser/base/content/popup-notifications.inc index b29dafb451e56..880203a83a64b 100644 --- a/browser/base/content/popup-notifications.inc +++ b/browser/base/content/popup-notifications.inc @@ -96,16 +96,14 @@ - - - - - - - + + + + + diff --git a/browser/themes/shared/browser.inc.css b/browser/themes/shared/browser.inc.css index ac95c83679040..b6c2863fa6a72 100644 --- a/browser/themes/shared/browser.inc.css +++ b/browser/themes/shared/browser.inc.css @@ -232,8 +232,7 @@ margin-bottom: 0; } -#cfr-notification-footer-text-and-addon-info { - display: block; +#cfr-notification-footer { padding: 10px var(--arrowpanel-padding); } @@ -295,60 +294,6 @@ flex-grow: 1; } -#cfr-notification-footer-pintab-animation-container { - background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_animated.png"); - background-position: top center; - background-repeat: no-repeat; - height: 173px; - width: 343px; -} - -#contextual-feature-recommendation-notification[data-notification-category="cfrAddons"] #cfr-notification-footer-pintab-animation-container { - display: none; -} - -#cfr-notification-footer-pintab-animation-container:not([animate]), -#cfr-notification-footer-pintab-animation-container[paused], -:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container:not([animate]), -:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container[paused] { - background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_static.png"); -} - -:root[lwt-popup-brighttext] #cfr-notification-footer-pintab-animation-container { - background-image: url("resource://activity-stream/data/content/assets/cfr_pinnedtab_animated_darktheme.png"); -} - -#cfr-notification-footer-animation-controls { - background: linear-gradient(transparent 0%, rgba(255, 255, 255, 0.95) 35%); - padding: 20px var(--arrowpanel-padding) 10px; -} - -:root[lwt-popup-brighttext] #cfr-notification-footer-animation-controls { - margin-left: 13px; -} - -#cfr-notification-footer-pintab-animation-container:not([animate]) #cfr-notification-footer-animation-controls, -#cfr-notification-footer-pintab-animation-container[paused] #cfr-notification-footer-animation-controls { - visibility: hidden; -} - -#cfr-notification-footer-pause-button, -#cfr-notification-footer-pause-label { - color: rgba(12, 12, 13, 0.8); - cursor: pointer; -} - -#cfr-notification-footer-pause-icon { - background-image: url("resource://activity-stream/data/content/assets/glyph-pause-12.svg"); - background-position: center center; - background-repeat: no-repeat; - background-size: 12px; - -moz-context-properties: fill; - fill: rgba(12, 12, 13, 0.8); - height: 12px; - width: 12px; -} - #content-mask { background: rgba(0, 0, 0, 0.5); } From af78a85968aafab0ab1b14f088e5ac2cc5e9d86f Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 4 Mar 2019 22:16:46 +0000 Subject: [PATCH 42/48] Bug 1532443 - Drop clampScrollPoistion stuff. r=kats This was introduced in bug 726817 for B2G stuff and there is no call site of SetClampScrollPosition now and the only one entry point to call the function was nsIFrameLoader.clampScrollPosition which was removed in https://hg.mozilla.org/mozilla-central/rev/cd9aace7bb96 . ScrollFrameHelper::ShouldClampScrollPosition() had always returned true in both cases of root and non-root scrollable frames. (In the case of non-root scrollable, nsFrameLoader.mClampScrollPosition is initially set to true and nobody changes the value) Differential Revision: https://phabricator.services.mozilla.com/D22026 --HG-- extra : moz-landing-system : lando --- dom/base/nsFrameLoader.cpp | 23 ----------------------- dom/base/nsFrameLoader.h | 6 ------ layout/generic/nsGfxScrollFrame.cpp | 12 ------------ layout/generic/nsGfxScrollFrame.h | 2 -- layout/generic/nsSubDocumentFrame.h | 5 ----- 5 files changed, 48 deletions(-) diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index dd6263904bd24..f15e600c5ce89 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -180,7 +180,6 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, nsPIDOMWindowOuter* aOpener, mLoadingOriginalSrc(false), mRemoteBrowserShown(false), mRemoteFrame(false), - mClampScrollPosition(true), mObservingOwnerContent(false) { mRemoteFrame = ShouldUseRemoteProcess(); MOZ_ASSERT(!mRemoteFrame || !aOpener, @@ -2369,28 +2368,6 @@ uint32_t nsFrameLoader::LazyHeight() const { return lazyHeight; } -void nsFrameLoader::SetClampScrollPosition(bool aClamp) { - mClampScrollPosition = aClamp; - - // When turning clamping on, make sure the current position is clamped. - if (aClamp) { - nsIFrame* frame = GetPrimaryFrameOfOwningContent(); - nsSubDocumentFrame* subdocFrame = do_QueryFrame(frame); - if (subdocFrame) { - nsIFrame* subdocRootFrame = subdocFrame->GetSubdocumentRootFrame(); - if (subdocRootFrame) { - nsIScrollableFrame* subdocRootScrollFrame = - subdocRootFrame->PresShell()->GetRootScrollFrameAsScrollable(); - if (subdocRootScrollFrame) { - subdocRootScrollFrame->ScrollTo( - subdocRootScrollFrame->GetScrollPosition(), - nsIScrollableFrame::INSTANT); - } - } - } - } -} - static Tuple GetContentParent(Element* aBrowser) { using ReturnTuple = Tuple; diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index a12ae7a8e9e8f..93ad673ff0eec 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -193,9 +193,6 @@ class nsFrameLoader final : public nsStubMutationObserver, uint64_t ChildID() const { return mChildID; } - bool ClampScrollPosition() const { return mClampScrollPosition; } - void SetClampScrollPosition(bool aClamp); - bool DepthTooGreat() const { return mDepthTooGreat; } bool IsDead() const { return mDestroyCalled; } @@ -304,8 +301,6 @@ class nsFrameLoader final : public nsStubMutationObserver, mozilla::dom::Element* GetOwnerContent() { return mOwnerContent; } - bool ShouldClampScrollPosition() { return mClampScrollPosition; } - mozilla::dom::ParentSHistory* GetParentSHistory() { return mParentSHistory; } /** @@ -485,7 +480,6 @@ class nsFrameLoader final : public nsStubMutationObserver, bool mRemoteBrowserShown : 1; bool mRemoteFrame : 1; - bool mClampScrollPosition : 1; bool mObservingOwnerContent : 1; }; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index ab61d213c9dfe..d440240fc4855 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2411,14 +2411,6 @@ void ScrollFrameHelper::MarkScrollbarsDirtyForReflow() const { } } -bool ScrollFrameHelper::ShouldClampScrollPosition() const { - if (!mIsRoot) return true; - nsSubDocumentFrame* subdocFrame = - static_cast(nsLayoutUtils::GetCrossDocParentFrame( - mOuter->PresShell()->GetRootFrame())); - return !subdocFrame || subdocFrame->ShouldClampScrollPosition(); -} - bool ScrollFrameHelper::IsAlwaysActive() const { if (nsDisplayItem::ForceActiveLayers()) { return true; @@ -4059,10 +4051,6 @@ nsRect ScrollFrameHelper::GetScrollRange(nscoord aWidth, } nsRect ScrollFrameHelper::GetScrollRangeForClamping() const { - if (!ShouldClampScrollPosition()) { - return nsRect(nscoord_MIN / 2, nscoord_MIN / 2, - nscoord_MAX - nscoord_MIN / 2, nscoord_MAX - nscoord_MIN / 2); - } nsSize visualViewportSize = GetVisualViewportSize(); return GetScrollRange(visualViewportSize.width, visualViewportSize.height); } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 39286ed0278f5..4e10a113e7564 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -447,8 +447,6 @@ class ScrollFrameHelper : public nsIReflowCallback { void MarkScrollbarsDirtyForReflow() const; - bool ShouldClampScrollPosition() const; - bool IsAlwaysActive() const; void MarkEverScrolled(); void MarkRecentlyScrolled(); diff --git a/layout/generic/nsSubDocumentFrame.h b/layout/generic/nsSubDocumentFrame.h index 4a5f7477bc36b..b7991bfb52995 100644 --- a/layout/generic/nsSubDocumentFrame.h +++ b/layout/generic/nsSubDocumentFrame.h @@ -101,11 +101,6 @@ class nsSubDocumentFrame final : public nsAtomicContainerFrame, bool ReflowFinished() override; void ReflowCallbackCanceled() override; - bool ShouldClampScrollPosition() { - nsFrameLoader* frameLoader = FrameLoader(); - return !frameLoader || frameLoader->ShouldClampScrollPosition(); - } - /** * Return true if pointer event hit-testing should be allowed to target * content in the subdocument. From c2596e8439a39ba804080a75be264e9bc37c7d34 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Thu, 7 Mar 2019 03:01:30 +0000 Subject: [PATCH 43/48] Bug 1533160 - Clean up dumpThread. r=loganfsmyth Differential Revision: https://phabricator.services.mozilla.com/D22399 --HG-- extra : moz-landing-system : lando --- .../debugger/new/src/client/firefox/commands.js | 4 ++-- devtools/client/debugger/new/src/utils/dbg.js | 15 +++++++-------- devtools/server/actors/thread.js | 1 + .../server/actors/utils/breakpoint-actor-map.js | 4 ++++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/devtools/client/debugger/new/src/client/firefox/commands.js b/devtools/client/debugger/new/src/client/firefox/commands.js index b904fbd5c1aca..503cac423dd98 100644 --- a/devtools/client/debugger/new/src/client/firefox/commands.js +++ b/devtools/client/debugger/new/src/client/firefox/commands.js @@ -72,8 +72,8 @@ function releaseActor(actor: String) { return debuggerClient.release(actor); } -function sendPacket(packet: Object, callback?: Function = r => r) { - return debuggerClient.request(packet).then(callback); +function sendPacket(packet: Object) { + return debuggerClient.request(packet) } function lookupThreadClient(thread: string) { diff --git a/devtools/client/debugger/new/src/utils/dbg.js b/devtools/client/debugger/new/src/utils/dbg.js index 34c8e63a82d40..66a79f7898eed 100644 --- a/devtools/client/debugger/new/src/utils/dbg.js +++ b/devtools/client/debugger/new/src/utils/dbg.js @@ -18,20 +18,19 @@ function findSources(dbg: any, url: string) { return sources.filter(s => (s.url || "").includes(url)); } -function sendPacket(dbg: any, packet: any, callback: () => void) { - dbg.client.sendPacket(packet, callback || console.log); +function sendPacket(dbg: any, packet: any) { + return dbg.client.sendPacket(packet); } -function sendPacketToThread(dbg: Object, packet: any, callback: Function = () => {}) { - sendPacket( +function sendPacketToThread(dbg: Object, packet: any) { + return sendPacket( dbg, - { to: dbg.connection.tabConnection.threadClient.actor, ...packet }, - callback + { to: dbg.connection.tabConnection.threadClient.actor, ...packet } ); } -function evaluate(dbg: Object, expression: any, callback: () => void) { - dbg.client.evaluate(expression).then(callback || console.log); +function evaluate(dbg: Object, expression: any) { + return dbg.client.evaluate(expression) } function bindSelectors(obj: Object): Object { diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index 02bc5f8a37076..0ea6fcdeb89da 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -1761,6 +1761,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { pauseOnExceptions: this._options.pauseOnExceptions, ignoreCaughtExceptions: this._options.ignoreCaughtExceptions, skipBreakpoints: this.skipBreakpoints, + breakpoints: this.breakpointActorMap.listKeys(), }; }, }); diff --git a/devtools/server/actors/utils/breakpoint-actor-map.js b/devtools/server/actors/utils/breakpoint-actor-map.js index 189059f9d2b46..a0ad07517680c 100644 --- a/devtools/server/actors/utils/breakpoint-actor-map.js +++ b/devtools/server/actors/utils/breakpoint-actor-map.js @@ -31,6 +31,10 @@ BreakpointActorMap.prototype = { return Object.values(this._actors); }, + listKeys() { + return Object.keys(this._actors); + }, + /** * Return the BreakpointActor at the given location in this * BreakpointActorMap. From 3bc83a5a933e06645feb932adb39818dbb3ff852 Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Thu, 7 Mar 2019 03:57:23 +0000 Subject: [PATCH 44/48] Bug 1528869 - Enable IonMonkey in the ARM64 shell, but keep it disabled in the browser. r=nbp Enable IonMonkey in the ARM64 shell, but keep it disabled in the browser. Differential Revision: https://phabricator.services.mozilla.com/D20243 --HG-- extra : moz-landing-system : lando --- js/public/ContextOptions.h | 6 ------ js/src/shell/js.cpp | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/js/public/ContextOptions.h b/js/public/ContextOptions.h index 5c24b7957e5b8..564558ce02c0e 100644 --- a/js/public/ContextOptions.h +++ b/js/public/ContextOptions.h @@ -19,15 +19,9 @@ class JS_PUBLIC_API ContextOptions { public: ContextOptions() : baseline_(true), -#ifdef JS_CODEGEN_ARM64 - ion_(false), - asmJS_(false), - wasm_(false), -#else ion_(true), asmJS_(true), wasm_(true), -#endif wasmVerbose_(false), wasmBaseline_(true), wasmIon_(true), diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index be65c9065be10..f56fa0ae5607b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -9839,25 +9839,14 @@ static MOZ_MUST_USE bool ProcessArgs(JSContext* cx, OptionParser* op) { static bool SetContextOptions(JSContext* cx, const OptionParser& op) { enableBaseline = !op.getBoolOption("no-baseline"); -#ifdef JS_CODEGEN_ARM64 - // TODO: Enable Ion by default. - enableIon = false; - enableAsmJS = false; -#else enableIon = !op.getBoolOption("no-ion"); enableAsmJS = !op.getBoolOption("no-asmjs"); -#endif enableNativeRegExp = !op.getBoolOption("no-native-regexp"); // Default values for wasm. enableWasm = true; enableWasmBaseline = true; -#ifdef JS_CODEGEN_ARM64 - // TODO: Enable WasmIon by default. - enableWasmIon = false; -#else enableWasmIon = true; -#endif if (const char* str = op.getStringOption("wasm-compiler")) { if (strcmp(str, "none") == 0) { enableWasm = false; From 25265b82d192aa67f817af49d7622657a7719a61 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Thu, 7 Mar 2019 05:56:24 +0200 Subject: [PATCH 45/48] Backed out changeset 238d9fba1b5a (bug 1533160) for Debugger failures --- .../debugger/new/src/client/firefox/commands.js | 4 ++-- devtools/client/debugger/new/src/utils/dbg.js | 15 ++++++++------- devtools/server/actors/thread.js | 1 - .../server/actors/utils/breakpoint-actor-map.js | 4 ---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/devtools/client/debugger/new/src/client/firefox/commands.js b/devtools/client/debugger/new/src/client/firefox/commands.js index 503cac423dd98..b904fbd5c1aca 100644 --- a/devtools/client/debugger/new/src/client/firefox/commands.js +++ b/devtools/client/debugger/new/src/client/firefox/commands.js @@ -72,8 +72,8 @@ function releaseActor(actor: String) { return debuggerClient.release(actor); } -function sendPacket(packet: Object) { - return debuggerClient.request(packet) +function sendPacket(packet: Object, callback?: Function = r => r) { + return debuggerClient.request(packet).then(callback); } function lookupThreadClient(thread: string) { diff --git a/devtools/client/debugger/new/src/utils/dbg.js b/devtools/client/debugger/new/src/utils/dbg.js index 66a79f7898eed..34c8e63a82d40 100644 --- a/devtools/client/debugger/new/src/utils/dbg.js +++ b/devtools/client/debugger/new/src/utils/dbg.js @@ -18,19 +18,20 @@ function findSources(dbg: any, url: string) { return sources.filter(s => (s.url || "").includes(url)); } -function sendPacket(dbg: any, packet: any) { - return dbg.client.sendPacket(packet); +function sendPacket(dbg: any, packet: any, callback: () => void) { + dbg.client.sendPacket(packet, callback || console.log); } -function sendPacketToThread(dbg: Object, packet: any) { - return sendPacket( +function sendPacketToThread(dbg: Object, packet: any, callback: Function = () => {}) { + sendPacket( dbg, - { to: dbg.connection.tabConnection.threadClient.actor, ...packet } + { to: dbg.connection.tabConnection.threadClient.actor, ...packet }, + callback ); } -function evaluate(dbg: Object, expression: any) { - return dbg.client.evaluate(expression) +function evaluate(dbg: Object, expression: any, callback: () => void) { + dbg.client.evaluate(expression).then(callback || console.log); } function bindSelectors(obj: Object): Object { diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index 0ea6fcdeb89da..02bc5f8a37076 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -1761,7 +1761,6 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { pauseOnExceptions: this._options.pauseOnExceptions, ignoreCaughtExceptions: this._options.ignoreCaughtExceptions, skipBreakpoints: this.skipBreakpoints, - breakpoints: this.breakpointActorMap.listKeys(), }; }, }); diff --git a/devtools/server/actors/utils/breakpoint-actor-map.js b/devtools/server/actors/utils/breakpoint-actor-map.js index a0ad07517680c..189059f9d2b46 100644 --- a/devtools/server/actors/utils/breakpoint-actor-map.js +++ b/devtools/server/actors/utils/breakpoint-actor-map.js @@ -31,10 +31,6 @@ BreakpointActorMap.prototype = { return Object.values(this._actors); }, - listKeys() { - return Object.keys(this._actors); - }, - /** * Return the BreakpointActor at the given location in this * BreakpointActorMap. From 9203300311f857ff3346400804060ca5c1306f01 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Thu, 7 Mar 2019 04:20:33 +0000 Subject: [PATCH 46/48] Bug 1532710: [taskgraph] Provide a function version of `resolve_keyed_by` that doesn't mutate; r=dustin I'd like to use the same format for config values, that get evaluated in different contexts, so don't to mutate the config for that. Differential Revision: https://phabricator.services.mozilla.com/D22126 --HG-- extra : moz-landing-system : lando --- taskcluster/taskgraph/util/keyed_by.py | 74 ++++++++++++++++++++++++++ taskcluster/taskgraph/util/schema.py | 50 ++++------------- 2 files changed, 84 insertions(+), 40 deletions(-) create mode 100644 taskcluster/taskgraph/util/keyed_by.py diff --git a/taskcluster/taskgraph/util/keyed_by.py b/taskcluster/taskgraph/util/keyed_by.py new file mode 100644 index 0000000000000..bdc551ea52422 --- /dev/null +++ b/taskcluster/taskgraph/util/keyed_by.py @@ -0,0 +1,74 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from __future__ import absolute_import, print_function, unicode_literals + +from .attributes import keymatch + + +def evaluate_keyed_by(value, item_name, attributes): + """ + For values which can either accept a literal value, or be keyed by some + attributes, perform that lookup and return the result. + + For example, given item:: + + by-test-platform: + macosx-10.11/debug: 13 + win.*: 6 + default: 12 + + a call to `evaluate_keyed_by(item, 'thing-name', {'test-platform': 'linux96')` + would return `12`. + + The `item_name` parameter is used to generate useful error messages. + Items can be nested as deeply as desired:: + + by-test-platform: + win.*: + by-project: + ash: .. + cedar: .. + linux: 13 + default: 12 + """ + while True: + if not isinstance(value, dict) or len(value) != 1 or not value.keys()[0].startswith('by-'): + return value + + keyed_by = value.keys()[0][3:] # strip off 'by-' prefix + key = attributes.get(keyed_by) + alternatives = value.values()[0] + + if len(alternatives) == 1 and 'default' in alternatives: + # Error out when only 'default' is specified as only alternatives, + # because we don't need to by-{keyed_by} there. + raise Exception( + "Keyed-by '{}' unnecessary with only value 'default' " + "found, when determining item {}".format( + keyed_by, item_name)) + + if key is None: + if 'default' in alternatives: + value = alternatives['default'] + continue + else: + raise Exception( + "No attribute {} and no value for 'default' found " + "while determining item {}".format( + keyed_by, item_name)) + + matches = keymatch(alternatives, key) + if len(matches) > 1: + raise Exception( + "Multiple matching values for {} {!r} found while " + "determining item {}".format( + keyed_by, key, item_name)) + elif matches: + value = matches[0] + continue + + raise Exception( + "No {} matching {!r} nor 'default' found while determining item {}".format( + keyed_by, key, item_name)) diff --git a/taskcluster/taskgraph/util/schema.py b/taskcluster/taskgraph/util/schema.py index 1bdf1b571c417..dfa780c01b6ff 100644 --- a/taskcluster/taskgraph/util/schema.py +++ b/taskcluster/taskgraph/util/schema.py @@ -12,7 +12,8 @@ import taskgraph from mozbuild import schedules -from .attributes import keymatch + +from .keyed_by import evaluate_keyed_by def validate_schema(schema, obj, msg_prefix): @@ -79,6 +80,7 @@ def resolve_keyed_by(item, field, item_name, **extra_values): would mutate item in-place to:: job: + test-platform: linux128 chunks: 12 The `item_name` parameter is used to generate useful error messages. @@ -109,46 +111,14 @@ def resolve_keyed_by(item, field, item_name, **extra_values): if subfield not in container: return item - value = container[subfield] - while True: - if not isinstance(value, dict) or len(value) != 1 or not value.keys()[0].startswith('by-'): - return item - keyed_by = value.keys()[0][3:] # strip off 'by-' prefix - key = extra_values[keyed_by] if keyed_by in extra_values else item.get(keyed_by) - alternatives = value.values()[0] - - if len(alternatives) == 1 and 'default' in alternatives: - # Error out when only 'default' is specified as only alternatives, - # because we don't need to by-{keyed_by} there. - raise Exception( - "Keyed-by '{}' unnecessary with only value 'default' " - "found, when determining item '{}' in '{}'".format( - keyed_by, field, item_name)) - - if key is None: - if 'default' in alternatives: - value = container[subfield] = alternatives['default'] - continue - else: - raise Exception( - "No attribute {} and no value for 'default' found " - "while determining item {} in {}".format( - keyed_by, field, item_name)) - - matches = keymatch(alternatives, key) - if len(matches) > 1: - raise Exception( - "Multiple matching values for {} {!r} found while " - "determining item {} in {}".format( - keyed_by, key, field, item_name)) - elif matches: - value = container[subfield] = matches[0] - continue - - raise Exception( - "No {} matching {!r} nor 'default' found while determining item {} in {}".format( - keyed_by, key, field, item_name)) + container[subfield] = evaluate_keyed_by( + value=container[subfield], + item_name="`{}` in `{}`".format(field, item_name), + attributes=dict(item, **extra_values), + ) + + return item # Schemas for YAML files should use dashed identifiers by default. If there are From 24f4ed9c753e8925756faae6bd3edec33dcbd28b Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Thu, 7 Mar 2019 04:20:36 +0000 Subject: [PATCH 47/48] Bug 1532710: [taskgraph] Move default branch priorities to graph config; r=dustin Differential Revision: https://phabricator.services.mozilla.com/D22127 --HG-- extra : moz-landing-system : lando --- taskcluster/ci/config.yml | 11 ++++++ taskcluster/taskgraph/config.py | 11 +++++- taskcluster/taskgraph/transforms/task.py | 45 ++++++------------------ 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/taskcluster/ci/config.yml b/taskcluster/ci/config.yml index 1bd8e1b88455f..df4d9ca21cf1f 100755 --- a/taskcluster/ci/config.yml +++ b/taskcluster/ci/config.yml @@ -246,3 +246,14 @@ partner-urls: by-release-level: production: 'git@github.com:mozilla-partners/mozilla-EME-free-manifest.git' staging: 'git@github.com:moz-releng-automation-stage/mozilla-EME-free-manifest.git' + + +task-priority: + by-project: + 'mozilla-release': 'highest' + 'mozilla-esr60': 'very-high' + 'mozilla-beta': 'high' + 'mozilla-central': 'medium' + 'autoland': 'low' + 'mozilla-inbound': 'low' + 'default': 'very-low' diff --git a/taskcluster/taskgraph/config.py b/taskcluster/taskgraph/config.py index ba4ce7dab4c61..3204fcd57fca8 100644 --- a/taskcluster/taskgraph/config.py +++ b/taskcluster/taskgraph/config.py @@ -58,6 +58,15 @@ # Mapping of scriptworker types to scopes they accept Required('worker-types'): {basestring: [basestring]} }, + Required('task-priority'): optionally_keyed_by('project', Any( + 'highest', + 'very-high', + 'high', + 'medium', + 'low', + 'very-low', + 'lowest', + )), Required('partner-urls'): { Required('release-partner-repack'): optionally_keyed_by('release-product', 'release-level', 'release-type', @@ -69,7 +78,7 @@ }) -@attr.s(frozen=True) +@attr.s(frozen=True, cmp=False) class GraphConfig(object): _config = attr.ib() root_dir = attr.ib() diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 776a67b12f844..f7d630884bd3c 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -22,6 +22,7 @@ from taskgraph.util.treeherder import split_symbol from taskgraph.transforms.base import TransformSequence from taskgraph.util.taskcluster import get_root_url +from taskgraph.util.keyed_by import evaluate_keyed_by from taskgraph.util.schema import ( validate_schema, Schema, @@ -284,37 +285,15 @@ def get_branch_repo(config): COALESCE_KEY = '{project}.{job-identifier}' SUPERSEDER_URL = 'https://coalesce.mozilla-releng.net/v1/list/{age}/{size}/{key}' -DEFAULT_BRANCH_PRIORITY = 'low' -BRANCH_PRIORITIES = { - 'mozilla-release': 'highest', - 'comm-esr60': 'highest', - 'mozilla-esr60': 'very-high', - 'mozilla-beta': 'high', - 'comm-beta': 'high', - 'mozilla-central': 'medium', - 'comm-central': 'medium', - 'comm-aurora': 'medium', - 'autoland': 'low', - 'mozilla-inbound': 'low', - 'try': 'very-low', - 'try-comm-central': 'very-low', - 'alder': 'very-low', - 'ash': 'very-low', - 'birch': 'very-low', - 'cedar': 'very-low', - 'cypress': 'very-low', - 'elm': 'very-low', - 'fig': 'very-low', - 'gum': 'very-low', - 'holly': 'very-low', - 'jamun': 'very-low', - 'larch': 'very-low', - 'maple': 'very-low', - 'oak': 'very-low', - 'pine': 'very-low', - 'graphics': 'very-low', - 'ux': 'very-low', -} + +@memoize +def get_default_priority(graph_config, project): + return evaluate_keyed_by( + graph_config['task-priority'], + "Graph Config", + {'project': project} + ) + # define a collection of payload builders, depending on the worker implementation payload_builders = {} @@ -1689,9 +1668,7 @@ def build_task(config, tasks): routes.append('coalesce.v1.' + key) if 'priority' not in task: - task['priority'] = BRANCH_PRIORITIES.get( - config.params['project'], - DEFAULT_BRANCH_PRIORITY) + task['priority'] = get_default_priority(config.graph_config, config.params['project']) tags = task.get('tags', {}) tags.update({ From 49207fb1b783cc5500a6ea0b592f3953b91d3a25 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Thu, 7 Mar 2019 04:25:40 +0000 Subject: [PATCH 48/48] Bug 1532890 - Get rid of CachedWeakPtr due to unused r=m_kato The class was created for Quantum Flow, but now, nobody uses it. Differential Revision: https://phabricator.services.mozilla.com/D22266 --HG-- extra : moz-landing-system : lando --- editor/libeditor/EditorBase.h | 58 ----------------------------------- 1 file changed, 58 deletions(-) diff --git a/editor/libeditor/EditorBase.h b/editor/libeditor/EditorBase.h index 49c5ce1f962de..e3244923b26c0 100644 --- a/editor/libeditor/EditorBase.h +++ b/editor/libeditor/EditorBase.h @@ -99,64 +99,6 @@ namespace widget { struct IMEState; } // namespace widget -/** - * CachedWeakPtr stores a pointer to a class which inherits nsIWeakReference. - * If the instance of the class has already been destroyed, this returns - * nullptr. Otherwise, returns cached pointer. - * If class T inherits nsISupports a lot, specify Base explicitly for avoiding - * ambiguous conversion to nsISupports. - */ -template -class CachedWeakPtr final { - public: - CachedWeakPtr() : mCache(nullptr) {} - explicit CachedWeakPtr(T* aObject) { - mWeakPtr = do_GetWeakReference(static_cast(aObject)); - mCache = aObject; - } - explicit CachedWeakPtr(const nsCOMPtr& aOther) { - mWeakPtr = do_GetWeakReference(static_cast(aOther.get())); - mCache = aOther; - } - explicit CachedWeakPtr(already_AddRefed& aOther) { - RefPtr other = aOther; - mWeakPtr = do_GetWeakReference(static_cast(other.get())); - mCache = other; - } - - CachedWeakPtr& operator=(T* aObject) { - mWeakPtr = do_GetWeakReference(static_cast(aObject)); - mCache = aObject; - return *this; - } - CachedWeakPtr& operator=(const nsCOMPtr& aOther) { - mWeakPtr = do_GetWeakReference(static_cast(aOther.get())); - mCache = aOther; - return *this; - } - CachedWeakPtr& operator=(already_AddRefed& aOther) { - RefPtr other = aOther; - mWeakPtr = do_GetWeakReference(static_cast(other.get())); - mCache = other; - return *this; - } - - bool IsAlive() const { return mWeakPtr && mWeakPtr->IsAlive(); } - - explicit operator bool() const { return mWeakPtr; } - operator T*() const { return get(); } - T* get() const { - if (mCache && !mWeakPtr->IsAlive()) { - const_cast*>(this)->mCache = nullptr; - } - return mCache; - } - - private: - nsWeakPtr mWeakPtr; - T* MOZ_NON_OWNING_REF mCache; -}; - #define kMOZEditorBogusNodeAttrAtom nsGkAtoms::mozeditorbogusnode #define kMOZEditorBogusNodeValue NS_LITERAL_STRING("TRUE")