js/src/gdb/tests/test-Root.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

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

mercurial