From 1eafcb40c76a1edf47089827376f0f54b15e15ae Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Wed, 23 Dec 2015 11:50:05 -0800 Subject: [PATCH] Bug 1234813 - sendBeacon should not throw if blocked by Content Policy. r=rbarnes --- dom/base/Navigator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 265c3c26a17e..a4c178b74fee 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -1342,10 +1342,9 @@ Navigator::SendBeacon(const nsAString& aUrl, RefPtr beaconListener = new BeaconStreamListener(); rv = channel->AsyncOpen2(beaconListener); - if (NS_FAILED(rv)) { - aRv.Throw(rv); - return false; - } + // do not throw if security checks fail within asyncOpen2 + NS_ENSURE_SUCCESS(rv, false); + // make the beaconListener hold a strong reference to the loadgroup // which is released in ::OnStartRequest beaconListener->SetLoadGroup(loadGroup);