js/src/jit-test/tests/debug/onNewScript-off-main-thread.js

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 // We still get onNewScript notifications for code compiled off the main thread.
     3 if (workerThreadCount() === 0)
     4   quit(0);
     6 var g = newGlobal();
     7 var dbg = new Debugger(g);
     9 var log;
    10 dbg.onNewScript = function (s) {
    11   log += 's';
    12   assertEq(s.source.text, '"t" + "wine"');
    13 }
    15 log = '';
    16 g.offThreadCompileScript('"t" + "wine"');
    17 assertEq(g.runOffThreadScript(), 'twine');
    18 assertEq(log, 's');

mercurial