summaryrefslogtreecommitdiffstats
path: root/base/observer_list_threadsafe.h
Commit message (Collapse)AuthorAgeFilesLines
* base::Bind: Cleanup in base/observer_list*.jhawkins@chromium.org2011-10-121-3/+3
| | | | | | | | | | | BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/8229035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105148 0039d316-1c4b-4281-b951-d872f2087c98
* Delete Tracked, and move Location to its own file.ajwong@chromium.org2011-09-211-0/+1
| | | | | | | | | | | | | The Birth/Death tracking of tasks has been moved out-of-band into MessageLoop's PendingTask structure. Thus, Task no longer needs to inherit from Tracked. Since Task was the only child of Tracked, delete the Tracked class and move Location to its own file. BUG=none TEST=builds Review URL: http://codereview.chromium.org/7879006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102132 0039d316-1c4b-4281-b951-d872f2087c98
* Add MessageLoopProxy::currentnduca@chromium.org2011-08-151-1/+1
| | | | | | Review URL: http://codereview.chromium.org/7583053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96819 0039d316-1c4b-4281-b951-d872f2087c98
* Use MessageLoopProxy instead of MessageLoop to dispatch notifications in ↵adamk@chromium.org2011-08-091-17/+30
| | | | | | | | | | | | | | | ObserverListThreadsafe. This is nearly identical to the reverted r96013, with the modification that std::map::insert isn't used. Its invocation was complex (such that it worked in some compilers but not in others) and the performance gain is negligible in any use case I've seen in Chromium. BUG=91589 Review URL: http://codereview.chromium.org/7604006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96076 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 96013 - Use MessageLoopProxy instead of MessageLoop to dispatch ↵adamk@chromium.org2011-08-091-34/+18
| | | | | | | | | | | | | notifications in ObserverListThreadsafe. BUG=91589 Review URL: http://codereview.chromium.org/7584016 TBR=adamk@chromium.org Review URL: http://codereview.chromium.org/7605002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96024 0039d316-1c4b-4281-b951-d872f2087c98
* Use MessageLoopProxy instead of MessageLoop to dispatch notifications in ↵adamk@chromium.org2011-08-091-18/+34
| | | | | | | | | | ObserverListThreadsafe. BUG=91589 Review URL: http://codereview.chromium.org/7584016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96013 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Split DirectoryChangeListener for thread-safetyakalin@chromium.org2011-06-161-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Split DirectoryChangeListener into DirectoryChangeDelegate and TransactionObserver classes. This removes a remove/notify race condition with the DirectoryChange events. Make syncable::{Read,Write}Transaction take Locations instead of file/line pairs. Move construction of sync_manager_ into sync thread. Add logging utils in sync/logging.{h,cc}. Add overloads to ObserverListThreadSafe::Notify for 2, 3, and 4 arguments. Fixed 'Inital' misspelling in SyncBackendHost (finally). BUG=85656 TEST= Review URL: http://codereview.chromium.org/7190001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89413 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug in ObserverListThreadsafe::RemoveObserverakalin@chromium.org2011-06-051-9/+12
| | | | | | | | | | | | | | | | | | Like ObserverList, ObserverListThreadSafe::RemoveObserver should do nothing if the observer isn't in the list. Instead, it causes weird bugs if the list has 0 or 1 existing elements. Add comments clarifying semantics of AddObserver/RemoveObserver. Change AddObserver to do nothing in release mode if it tries to add an existing observer. BUG=84922 TEST= Review URL: http://codereview.chromium.org/7024037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87944 0039d316-1c4b-4281-b951-d872f2087c98
* iwyu: Use callback_old.h where appropriate, part 1.jhawkins@chromium.org2011-05-101-1/+1
| | | | | | | | | | | BUG=none TEST=none R=thakis@chromium.org Review URL: http://codereview.chromium.org/6985009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84725 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obsolete base/lock.h and fix up callers to use the new header file andbrettw@chromium.org2011-01-211-6/+6
| | | | | | | | | | | the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
* Add workaround for VS2005 compile error introduced by r70933akalin@chromium.org2011-01-111-3/+27
| | | | | | | | | BUG=None TEST=compiles on VS2005 Review URL: http://codereview.chromium.org/6198003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71081 0039d316-1c4b-4281-b951-d872f2087c98
* Made ObserverListThreadSafe's destructor private since it's ref-counted.akalin@chromium.org2011-01-101-7/+9
| | | | | | | | | BUG=None TEST=Compiles Review URL: http://codereview.chromium.org/3832006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70933 0039d316-1c4b-4281-b951-d872f2087c98
* Fix removal of multiple observers in ObserverListThreadSafe.willchan@chromium.org2010-09-171-4/+5
| | | | | | | | | BUG=55725 TEST=ObserverListThreadSafeTest.RemoveMultipleObservers Review URL: http://codereview.chromium.org/3381009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59833 0039d316-1c4b-4281-b951-d872f2087c98
* Allow NOTIFY_EXISTING_ONLY in ObserverListThreadSafe. Switch NCN to using it.willchan@chromium.org2010-08-311-2/+8
| | | | | | | | TEST=none Review URL: http://codereview.chromium.org/3235013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58089 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded #includes of <string> and <vector> from src/app and ↵viettrungluu@chromium.org2010-08-141-1/+0
| | | | | | | | | | | src/base. BUG=none TEST=builds Review URL: http://codereview.chromium.org/3173020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56144 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Attempt four at landing the "histogram.h removed from message_loop.h" patch.erg@chromium.org2010-07-151-1/+2
| | | | | | | | | | | | | | Previously committed as r52349 and r52336. Related commits: r52367, r52364 and r52343. Rerunning trybots due to previous trybot breakage. TEST=none BUG=none Review URL: http://codereview.chromium.org/2965015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52496 0039d316-1c4b-4281-b951-d872f2087c98
* Revert everything related to the relanding.erg@chromium.org2010-07-141-2/+1
| | | | | | Review URL: http://codereview.chromium.org/2982009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52367 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r52336.erg@chromium.org2010-07-141-1/+2
| | | | | | | | | | | | | | (I accidentally committed a previous version of the patch (the fixed version was in codereview since I had switched to my mac to address this exact compile failure.) BUG=none TEST=none TBR=evan Review URL: http://codereview.chromium.org/2937010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52349 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 52336 - More header cleanup:erg@chromium.org2010-07-141-2/+1
| | | | | | | | | | | | | | | | - Some cleanup to url_request.h - Remove task.h from headers that don't need it. - Remove histogram.h from message_loop.h BUG=none TEST=none Review URL: http://codereview.chromium.org/2986002 TBR=erg@chromium.org Review URL: http://codereview.chromium.org/2969006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52343 0039d316-1c4b-4281-b951-d872f2087c98
* More header cleanup:erg@chromium.org2010-07-141-1/+2
| | | | | | | | | | | | | - Some cleanup to url_request.h - Remove task.h from headers that don't need it. - Remove histogram.h from message_loop.h BUG=none TEST=none Review URL: http://codereview.chromium.org/2986002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52336 0039d316-1c4b-4281-b951-d872f2087c98
* Massively simplify the NetworkChangeNotifier infrastructure:pkasting@chromium.org2010-06-251-1/+1
| | | | | | | | | | | | | | * Use a process-wide object (singleton pattern) * Create/destroy this object on the main thread, make it outlive all consumers * Make observer-related functions threadsafe As a result, the notifier can now be used by any thread (eliminating things like NetworkChangeObserverProxy and NetworkChangeNotifierProxy, and expanding its usefulness); its creation and inner workings are much simplified (eliminating implementation-specific classes); and it is simpler to access (eliminating things like NetworkChangeNotifierThread and a LOT of passing pointers around). BUG=none TEST=Unittests; network changes still trigger notifications Review URL: http://codereview.chromium.org/2802015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50895 0039d316-1c4b-4281-b951-d872f2087c98
* Use DISALLOW_COPY_AND_ASSIGN instead of DISALLOW_EVIL_CONSTRUCTORS in app ↵tfarina@chromium.org2010-06-041-2/+2
| | | | | | | | | | | and base directories. BUG=None TEST=None Review URL: http://codereview.chromium.org/2654001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48931 0039d316-1c4b-4281-b951-d872f2087c98
* Pulled out Callback code into base/callback.h. This is the first step ↵akalin@chromium.org2010-02-191-0/+1
| | | | | | | | | | | | | towards redoing the Callback interfaces. Added and removed includes as needed. BUG=35223 TEST=trybots Review URL: http://codereview.chromium.org/646061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39419 0039d316-1c4b-4281-b951-d872f2087c98
* Fix up some style guide violations wrt aligning function arguments.willchan@chromium.org2010-02-121-1/+2
| | | | | | Review URL: http://codereview.chromium.org/593084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38951 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
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-6/+6
| | | | | | | | | | | 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
* Add a TODO from Jar.mbelshe@google.com2008-11-031-0/+3
| | | | | | Review URL: http://codereview.chromium.org/9262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4475 0039d316-1c4b-4281-b951-d872f2087c98
* The base unittests were succeeding for the isolatedmbelshe@google.com2008-11-031-0/+2
| | | | | | | | | | | | | | | tests, but failed when all tests were run because some tests run without a message loop. The observer_list_threadsafe allowed AddObserver to run with null message loops. But, if you call Notify after doing so, then the notify call would attempt to use the registered "null" ptr to a message loop. This crashed, of course. Review URL: http://codereview.chromium.org/9045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4459 0039d316-1c4b-4281-b951-d872f2087c98
* Make the SystemMonitor observer list thread safe.mbelshe@google.com2008-11-031-2/+6
| | | | | | | | This is done by using the new observer_list_threadsafe. Review URL: http://codereview.chromium.org/4288 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4452 0039d316-1c4b-4281-b951-d872f2087c98
* Create a thread-safe observer list. Will be usedmbelshe@google.com2008-10-221-0/+190
by SystemMonitor. Right now the class requires that Observers be RefCounted<>. This is because we invoke tasks via NewRunnableMethod for them. However, because we manually track lifecycle via AddObserver/RemoveObserver, we could override the RunnableMethodTraits to not require RefCounted<>. This would have the advantage that callers do not need to make all Observers be RefCounted, but makes it more critical that observers not forget to call RemoveObserver(). Review URL: http://codereview.chromium.org/7353 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3787 0039d316-1c4b-4281-b951-d872f2087c98