summaryrefslogtreecommitdiffstats
path: root/base/ref_counted.h
Commit message (Collapse)AuthorAgeFilesLines
* Roll to a version of LevelDB that doesn't depend on the old ref_counted.h ↵jorlow@chromium.org2011-03-301-13/+0
| | | | | | | | | | | | and delete it. R=levin@chromium.org BUG=77801 TEST=none Review URL: http://codereview.chromium.org/6771027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79865 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-289/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Base: First pass at having base.dll: definition ofrvargas@google.com2011-03-221-3/+4
| | | | | | | | | | BASE_API and a few files that use it. BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6725001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79056 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 78649 - Finished running the experiment.willchan@chromium.org2011-03-191-4/+30
| | | | | | | | | | | | | | | | | Chrome is too fast, make it slower. Test out using RefCountedThreadSafeBase for all refcounting. Will revert after I'm done testing performance implications. BUG= TEST= Review URL: http://codereview.chromium.org/6712009 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/6711057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78811 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome is too fast, make it slower.willchan@chromium.org2011-03-181-30/+4
| | | | | | | | | | | | Test out using RefCountedThreadSafeBase for all refcounting. Will revert after I'm done testing performance implications. BUG= TEST= Review URL: http://codereview.chromium.org/6712009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78649 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r74850 and r74865:ajwong@chromium.org2011-02-151-14/+3
| | | | | | | | | | | | - Redo "Add extra heap-allocation to refcounting. For perf test only." - Another intentional leak introduced by r74850 BUG=none TEST=none Review URL: http://codereview.chromium.org/6484047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75005 0039d316-1c4b-4281-b951-d872f2087c98
* Redo "Add extra heap-allocation to refcounting. For perf test only."ajwong@chromium.org2011-02-141-3/+14
| | | | | | | | | | | | | Leaving it in tree for longer perf testing. Original review http://codereview.chromium.org/6484024/ BUG=none TEST=none Review URL: http://codereview.chromium.org/6517022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74850 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add extra heap-allocation to refcounting. For perf test only. Will ↵ajwong@chromium.org2011-02-131-14/+3
| | | | | | | | | | Revert after one build." This reverts commit r74764. TBR=willchan git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74765 0039d316-1c4b-4281-b951-d872f2087c98
* Add extra heap-allocation to refcounting. For perf test only. Will Revert ↵ajwong@chromium.org2011-02-131-3/+14
| | | | | | | | | | | after one build. BUG= TEST= Review URL: http://codereview.chromium.org/6484024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74764 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/thread.h to base/threading, fix up callers to use the new location.brettw@chromium.org2011-01-011-1/+1
| | | | | | | | TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6028009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70345 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert "Const-ify RefCountedThreadSafe::AddRef and Release.""mpcomplete@chromium.org2010-10-221-5/+5
| | | | | | | | | chrome_frame failed to compile last time. I needed to add a "mutable" to a member variable in chrome_frame/metrics_service.cc. Review URL: http://codereview.chromium.org/3971004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63574 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Const-ify RefCountedThreadSafe::AddRef and Release."levin@chromium.org2010-10-221-5/+5
| | | | | | This reverts commit b7ce919957536ceb0cfac1709bc779fd086b6ce8. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63459 0039d316-1c4b-4281-b951-d872f2087c98
* Const-ify RefCountedThreadSafe::AddRef and Release.mpcomplete@chromium.org2010-10-221-5/+5
| | | | | | Review URL: http://codereview.chromium.org/3869003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63457 0039d316-1c4b-4281-b951-d872f2087c98
* Make the ref counts mutable, so we can ref count const objects.willchan@chromium.org2010-10-021-11/+11
| | | | | | Review URL: http://codereview.chromium.org/1575024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61263 0039d316-1c4b-4281-b951-d872f2087c98
* Fix lines longer than 80 characters.tfarina@chromium.org2010-07-281-2/+3
| | | | | | | | | BUG=50266 TEST=None Review URL: http://codereview.chromium.org/3013038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53958 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
* Forces T*s to scoped_refptr<T> when PostTask()ing to a function expecting ↵jamesr@chromium.org2009-11-201-0/+18
| | | | | | | | scoped_refptr<T> Review URL: http://codereview.chromium.org/418007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32706 0039d316-1c4b-4281-b951-d872f2087c98
* First patch in making destructors of refcounted objects private.jam@chromium.org2009-11-051-2/+7
| | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/360042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31136 0039d316-1c4b-4281-b951-d872f2087c98
* Add the ability for objects which derive from RefCountedThreadSafe to ↵jam@chromium.org2009-11-021-3/+26
| | | | | | | | | | | | specify a destructor trait. This allows browser objects to specify which thread they're terminated on. The benefit is we avoid the need to do manual ref counting when an object posts tasks to itself on different threads, if an object must be destructed on a specific thread. This patch adds initial support and only shows one example with ResourceMessageFilter. I will do the rest in a follow-up patch to keep things small. BUG=25354 TEST=added unit tests Review URL: http://codereview.chromium.org/338065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30688 0039d316-1c4b-4281-b951-d872f2087c98
* First fix to minimize copying of image data.erg@google.com2009-10-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of multiple patches that clean up handling of memory regarding images. Previously, the code did several memcpy()s or equivalents. This change: - Creates an abstract interface RefCountedMemory which provides access to the front() of a memory range and the size() of it. It is a RefCountedThreadSafe. - Adds a RefCountedStaticMemory class which isa RefCountedMemory. - Pushes RefCountedBytes up into base/ from chrome/ and make it conform to RefCountedMemory. - Have ResourceBundle return RefCountedStaticMemory to the mmaped() or DLL loaded resources instead of memcpy()ing them. - General cleanups to minimize copies in constructing RefCountedBytes. - Use the above consistent interface in the BrowserThemeProvider, along with special casing the loading of the new tab page background. This patch is mostly cleanups and there should only be a slight performance gain if any. Most of the real speedups should come in subsequent patches. BUG=http://crbug.com/24493 TEST=Slightly faster on Perf bot; does not introduce crashes. Review URL: http://codereview.chromium.org/288005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29412 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 27389.darin@chromium.org2009-09-301-0/+4
| | | | | | Review URL: http://codereview.chromium.org/246027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27594 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 27379, in hopes of fixing browser_tests.senorblanco@chromium.org2009-09-281-4/+0
| | | | | | | | TBR=darin Review URL: http://codereview.chromium.org/248021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27389 0039d316-1c4b-4281-b951-d872f2087c98
* Assert that thread-safe reference counting is used withdarin@chromium.org2009-09-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | cross-thread NewRunnableMethod. This assertion caught such an error in VisitedLinkMaster! My approach, modify RunnableMethodTraits<T> to assert that when ReleaseCallee happens on a different thread from RetainCallee that the type supports thread-safe reference counting. I do this by adding a static method to both RefCounted<T> and RefCountedThreadSafe<T>. This results in a little ugliness in cases where people implement AddRef and Release by hand (to make the no-ops). There may be a nicer way to deal with those few cases. R=brettw BUG=none TEST=none Review URL: http://codereview.chromium.org/251012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27379 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ScopedRunnableMethodFactory using WeakPtr.darin@chromium.org2009-09-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required some changes to WeakPtr to support the addition of WeakPtrFactory::HasWeakPtrs(), which is used to implement ScopedRunnableMethodFactory::empty(). Now, the WeakReferenceOwner just holds a pointer to the Flag class, and the Flag holds a back-pointer that it can use to clear the WeakReferenceOwner's pointer when the Flag is destroyed. I use the null'ness of this back-pointer in place of the bool member that was previously used to indicate if the WeakReference is valid. It was also necessary to expose a HasOneRef method on RefCounted. I included one on RefCountedThreadSafe for completeness. Finally, I switched HttpCache over to using WeakPtr instead of RevocableStore so that I could delete RevocableStore. (I'm making this change to consolidate similar functionality.) R=abarth BUG=none TEST=none Review URL: http://codereview.chromium.org/235027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27287 0039d316-1c4b-4281-b951-d872f2087c98
* Cross-process Message Port implementation.jam@chromium.org2009-08-041-0/+11
| | | | | | | | | I'm sending this first, then I'll add support to workers in another changelist to avoid making this change larger. TEST=running message port related layout tests in ui_tests Review URL: http://codereview.chromium.org/159372 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22356 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce the amount of included header files. Vast change like in "Oh God! ↵maruel@chromium.org2009-02-181-1/+0
| | | | | | | | This revision changes half of the source files!". Review URL: http://codereview.chromium.org/20378 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9958 0039d316-1c4b-4281-b951-d872f2087c98
* Add thread safety checks but keep them disabled for now until I fix all the ↵maruel@chromium.org2009-01-261-0/+3
| | | | | | | | | current places where it triggers. Fix thread_collision_warner for real this (third?) time. Review URL: http://codereview.chromium.org/18569 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8650 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8499.maruel@chromium.org2009-01-221-3/+0
| | | | | | Review URL: http://codereview.chromium.org/18687 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8504 0039d316-1c4b-4281-b951-d872f2087c98
* Add (currently disabled) RefCountedBase check. (2nd try)maruel@chromium.org2009-01-221-0/+3
| | | | | | Review URL: http://codereview.chromium.org/18438 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8499 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8180.maruel@chromium.org2009-01-161-3/+0
| | | | | | Review URL: http://codereview.chromium.org/18319 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8186 0039d316-1c4b-4281-b951-d872f2087c98
* Add thread safety checks but keep them disabled for now until I fix all the ↵maruel@chromium.org2009-01-161-0/+3
| | | | | | | | | | | current places where it triggers. Set back StoreRef as non-thread-safe. BUG5689 Review URL: http://codereview.chromium.org/18272 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8180 0039d316-1c4b-4281-b951-d872f2087c98
* Changing access to scoped_refptr member variables from private to protected.tommi@chromium.org2009-01-101-1/+1
| | | | | | | | This is required to be able to extend the functionality of the class where existing public functionality does not offer sufficient access. Review URL: http://codereview.chromium.org/17464 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7851 0039d316-1c4b-4281-b951-d872f2087c98
* Move DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe<T>) to private section.tim@chromium.org2008-12-101-0/+1
| | | | | | | | | | | | I hope this is as innocent as it seems, but the presence of the "subtle" namespace freaks me out. Given that everything built, I doubt this was affecting anything because if it were somehow abused moving this to private should have generated compilation errors. In any event, smack me if I'm missing something "subtley" obvious or should try something else (besides running tests). Review URL: http://codereview.chromium.org/13219 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6715 0039d316-1c4b-4281-b951-d872f2087c98
* Remove throttling code from the Browser process and implement throttling in ↵erg@google.com2008-10-171-1/+13
| | | | | | | | | | | | | the Renderer. The previous way of doing throttling was just calling CloseContents() on a window to reject it. But since the Browser is notified about a window opening asynchronously, by the time the CloseContents() sends a message back to the Renderer, a bunch more windows have been opened, leading to memory exhaustion. Instead, make all RenderViews created from a parent RenderView share a counter and start refusing to create RenderViews if too many RV have been created. Every RenderView (except for the first one) is assumed to be an unrequested popup, until notified by the Browser process by either a ViewMsg_DisassociateFromPopupCount message (this RenderView is a new top level page) or a ViewMsg_DisassociatePopup message (this RenderView is a requested popup and therefore shouldn't count against the count.) BUG=3382, 2632 Review URL: http://codereview.chromium.org/7388 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3568 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
* Add ref_counted.cc to the Mac build.mmentovai@google.com2008-08-151-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@938 0039d316-1c4b-4281-b951-d872f2087c98
* Large patch set (159 files total) to cleanup the includes.maruel@google.com2008-08-151-65/+59
| | | | | | | | | | - Slightly reduce the size of the generated .lib files ~3%. - Reduce the number of implicit and explicit atl and windows includes. hooray! - Help incremental build by reducing the number of unnecessary included files. - Split some template class in two, one base class for the common code and the specialization that inherits from the base class. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@937 0039d316-1c4b-4281-b951-d872f2087c98
* Move ref_counted to the new atomic_ref_count interface.deanm@google.com2008-08-061-8/+5
| | | | | | | | BUG=1112286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@425 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+249
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98