Pier Angelo Vendrame pushed to branch mullvad-browser-140.6.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser

Commits:

3 changed files:

Changes:

  • dom/base/StructuredCloneHolder.cpp
    ... ... @@ -1110,7 +1110,7 @@ JSObject* StructuredCloneHolder::CustomReadHandler(
    1110 1110
         return ClonedErrorHolder::ReadStructuredClone(aCx, aReader, this);
    
    1111 1111
       }
    
    1112 1112
     
    
    1113
    -  if (VideoFrame::PrefEnabled() && aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1113
    +  if (VideoFrame::PrefEnabled(aCx) && aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1114 1114
           CloneScope() == StructuredCloneScope::SameProcess &&
    
    1115 1115
           aCloneDataPolicy.areIntraClusterClonableSharedObjectsAllowed()) {
    
    1116 1116
         JS::Rooted<JSObject*> global(aCx, mGlobal->GetGlobalJSObject());
    
    ... ... @@ -1250,7 +1250,7 @@ bool StructuredCloneHolder::CustomWriteHandler(
    1250 1250
       }
    
    1251 1251
     
    
    1252 1252
       // See if this is a VideoFrame object.
    
    1253
    -  if (VideoFrame::PrefEnabled()) {
    
    1253
    +  if (VideoFrame::PrefEnabled(aCx)) {
    
    1254 1254
         VideoFrame* videoFrame = nullptr;
    
    1255 1255
         if (NS_SUCCEEDED(UNWRAP_OBJECT(VideoFrame, &obj, videoFrame))) {
    
    1256 1256
           SameProcessScopeRequired(aSameProcessScopeRequired);
    
    ... ... @@ -1446,7 +1446,7 @@ StructuredCloneHolder::CustomReadTransferHandler(
    1446 1446
                                                 aReturnObject);
    
    1447 1447
       }
    
    1448 1448
     
    
    1449
    -  if (VideoFrame::PrefEnabled() && aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1449
    +  if (VideoFrame::PrefEnabled(aCx) && aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1450 1450
           CloneScope() == StructuredCloneScope::SameProcess &&
    
    1451 1451
           aCloneDataPolicy.areIntraClusterClonableSharedObjectsAllowed()) {
    
    1452 1452
         MOZ_ASSERT(aContent);
    
    ... ... @@ -1591,7 +1591,7 @@ StructuredCloneHolder::CustomWriteTransferHandler(
    1591 1591
             return true;
    
    1592 1592
           }
    
    1593 1593
     
    
    1594
    -      if (VideoFrame::PrefEnabled()) {
    
    1594
    +      if (VideoFrame::PrefEnabled(aCx)) {
    
    1595 1595
             VideoFrame* videoFrame = nullptr;
    
    1596 1596
             rv = UNWRAP_OBJECT(VideoFrame, &obj, videoFrame);
    
    1597 1597
             if (NS_SUCCEEDED(rv)) {
    
    ... ... @@ -1758,7 +1758,7 @@ void StructuredCloneHolder::CustomFreeTransferHandler(
    1758 1758
         return;
    
    1759 1759
       }
    
    1760 1760
     
    
    1761
    -  if (VideoFrame::PrefEnabled() && aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1761
    +  if (aTag == SCTAG_DOM_VIDEOFRAME &&
    
    1762 1762
           CloneScope() == StructuredCloneScope::SameProcess) {
    
    1763 1763
         if (aContent) {
    
    1764 1764
           VideoFrame::TransferredData* data =
    
    ... ... @@ -1767,8 +1767,7 @@ void StructuredCloneHolder::CustomFreeTransferHandler(
    1767 1767
         }
    
    1768 1768
         return;
    
    1769 1769
       }
    
    1770
    -  if (StaticPrefs::dom_media_webcodecs_enabled() &&
    
    1771
    -      aTag == SCTAG_DOM_AUDIODATA &&
    
    1770
    +  if (aTag == SCTAG_DOM_AUDIODATA &&
    
    1772 1771
           CloneScope() == StructuredCloneScope::SameProcess) {
    
    1773 1772
         if (aContent) {
    
    1774 1773
           AudioData::TransferredData* data =
    
    ... ... @@ -1851,7 +1850,7 @@ bool StructuredCloneHolder::CustomCanTransferHandler(
    1851 1850
         }
    
    1852 1851
       }
    
    1853 1852
     
    
    1854
    -  if (VideoFrame::PrefEnabled()) {
    
    1853
    +  if (VideoFrame::PrefEnabled(aCx)) {
    
    1855 1854
         VideoFrame* videoframe = nullptr;
    
    1856 1855
         nsresult rv = UNWRAP_OBJECT(VideoFrame, &obj, videoframe);
    
    1857 1856
         if (NS_SUCCEEDED(rv)) {
    

  • dom/media/webcodecs/VideoFrame.h
    ... ... @@ -104,7 +104,7 @@ class VideoFrame final : public nsISupports,
    104 104
       JSObject* WrapObject(JSContext* aCx,
    
    105 105
                            JS::Handle<JSObject*> aGivenProto) override;
    
    106 106
     
    
    107
    -  static bool PrefEnabled(JSContext* aCx = nullptr, JSObject* aObj = nullptr);
    
    107
    +  static bool PrefEnabled(JSContext* aCx, JSObject* aObj = nullptr);
    
    108 108
     
    
    109 109
       static already_AddRefed<VideoFrame> Constructor(
    
    110 110
           const GlobalObject& aGlobal, HTMLImageElement& aImageElement,
    

  • toolkit/components/resistfingerprinting/nsRFPService.cpp
    ... ... @@ -2708,8 +2708,10 @@ bool nsRFPService::IsWebCodecsRFPTargetEnabled(JSContext* aCx) {
    2708 2708
       // We know that the RFPTarget::WebCodecs is enabled, check if principal
    
    2709 2709
       // is exempted.
    
    2710 2710
     
    
    2711
    -  // VideoFrame::PrefEnabled function can be called without a JSContext.
    
    2712
    -  if (!aCx) {
    
    2711
    +  if (NS_WARN_IF(!aCx)) {
    
    2712
    +    MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
    
    2713
    +            ("nsRFPService::IsWebCodecsRFPTargetEnabled called with null "
    
    2714
    +             "JSContext"));
    
    2713 2715
         return true;
    
    2714 2716
       }
    
    2715 2717