summaryrefslogtreecommitdiffstats
path: root/base/process_util_win.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make RouteStdioToConsole() redirect FDs 1 and 2 as well as FILE* pointersmseaborn@chromium.org2013-01-301-2/+11
| | | | | | | | | | | | | | | | | | After this change, --enable-logging allows NaCl untrusted code to output to stdout/stderr when Chrome is running under the Windows console, which makes debugging easier. The change is needed because NaCl uses _write() on file descriptors 1 and 2 in this case rather than fwrite() on FILE* stdout and stderr. stdout/stderr already worked for NaCl untrusted code on Linux and Mac. BUG=171836 TEST=manually run hello_world.nexe under Chrome on a Windows console Review URL: https://chromiumcodereview.appspot.com/12095018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179613 0039d316-1c4b-4281-b951-d872f2087c98
* Use LOG_GETLASTERROR in more cases in base/mseaborn@chromium.org2013-01-281-4/+3
| | | | | | | | | | | | | This provides a more informative textual error rather than a numeric error code. BUG=none TEST=build Review URL: https://chromiumcodereview.appspot.com/12051083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179214 0039d316-1c4b-4281-b951-d872f2087c98
* Add more logging to error paths of GetTerminationStatus()mseaborn@chromium.org2013-01-251-4/+8
| | | | | | | | | | | | | | | | | | | On a win_rel trybot run, I saw PPAPINaClNewlibTest.PostMessage_SendingData hang and produce the following output: [93604:92588:0124/001325:8318410:FATAL:process_util_win.cc(514)] Check failed: ((((DWORD )0x00000000L) ) + 0 ) == wait_result (0 vs. 4294967295) where 4294967295 is WAIT_FAILED (-1). More logging will help us diagnose such failures in the future. BUG=none TEST=compile Review URL: https://codereview.chromium.org/12040079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178852 0039d316-1c4b-4281-b951-d872f2087c98
* Windows: Fix --enable-logging to not disable logging when stderr is a pipemseaborn@chromium.org2013-01-241-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, when chrome.exe is run under Buildbot or under Cygwin's default terminal (mintty), passing --enable-logging (which calls RouteStdioToConsole()) has the unfortunate side effect of disabling logging from the browser process. In these cases, stderr is a pipe handle, not a Windows console, and opening CONOUT$ gives a console handle whose output doesn't go anywhere. (Note that this does not apply to browser_tests.exe, which has subsystem=console in its headers. In this case, the browser process is already attached to a non-visible console at startup, and RouteStdioToConsole() exits via the ERROR_ACCESS_DENIED path.) We fix this by making RouteStdioToConsole() a no-op if stdout/stderr already point to valid streams. BUG=169941 TEST=Ran chrome.exe and browser_tests.exe from both Cygwin mintty and the Windows console, with some extra logging added; checked that logging is displayed. Review URL: https://codereview.chromium.org/12038059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178656 0039d316-1c4b-4281-b951-d872f2087c98
* base: Convert scoped_arrays to the new scoped_ptr style.tfarina@chromium.org2013-01-181-2/+2
| | | | | | | | | | BUG=109874 R=darin@chromium.org,ajwong@chromium.org Review URL: https://chromiumcodereview.appspot.com/11961021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177670 0039d316-1c4b-4281-b951-d872f2087c98
* Add stdin_handle and stdout_handle in base::LaunchOptions.sergeyu@chromium.org2013-01-051-0/+11
| | | | | | | | | | | | | | | New members in LaunchOptions will allow to redirect stdin and stdout on Windows. This change was originally implemented by eaugusti@chromium.com in crrev.com/10918255 . BUG=142915 Review URL: https://chromiumcodereview.appspot.com/11419267 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175268 0039d316-1c4b-4281-b951-d872f2087c98
* Move EnableInProcessStackDumping to base/debugphajdan.jr@chromium.org2012-11-011-21/+0
| | | | | | | | | | | | | | This is a preparation to fix async-signal unsafety of the stack dumping signal handler, and I'd like to share code between the handler and stack trace code that wouldn't be useful outside those two. BUG=101155 TEST=if it compiles, it is perfect Review URL: https://codereview.chromium.org/11293021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165514 0039d316-1c4b-4281-b951-d872f2087c98
* delete unused variable in base/process_util_win.ccscottmg@chromium.org2012-10-221-1/+0
| | | | | | | | | | | Just tidying, no functional change. R=jar@chromium.org Review URL: https://chromiumcodereview.appspot.com/11236030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163335 0039d316-1c4b-4281-b951-d872f2087c98
* Add a flag force_breakaway_from_job_ to the base::LaunchOptions structure ↵ananta@chromium.org2012-09-141-0/+3
| | | | | | | | | | | | for Windows, which when set ensures that the child process is created with the CREATE_BREAKAWAY_FROM_JOB flag. BUG=148753 R=cpu Review URL: https://codereview.chromium.org/10914277 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156690 0039d316-1c4b-4281-b951-d872f2087c98
* Buffer console output on windows to avoid interleaved LOG output.fischman@chromium.org2012-08-301-2/+7
| | | | | | | | | BUG=142722 Review URL: https://chromiumcodereview.appspot.com/10890017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154122 0039d316-1c4b-4281-b951-d872f2087c98
* replace CONERR with CONOUT, because CONERR doesn't workjbates@chromium.org2012-08-231-1/+1
| | | | | | | | | | CONERR$ doesn't show up in the console. Not sure where it goes. For our purposes we want stderr to show up in the console, so let's output to CONOUT instead. BUG=142722 Review URL: https://chromiumcodereview.appspot.com/10869021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152945 0039d316-1c4b-4281-b951-d872f2087c98
* Make printf and LOG output to cmd console for Windowsjbates@chromium.org2012-08-221-34/+26
| | | | | | | | | | | | | | BUG=142722 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=152432 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=152566 Review URL: https://chromiumcodereview.appspot.com/10832309 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152722 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 152432 - Make printf and LOG output to cmd console for Windowsjbates@chromium.org2012-08-211-33/+34
| | | | | | | | | | | | BUG=142722 Review URL: https://chromiumcodereview.appspot.com/10832309 TBR=jbates@chromium.org Review URL: https://chromiumcodereview.appspot.com/10836363 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152566 0039d316-1c4b-4281-b951-d872f2087c98
* Make printf and LOG output to cmd console for Windowsjbates@chromium.org2012-08-201-34/+33
| | | | | | | | | BUG=142722 Review URL: https://chromiumcodereview.appspot.com/10832309 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152432 0039d316-1c4b-4281-b951-d872f2087c98
* Fix CleanupProcesses() interface to use TimeDelta.tedvessenes@gmail.com2012-07-311-5/+2
| | | | | | | | | BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10821062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149312 0039d316-1c4b-4281-b951-d872f2087c98
* Remove old test timeout and process waiting function interfaces.tedvessenes@gmail.com2012-07-261-25/+9
| | | | | | | | | BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10808069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148656 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to TimeDelta interface for process waiting functions in base.tedvessenes@gmail.com2012-07-111-1/+2
| | | | | | | | | | R=jar@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10694131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146211 0039d316-1c4b-4281-b951-d872f2087c98
* Add windows version of WaitForSingleProcess variant.tedvessenes@gmail.com2012-07-091-1/+6
| | | | | | | | | | | | The windows definition of this function omitted from the previous CL. Here it is. R=jar@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10704117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145700 0039d316-1c4b-4281-b951-d872f2087c98
* Add TimeDelta interfaces for WaitForExitCodeWithTimeout() functions.tedvessenes@gmail.com2012-07-081-3/+15
| | | | | | | | | | | | | Adding these interfaces will help update code that uses TestTimeouts::foo_timeout_ms() to use TestTimeouts::foo_timeout() instead. Old interfaces can get removed with the TestTimeouts code. R=jar@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10695117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145640 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base::GetModuleFromAddress() not to increment the module's reference count,alexeypa@chromium.org2012-05-161-4/+5
| | | | | | | | | | | | to match the behaviour expected by calling code. The original change was reverted by https://chromiumcodereview.appspot.com/10384209. BUG=124091,127933 Review URL: https://chromiumcodereview.appspot.com/10391169 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137547 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r133134 - Make sure that base::MessagePumpForUI from different ↵alexeypa@chromium.org2012-05-161-5/+4
| | | | | | | | | | | | | | modules are isolated from each other and add protection from shatter attacks by placing |this| pointer to the used data associated with the message-only window (instead of blindly trusting the value of WPARAM). We suspect that r133134 might be causing issues like 124091, so it needs to be reworked. BUG=124091,127933 TBR=alexeypa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10384209 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137542 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure that base::MessagePumpForUI from different modules are isolated ↵alexeypa@chromium.org2012-04-201-4/+5
| | | | | | | | | | | from each other and add protection from shatter attacks by placing |this| pointer to the used data associated with the message-only window (instead of blindly trusting the value of WPARAM). BUG=124091 Review URL: http://codereview.chromium.org/10134001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133134 0039d316-1c4b-4281-b951-d872f2087c98
* Update use of TimeDelta in base/*.tedvessenes@gmail.com2012-04-101-1/+1
| | | | | | | | | | R=jar@chromium.org BUG=108171 Review URL: http://codereview.chromium.org/10020012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131532 0039d316-1c4b-4281-b951-d872f2087c98
* ScopedProcessInformation protects against process/thread handle leaks from ↵erikwright@chromium.org2012-04-041-24/+15
| | | | | | | | | | | | | | | | | CreateProcess calls. This CL includes the definition of the class along with changes to clients of CreateProcess. Please see http://codereview.chromium.org/9959018/ for the most substantial usages I propose introducing. This was motivated by realizing that my previous fix to LaunchProcess actually still had a leak of the thread handle. BUG=None TEST=tests added in base_unittests Review URL: https://chromiumcodereview.appspot.com/9700038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130710 0039d316-1c4b-4281-b951-d872f2087c98
* Add comments and fix a potential leak in LaunchProcess.erikwright@chromium.org2012-03-151-0/+2
| | | | | | | | | | | | | | I found a need to look at the implementation to confirm that process_handle would never be assigned to if the call failed. So I added a comment for future readers. While doing so, I found an edge case where I think the process handle could be leaked. BUG=None TEST=Ask a random developer whether they must check process_handle if LaunchProcess returns false. If they look at process_util_*.cc, fail. Review URL: http://codereview.chromium.org/9689081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126890 0039d316-1c4b-4281-b951-d872f2087c98
* Fix error handling in OpenProcess wrappers. halyavin@google.com2012-03-141-3/+3
| | | | | | | | | | | OpenProcess returns NULL on error, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms684320(v=vs.85).aspx BUG= none TEST= none Review URL: http://codereview.chromium.org/9703019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126717 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in ProcessSingleton. These originated as candidate fixes for issue ↵joi@chromium.org2012-02-101-0/+10
| | | | | | | | | | | | | | | | | 111361, but the true fix is cpu@'s r119830. a) Unify code to retrieve HMODULE based on address in base::GetModuleFromAddress. (cpu@'s r119830 already has the fix to use the DLL's HMODULE 119830 rather than the EXE's HINSTANCE) b) Try harder to unregister the window class, by trying it first in ProcessSingleton::Cleanup, which gets called before the fast shutdown path calls ExitProcess(). Also, use correct HMODULE to unregister. c) Avoid any possibility of a race to create the message window when the Create() method is called from NotifyOtherProcessOrCreate() or from outside the class by moving the implementation of Create(), which was always called from the constructor, into the constructor and making Create() just return true or false based on the success of the work already done. BUG=111361 Review URL: http://codereview.chromium.org/9121046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121480 0039d316-1c4b-4281-b951-d872f2087c98
* windows: Fix a few things clang complains about.thakis@chromium.org2012-01-231-1/+1
| | | | | | | | | | | | No functionality change. BUG=82385 TEST=none Review URL: http://codereview.chromium.org/9200009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118725 0039d316-1c4b-4281-b951-d872f2087c98
* check for successful exit code in WaitForSingleProcess on Windows tobruening@chromium.org2012-01-231-3/+5
| | | | | | | | | | | | | | | | match other platforms. consequentially, in browser tests, add PROCESS_QUERY_INFORMATION to the rights requested when opening a child serviceprocess handle so the exit code can be queried. BUG=106234 TEST=Ran base_unittests.exe --gtest_filter="ProcessUtilTest.SpawnChild" with the child custom-tweaked to fail and verified that prior to my change (with HEAD) the failure is NOT detected and the test passes; with this change the failure is detected. Review URL: http://codereview.chromium.org/8964004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118695 0039d316-1c4b-4281-b951-d872f2087c98
* Remove custom Task implementation from process_util_win.cc.dcheng@chromium.org2011-12-131-40/+46
| | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/8873007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114169 0039d316-1c4b-4281-b951-d872f2087c98
* Extract similar code into SetJobObjectAsKillOnJobClose()toyoshim@chromium.org2011-11-231-0/+11
| | | | | | | | | | | | | For now, Chromium have five same code in various place to handle JobObject as KILL_ON_JOB_CLOSE. This change provide a common utility function to be used by them. BUG=n/a TEST=n/a; run existing unit tests because this is just a refactoring change Review URL: http://codereview.chromium.org/8667006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111441 0039d316-1c4b-4281-b951-d872f2087c98
* Move the ProcessWatcher methods out of content/common/process_watcher into ↵jam@chromium.org2011-11-231-0/+71
| | | | | | | | | | | base/process_util, alongside the other process methods. The only non-trivial move change is to the Windows implementation, where I changed KillProcess to use an exit code of kProcessKilledExitCode instead of content::RESULT_CODE_HUNG. cpu said that the existing code was incorrect, since GetTerminationStatus() should be mapping that result to TERMINATION_STATUS_PROCESS_WAS_KILLED. So I changed the exit code to kProcessKilledExitCode. This might make the UMA stats for killed processes to go up (and crashed to go down), but that will be an accounting change and should be zero-sum. BUG=98716 Review URL: http://codereview.chromium.org/8674003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111371 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-261-2/+2
| | | | | | | | | | | [ Reland of 107042 http://codereview.chromium.org/8368009 ] I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8341026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107434 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 107042 - Replace most LOG/CHECK statements with DLOG/DCHECK ↵brettw@chromium.org2011-10-251-2/+2
| | | | | | | | | | | | | | statements in base. I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8351025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107051 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-251-2/+2
| | | | | | | | | I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
* Move launching in a job object logicphajdan.jr@chromium.org2011-09-071-2/+24
| | | | | | | | | | | from TestServer to LaunchProcess, so that I can re-use it in other places for experiments. BUG=none Review URL: http://codereview.chromium.org/7789018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100027 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify chrome_exe_main_*.cc, moving as much of the code out as possible. ↵jam@chromium.org2011-08-311-0/+13
| | | | | | | | This is in preparation for moving the code in ChromeMain (and associated platform files) to a common place that can be used by both chrome and other embedders of content (i.e. content_shell). Included is a change to make the sandbox code not need an AtExitManager. This is necessary because content_shell would be just one exe, and we'd need to initialize the sandbox before calling ChromeMain, which is what would creat AtExitManager.I removed the code that printed the tcmalloc stacks in the OOM handler (i.e. r33993) under Windows. The issue is I wanted to move the OOM handling code to base to match the other platforms (in a long string of changes to make the startup code more sane, so I can share it with a browser built over content). When I tried moving the tcmalloc code to base, then I ran into a bunch of linker errors because a bunch of targets that depend on base don't depend on allocator. When I tried to add that to base, I ran into strange gyp errors (see patchset 2). I asked Jim/Eric and they said they don't use this data from dumps, and that most of the OOM minimdumps are in v8 heap anyways. When James get back, if he still uses this I can figure out how to put this back.BUG=90445 Review URL: http://codereview.chromium.org/7810005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99032 0039d316-1c4b-4281-b951-d872f2087c98
* Rename CommandLine::GetCommandLineString().msw@chromium.org2011-07-201-3/+4
| | | | | | | | | | | | Fix string hackery in net/tools/dump_cache/dump_cache.cc Fix const casts in chrome/installer/util/product.cc and base/process_util_win.cc. BUG=73195 TEST=none Review URL: http://codereview.chromium.org/7386002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93165 0039d316-1c4b-4281-b951-d872f2087c98
* Change base::LaunchProcess API slightlyevan@chromium.org2011-07-151-5/+7
| | | | | | | | | | | Rather than passing the out param process handle via the options, take it as a function argument. This simplifies many callers. BUG=88990 Review URL: http://codereview.chromium.org/7377012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92701 0039d316-1c4b-4281-b951-d872f2087c98
* base: refactor LaunchApp variants into a single functionevan@chromium.org2011-06-301-71/+36
| | | | | | | | | | | | | | | base provides a bunch of process-spawning functions that only differ by one or two arguments; worse, they're all backed by the same implementation anyway. Unify all the functions into one LaunchProcess() function, which takes a struct containing a bunch of optional arguments. For this change, I'm trying to not change the base API. Follow up changes can fix callers. Because of this, I made temporary shims for all of the old API. Review URL: http://codereview.chromium.org/7283019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91220 0039d316-1c4b-4281-b951-d872f2087c98
* Updating logging in src/base/. Using DCHECK_NE/EQ/LE/GE/GT() where possiblekushi.p@gmail.com2011-05-041-1/+1
| | | | | | | | | BUG=58409 Review URL: http://codereview.chromium.org/6883295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84016 0039d316-1c4b-4281-b951-d872f2087c98
* Make the windows_version.h functions threadsafe by using a singleton. Add ↵pkasting@chromium.org2011-04-071-6/+6
| | | | | | | | | | | | accessors to the singleton for more values that various code wants, then convert almost everyone using OSVERSIONINFO or SYSTEM_INFO structs to calling these accessors. Declare an AtExitManager in the out-of-process test runner since it didn't have one and that breaks singleton-using code in the test executable (as opposed to in chrome.dll). A few other minor cleanups along the way (binding of "*", shorter code, etc.). Because I ran into problems with it while modifying gcapi.cc, I cleaned up our usage of strsafe.h a bit, so that files that don't need it don't include it and files that do use STRSAFE_NO_DEPRECATE instead of a modified #include order. BUG=none TEST=none Review URL: http://codereview.chromium.org/6816027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80851 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 80819 due to failed testsmmenke@chromium.org2011-04-071-6/+6
| | | | | | | TBR=pkasting@chromium.org Review URL: http://codereview.chromium.org/6816024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80824 0039d316-1c4b-4281-b951-d872f2087c98
* Make the windows_version.h functions threadsafe by using a singleton. Add ↵pkasting@chromium.org2011-04-071-6/+6
| | | | | | | | | | | | accessors to the singleton for more values that various code wants, then convert almost everyone using OSVERSIONINFO or SYSTEM_INFO structs to calling these accessors. Declare an AtExitManager in the out-of-process test runner since it didn't have one and that breaks singleton-using code in the test executable (as opposed to in chrome.dll). A few other minor cleanups along the way (binding of "*", shorter code, etc.). Because I ran into problems with it while modifying gcapi.cc, I cleaned up our usage of strsafe.h a bit, so that files that don't need it don't include it and files that do use STRSAFE_NO_DEPRECATE instead of a modified #include order. BUG=none TEST=none Review URL: http://codereview.chromium.org/6713107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80819 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Detect browser crashes on shutdown in UI tests. phajdan.jr@chromium.org2011-04-061-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the automation framework could miss a browser crash during shutdown on POSIX (on Windows there is crash_service.exe that should catch all crashes). This change makes the automation framework avoid losing information about the browser process' exit status (CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout (which on POSIX never reported the process has been signaled). Finally, it makes the automation framework use WaitForExitCodeWithTimeout instead of WaitForSingleProcess. This way we can get the exit status information in an accurate and cross-platform way. To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them. I've tested this change locally on Mac with a UI test that SIGKILLs the browser. Before this change the test passed (it shouldn't), and after this change the test failed with an information that the browser has not exited cleanly. BUG=56644 Review URL: http://codereview.chromium.org/6689014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80608 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 80472 - GTTF: Detect browser crashes on shutdown in UI ↵phajdan.jr@chromium.org2011-04-051-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tests.Previously the automation framework could miss a browsercrash during shutdown on POSIX (on Windows there iscrash_service.exe that should catch all crashes).This change makes the automation framework avoid losinginformation about the browser process' exit status(CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout(which on POSIX never reported the process has been signaled).Finally, it makes the automation framework use WaitForExitCodeWithTimeoutinstead of WaitForSingleProcess. This way we can get the exit statusinformation in an accurate and cross-platform way.To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them.I've tested this change locally on Mac with a UI test that SIGKILLs the browser.Before this change the test passed (it shouldn't), and after this changethe test failed with an information that the browser has not exited cleanly.BUG=56644Review URL: http://codereview.chromium.org/6689014 TBR=phajdan.jr@chromium.org [----------] 1 test from MultipartResponseUITest [ RUN ] MultipartResponseUITest.SingleVisit [3538:3538:0405/104633:11326126024137:ERROR:process_util_posix.cc(108)] Received signal 11 base::debug::StackTrace::StackTrace() [0xcd194a] base::(anonymous namespace)::StackDumpSignalHandler() [0xcb0e5a] 0x2b835e391100 AutomationProxy::GetBrowserWindowCount() [0x2055e86] ProxyLauncher::IsBrowserRunning() [0xc3f1a2] ProxyLauncher::QuitBrowser() [0xc454b3] ProxyLauncher::CloseBrowserAndServer() [0xc472d6] UITestBase::TearDown() [0xc50d54] UITest::TearDown() [0xc51260] testing::TestInfo::Run() [0xe8de78] testing::TestCase::Run() [0xe8df35] testing::internal::UnitTestImpl::RunAllTests() [0xe8f6e7] testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0xe804d5] testing::internal::HandleExceptionsInMethodIfSupported<>() [0xe8ba92] testing::UnitTest::Run() [0xe8badb] base::TestSuite::Run() [0x212c26d] main [0xc48e41] 0x2b835e37d1c4 0x42fec9 Review URL: http://codereview.chromium.org/6794056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80488 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Detect browser crashes on shutdown in UI tests.phajdan.jr@chromium.org2011-04-051-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the automation framework could miss a browser crash during shutdown on POSIX (on Windows there is crash_service.exe that should catch all crashes). This change makes the automation framework avoid losing information about the browser process' exit status (CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout (which on POSIX never reported the process has been signaled). Finally, it makes the automation framework use WaitForExitCodeWithTimeout instead of WaitForSingleProcess. This way we can get the exit status information in an accurate and cross-platform way. To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them. I've tested this change locally on Mac with a UI test that SIGKILLs the browser. Before this change the test passed (it shouldn't), and after this change the test failed with an information that the browser has not exited cleanly. BUG=56644 Review URL: http://codereview.chromium.org/6689014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80472 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* This adds some plumbing for propagating the status and error code of a ↵gspencer@chromium.org2010-12-141-32/+54
| | | | | | | | | | | | | | | | | | | | | renderer process that went away so that we can tell at the UI level what happened to the tab: did it crash, or was it killed by the OOM killer (or some other reason). This is in preparation for implementing a new UI for when a process is killed by the OOM on ChromeOS which handles it differently from a crash. Most of the changes are modifications of the argument list to include a status and error code for the exited process, but in addition the following was done: - Changed the name of DidProcessCrash to GetTerminationStatus. - Added TerminationStatus enum in process_util.h, so it can be used as the status returned by GetTerminationStatus. - Improved process_util_unittest to actually test for crashing and terminated processes on all platforms. - Added a new notification for renderers that were killed. - Added error code information to crash notification. - Added status and error code information to renderer IPC message for RenderViewGone. - Added a UMA histogram count for number of renderer kills. BUG=http://crosbug.com/8505 TEST=ran new unit test. Test passes on try servers. Review URL: http://codereview.chromium.org/5172009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69082 0039d316-1c4b-4281-b951-d872f2087c98
* Move debug-related stuff from base to the base/debug directory and use thebrettw@chromium.org2010-10-261-6/+6
| | | | | | | | | | | | | | | | base::debug namespace. This splits apart debug_util into base/debugger and base/stack_trace There are still two functions in debug_util that I'm not sure what to do with. Since this uses the base::debug namespace, I removed the functions in debugger.h from the static class and just made them free functions in the namespace. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3945002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63859 0039d316-1c4b-4281-b951-d872f2087c98