summaryrefslogtreecommitdiffstats
path: root/base/memory
Commit message (Collapse)AuthorAgeFilesLines
* Add missing BASE_EXPORT to fix buildjoth@chromium.org2011-11-071-1/+2
| | | | | | | | | | | | In follow up to http://src.chromium.org/viewvc/chrome?view=rev&revision=108853 BUG=None TEST=http://chromegw.corp.google.com/i/chromium/builders/Linux%20Builder%20%28dbg%29%28shared%29 goes green TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8491010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108855 0039d316-1c4b-4281-b951-d872f2087c98
* Thin out the Singeton template codejoth@chromium.org2011-11-072-22/+52
| | | | | | | | | | | | - hides platform_thread.h from users of singelton - knock 4KB off the release binary size BUG=None TEST=Nothing breaks Review URL: http://codereview.chromium.org/8475007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108853 0039d316-1c4b-4281-b951-d872f2087c98
* Minor perf and size optimization - don't do asserts in release buildjoth@chromium.org2011-11-041-0/+3
| | | | | | | | | | | Avoiding the pthread_getspecific call on every pointer access seems worth it (and it reduces templated code size) BUG=None TEST=None Review URL: http://codereview.chromium.org/8465010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108678 0039d316-1c4b-4281-b951-d872f2087c98
* Thread::Stop() must be called before any subclass's destructor completes.joi@chromium.org2011-11-021-0/+4
| | | | | | | | | | | Update base::Thread documentation, fix all subclasses I could find that had a problem, and remove no-longer-necessary suppressions. BUG=102134 Review URL: http://codereview.chromium.org/8427007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108296 0039d316-1c4b-4281-b951-d872f2087c98
* Remove an unused typedef in scoped_nsobject.hisherman@chromium.org2011-10-171-4/+0
| | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/8283019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105764 0039d316-1c4b-4281-b951-d872f2087c98
* Support dynamic switching between integrated and discrete GPUs on Mac OS X.kbr@chromium.org2011-10-131-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Chrome to allocate most OpenGL contexts with the kCGLPFAAllowOfflineRenderers flag, and specify NSSupportsAutomaticGraphicsSwitching in the Info.plist for the main executable and helper apps. This keeps Chrome on the integrated GPU except when using WebGL, accelerated 2D Canvas, Pepper 3D, and Core Animation-based plugins (except Flash). Chrome shares resources between OpenGL contexts in order to display WebGL and other content in the compositor, and resource sharing doesn't work between contexts allocated on different GPUs. Therefore, when the first context for a given renderer requests the discrete GPU, the channel is dropped and all contexts are reallocated on the discrete GPU. Similarly, when the last context requesting the discrete GPU for a given renderer is shut down, all contexts are dropped and reallocated on the integrated GPU. Currently dynamic GPU switching is only supported on the latest Mac OS X 10.7 update and MacBook Pros with dual AMD / Intel GPUs, though this will improve in future OS updates. Tested with WebGL, CSS 3D, Flash and Unity3D content and observed desired GPU switching behavior. Also added a layout test to WebKit under https://bugs.webkit.org/show_bug.cgi?id=69776 which when run in Chrome catches an assertion failure related to the destruction of contexts. The intent is to add it as a UI layout test on the GPU bots. BUG=88788 TEST=none Review URL: http://codereview.chromium.org/8233027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105399 0039d316-1c4b-4281-b951-d872f2087c98
* Add trace code to track all posted tasks in message_loop and WorkerThreads ↵jbates@chromium.org2011-10-031-0/+3
| | | | | | | | | | | | (non-official builds only). It's very helpful to understand what chrome is doing at runtime. Sometimes a thread in chrome does something expensive that causes a frame hitch. With this change, any expensive task will show up clearly in traces, with the file/function of where the task was posted. TEST=go to about:tracing, run a trace and notice that all tasks are traced. Review URL: http://codereview.chromium.org/7778033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103740 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream ProcessUtilTest, and make a few other files compile on Android.jingzhao@chromium.org2011-09-291-1/+1
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/8059007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103236 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the free_ member of scoped_ptr_malloc.evan@chromium.org2011-08-291-7/+3
| | | | | | | | | | | | | | | | Conceptually, the function to call is known at compile time. There is no reason to save it into a static variable. It turns out doing causes the compiler to emit a static initializer to track whether free_ has been initialized. This change removes static initializers from eight .o files on my local Release build. BUG=87171 Review URL: http://codereview.chromium.org/7795008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98718 0039d316-1c4b-4281-b951-d872f2087c98
* Make WeakPtr thread-safe, i.e. allow cross-thread copying of WeakPtrsievers@chromium.org2011-08-263-18/+220
| | | | | | | | | | | | | | | | | | | | | | | | | and destruction on a thread other than the one where the original reference was created. The problem with the current implementation is modifying the flag pointer from WeakPtr::~WeakPtr which might happen on a different thread (potentially racing with somebody invalidating the flag on the original thread). For compatibility reasons, creating the initial reference attaches to the thread and governs the thread-safety checking logic with respect to checking a reference to be valid and invalidating it, which should both only be done on the same thread. BUG=82509 TEST=added unit tests Added memleak suppression: http://crbug.com/94345 TBR=timurrrr@chromium.org Review URL: http://codereview.chromium.org/7677028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98443 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 97808 - Make WeakPtr thread-safe, i.e. allow cross-thread copying of ↵cbentzel@chromium.org2011-08-233-220/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | WeakPtr and destruction on a thread other than the one where the original reference was created. The problem with the current implementation is modifying the flag pointer from WeakPtr::~WeakPtr which might happen on a different thread (potentially racing with somebody invalidating the flag on the original thread). For compatibility reasons, creating the initial reference attaches to the thread and governs the thread-safety checking logic with respect to checking a reference to be valid and invalidating it, which should both only be done on the same thread. BUG=82509 TEST=added unit tests Review URL: http://codereview.chromium.org/7677028 TBR=sievers@chromium.org Review URL: http://codereview.chromium.org/7685054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97846 0039d316-1c4b-4281-b951-d872f2087c98
* Make WeakPtr thread-safe, i.e. allow cross-thread copying of WeakPtrsievers@chromium.org2011-08-233-18/+220
| | | | | | | | | | | | | | | | | | | | | and destruction on a thread other than the one where the original reference was created. The problem with the current implementation is modifying the flag pointer from WeakPtr::~WeakPtr which might happen on a different thread (potentially racing with somebody invalidating the flag on the original thread). For compatibility reasons, creating the initial reference attaches to the thread and governs the thread-safety checking logic with respect to checking a reference to be valid and invalidating it, which should both only be done on the same thread. BUG=82509 TEST=added unit tests Review URL: http://codereview.chromium.org/7677028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97808 0039d316-1c4b-4281-b951-d872f2087c98
* Remove Purify and Quantify.Doing so will reduce substantially the size of ↵jeanluc@chromium.org2011-08-173-104/+1
| | | | | | | | | the project files. BUG=92102 Review URL: http://codereview.chromium.org/7528010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97156 0039d316-1c4b-4281-b951-d872f2087c98
* Optimize phishing page term feature extraction.gcasto@chromium.org2011-08-092-2/+63
| | | | | | | | | | | | | | | | | | | | | | | We've been seeing in the histograms that for some users, page feature extraction is taking much longer than we would like, up to 200ms between stops. This could possibly contribute to jankiness in the UI. These are some timings from my desktop for how long it takes to extract features before and after these changes. Obviously this is on much better hardware than the use case we are worried about, but hopefully the increase is speed is proportional. Before After CNN 19 7.5 ESPN 22 9.5 Google 12 4 Salon 40 12 BUG= TEST=Ran associated unit tests. Review URL: http://codereview.chromium.org/7549003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96097 0039d316-1c4b-4281-b951-d872f2087c98
* Rename BASE_API to BASE_EXPORT.darin@chromium.org2011-08-054-14/+14
| | | | | | | R=rvargas Review URL: http://codereview.chromium.org/7461141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95618 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land r93365 - add RefCountedStringjoth@chromium.org2011-07-223-14/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added RefCountedString, as this is what many RefCountedMemory users seem to want Made data member of RefCountedBytes private, as per style guide Changed base64 APIs to accept StringPiece, as it's sometimes better and never worse than string. Fix chromeos build; additional files updated comapred to previous patch: chrome/browser/ui/login/login_prompt_ui.cc chrome/browser/ui/webui/active_downloads_ui.cc chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.cc chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc chrome/browser/ui/webui/chromeos/login/login_ui.cc chrome/browser/ui/webui/chromeos/login/login_ui_helpers.cc chrome/browser/ui/webui/chromeos/login/login_ui_helpers.h chrome/browser/ui/webui/chromeos/login/mock_login_ui_helpers.h chrome/browser/ui/webui/chromeos/login/oobe_ui.cc chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc chrome/browser/ui/webui/chromeos/register_page_ui.cc chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc chrome/browser/ui/webui/chromeos/system_info_ui.cc chrome/browser/ui/webui/collected_cookies_ui_delegate.cc BUG=None TEST=All existing tests pass. Extended ref_counted_memory_unittests Review URL: http://codereview.chromium.org/7397021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93617 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 93365 - it broke on Chrome OSjoth@chromium.org2011-07-213-118/+12
| | | | | | | | | | | | | | | | Added RefCountedString, as this is what many RefCountedMemory users seem to want Made data member of RefCountedBytes private, as per style guide Changed base64 APIs to accept StringPiece, as it's sometimes better and never worse than string. BUG=None TEST=All existing tests pass. Extended ref_counted_memory_unittests Review URL: http://codereview.chromium.org/7397021 TBR=joth@chromium.org Review URL: http://codereview.chromium.org/7471033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93367 0039d316-1c4b-4281-b951-d872f2087c98
* Added RefCountedString, as this is what many RefCountedMemory users seem to wantjoth@chromium.org2011-07-213-12/+118
| | | | | | | | | | | | Made data member of RefCountedBytes private, as per style guide Changed base64 APIs to accept StringPiece, as it's sometimes better and never worse than string. BUG=None TEST=All existing tests pass. Extended ref_counted_memory_unittests Review URL: http://codereview.chromium.org/7397021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93365 0039d316-1c4b-4281-b951-d872f2087c98
* some cleanup for base/stl_utildilmah@chromium.org2011-07-191-1/+1
| | | | | | | | | | | | | removed unused/irrelevant functions removed irrelevant comments Moved stl_util-inl.h => stl_util.h BUG=None TEST=None Review URL: http://codereview.chromium.org/7342047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93110 0039d316-1c4b-4281-b951-d872f2087c98
* Add a warning to the top of base/memory/singleton.hscherkus@chromium.org2011-06-211-0/+14
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7217014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89870 0039d316-1c4b-4281-b951-d872f2087c98
* Avoiding duplication of singular iteratortzik@chromium.org2011-06-211-1/+1
| | | | | | | | | | BUG= 65151 TEST='MRUCacheTest.*' Review URL: http://codereview.chromium.org/7187005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89848 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing test to WeakPtrcpu@chromium.org2011-05-241-0/+14
| | | | | | | | | | | | | | | | | | | | | I discovered we have a weak pointer now and in my quest to understand how it works I spotted case that was not tested: 1) ctor weakptr a 2) ctor factory f 3) ctor weakptr b 4) dtor weakptr b 5) dtor factory f 6) test a Mostly because I thought I saw a mistake but alas it works as-is but still the test is missing. BUG=none TEST= this is a test Review URL: http://codereview.chromium.org/7065030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86526 0039d316-1c4b-4281-b951-d872f2087c98
* Move scoped_temp_dir and scoped_native_library back from base/memory to base.thakis@chromium.org2011-05-196-383/+0
| | | | | | | | | | | It looks like they got moved accidentally in http://codereview.chromium.org/6714032 BUG=none TEST=none Review URL: http://codereview.chromium.org/7048007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86010 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
* Moved mru_cache from content/common to base/memory.agayev@chromium.org2011-04-272-0/+516
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/6883187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83182 0039d316-1c4b-4281-b951-d872f2087c98
* Delete a few unused functions.thakis@chromium.org2011-04-251-3/+0
| | | | | | | | | BUG=none TEST=Compiles. Review URL: http://codereview.chromium.org/6880164 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82884 0039d316-1c4b-4281-b951-d872f2087c98
* linux: don't always print dlopen errors from LoadNativeLibraryevan@chromium.org2011-04-181-1/+1
| | | | | | | | | | | Instead, return them to the caller and let the caller decide whether the error is worth notifying the user about. BUG=79068 Review URL: http://codereview.chromium.org/6864020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82008 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base::internal::WeakReference::Flag to be RefCountedThreadSafe.willchan@chromium.org2011-04-112-24/+23
| | | | | | | | | | | | | This allows a base::WeakPtr to be deleted on a different thread, which will modify the refcount on Flag. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81142 Review URL: http://codereview.chromium.org/6826034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81148 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 81142 - Fix base::internal::WeakReference::Flag to be ↵erg@google.com2011-04-112-23/+24
| | | | | | | | | RefCountedThreadSafe.This allows a base::WeakPtr to be deleted on a different thread, which will modify the refcount on Flag.BUG=noneTEST=noneReview URL: http://codereview.chromium.org/6826034 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/6821053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81144 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base::internal::WeakReference::Flag to be RefCountedThreadSafe.willchan@chromium.org2011-04-112-24/+23
| | | | | | | | | | | | This allows a base::WeakPtr to be deleted on a different thread, which will modify the refcount on Flag. BUG=none TEST=none Review URL: http://codereview.chromium.org/6826034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81142 0039d316-1c4b-4281-b951-d872f2087c98
* Base: Last set of files to use BASE_API (for base.dll)rvargas@google.com2011-03-282-4/+7
| | | | | | | | | | Note that a bunck of these files have no unit tests :( BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6747014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79633 0039d316-1c4b-4281-b951-d872f2087c98
* When looking at this bug, I found at least the following issues:scr@chromium.org2011-03-282-0/+162
| | | | | | | | | | | | | | | | | | 1) PasswordManagerHandler was not canceling requests if new requests were made (by double-clicking the "Manage Saved Passwords..." button with a slow database - simulated with long Sleep). 2) PasswordStore starts its handle numbering at 0 meaning that the very first request is non-true and could hit DCHECK(s). 3) PasswordManagerHandler doesn't free the results. When talking with the DOMUI TL (jhawkins) and an author of PasswordStore (stuartmorgan), I learned that it was modeled after HistoryService, which had since been refactored into a reusable suite of classes in content/browser/cancelable_request.h So the CL will include fixes for the 3 issues, as well as a refactor to use the shared code in cancelable_requst.h BUG=71466 TEST=chrome://settings/personal, then click "Manage Saved Passwords". Put PlatformThread::Sleep(10000), then try double-clicking the button to see no error. Review URL: http://codereview.chromium.org/6646051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79625 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-2829-0/+3557
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