Bug 870043 - Factor the watchdog machinery into a helper class. r=mrbkap

This is a long-overdue change in general. It's now particularly necessary
because we want to start and stop the watchdog, potentially multiple times
during a session. Encapsulating this into a class that we can
destroy/instantiate several times means that we don't end up with inconsistent
state.

As a nice bonus, this centralizes the whole setup and makes it easier to
comprehend. I actually had this nicely split up into several patches, but
I accidentally squashed them while rebasing. :-(
Bug 870043 - Add a script-accessible statistics for various watchdog events. r=mrbkap

We need this even for testing wakeups, because we can't be certain that any
given operation callback was necessarily triggered from the watchdog thread
(since it's triggered from within the JS engine in various cases as well).
Bug 870043 - Add support for scripted operation callbacks in XPCShell. r=mrbkap
Bug 870043 - Add a way to simulate the JSRuntime activity callback from xpcshell. r=mrbkap

The JS engine fires this callback when the request count drops to zero, and we
use it determine when we should hibernate the watchdog thread. But since the
request count never drops to zero for nested event loops, the watchdog never
runs in those cases. And since our xpcshell harness runs tests in a nested event
loop, this means we can't test watchdog hibernation from xpcshell. And we don't
want to test it in mochitests, because the non-determinism of timer CCs and GCs
are likely to be problematic.

Really, we should consider finding a way to integrate nested event loops into
the activity callback mechanism, and should probably get a bug on file. But such
a task is out of scope for this bug, so we just add a way to fake it.
Bug 870043 - Watchdog tests. r=mrbkap
Bug 870043 - Disable the watchdog on b2g. r=mrbkap
Bug 897574 - Fix GGC opt build failure; r=sfink

--HG--
extra : rebase_source : 1a5f5f1eef09241960b1ba08e4c52b820b55b66b
Bug 896292: Mark widget/gtk2 as FAIL_ON_WARNINGS. r=karlt r=gps
Bug 886587 - Remove profile migrator, r=gcp, f=rnewman
Bug 303896 - Turn on displaying the selection when the 'disabled' attr is removed if the element has focus.  r=ehsan
Bug 303896 - Refactor AttributeChanged() to follow code style and make it easier to read (no functional change).  r=ehsan
Bug 896429 - Signaling: dynamically create SDP config r=abr
Bug 897701: Don't entrain the target of the pan longer than necessary. r=jlebar
Bug 891932 - process the pending spdy transaction queue in order r=mcmanus
Bug 890773 - Compute -x-text-zoom properly. r=dbaron
Bug 876946: Never return null from Proxy::className, even if we're over-recursed.
Bug 895940 - Mirror mozbase to m-c, r=jhammel
Bug 867946: fix bug number in push comment DONTBUILD r=me
Backout 04bde6c5fb16 (bug 896292) for PGO-only build bustage on a CLOSED TREE
Bug 897789 - Add a fuzz factor to watchdog tests. r=Waldo
CLOSED TREE