summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_sync_channel.cc
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Move IPC code to ipc/"agl@chromium.org2009-04-031-0/+453
| | | | | | | This reverts commit r13062 which, unsurprisingly, broke the build. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13063 0039d316-1c4b-4281-b951-d872f2087c98
* Move IPC code to ipc/agl@chromium.org2009-04-031-453/+0
| | | | | | | (No review URL: Rietvelt couldn't cope) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13062 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that a listener's OnChannelConnected is called before OnMessageReceived.jam@chromium.org2009-03-121-15/+1
| | | | | | | | | | | | A race condition existed since the listener thread could dispatch messages in two ways: a task being posted to it, or because the dispatch messages event is set. The latter is needed to avoid deadlock when multiple SyncChannels are used on the same listener thread. If the latter method was used to dispatch a message, it might occur before the task that calls OnChannelConnected gets run. The fix is to call OnChannelConnected manually if we notice a message is being dispatched before it's called. Note: I couldn't think of a way to test this since it depends on a race condition in the listener message looop (whether the task or objectwatcher gets run first). Review URL: http://codereview.chromium.org/42113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11522 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE.maruel@google.com2009-03-051-1/+2
| | | | | | | Split the lines >80 cols. (Part 1) Review URL: http://codereview.chromium.org/39206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11032 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Renderer Crash on OS X + update unit test.jeremy@chromium.org2009-02-061-0/+1
| | | | | | | | | | | | | | The problem was that the process shutdown_event_ was created in RenderProcess::GlobalInit() and then deleted in RenderProcess::GlobalCleanup() and was being accessed after it's deletion by the MessageLoop's destructor (which was trying to signal shutdown). MessageLoop was still retaining a reference to it since there was still an IPCSyncChannel listening on it. IPCSyncChannel hadn't stopped listening on it since it was being terminated via OnChannelError. This fix adds code that terminates listening on a channel when a Channel error occurs. Review URL: http://codereview.chromium.org/20114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9295 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Get IPCSyncChannel unittests workingagl@chromium.org2009-01-201-7/+3
| | | | | | | Review URL: http://codereview.chromium.org/18324 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8328 0039d316-1c4b-4281-b951-d872f2087c98
* WaitableEvent is the replacement for Windows events. Previously in the code, ↵agl@chromium.org2009-01-151-43/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a HANDLE from CreateEvent was used for signaling, both within a process and across processes. WaitableEvent is the cross platform replacement for this. To convert: * HANDLE -> base::WaitableEvent* * ScopedHandle -> scoped_ptr<base::WaitableEvent> * CreateEvent -> new base::WaitableEvent * SetEvent -> base::WaitableEvent::Signal * ResetEvent -> base::WaitableEvent::Reset * ObjectWatcher -> base::WaitableEventWatcher * WaitForMultipleObjects -> static base::WaitableEvent::WaitMany ObjectWatcher remains for Windows specific code. WaitableEventWatcher has an identical interface save, * It uses WaitableEvents, not HANDLEs * It returns void from StartWatching and StopWatcher, rather than errors. System internal errors are fatal to the address space IMPORTANT: There are semantic differences between the different platforms. WaitableEvents on Windows are implemented on top of events. Windows events work across process and this is used mostly for modal dialog support. Windows events can be duplicated with DuplicateHandle. On other platforms, WaitableEvent works only within a single process. In the future we shall have to replace the current uses of cross-process events with IPCs. BEWARE: HANDLE, on Windows, is a void *. Since any pointer type coerces to void *, you can pass a WaitableEvent * where a HANDLE is expected without any build-time errors. Review URL: http://codereview.chromium.org/16554 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8126 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a race condition in the SyncChannel code.jam@chromium.org2008-12-051-57/+34
| | | | | | | | | | | The problem is that QueueMessage would be called with listener() on the IPC thread, and then the function would wait on message_lock_ before adding the message and its associated listener. However, in between the time that listener() was called and the lock was taken control of, the listener thread may be calling RemoveListener. The fix is to not send the listener, but instead just send a pointer to the context. It'll be used on the listener thread, at which point listener() can be called to check if the listener is available. BUG=1305036 Review URL: http://codereview.chromium.org/12952 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6448 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a race condition in SyncChannel that would happen if a nested Send ↵jam@chromium.org2008-11-121-1/+7
| | | | | | | | | occurred in between the time that SetEvent was called on the current Send's done_event and when OnObjectSignalled was called. The pending signal would be cancelled and since the event was already reset, when we watched it again later OnObjectSignalled would never be called. The fix is to make it a manual reset event. BUG=1474092 Review URL: http://codereview.chromium.org/10817 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5238 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+2
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a problem with the SyncChannel rewrite. DispatchReplies needs to be ↵jam@chromium.org2008-10-251-40/+36
| | | | | | | | called after the deserializer has been popped. This now happens in the listener thread, so post a task to the IPC thread to do it. Review URL: http://codereview.chromium.org/8175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3971 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC::SyncChannel not duplicate the underlying MessageLoop ↵jam@chromium.org2008-10-241-206/+200
| | | | | | | | implementation by pumping messages on its own. This fixes the problem of windowless plugins not painting on right click, and generally makes this class almost ported, other than using a generic version of events/locks.Through this change I've also cleaned up the class and hopefully made it more understandable. Review URL: http://codereview.chromium.org/8001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3934 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of code from the old to new TLS interface.deanm@chromium.org2008-09-101-8/+13
| | | | | | Review URL: http://codereview.chromium.org/1660 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1982 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* TrackedObjects assumes you can use a "TLS slot" of -1 to indicate ↵evanm@google.com2008-08-201-6/+6
| | | | | | uninitialized. This isn't true for the pthread_key_t type, which is unsigned on Linux and reportedly a struct on Macs. This change modifies the Slot type to be a struct containing an "initialized" flag. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1122 0039d316-1c4b-4281-b951-d872f2087c98
* Revert. Failing unit tests.evanm@google.com2008-08-201-6/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98
* TrackedObjects assumes you can use a "TLS slot" of -1 to indicate ↵evanm@google.com2008-08-201-6/+6
| | | | | | uninitialized. This isn't true for the pthread_key_t type, which is unsigned on Linux and reportedly a struct on Macs. This change modifies the Slot type to be a struct containing an "initialized" flag. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1113 0039d316-1c4b-4281-b951-d872f2087c98
* IPCSyncChannel cleanup:jabdelmalek@google.com2008-08-131-33/+26
| | | | | | | | -remove reply_lock_ since received_replies_ was only being used on the IPC thread -stop using nested locks git-svn-id: svn://svn.chromium.org/chrome/trunk/src@773 0039d316-1c4b-4281-b951-d872f2087c98
* Manually refcount ReceivedSyncMsgQueue so that we force it to be destructed onjabdelmalek@google.com2008-08-121-9/+13
| | | | | | | | the listener thread. I've fixed the renderer crashes which were happening because SyncChannel was going away before the listener thread. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@762 0039d316-1c4b-4281-b951-d872f2087c98
* Revert my changejabdelmalek@google.com2008-08-121-13/+9
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@740 0039d316-1c4b-4281-b951-d872f2087c98
* Manually refcount ReceivedSyncMsgQueue so that we force it to be destructed ↵jabdelmalek@google.com2008-08-121-9/+13
| | | | | | | | | on the listener thread. BUG=1319842 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@733 0039d316-1c4b-4281-b951-d872f2087c98
* Enabling sync_channel in the browser to allow accessibility code making ↵jcampan@google.com2008-08-121-20/+59
| | | | | | | | | blocking calls. This replaces my previous CL that was somehow duplicating some of these functionalities. BUG=None TEST=Run the unit tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@691 0039d316-1c4b-4281-b951-d872f2087c98
* Support RanAllPending() rather than RunOnce(), and integrated into ↵jar@google.com2008-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ipc_sync_channel. RunOnce() semantics were not sufficient to support the effort to pump messages in ipc_sync_channel, as ipc_sync_channel is not able to detect pending Tasks. This change list switches to RunAllPending() tasks, rather than just Running the items that avail themselves in one run of the loop. This is a very small mod of the existing code. I'm still trying to stay focused on the bug at hand, and minimize chances of unrelated regressions (we only modify IPC channel semantics). The slight semantic change (from original attempts to call Quit() externally and then Run()) is that we now terminate the message loop after also servicing the high-resolution timer tasks. bug=1291034 r=darin M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176 0039d316-1c4b-4281-b951-d872f2087c98
* (Re-landing of) Support RunOnce() in message loop.jar@google.com2008-07-301-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Deeply nested calls to MessageLoop::Run() were made, and a multitude of Quit() messages were handled at the most nested level. This left outer invocations hung, waiting for "their" kQuitMsg to arrive (but the the nested loop had already discarded them in its processing of pending messages before exit :-/ ). We now use a more controlled run of the message loop, which does not rely on kQuitMsg. This re-landing doesn't have the anti-hang assertion, which was breaking a lot of tests. bug=1291034 r=darin,mpcomplete M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130 0039d316-1c4b-4281-b951-d872f2087c98
* Rollback 109jar@google.com2008-07-301-3/+4
| | | | | | | | | | M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110 0039d316-1c4b-4281-b951-d872f2087c98
* M base/message_loop.hjar@google.com2008-07-301-4/+3
| | | | | | | | M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome to the repository.initial.commit2008-07-261-0/+470
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98