Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <meta charset=utf-8> |
michael@0 | 3 | <title>Test that we don't DCE functions that can throw</title> |
michael@0 | 4 | <script src="/resources/testharness.js"></script> |
michael@0 | 5 | <script src="/resources/testharnessreport.js"></script> |
michael@0 | 6 | <div id="log"></div> |
michael@0 | 7 | <script> |
michael@0 | 8 | test(function() { |
michael@0 | 9 | function test(root) { |
michael@0 | 10 | var threw = false; |
michael@0 | 11 | try { |
michael@0 | 12 | root.querySelectorAll(""); |
michael@0 | 13 | } catch(e){ threw = true; }; |
michael@0 | 14 | // Hot loop to make sure the JIT heuristics ion-compile this function even |
michael@0 | 15 | // though it's throwing exceptions (which would normally make us back off |
michael@0 | 16 | // of ion compilation). |
michael@0 | 17 | for (var i=0; i<1500; i++) {} |
michael@0 | 18 | return threw; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | var threw = false; |
michael@0 | 22 | var el = document.createElement("div"); |
michael@0 | 23 | for (var i=0; i<200; i++) |
michael@0 | 24 | threw = test(el); |
michael@0 | 25 | assert_true(threw); |
michael@0 | 26 | }, "Shouldn't optimize away throwing functions"); |
michael@0 | 27 | </script> |