summaryrefslogtreecommitdiffstats
path: root/base/object_watcher.cc
Commit message (Collapse)AuthorAgeFilesLines
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-2/+2
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC::SyncChannel not duplicate the underlying MessageLoop ↵jam@chromium.org2008-10-241-0/+7
| | | | | | | | 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
* 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
* rollback the experimentsdarin@google.com2008-08-091-34/+9
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@630 0039d316-1c4b-4281-b951-d872f2087c98
* experiment with APCsdarin@google.com2008-08-091-11/+33
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@629 0039d316-1c4b-4281-b951-d872f2087c98
* just a test...darin@google.com2008-08-091-0/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@628 0039d316-1c4b-4281-b951-d872f2087c98
* rollback my experiment to see the effectsdarin@google.com2008-08-081-4/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@551 0039d316-1c4b-4281-b951-d872f2087c98
* This is an experiment to see the impact of a boosted priority on the pagedarin@google.com2008-08-071-0/+4
| | | | | | | | | | | cyclers. I worry that this could lead to starvation of regular tasks (it is common for OnObjectSignaled to do another IO call), so I don't think this is necessarily a good solution. TBR=jar git-svn-id: svn://svn.chromium.org/chrome/trunk/src@530 0039d316-1c4b-4281-b951-d872f2087c98
* ObjectWatcher needs to know when the current thread's MessageLoop is being ↵darin@google.com2008-08-051-1/+12
| | | | | | destroyed. This might also be generically useful, so I added a new API on ML to observe when the ML is being destroyed. The notification is sent to observers just prior to ML::current() being modified to return NULL. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@407 0039d316-1c4b-4281-b951-d872f2087c98
* Revise the ObjectWatcher API to be one-to-one with the object being watched. ↵darin@google.com2008-08-041-39/+35
| | | | | | | | | | | | This greatly simplifies the implementation and API. Now consumers can use ObjectWatcher as a "smart pointer" class, which automatically cleans-up after itself when it goes out of scope. I also switched away from the Task based API to one that is more compatible with MessageLoop::WatchObject. That allows me to make minimal changes to existing code, and it also means that consumers do not have to allocate Task objects to use this API. In this CL, I included changes to make a couple consumers use ObjectWatcher instead of ML::WatchObject. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@322 0039d316-1c4b-4281-b951-d872f2087c98
* Call ResetBirthTime before dispatching the user's Task. Also, remove ↵darin@google.com2008-08-021-0/+1
| | | | | | | | PostSignaledTask since it won't be used. TBR=jar git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289 0039d316-1c4b-4281-b951-d872f2087c98
* A helper class for calling RegisterWaitForSingleObject with the objective of ↵darin@google.com2008-08-011-0/+148
finding out when objects get signaled. The API is pretty simple: - consumer can associate a Task with a HANDLE via AddWatch method - when the HANDLE is signaled, we run the Task on the thread that called AddWatch - the consumer can call CancelWatch to abort the watch - a watch is one-shot: after the object is signaled, the consumer has to call AddWatch again to wait a second time - if the ObjectWatcher instance is destroyed, it cancels all associated watches. Implementation details: - Uses RegisterWaitForSingleObject to run a function on the wait thread. This avoids extra thread marshaling to a worker thread. - Uses a Task to get back onto the origin thread. This is possible due to the UnregisterWaitEx(INVALID_HANDLE_VALUE) call. - Once on the origin thread, runs the consumer's Task directly. This is the first part of changes I want to make to MessageLoop::WatchObject. For now, I have not made any changes to existing code. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259 0039d316-1c4b-4281-b951-d872f2087c98