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 | #include "gdb-tests.h" |
michael@0 | 2 | #include "jsapi.h" |
michael@0 | 3 | |
michael@0 | 4 | FRAGMENT(Root, null) { |
michael@0 | 5 | JS::Rooted<JSObject *> null(cx, nullptr); |
michael@0 | 6 | |
michael@0 | 7 | breakpoint(); |
michael@0 | 8 | |
michael@0 | 9 | (void) null; |
michael@0 | 10 | } |
michael@0 | 11 | |
michael@0 | 12 | void callee(JS::Handle<JSObject *> obj, JS::MutableHandle<JSObject *> mutableObj) |
michael@0 | 13 | { |
michael@0 | 14 | // Prevent the linker from unifying this function with others that are |
michael@0 | 15 | // equivalent in machine code but not type. |
michael@0 | 16 | fprintf(stderr, "Called " __FILE__ ":callee\n"); |
michael@0 | 17 | breakpoint(); |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | FRAGMENT(Root, handle) { |
michael@0 | 21 | JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx)); |
michael@0 | 22 | callee(global, &global); |
michael@0 | 23 | (void) global; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | FRAGMENT(Root, HeapSlot) { |
michael@0 | 27 | JS::Rooted<jsval> plinth(cx, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "plinth"))); |
michael@0 | 28 | JS::Rooted<JSObject *> array(cx, JS_NewArrayObject(cx, plinth)); |
michael@0 | 29 | |
michael@0 | 30 | breakpoint(); |
michael@0 | 31 | |
michael@0 | 32 | (void) plinth; |
michael@0 | 33 | (void) array; |
michael@0 | 34 | } |