This prevents the child process from downgrading its CPU priority when
it notices that it has the CPU wake lock but no "critical" frames.
In this patch we also reduce the scope of a race condition which occurs
when we don't launch a new process for an app. In this case, we still
need to set the child process's priority and then check that the process
is still alive.
Because this isn't a brand-new process, it's possible that the process
will downgrade its priority (e.g. due to a timer) after we check that
it's still alive and before it notices that we've acquired the CPU wake
lock on its behalf. This patch does not resolve that race.
Previously, it was possible to return a dead preallocated process. This
patch eliminates or at least significantly reduces the likelihood of
this race.
--HG--
extra : rebase_source : f51022581edbdee8b72a8a56e296b6706bf1d165
Bug 821192, part 1: Fix the watchdog timeout code. r=dhylands
Bug 821192, part 2: Add an interface to join all live content processes. r=bent
Bug 821192, part 3: Join all subprocesses before restarting the main process, when we're e.g. about to apply an update. r=dhylands
This is a rollup of the following patches
Bug 811315, part 0.9: Fix pre-existing race condition that allows dying ContentParents to accidentally try to load new TabParents. r=jlebar
Bug 811315, part 0.91: Fix another pre-existing race condition where FirstIdle might run after ContentChild::ActorDestroy(). r=jlebar
Bug 811315, part 1: Make "browser" process limit infinite and unload the processes when all tabs are closed. Firefox with process-per-tab! r=jlebar
Bug 811315, part 2: Pass scrolling-behavior hint down into TabParent instead of inferring it from app/browser. r=jlebar
Bug 811315, part 3: Add a mozasyncpanzoom attribute for iframes and honor it when constructing a remote frame. r=jlebar sr=roc
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.