summaryrefslogtreecommitdiffstats
path: root/base/process_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Linux: about:memoryagl@chromium.org2009-09-011-0/+9
| | | | | | | | | | | | | (based on http://code.google.com/p/chromium/issues/detail?id=16251) Add about:memory support to Linux. Rather than try and copy the Windows output, we use a couple of metrics which make more sense on Linux: USS and PSS. http://codereview.chromium.org/177024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24979 0039d316-1c4b-4281-b951-d872f2087c98
* Port some of the base module to FreeBSD. Extracted fromwtc@chromium.org2009-08-311-7/+7
| | | | | | | | | | | | | | http://codereview.chromium.org/172032. The patch is contributed by Ben Laurie of Google. Original review URL: http://codereview.chromium.org/180037 R=wtc BUG=none TEST=none Review URL: http://codereview.chromium.org/183016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24950 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the Mac-specific implementation of LaunchApp, and share the Linux ↵stuartmorgan@google.com2009-08-061-2/+1
| | | | | | | | | | | | | version. Fixes a race condition with file descriptors, and gives the Mac access to the environment-alterning version of LaunchApp BUG=11174 TEST=Launching render/plugin/utility processes should still work on the Mac Review URL: http://codereview.chromium.org/165067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22649 0039d316-1c4b-4281-b951-d872f2087c98
* Set GTK_PATH to CHROMIUM_SAVED_GTK_PATH before launching xdg-open.thestig@chromium.org2009-07-211-1/+11
| | | | | | | | | | | | Wrappers that launch Chromium will need to set CHROMIUM_SAVED_GTK_PATH before modifying GTK_PATH. This can be done later in separate CLs. BUG=15565 TEST=see bug Review URL: http://codereview.chromium.org/159112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21168 0039d316-1c4b-4281-b951-d872f2087c98
* Fix comment for posix LaunchApp wrt PATH searching.mattm@chromium.org2009-07-171-2/+2
| | | | | | | | | | | (Behavior was changed in r4515 but the comment wasn't updated to match.) BUG=none TEST=none Review URL: http://codereview.chromium.org/159022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20983 0039d316-1c4b-4281-b951-d872f2087c98
* Consistently use int64 for integers holding number of milliseconds.phajdan.jr@chromium.org2009-06-171-4/+4
| | | | | | | | | | This applies only to things which use TimeDelta::InMilliseconds, because it returns int64. Before this patch callers static_casted that to int, and after this patch they use the returned value as int64. Review URL: http://codereview.chromium.org/126279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18626 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: refactor zygote supportagl@chromium.org2009-06-121-8/+0
| | | | | | | | | | | | | | | | | | | http://code.google.com/p/chromium/wiki/LinuxZygote * Move Chrome specific bits out of base * Move away from the idea of reserved file descriptors (which don't really work with zygotes) * Load resources before forking renderers (means that we don't need communication between the zygote process and the renderers) * Make sure that gdb works against the browser again * Make sure that we have different ASLR between the renderers and the browser. http://codereview.chromium.org/119335 (This is a reland. First landed in r18109, reverted in r18112.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18291 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 18159 since it wasn't using all the data it should be.thomasvl@chromium.org2009-06-111-4/+4
| | | | | | | | | TEST=none BUG=none TBR=mark Review URL: http://codereview.chromium.org/123016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18160 0039d316-1c4b-4281-b951-d872f2087c98
* Some basic memory api support that is needed for perf tests and i think the ↵thomasvl@chromium.org2009-06-111-4/+4
| | | | | | | | | | task window. BUG=none TEST=perf bots should have memory numbers now like linux. Review URL: http://codereview.chromium.org/118436 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18159 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 18109, 18111: Windows UI tests failed.agl@chromium.org2009-06-101-0/+8
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18112 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: refactor zygote supportagl@chromium.org2009-06-101-8/+0
| | | | | | | | | | | | | | | | | | http://code.google.com/p/chromium/wiki/LinuxZygote * Move Chrome specific bits out of base * Move away from the idea of reserved file descriptors (which don't really work with zygotes) * Load resources before forking renderers (means that we don't need communication between the zygote process and the renderers) * Make sure that gdb works against the browser again * Make sure that we have different ASLR between the renderers and the browser. http://codereview.chromium.org/119335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18109 0039d316-1c4b-4281-b951-d872f2087c98
* Enable zygote manager by default.dkegel@google.com2009-06-081-0/+9
| | | | | | | | | | | | | | Fix broken recursion check. Make OpenFile warning less scary, indicate it's normal at start of ui tests. Make ui tests pass. Avoid generating extra code on Mac. BUG=11841 TEST=start the browser, then make chrome and all .pak files unreadable; or alternately, start an installed browser, and uninstall the browser while it's running. Then create a new tab and browse to two new sites. Review URL: http://codereview.chromium.org/119289 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17909 0039d316-1c4b-4281-b951-d872f2087c98
* Prototype implementation of zygotes. dkegel@google.com2009-06-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limitations that need addressing still: - Doesn't forcibly terminate children that should have exited but haven't Enable with env var ENABLE_ZYGOTE_MANAGER=1. BUG=11841 TEST= start the browser, then make chrome and all .pak files unreadable; or alternately, start an installed browser, and uninstall the browser while it's running. Then create a new tab and browse to two new sites. Here's an example script to hide and unhide the .pak files (note: do not move the directory they're in, that doesn't work): #!/bin/sh chmod_all() { chmod $1 sconsbuild/Debug/chrome for path in . locales obj/chrome/app/intermediate/repack obj/global_intermediate/* themes do chmod $1 sconsbuild/Debug/$path/*.pak done } case $1 in hide) chmod_all 000 ;; show) chmod_all 755 ;; esac Review URL: http://codereview.chromium.org/115773 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17840 0039d316-1c4b-4281-b951-d872f2087c98
* Harmonizing ProcessUtil::GetAppOutput on Win/Unixjcampan@chromium.org2009-06-041-8/+0
| | | | | | | | BUG=None TEST=Run the base unit-tests Review URL: http://codereview.chromium.org/119190 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17660 0039d316-1c4b-4281-b951-d872f2087c98
* Add memory stats for linux page cycler. On linux, we collecttc@google.com2009-05-111-2/+6
| | | | | | | | | the final RSS size and the total VM size. Review URL: http://codereview.chromium.org/113217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15814 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Add code for shuffling file descriptors.agl@chromium.org2009-04-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When forking a child process, one often wants to move existing file descriptors to well known locations (stdout, stderr etc). However, this is a process bedeviled with corner cases. Consider the case where you open two file descriptors, get assigned fds 1 and 0 for them and wish to shuffle them so that they end up in slots 0 and 1. Our current code fails in this case. We also have a problem where we're currently trying to mark file descriptors as close-on-exec rather than closing them in the child process. This is inherently broken in a multithreaded process where another thread can open a file descriptor and race the loop which is trying to mark them. Thus, on Linux we switch to close-after-fork where we known that no other threads exist in the process. On Mac, the code is sufficiently different that this simple fix isn't applicable and one of the Mac folks will need to take a look. http://codereview.chromium.org/100127 BUG=11174 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14978 0039d316-1c4b-4281-b951-d872f2087c98
* Make task_manager_resource_providers.cc compile on POSIX.phajdan.jr@chromium.org2009-04-301-0/+6
| | | | | | | | TEST=Make sure that the task manager isn't obviously broken on Windows. Review URL: http://codereview.chromium.org/93067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14934 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: don't spawn zombies.agl@chromium.org2009-04-281-3/+7
| | | | | | | | | http://codereview.chromium.org/93147 BUG=9401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14705 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "POSIX: Don't spawn zombies." (r14488)agl@chromium.org2009-04-241-7/+3
| | | | | | | | Something else is trying to reap children in the ui_tests and causing a mess. Reverting since it's a Friday night. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14499 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Don't spawn zombies.agl@chromium.org2009-04-241-3/+7
| | | | | | | | TEST=Navigate to several different sites and check that no Chrome zombies are roaming around. BUG=9401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14488 0039d316-1c4b-4281-b951-d872f2087c98
* This CL adds a utility method that lets you start a process and block until ↵jcampan@chromium.org2009-04-211-5/+11
| | | | | | | | | | | | | the process terminates, and retrieve what the process printed to the standard output. That util function is needed for the new in-process test framework. It is Windows only for now. BUG=None TEST=Covered by new unit test. Review URL: http://codereview.chromium.org/87008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14135 0039d316-1c4b-4281-b951-d872f2087c98
* More solid detection of browser process in chrome_process_util_linux.cc:phajdan.jr@chromium.org2009-04-211-3/+4
| | | | | | | | | | | | | | | | - use GetAppOutput instead of popen - make unexpected conditions fatal (otherwise the tests using this code would mistakenly assume that there is no running browser process) Also add a constant for SingletonSocket. Make necessary adjustments to GetAppOutput - ignore stderr (because fuser prints the file name to stderr and having stderr in |output| would require more parsing). Review URL: http://codereview.chromium.org/77031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14091 0039d316-1c4b-4281-b951-d872f2087c98
* Add GetAppOutput function, a better replacement for popen.phajdan.jr@chromium.org2009-04-171-0/+8
| | | | | | | | | | | | It will replace popen call in chrome_process_util_linux. I don't see much benefit in having a Windows implementation (not many useful programs you can launch and get output), so POSIX-only. Review URL: http://codereview.chromium.org/67226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13920 0039d316-1c4b-4281-b951-d872f2087c98
* Make OpenProcessHandle report an error when it couldn't open the handle.phajdan.jr@chromium.org2009-04-031-2/+2
| | | | | | | | One more step to land http://codereview.chromium.org/54003 (chrome_process_util). Review URL: http://codereview.chromium.org/62004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13086 0039d316-1c4b-4281-b951-d872f2087c98
* Use portable typedef for PIDs (process IDs).phajdan.jr@chromium.org2009-04-011-5/+5
| | | | | | | | | This is a preparation to land http://codereview.chromium.org/54003, which replaces chrome_process_filter with more portable chrome_process_util. Review URL: http://codereview.chromium.org/57062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12948 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in chrome/browserphajdan.jr@chromium.org2009-03-251-8/+8
| | | | | | | | | | - make more things const - remove unreferenced declaration of GetGoButton - fix indentation in one place Review URL: http://codereview.chromium.org/53053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12475 0039d316-1c4b-4281-b951-d872f2087c98
* Make UITest::CrashAwareSleep portable.phajdan.jr@chromium.org2009-03-041-0/+4
| | | | | | Review URL: http://codereview.chromium.org/40119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10916 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-2/+2
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the windows implementation of KillProcess and WaitForSingleProcess to ↵stoyan@chromium.org2009-02-091-2/+2
| | | | | | | | not close the process handle that they do not own. Review URL: http://codereview.chromium.org/24004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9400 0039d316-1c4b-4281-b951-d872f2087c98
* Make ResourceMessageFilter compile on Mac. It stubs out a substantial part ofbrettw@google.com2009-02-061-0/+7
| | | | | | | | | the printing. It creates new base functions for converting PIDs to handles, and then closing them (since Windows requires this). This also fixes the formatting of image_util. Review URL: http://codereview.chromium.org/20109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9291 0039d316-1c4b-4281-b951-d872f2087c98
* Implement NamedProcessIterator in base/process_util_mac.mm. Patch by Naokimark@chromium.org2009-02-051-3/+9
| | | | | | | | | Takano <takano.naoki@gmail.com> Review URL: http://codereview.chromium.org/18192 Review URL: http://codereview.chromium.org/21097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9263 0039d316-1c4b-4281-b951-d872f2087c98
* Add routine to close file descriptors on execjeremy@chromium.org2009-01-291-3/+3
| | | | | | | | for linux and mac. See BUG 6598. Review URL: http://codereview.chromium.org/18801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8892 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r8560 due to broken interactive_ui_testsmark@chromium.org2009-01-231-3/+0
| | | | | | Review URL: http://codereview.chromium.org/18722 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8570 0039d316-1c4b-4281-b951-d872f2087c98
* Porting in chrome/phajdan.jr@chromium.org2009-01-231-0/+3
| | | | | | Review URL: http://codereview.chromium.org/18446 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8560 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Get render_process_host to build.agl@chromium.org2009-01-221-0/+3
| | | | | | | | | | | | This is an adopted CL from Evan. Original: http://codereview.chromium.org/14504 (see original for review comments etc) Review URL: http://codereview.chromium.org/16814 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8430 0039d316-1c4b-4281-b951-d872f2087c98
* * Revert "POSIX: Get render_process_host to build."agl@chromium.org2009-01-211-3/+0
| | | | | | | | | * Revert "Build fix: release builds seemed to break" Review URL: http://codereview.chromium.org/18460 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8386 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Get render_process_host to build.agl@chromium.org2009-01-211-0/+3
| | | | | | | | | | | | This is an adopted CL from Evan. Original: http://codereview.chromium.org/14504 (see original for review comments etc) Review URL: http://codereview.chromium.org/16814 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8384 0039d316-1c4b-4281-b951-d872f2087c98
* Make CommandLine into a normal object, with some statics for getting at the ↵evan@chromium.org2009-01-211-2/+0
| | | | | | | | | | | current process's command line. One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.) Review URL: http://codereview.chromium.org/18248 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8347 0039d316-1c4b-4281-b951-d872f2087c98
* Port crash_cache tool to Linux.phajdan.jr@chromium.org2009-01-131-0/+6
| | | | | | Review URL: http://codereview.chromium.org/17353 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7939 0039d316-1c4b-4281-b951-d872f2087c98
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-0/+11
| | | | | | | | | | | | * Add a facility to LaunchProcess() to remap a given FD into a child process. This change is needed for 2 reasons: 1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket. 2)The OS X Sandbox doesn't close FDs. Review URL: http://codereview.chromium.org/14497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7175 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 7156.ojan@google.com2008-12-171-11/+0
| | | | | | | Broke the build. Review URL: http://codereview.chromium.org/15402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7159 0039d316-1c4b-4281-b951-d872f2087c98
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-0/+11
| | | | | | | | | | | | * Add a facility to LaunchProcess() to remap a given FD into a child process. This change is needed for 2 reasons: 1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket. 2)The OS X Sandbox doesn't close FDs. Review URL: http://codereview.chromium.org/14497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7156 0039d316-1c4b-4281-b951-d872f2087c98
* Add Terminate() to the Process object, have RenderProcessHost use this to ↵brettw@google.com2008-11-141-2/+2
| | | | | | | | | | avoid some more Windows specific code. Move Process and SharedMemory into the base namespace (most changes). Review URL: http://codereview.chromium.org/10895 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5446 0039d316-1c4b-4281-b951-d872f2087c98
* Remove fragile check in DidProcessCrashcpu@google.com2008-11-031-1/+10
| | | | | | | | | | | | | - the numbers were out of sync with result_codes.h - can't use result_codes.h in base project so I extracted the generic part of it. Rahul: I hope I don't break installer assumptions here. Dan: don't feel obligated to review. Review URL: http://codereview.chromium.org/9012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4519 0039d316-1c4b-4281-b951-d872f2087c98
* Port GetProcessCount(), KillProcesses(), and CleanupProcesses().dkegel@google.com2008-10-311-4/+19
| | | | | | | | | Also switch to fork() from vfork(), since strace on my box doesn't support vfork! It's deprecated, anyway. Review URL: http://codereview.chromium.org/8880 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4315 0039d316-1c4b-4281-b951-d872f2087c98
* Added linux process utilities and tests.estade@chromium.org2008-10-221-0/+25
| | | | | | Review URL: http://codereview.chromium.org/7202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3715 0039d316-1c4b-4281-b951-d872f2087c98
* Port parts of base/process_util to Linux.evanm@google.com2008-10-141-1/+8
| | | | | | | | Review URL: http://codereview.chromium.org/6492 Patch from Paweł Hajdan jr <phajdan.jr@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3363 0039d316-1c4b-4281-b951-d872f2087c98
* Enforce Terminate on Heap Corruption in most of our executable on Windows XP ↵maruel@google.com2008-09-241-0/+4
| | | | | | | | | | | SP3 or Vista. This won't submit the crash dump but it's still better than nothing. Fix broken alignment on test_shell_main.cc. Review URL: http://codereview.chromium.org/3105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2546 0039d316-1c4b-4281-b951-d872f2087c98
* * Change output of trace_event log to JSON to enable easier integration with ↵erikkay@google.com2008-09-181-0/+3
| | | | | | | | | | | | visualization UI. * Simple (manual) trace visualizer with some sample data. * a few more trace events * add process_util function for current process handle Review URL: http://codereview.chromium.org/3086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2381 0039d316-1c4b-4281-b951-d872f2087c98
* Fix process_util_posix.ccmmentovai@google.com2008-08-271-2/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1442 0039d316-1c4b-4281-b951-d872f2087c98