ChildProcessHostDelegate doesn't make clear what ownership rules apply to
the process handle and as a result one of the implementations assume that
the caller has to delete the handle (ServiceUtilityProcessHost) while the
other one assumes that it does not (BrowserChildProcessHostImpl).
On the other hand, one caller closes the handle (ChildProcessHostImpl)
and the other does not (PpapiPluginProcessHost).
This CL enforces the API of not transfering ownership when getting the
process handle (as both implementations keep using the handle after they
receive the call).
BUG=417532
Review URL: https://codereview.chromium.org/725353003
Cr-Commit-Position: refs/heads/master@{#304664}
The early exit watcher holds on to a reference to the waitable event which ChildProcessLauncher::GetChildTerminationStatus deletes, so it should be stopped first.
BUG=424024
Review URL: https://codereview.chromium.org/658253002
Cr-Commit-Position: refs/heads/master@{#300518}
The main user (and the immediate reason for the change) is to improve handle
ownership in content::ChildProcessLauncher.
This CL is not enforcing clean ownership beyond ChildProcessLauncher; that is
to be covered by subsequent CLs.
BUG=417532
TEST=base_unittests
R=scottmg@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/651253002
Cr-Commit-Position: refs/heads/master@{#300180}
Relanding simonjam@'s CL https://codereview.chromium.org/41953002/ to enable QPC.
This may result in perf changes, the perf changes may only be in the measurements and not actual regressions.
BUG=158234
Review URL: https://codereview.chromium.org/429053002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286928 0039d316-1c4b-4281-b951-d872f2087c98
Adding an Init method to the Broadcaster, that gets invoked while initializing the host.
The Init method broadcasts the original on_power_battery value to the new processes.
BUG=153139
Review URL: https://codereview.chromium.org/401083002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284599 0039d316-1c4b-4281-b951-d872f2087c98
Normally a child process kills itself if it can't connect to the browser in 15 seconds. This is to prevent a child process from staying around if the browser crashed right after launching it but before connecting to it.
When browser tests are sharded, sometimes tests run slower because of resource starvation which is why we have longer timeouts. So increase the child process connection timeout to match this.
BUG=TODO
R=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/343543002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278812 0039d316-1c4b-4281-b951-d872f2087c98
Content should not have knowledge of NaCl. Moving per process NaCl debug
stub port information to NaClBrowser.
More explicitly distiquish between the case where the debug port is not yet
known versus when it is unused.
Switch debug port to being a per-process value (as it is).
This relands r270907 with a fix to make it work with disable_nacl=1
and therefore ASAN.
BUG=None
TEST=trybots
R=jam@chromium.org,sehr@chromium.org
Review URL: https://codereview.chromium.org/286143010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271133 0039d316-1c4b-4281-b951-d872f2087c98
Content should not have knowledge of NaCl. Moving per process NaCl debug
stub port information to NaClBrowser.
More explicitly distiquish between the case where the debug port is not yet
known versus when it is unused.
Switch debug port to being a per-process value (as it is).
BUG=None
TEST=trybots
R=jam@chromium.org
Review URL: https://codereview.chromium.org/286993006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270907 0039d316-1c4b-4281-b951-d872f2087c98
See
https://docs.google.com/document/d/1H-hCsIcMsAEP0fWHimbuiNA-Hc9eXEmR94eb-2RQAhA/edit?usp=sharing
for background.
This moves all process type dependent decisions on how to create
Linux processes (not how to sandbox them once created, not Android)
into the launch delegates and makes the arguments to the
ChildProcessLauncher constructor and
BrowserChildProcessHostImpl::Launch OS independent.
BUG=none
Review URL: https://codereview.chromium.org/177863002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256802 0039d316-1c4b-4281-b951-d872f2087c98
- Remove DCHECK in non-official-release build by default
- Gyp variable dcheck_always_on=1 (existing) forces to enable DCHECK
in release build
- Remove flag --enable-dcheck
Other effects/notes:
- Now allow "buildtype=Official dcheck_always_on=1" (which will
enable DCHECK in official build) combination.
- Gyp variable logging_like_official_build no longer has an effect
- Leave DCHECK_IS_ON() unchanged. May deal with it in a later change
if needed.
This won't affect bots which use dcheck_always_on=1.
BUG=350462
TEST=LoggingTest.Dcheck
R=thakis@chromium.org
TBR=darin,sehr (command line changes in components/nacl and mojo)
Review URL: https://codereview.chromium.org/189603007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255987 0039d316-1c4b-4281-b951-d872f2087c98
IPCs to the utility process will be filtered when it is running elevated.
BUG=331881
Review URL: https://codereview.chromium.org/98603007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250409 0039d316-1c4b-4281-b951-d872f2087c98
Assigning the first NaCl module to load to port 4014, allowing other to be
dynamic, using a code path currently used for testing.
Expose the port used by each module in the Task Manager UI to make it available
to users debugging NaCl modules.
Follow on changes will add extension api fields to make debuggable modules
discoverable to a web based debugger.
NOTE: The debug stub port on windows is opened at a different layer (inside nacl, only availabled with --disable-sandbox). This will be exposed in a follow on change.
Reviewers:
yoshiki@chromium.org (for task_manager)
pkasting@chromium.org (for browser/ui)
brettw@chromium.org (for content)
noelallen@chromium.org (for nacl)
BUG=328714
TEST=trybots
R=yoshiki@chromium.org,pkasting@chromium.org,brettw@chromium.org,noelallen@chromium.org
Review URL: https://codereview.chromium.org/102073008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244041 0039d316-1c4b-4281-b951-d872f2087c98
Speculative revert. Appears to be causing problems on webgl gpu bots
(unsure of root cause), and possible some XP test bots (TimeTicks::Now
non-monotonic).
TBR=awong@chromium.org, kbr@chromium.org, simonjam@chromium.org
BUG=311646
> Use HighResNow whenever possible on Windows.
>
> This has been enabled on Canary channel for sometime now and seems to be
> safe there. We also now have data from stable channel showing there are
> no unexpectedly buggy CPUs out there. This should be safe to turn on for
> all users with adequate CPUs, which is the majority of them.
>
> BUG=158234
>
> Review URL: https://codereview.chromium.org/41953002TBR=simonjam@chromium.org
Review URL: https://codereview.chromium.org/45783003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231152 0039d316-1c4b-4281-b951-d872f2087c98
This has been enabled on Canary channel for sometime now and seems to be
safe there. We also now have data from stable channel showing there are
no unexpectedly buggy CPUs out there. This should be safe to turn on for
all users with adequate CPUs, which is the majority of them.
BUG=158234
Review URL: https://codereview.chromium.org/41953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230968 0039d316-1c4b-4281-b951-d872f2087c98
This should be unnoticeable, except for improved resolution in places such as window.performance.now().
The feature is enabled if the user is running Canary channel or has manually specified the --enable-high-resolution-time flag. This will only work if the CPU has a non-stop TSC and isn't a broken Athlon processor. UMA data show this is a safe combination.
The flag is propagated to renderer processes so that they know to enable it too.
BUG=158234
Review URL: https://chromiumcodereview.appspot.com/23147002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222396 0039d316-1c4b-4281-b951-d872f2087c98
This changes the input from a vector to a map and just adds the map on the LaunchOptions rather than requiring the caller to set a pointer. This cleans up the callsites somewhat.
BUG=
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/22750002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220608 0039d316-1c4b-4281-b951-d872f2087c98
This makes BrowserChildProcessHost::GetTerminationStatus() similar to
RenderProcessHostImpl::GetChildTerminationStatus().
Linux requires waitpid() to block to get an exit status reliably. Otherwise
the kernel is at liberty to not reap the process, even if it's already currently
exiting or dead.
If we know that a process is dead, we should make use of the known_dead
argument to ChildProcessLauncher::GetChildTerminationStatus(), as does
RenderProcessHostImpl::GetChildTerminationStatus().
A discussion of this tricky issue is available in crbug.com/157458 and the
related CL.
This will, among other things, fix NaCl's crash throttling security measure.
BUG=274827,nativeclient:359
R=mseaborn@chromium.org, piman@chromium.org
Review URL: https://codereview.chromium.org/23019012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219814 0039d316-1c4b-4281-b951-d872f2087c98
This should be unnoticeable, except for improved resolution in places such as window.performance.now().
The feature is enabled if the user is running Canary channel or has manually specified the --enable-high-resolution-time flag. This will only work if the CPU has a non-stop TSC and isn't a broken Athlon processor. UMA data show this is a safe combination.
The flag is propagated to renderer processes so that they know to enable it too.
BUG=158234
Review URL: https://chromiumcodereview.appspot.com/16896018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217172 0039d316-1c4b-4281-b951-d872f2087c98
This patch gets rid of the cc-only trace-to-vlog stuff and replaces it with a
general trace-to-console approach that can be used everywhere, even the
browser.
BUG=None
Review URL: https://chromiumcodereview.appspot.com/18174006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211245 0039d316-1c4b-4281-b951-d872f2087c98
This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.
BUG=
TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199840
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200932
Review URL: https://chromiumcodereview.appspot.com/14137016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203272 0039d316-1c4b-4281-b951-d872f2087c98
We need a place to put code that is shared between child processes of different
types but not used in the browser process. For instance, the NPObject bindings
code is used in the plugin and renderer processes but depends on WebBindings
which the browser shouldn't depend on. Some web platform features require shared
code between renderer and worker processe. The WebKit image decoders are used
by worker, renderer and utility processes.
This creates a content/common_child directory for code shared by more than one
child process type. content/common_child can depend on content/common and all
content/ subdirs except for content/browser and content/common can depend on it.
The java bridge code is (more than a) bit busted since it pulls the NPObject
bindings in to the browser, but since this code is only intended for use on
android single-process configurations I've just created DEPS exceptions for
this bit of code.
BUG=241606
Review URL: https://chromiumcodereview.appspot.com/15047014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201252 0039d316-1c4b-4281-b951-d872f2087c98
> Lower the priority of shared workers that aren't associated with the foreground tab.
>
> This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.
>
> BUG=
> TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199840
>
> Review URL: https://chromiumcodereview.appspot.com/14137016TBR=simonhatch@chromium.org
Review URL: https://codereview.chromium.org/15465006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201090 0039d316-1c4b-4281-b951-d872f2087c98
This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.
BUG=
TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199840
Review URL: https://chromiumcodereview.appspot.com/14137016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200932 0039d316-1c4b-4281-b951-d872f2087c98
> Lower the priority of shared workers that aren't associated with the foreground tab.
>
> This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.
>
> BUG=
> TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.
>
> Review URL: https://chromiumcodereview.appspot.com/14137016TBR=simonhatch@chromium.org
Review URL: https://codereview.chromium.org/15012025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199847 0039d316-1c4b-4281-b951-d872f2087c98
This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.
BUG=
TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.
Review URL: https://chromiumcodereview.appspot.com/14137016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199840 0039d316-1c4b-4281-b951-d872f2087c98
In r174057, ajwong@ added support for implicit testing to scoped_ptr<>. Removes
these in content/.
BUG=232084
Review URL: https://codereview.chromium.org/14081010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194608 0039d316-1c4b-4281-b951-d872f2087c98
Also move the NaCl command line switches to chrome.
BUG=191682
Review URL: https://codereview.chromium.org/12662019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189763 0039d316-1c4b-4281-b951-d872f2087c98
-remove NaCl sandbox rules from content
-remove the hack for ifdef'ing out the GPU policy since it didn't link for nacl64.exe
-remove the 1GB memory reservation for the NaCl loader process out of content
Other cleanup:
-renamed sandbox_policy.* to sandbox_win.* to match the other platform-specific sandbox files
-moved BrokerGetFileHandleForProcess to internal content files since it's not called from outside
-remove AddGpuDllEvictionPolicy since it was redundant (the one dll it removed was already listed in the generic list)
There's still more cleanup to be done in the sandbox code (i.e. remove chrome frame switch, nacl process type switch etc). I will do that in future changes.
BUG=191682
Review URL: https://codereview.chromium.org/12805004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189175 0039d316-1c4b-4281-b951-d872f2087c98
When a child process crashes, this is generally detected by an error on the IPC channel, i.e. OnChannelError being called. However, if the child process exits or crashes before this IPC channel has been established, the crash is lost. The browser process sees the child process being launched but never learns of its termination.
This patch uses a WaitableEventWatcher to track the lifetime of the child process up to the point the IPC channel is connected. If the child process crashes in the interim, the usual OnProcessCrashed handler is invoked.
This is important for the GPU child process because it is prone to crashing before the IPC channel is established; it has to initialize Direct3D before the sandbox is turned on. This would lead to a browser hang if Direct3D or the driver crashed during initialization.
BUG=177611
Review URL: https://chromiumcodereview.appspot.com/12374061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186498 0039d316-1c4b-4281-b951-d872f2087c98
If the browser calls ProcessDied() and asks the Zygote to wait (without blocking)
on a dead process, the kernel might not be done destroying it and the Zygote may
mistakenly claim that the process is alive.
We now inform the Zygote over the IPC that the process is already dead so
that it can wait synchroneously.
BUG=157458
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11316261
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171450 0039d316-1c4b-4281-b951-d872f2087c98