summaryrefslogtreecommitdiffstats
path: root/chromeos/process_proxy
Commit message (Collapse)AuthorAgeFilesLines
* Fix for flow control in terminalPrivate APItbarzic2016-01-088-156/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes problem where terminalPrivate API floods IPC channel by sending crosh extension too many onProcessOutput events in short amount of time. The API uses chromeos/process_proxy/process_output_watcher to observe stdout of terminal process. Whenever some data is detected a chrome.terminalPrivate.onProcessOutput event is dispatched to crosh extension with the observed data. This may overwhelm communication channel to the extension when there is too much output from the process. To fix this the following is done: - When process_output_watcher sends some data, further process output observation/reporting is paused until the sent data is acknowledged by the receiver. - Callback used by process_output_watcher is passed a closure that unpauses the process_output_watcher. The callback is cached before sending chrome.terminalPrivate.onProcessOutput event. - chrome.terminalPrivate.ackOutput(int terminalId) is introduced that invokes cached (if it exists) the closure for the terminal process identified by terminalId. - When chrome.terminalPrivate.onProcessOutput is dispatched to the extension code, terminalPrivate.ackOutput is called for the target terminal. This is done internally in the APIs custom bindings (from the extension renderer process). - To ensure process output is acknowledged at most once, terminalPrivate.onProcessOutput is internally passed target tab ID as an argument. The tab ID is passed back as an argument of ackOutput, and the method is ignored if called from web contents with different tab ID. The tab ID is stripped from the argument list before dispatching onProcessOutput event to the extension. BUG=527475, 398901 Review URL: https://codereview.chromium.org/1455793003 Cr-Commit-Position: refs/heads/master@{#368277}
* Switch to standard integer types in chromeos/.avi2015-12-217-4/+15
| | | | | | | | | BUG=138542 TBR=zelidrag@chromium.org Review URL: https://codereview.chromium.org/1540803002 Cr-Commit-Position: refs/heads/master@{#366324}
* Don't use base::MessageLoop::{Quit,QuitClosure} in ash/, chromeos/, device/ki.stfu2015-10-121-4/+4
| | | | | | | | | | | | | This patch renames base::MessageLoop::{Quit,QuitClosure} to base::MessageLoop::{QuitWhenIdle,QuitWhenIdleClosure}. BUG=131220 TEST= R=oshima@chromium.org,stevenjb@chromium.org,reillyg@chromium.org Review URL: https://codereview.chromium.org/1396083003 Cr-Commit-Position: refs/heads/master@{#353548}
* User MessageLoopForIO::WatchFileDescriptor in proces_output_watchertbarzic2015-08-108-209/+162
| | | | | | | | | | | | | | | The main point is to avoid usage of select for observing process' pseudo-terminal fd. Main problems with select is that it doesn't work for fd > 1024, which started to be passed to ProcessOutputWatcher. Added benefit of MessageLoopForIO::WatchFileDescriptor is that it's async, so it enables us to do some clean up for process proxy thread management. BUG=495165 TEST=Open a lot of crosh tabs (e.g. ~30). Crosh is started in all of them. Review URL: https://codereview.chromium.org/1258193002 Cr-Commit-Position: refs/heads/master@{#342716}
* Fix flakiness in ProcessOutputWatcherTeststbarzic2015-07-291-18/+18
| | | | | | | | | | | | The flakiness was caused by process output watcher sending exit output during shutdown (if master end of watched pseudo terminal closure is detected before write to shutdown pipe). BUG=396496 Review URL: https://codereview.chromium.org/1254383005 Cr-Commit-Position: refs/heads/master@{#340983}
* chromeos: Remove use of MessageLoopProxy and deprecated MessageLoop APIsskyostil2015-06-113-26/+29
| | | | | | | | | | This patch was mostly autogenerated with https://codereview.chromium.org/1010073002/. BUG=465354 Review URL: https://codereview.chromium.org/1173593002 Cr-Commit-Position: refs/heads/master@{#333996}
* Prevent ProcessProxy from passing bad fds to ProcessOutputWatchertbarzic2015-05-143-12/+15
| | | | | | | | | | | | | | This makes crosh process creation (used by terminalPrivate API) fail gracefully when file descriptors used to observe process output cannot be used by select (as opposed to crashing). BUG=480616 TEST=Open huge number of crosh terminals in short time, until terminal launching starts failing. Review URL: https://codereview.chromium.org/1135823007 Cr-Commit-Position: refs/heads/master@{#329901}
* Remove uses of KillProcess.rvargas2015-04-012-5/+12
| | | | | | | | BUG=417532 Review URL: https://codereview.chromium.org/1035323002 Cr-Commit-Position: refs/heads/master@{#323179}
* Remove duplicate includes from chromeos/pneubeck2015-02-251-2/+0
| | | | | | | | | | | | This removes all includes from $X.cc files where the $X.h has the same include to conform to the style guide: "[...] However, any includes present in the related header do not need to be included again in the related cc (i.e., foo.cc can rely on foo.h's includes)." BUG=460988 Review URL: https://codereview.chromium.org/947173002 Cr-Commit-Position: refs/heads/master@{#318002}
* Rename base::Process::pid() to Pid()rvargas2015-01-241-1/+1
| | | | | | | | | | | | | | | | | The method is not a simple accessor. BUG=417532 TBR=satorux@chromium.org (chromeos) TBR=siggi@chromium.org (browser_watcher) TBR=mseaborn@chromium.org (nacl) TBR=davidben@chromium.org (content) TBR=rsesek@chromium.org (sandbox) TBR=sadrul@chromium.org (ui) Review URL: https://codereview.chromium.org/864163003 Cr-Commit-Position: refs/heads/master@{#312978}
* Update {virtual,override,final} to follow C++11 style in chromeos.dcheng2015-01-212-20/+21
| | | | | | | | | | | | | | | | The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override. This patch was automatically generated with a ChromeOS build using a variation of https://codereview.chromium.org/598073004. BUG=417463 R=zelidrag@chromium.org Review URL: https://codereview.chromium.org/856563004 Cr-Commit-Position: refs/heads/master@{#312426}
* Update ChromeOS code to use the new version of LaunchProcess.rvargas2015-01-101-2/+8
| | | | | | | | BUG=417532 Review URL: https://codereview.chromium.org/821583004 Cr-Commit-Position: refs/heads/master@{#310949}
* Make callers of CommandLine use it via the base:: namespace.avi2014-12-221-2/+2
| | | | | | | | | | | | Covers android_webview/, ash/, athena/, chromeos/. BUG=422426 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/825473002 Cr-Commit-Position: refs/heads/master@{#309459}
* Refactor AppendToFile and WriteFileDescriptorchirantan2014-10-072-8/+5
| | | | | | | | | | | | | | | - Unify the behavior of the windows and posix implementations of these functions. - Simplify the interface by having them just indicate success or failure instead of making callers deal with partial writes. BUG=418837 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org> Review URL: https://codereview.chromium.org/614893004 Cr-Commit-Position: refs/heads/master@{#298604}
* replace OVERRIDE and FINAL with override and final in chromeos/mostynb2014-10-062-10/+10
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/628883002 Cr-Commit-Position: refs/heads/master@{#298229}
* Cleanup: Use base/files/file_util.h instead of base/file_util.h in ash/, ↵thestig2014-09-102-6/+6
| | | | | | | | | | athena/, and chromeos/ TBR=pneubeck@chromium.org Review URL: https://codereview.chromium.org/555313002 Cr-Commit-Position: refs/heads/master@{#294072}
* Disable all the tests that are flaking more than 5% on ChromeOS builders.jam@chromium.org2014-07-231-10/+18
| | | | | | | | | | | | Data from http://chromium-build-logs.appspot.com/flakiness_dashboard?master=chromium.chromiumos. BUG=386891,396494,396496,396497,396499,396501,396502,396504,396505,393208,223888,396506,387045,396507,396509,396510 R=viettrungluu@chromium.org TBR=sky, stevenjb Review URL: https://codereview.chromium.org/407073010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284938 0039d316-1c4b-4281-b951-d872f2087c98
* Improve process output watcher's handling of multi-byte UTF8 characterstbarzic@chromium.org2014-05-154-60/+283
| | | | | | | | | | | | | | | | | Speciffically, handle case when a non ASCII UTF8 character is read partially from the process output. Instead of reporting read character bytes imediatelly, cache them until the rest of the character is read from the process output. BUG=278340 TEST=in crosh (see comment #1 in the bug): $python >>> print(u"\u20ac" * 10000) Verify a series of EURO signs is displayed (without "unknown" characters) Review URL: https://codereview.chromium.org/261743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270799 0039d316-1c4b-4281-b951-d872f2087c98
* [ChromeOS] Don't set NO_NEW_PRIVS for ProcessProxy processes (e.g. Crosh) ↵rsesek@chromium.org2014-04-101-0/+5
| | | | | | | | | | | when in dev-mode. BUG=358713 TEST=Put system in dev mode, open Crosh, type `shell`, and run sudo. Review URL: https://codereview.chromium.org/228783005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263092 0039d316-1c4b-4281-b951-d872f2087c98
* Move WriteFile and WriteFileDescriptor from file_util to base namespace.brettw@chromium.org2014-03-062-7/+7
| | | | | | | | | R=viettrungluu@chromium.org TBR=viettrungluu Review URL: https://codereview.chromium.org/184563006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255418 0039d316-1c4b-4281-b951-d872f2087c98
* Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.mark@chromium.org2013-12-034-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is incorrect to wrap close in HANDLE_EINTR on Linux. Correctness is generally undefined on Mac, but as of r223369, it is incorrect in Chrome on Mac. To avoid new offenders, a PRESUBMIT check ensures that HANDLE_EINTR is not used with close, and that IGNORE_EINTR is only used with close. Unnecessary #includes of eintr_wrapper.h are also removed. base/posix/einter_wrapper.h, PRESUBMIT.py, and ppapi/tests/test_broker.cc contain non-mechanical changes. Variable naming within the latter is updated per r178174. Missing #includes for <errno.h> in content/zygote/zygote_main_linux.cc and tools/android/common/daemon.cc were manually added. Mechanical changes were generated by running: sed -E -i '' \ -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \ -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \ -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \ $(git grep -El 'HANDLE_EINTR.*close') sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(git grep -El '#include.*eintr_wrapper\.h"')) BUG=269623 R=agl@chromium.org, jln@chromium.org TBR=OWNERS Review URL: https://codereview.chromium.org/100253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238390 0039d316-1c4b-4281-b951-d872f2087c98
* Move AlterEnvironment to base/environment.h, implement on Windows. This ↵brettw@chromium.org2013-08-301-4/+1
| | | | | | | | | | | | | re-implements the Posix version to be more like the Windows version and to share some parsing code. The new version will be somewhat slower due to some extra mallocs, but is shorter and more clear. I didn't want to implement a super optimized version on Windows, and the alternative would be to keep the new Windows version and the old Posix version in parallel which seemed less desirable. 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
* Update include paths in chromeos for base/process changes.rsesek@chromium.org2013-07-232-3/+4
| | | | | | | | | BUG=242290 R=zelidrag@chromium.org Review URL: https://codereview.chromium.org/20000002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213098 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug caught by clang's -Wlogical-not-parenthesesthakis@chromium.org2013-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | ../../chromeos/process_proxy/process_output_watcher_unittest.cc:49:9: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!type == PROCESS_OUTPUT_TYPE_OUT) ^ ~~ ../../chromeos/process_proxy/process_output_watcher_unittest.cc:49:9: note: add parentheses after the '!' to evaluate the comparison first if (!type == PROCESS_OUTPUT_TYPE_OUT) ^ ( ) ../../chromeos/process_proxy/process_output_watcher_unittest.cc:49:9: note: add parentheses around left hand side expression to silence this warning if (!type == PROCESS_OUTPUT_TYPE_OUT) ^ ( ) Since PROCESS_OUTPUT_TYPE_OUT evaluates to 0, this doesn't change behavior. BUG=262248 R=tbarzic@chromium.org Review URL: https://codereview.chromium.org/19517008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212910 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in chromeos/.avi@chromium.org2013-07-171-1/+1
| | | | | | | | | | BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19468003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212154 0039d316-1c4b-4281-b951-d872f2087c98
* Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*"rsleevi@chromium.org2013-06-141-1/+1
| | | | | | | | | BUG=110610 TBR=darin Review URL: https://chromiumcodereview.appspot.com/16998003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206357 0039d316-1c4b-4281-b951-d872f2087c98
* chromeos: Use base::MessageLoop.xhwang@chromium.org2013-05-291-13/+13
| | | | | | | | | BUG=236029 R=oshima@chromium.org Review URL: https://codereview.chromium.org/15774005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202997 0039d316-1c4b-4281-b951-d872f2087c98
* Move chrome/browser/chromeos/process_proxy to chromeosphajdan.jr@chromium.org2013-03-129-0/+1220
BUG=180711 Review URL: https://codereview.chromium.org/12433023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187641 0039d316-1c4b-4281-b951-d872f2087c98