| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(1) Use nonblocking sockets. Blocking the IO thread is bad.
(2) Handle multiple SocketReaders.
(3) Stop leaking file descriptors in SocketReader. Old code used to stop watching the fds, but not close them.
(4) Handle partial reads and writes. SocketReader reads until the sender shuts down his side of the socket.
(5) Timeout readers after 5 seconds so they don't hang forever.
BUG=http://www.crbug.com/12343
TEST=Open a chrome instance. Check /proc/<pid>/fd/ to see how many descriptors there are. Run "chrome www.google.com" on the command line a bunch of times, which should create a bunch of tabs. Make sure you close all these new tabs that pop up.a Check /proc/<pid>/fd/ to see how many descriptors there are. There shouldn't be many more (although some of the new renderers that got created take awhile because they get cleaned up). Keep repeating, you should be at a steady state of file descriptors.
Review URL: http://codereview.chromium.org/112054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16811 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we split on NULL, the final NULL results in an extra command
line token passed to the original browser process.
Bug found by willchan.
Review URL: http://codereview.chromium.org/113714
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16629 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We set up a listener on the IO thread, but the listener lived longer
than the IO thread. Instead, register a listener to stop listening
when the IO thread goes away. We have to register the destruction
listener on the thread that we're listening to, so there's an new
StartListening method dispatched from ProcessSingleton::Create.
Review URL: http://codereview.chromium.org/115605
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16606 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
open multiple chrome processes, the first one just opens a new window.
This is based on http://codereview.chromium.org/88067 by Nikita
Ofitserov (himikof).
BUG=8073
Review URL: http://codereview.chromium.org/115572
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16528 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
base::DIR_EXE could be a very long path, which causes socket creation to fail because socket paths have a limited length. Let's use a temp directory instead. We should also clean up the temp dir when we're done. Also abort if the socket path is too long.
Reviewed in issue 115107
Review URL: http://codereview.chromium.org/113193
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15749 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
r15607 broke the build
TBR=brg, thestig
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15608 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
base::DIR_EXE could be a very long path, which causes socket creation to fail because socket paths have a limited length. Let's use a temp directory instead. We should also clean up the temp dir when we're done.
Also abort if the socket path is too long.
Review URL: http://codereview.chromium.org/115107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15607 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On POSIX systems, system calls can be interrupted by signals. In this
case, they'll return EINTR, indicating that the system call needs to
be restarted.
(The situation is a little more complicated than this with SA_RESTART,
but you can read man 7 signal if you like.)
The short of it is that you need to catch EINTR and restart the call
for these system calls:
* read, readv, write, writev, ioctl
* open() when dealing with a fifo
* wait*
* Anything socket based (send*, recv*, connect, accept etc)
* flock and lock control with fcntl
* mq_ functions which can block
* futex
* sem_wait (and timed wait)
* pause, sigsuspend, sigtimedwait, sigwaitinfo
* poll, epoll_wait, select and 'p' versions of the same
* msgrcv, msgsnd, semop, semtimedop
* close (although, on Linux, EINTR won't happen here)
* any sleep functions (careful, you need to handle this are restart
with different arguments)
We've been a little sloppy with this until now. This patch adds a
macro for dealing with this and corrects every case of these system
calls (that I found).
The macro is HANDLE_EINTR in base/eintr_wrapper.h. It's safe to
include on Windows and is a no-op there.
On POSIX, it uses GCC magic to return the correct type based on the
expression and restarts the system call if it throws EINTR.
And you can use it like:
HANDLE_EINTR(close(fd));
Or:
ssize_t bytes_read = HANDLE_EINTR(read(fd, buffer, len));
*BEWARE* that it will evaluate the argument multiple times, so this is
not safe:
HANDLE_EINTR(close(FireMissiles()));
http://groups.google.com/group/chromium-dev/browse_thread/thread/41a35b2a457d73a0
http://codereview.chromium.org/100225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15102 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
| |
To get the PID from the socket, we use lsof (fuser doesn't work with unix sockets apparently).
The download shelf, save page, and browser ui tests now pass.
Review URL: http://codereview.chromium.org/66071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13716 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
BUG=6468
Review URL: http://codereview.chromium.org/46076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12314 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/28142
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10395 0039d316-1c4b-4281-b951-d872f2087c98
|
|
We now will refuse to run a second browser process if one is already running;
making the second invocation bring up new windows in the first remains left to
be implemented.
Review URL: http://codereview.chromium.org/20448
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9980 0039d316-1c4b-4281-b951-d872f2087c98
|