summaryrefslogtreecommitdiffstats
path: root/base/message_loop.cc
Commit message (Collapse)AuthorAgeFilesLines
* Reapply r21429 - Cleanup pending tasks under Valgrind as well.kuchhal@chromium.org2009-07-231-9/+10
| | | | | | | | BUG=16095 Review URL: http://codereview.chromium.org/160035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21459 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Cleanup pending tasks under Valgrind as well." (r21429)kuchhal@chromium.org2009-07-231-10/+6
| | | | | | | | This reverts commit 26f9edf949e1678d4f8a3479518568b8a6e1972c. Review URL: http://codereview.chromium.org/160033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21430 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup pending tasks under Valgrind as well.kuchhal@chromium.org2009-07-231-6/+10
| | | | | | | | BUG=16095 Review URL: http://codereview.chromium.org/160020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21429 0039d316-1c4b-4281-b951-d872f2087c98
* Adds time-out to browser-tests to prevent a hanging test from hanging the ↵jcampan@chromium.org2009-07-011-0/+4
| | | | | | | | | | entire test suite. Bug=None TEST=None Review URL: http://codereview.chromium.org/151158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19755 0039d316-1c4b-4281-b951-d872f2087c98
* Consistently use int64 for integers holding number of milliseconds.phajdan.jr@chromium.org2009-06-171-3/+3
| | | | | | | | | | 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
* Promotes Add/RemoveObserver to MessageLoop for linux. Becausesky@chromium.org2009-05-181-8/+12
| | | | | | | | | | | | message_loop.h now includes message_pump_glib.h I needed to update the dependencies of a couple of projects. BUG=none TEST=none Review URL: http://codereview.chromium.org/112032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16317 0039d316-1c4b-4281-b951-d872f2087c98
* During shutdown delete any pending tasks if running under Valgrind.kuchhal@chromium.org2009-05-141-1/+8
| | | | | | | | | BUG=10755 Review URL: http://codereview.chromium.org/115328 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16060 0039d316-1c4b-4281-b951-d872f2087c98
* More linux ifdef tweaks. This reverts my earlier change (13503).sky@chromium.org2009-04-271-5/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/100046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14628 0039d316-1c4b-4281-b951-d872f2087c98
* Adds some ifdefs so that test_shell can be compiled on linuxsky@chromium.org2009-04-101-2/+6
| | | | | | | | | | | | | without GTK. I had to recreate this patch as my workspace for various resonds. UGH! BUG=none TEST=none Review URL: http://codereview.chromium.org/67024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13503 0039d316-1c4b-4281-b951-d872f2087c98
* (purify bustage) Correct purify (only) reference to variablejar@chromium.org2009-03-111-1/+1
| | | | | | | tbr=erikkay Review URL: http://codereview.chromium.org/43097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11476 0039d316-1c4b-4281-b951-d872f2087c98
* Fix tree bustagejar@chromium.org2009-03-111-2/+4
| | | | | | | | | mac/linux didn't like unused local varible. tbr=erikkay Review URL: http://codereview.chromium.org/43096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11474 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid leaks at shutdown when running purifyjar@chromium.org2009-03-111-4/+10
| | | | | | | | | | | | | We'll risk a (rare) crash under purify, but avoid having a leak detected. Note that this "leak" at shutdown is NBD, but this code at least shows that the would be leak is "understood" and acceptable. bug=6532 r=erikkay Review URL: http://codereview.chromium.org/42083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11473 0039d316-1c4b-4281-b951-d872f2087c98
* Use string for Histogram names since these are all ASCII anyway.dsh@google.com2009-02-241-5/+5
| | | | | | | | Wide-character literals cause problems between platforms. Review URL: http://codereview.chromium.org/28046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10276 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the purify directive which should no longer be necessary.ericroman@google.com2008-12-181-9/+0
| | | | | | | | | | Addressed by crbug.com/5645. TBR=erikkay@chromium.org Review URL: http://codereview.chromium.org/14850 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7229 0039d316-1c4b-4281-b951-d872f2087c98
* Mark MessageLoop::delayed_work_queue_ as initialized so Purify doesn't ↵ericroman@google.com2008-12-171-0/+9
| | | | | | | | | | report any UMRs when reading its comparator. BUG=5555 Review URL: http://codereview.chromium.org/14810 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7171 0039d316-1c4b-4281-b951-d872f2087c98
* message_pump_libevent refactor:jeremy@chromium.org2008-12-151-16/+11
| | | | | | | | | | * Unify WatchSocket & WatchFileHandle. * Better encapsulate libevent. * Fix a bug with blocking writes in ipc_posix.cc Review URL: http://codereview.chromium.org/13757 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7010 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 6911.ojan@google.com2008-12-121-11/+16
| | | | | | Review URL: http://codereview.chromium.org/14068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6916 0039d316-1c4b-4281-b951-d872f2087c98
* message_pump_libevent refactor:jeremy@chromium.org2008-12-121-16/+11
| | | | | | | | | | * Unify WatchSocket & WatchFileHandle. * Better encapsulate libevent. * Fix a bug with blocking writes in ipc_posix.cc Review URL: http://codereview.chromium.org/13757 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6911 0039d316-1c4b-4281-b951-d872f2087c98
* Add FD watching support to message_pump_libevent.jeremy@chromium.org2008-12-081-6/+16
| | | | | | | | This CL goes along the same lines as the WatchSocket code, but we really need better encapsulation for this class in generel. Review URL: http://codereview.chromium.org/13129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6513 0039d316-1c4b-4281-b951-d872f2087c98
* Switch MessagePumpForIO to use completion ports on Windows.rvargas@google.com2008-11-071-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the separation between MessagePumpForUI and MessagePumpForIO, and convert the latter to use Completion Ports instead of MsgWaitForMultipleobjects to sleep when idle. Remove all traces of Windows messages from MessagePumpForIO, remove the transitional API of completion port notifications and remove WatchObject API. Modify all callers of RegisterIOHandler so that they are no longer using RegisterIOContext, and also handle properly the new semantics of completion ports (notifications even when the IO completes immediately). Add a new interface to allow proper cleanup of disk cache (to replace code that was waiting for pending APCs from the destructor). Add a way for the message pump to perform cleanup of abandoned IO. BUG=B/1344358, 3497, 3630 TESt=unit tests R=darin Review URL: http://codereview.chromium.org/8156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5021 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+3
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Add a way to register for completion-ports based async operations to be handledrvargas@google.com2008-10-091-0/+9
| | | | | | | | | | | through the windows version of the message pump. As a first step, actual IO processing is still performed using WatchObject instead of using completion ports. Review URL: http://codereview.chromium.org/1950 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3157 0039d316-1c4b-4281-b951-d872f2087c98
* Implement MessageLoopForUI using GLib. This gets some exercise fromdsh@google.com2008-10-031-6/+8
| | | | | | | | | | base_unittest. BUG=1319 Review URL: http://codereview.chromium.org/4261 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2834 0039d316-1c4b-4281-b951-d872f2087c98
* As an intermediate step towards having a message pump handling IO through ↵rvargas@google.com2008-09-251-3/+6
| | | | | | | | | | completion ports, this CL creates two types of message pumps for windows: one to handle UI threads and another one to handle IO threads. I'm basically moving stuff around, except by the fact that now UI threads will not process APCs or wait on objects (those things only happen on message loops of TYPE_IO) Review URL: http://codereview.chromium.org/3094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2602 0039d316-1c4b-4281-b951-d872f2087c98
* Mac-specific CFRunLoop-based MessagePump implementationmark@chromium.org2008-09-231-2/+10
| | | | | | Review URL: http://codereview.chromium.org/444 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2521 0039d316-1c4b-4281-b951-d872f2087c98
* Always use the topmost delayed task as the basis for our WM_TIMER.darin@chromium.org2008-09-231-2/+2
| | | | | | | | | R=jar BUG=2559 Review URL: http://codereview.chromium.org/4041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2509 0039d316-1c4b-4281-b951-d872f2087c98
* Use libevent, second try. Changes this time:dkegel@google.com2008-09-181-1/+21
| | | | | | | | | - remove bogus include of base/completion_callback.h - add DEPS rules to allow including third_party/libevent Review URL: http://codereview.chromium.org/2964 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2371 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Make tcp_client_socket_unittest pass on Linux."evanm@google.com2008-09-181-21/+1
| | | | | | | This reverts commit d63170654d935f5a8ff6517bfacb60893f186a6b. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2347 0039d316-1c4b-4281-b951-d872f2087c98
* Make tcp_client_socket_unittest pass on Linux.dkegel@google.com2008-09-181-1/+21
| | | | | | | | | | Requires another changeset that puts libevent in third_party; I'll upload that next. This is not the final word; it makes too many syscalls per read. But it's a start. Review URL: http://codereview.chromium.org/3202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2346 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a mis-merge in TLS changes.deanm@chromium.org2008-09-101-4/+1
| | | | | | Review URL: http://codereview.chromium.org/1699 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1983 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of code from the old to new TLS interface.deanm@chromium.org2008-09-101-9/+19
| | | | | | Review URL: http://codereview.chromium.org/1660 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1982 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the GCC build.darin@chromium.org2008-09-101-2/+2
| | | | | | | | TBR=mmentovai Review URL: http://codereview.chromium.org/1687 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1962 0039d316-1c4b-4281-b951-d872f2087c98
* Put back r1891 with some task deletion disabled to maintain backwards compat ↵darin@chromium.org2008-09-101-36/+56
| | | | | | | | | | and thereby avoid unexpected crashes. r=jar Review URL: http://codereview.chromium.org/1664 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1959 0039d316-1c4b-4281-b951-d872f2087c98
* Revert the timeBeginPeriod changes in event_recorder. It's doing it's own ↵deanm@google.com2008-09-091-4/+0
| | | | | | | | timeGetTime calls, so let it manage all of those APIs on it's own. Remove an unneeded include in message_loop.cc. Review URL: http://codereview.chromium.org/1842 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1894 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply r1633 (which was reverted by r1635), with some additional ↵deanm@google.com2008-09-091-18/+0
| | | | | | | | modifications. Consolidate all timer resolution code to time.h, and always depend on TimeTicks::Now for 1ms resolution. Review URL: http://codereview.chromium.org/1806 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1893 0039d316-1c4b-4281-b951-d872f2087c98
* rollback r1891darin@google.com2008-09-091-36/+28
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1892 0039d316-1c4b-4281-b951-d872f2087c98
* Delete pending tasks that have not run. To do this properly, I found that I ↵darin@google.com2008-09-091-28/+36
| | | | | | | | | | | | cannot clear MessageLoop::current() until all of the tasks have been deleted. I wrote a loop to make sure that the queues are all empty. This could be abused, obviously. Another approach would be to CHECK that the second loop doesn't do anything. Thoughts? R=jar Review URL: http://codereview.chromium.org/1829 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1891 0039d316-1c4b-4281-b951-d872f2087c98
* Fix purify MLK errors resulting from my previous check-in. The TimerManager ↵darin@google.com2008-09-071-0/+7
| | | | | | | | | | previously deleted pending timers. We need to do the same for PostDelayedTask. This CL makes it so. TBR=jar Review URL: http://codereview.chromium.org/1607 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1826 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate the TimerManager by pulling its priority queue into MessageLoop. ↵darin@google.com2008-09-071-200/+140
| | | | | | | | | | This CL also eliminates TaskBase by creating a simple PendingTask struct that is allocated inline within a std::queue used to implement the queues in the MessageLoop class. R=jar Review URL: http://codereview.chromium.org/483 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1825 0039d316-1c4b-4281-b951-d872f2087c98
* Switch SharedTimerWin over to using PostDelayedTask. I made some tweaks to thedarin@google.com2008-08-301-13/+28
| | | | | | | | | | | | | PostDelayedTask implementation to ensure that perf is still good. This involved recording the intended fire time of PostDelayedTask on the Task object so that it can be used to properly determine the delay passed to the StartTimer call. With this change, I am able to service timers (call DoDelayedWork) more often from within the MessagePump implementations. R=mbelshe BUG=1346553 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1578 0039d316-1c4b-4281-b951-d872f2087c98
* rollback r1427 to attempt to fix test failuresdarin@google.com2008-08-271-0/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1429 0039d316-1c4b-4281-b951-d872f2087c98
* Re-enable DeletePendingTasks. We need this to plug memory leaks in the unitdarin@google.com2008-08-271-2/+0
| | | | | | | | | tests. TBR=abarth git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1427 0039d316-1c4b-4281-b951-d872f2087c98
* revert to using MessagePumpWin on all threadsdarin@google.com2008-08-261-12/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1368 0039d316-1c4b-4281-b951-d872f2087c98
* Allow consumers of MessageLoop to specify the type of MessageLoop they want.darin@google.com2008-08-261-14/+58
| | | | | | | | | | | | | | | | This CL introduces a Type enum to MessageLoop, and I also created subclasses of MessageLoop corresponding to the non-default types: MessageLoopForIO and MessageLoopForUI. I moved all of the platform-specific MessageLoop APIs onto either MessageLoopForIO or MessageLoopForUI. MessageLoopForIO gets the Watcher API, and MessageLoopForUI gets the Observer and Dispatcher APIs. Under the hood, both are implemented in terms of MessagePumpWin, but that will change in a future CL. The Thread class is changed to allow the consumer to specify the Type of MessageLoop they want to have setup on the created thread. I re-organized message_loop_unittest.cc and timer_unittest.cc so that I could exercise all (or most) of the tests against each type of MessageLoop. Note: I know that "explicit MessageLoop(Type type = TYPE_DEFAULT);" is in violation to the style-guide's restriction against default arguments. I'm working on finding a decent solution to that problem. Please ignore this issue for now. The corresponding chrome/ changes are coming in a separate CL due to Reitveld data size limitations. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1362 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
* Fix the final gcc warnings in base and net. Provide some macros to ↵mmentovai@google.com2008-08-211-1/+2
| | | | | | selectively disable MSVC warnings. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1194 0039d316-1c4b-4281-b951-d872f2087c98
* TrackedObjects assumes you can use a "TLS slot" of -1 to indicate ↵evanm@google.com2008-08-201-3/+5
| | | | | | 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-5/+3
| | | | 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-3/+5
| | | | | | 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
* Disable warning 4355 on Windows builds: "'this' : used in base member ↵maruel@google.com2008-08-201-1/+0
| | | | | | initializer list". git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1100 0039d316-1c4b-4281-b951-d872f2087c98