summaryrefslogtreecommitdiffstats
path: root/base
Commit message (Collapse)AuthorAgeFilesLines
* Make SystemMonitor not a Singleton and move it out of basephajdan.jr@chromium.org2009-11-269-461/+19
| | | | | | | | | | | | | SystemMonitor makes an assumption that through its lifetime a MessageLoop exists and stays the same. It is difficult and error-prone to satisfy that when it is a Singleton. It has caused problems in the past. Additionally, extract HighResoltionTimerManager out of time_win.cc, eliminating yet another Singleton. TEST=none BUG=none Review URL: http://codereview.chromium.org/431008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33214 0039d316-1c4b-4281-b951-d872f2087c98
* Convert the existing .gyp configuration to use the new base\allocatorsgk@chromium.org2009-11-262-2/+13
| | | | | | | | | | library with upstream source code from the new vendor branch patterns in third_party\jemalloc and third_party\tcmalloc. BUG=27911 TEST=none Review URL: http://codereview.chromium.org/435040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33208 0039d316-1c4b-4281-b951-d872f2087c98
* For now, let's clear local storage whenever we clear cookies.jorlow@chromium.org2009-11-263-0/+16
| | | | | | | | BUG=28788 TEST="Clear private data..." from the menu, check cookies, and tell it ok. Data in "Local Storage" inside the profile's data dir should be deleted and any open websites that were using that data should no longer be able to see it. Review URL: http://codereview.chromium.org/441012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33162 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SyncSocket class for Posix targets (Linux, Mac), and enable thesehr@google.com2009-11-262-0/+102
| | | | | | | | | | | corresponding unittest. This feature, as a reminder, allows low-latency (blocking) send/receive between processes, and will be used for real-time thread synchronization for Pepper audio and for direct synchronization for 3D video. Review URL: http://codereview.chromium.org/431043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33161 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor OS-dependent filename exclusion patternsevan@chromium.org2009-11-261-34/+1
| | | | | | | | | | | | | Rather than duplicate logic in the tree, merge all of the shared rules about patterns in filenames into one common set. The pattern is: "if (OS != x): exclude x's files." This is especially needed for upcoming changes that bring in a few more platform-specific (FreeBSD, OpenBSD, Solaris(?)) files. Review URL: http://codereview.chromium.org/443011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33160 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Remove deprecated function SetCurrentDirectory.thestig@chromium.org2009-11-252-5/+0
| | | | | | | | | | | BUG=24672 TEST=None Original Review URL: http://codereview.chromium.org/391059 Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/434093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33135 0039d316-1c4b-4281-b951-d872f2087c98
* Properly detect KDE4 on newer systems (e.g. [K]Ubuntu 9.04).mdm@chromium.org2009-11-251-1/+6
| | | | | | | | BUG=25938 TEST=try to configure proxy settings on KDE4 when $DESKTOP_SESSION=kde, it should work Review URL: http://codereview.chromium.org/427013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33132 0039d316-1c4b-4281-b951-d872f2087c98
* Make the eviction function faster by reading/writing 1MB blocksnsylvain@chromium.org2009-11-251-26/+25
| | | | | | | instead of 4k. Review URL: http://codereview.chromium.org/442011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33129 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix spurious gcc warning.pkasting@chromium.org2009-11-251-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33112 0039d316-1c4b-4281-b951-d872f2087c98
* Many changes to DictionaryValues:pkasting@chromium.org2009-11-257-122/+269
| | | | | | | | | | | | | | | | | * Add support for keys with "." in them via new XXXWithoutPathExpansion() APIs. * Use these APIs with all key iterator usage. * SetXXX() calls cannot fail, so change them from bool to void. * Change GetSize() to size() since it's cheap, and add empty(). Other: * Use standard for loop format in more places (e.g. instead of while loops when they're really doing a for loop). * Shorten a few bits of code. BUG=567 TEST=none Review URL: http://codereview.chromium.org/441008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33109 0039d316-1c4b-4281-b951-d872f2087c98
* Merge r33049 (symbolize_linux.cc) to new allocator structure.sgk@chromium.org2009-11-251-1/+3
| | | | | | | BUG=27911 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33074 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate the base logging with Event Tracing for Windows. This allows ETW ↵siggi@chromium.org2009-11-2513-0/+1610
| | | | | | | | | | | to control the log level and log feature flags from outside the process, and all log messages can be transported into ETW trace sessions.As is this provides an event trace provider class thatmanages the log level on control callbacks and shunts the formatted log messages to ETW when warranted.The provider observes one feature flag, which when turned on causes it to capture and log a stack trace at the log site, which can be helpful when diagnosing errors from logs.This CL also initializes ETW logging for chrome.dll, but only if the environment variable "CHROME_ETW_LOGGING" is set. The ETW machinery may create a thread in every process registering a trace provider, and the environment variable makes this overhead optional. TEST=Unittests in this change BUG=none Review URL: http://codereview.chromium.org/413006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33066 0039d316-1c4b-4281-b951-d872f2087c98
* Ignore UTF-8's BOM when parsing userscript's metadata.hayato@chromium.org2009-11-252-0/+4
| | | | | | | | | BUG=27333 TEST=UserScriptTest and check the issue does not happen against userscipt encoded in UTF-8 with BOM.. Review URL: http://codereview.chromium.org/420001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33048 0039d316-1c4b-4281-b951-d872f2087c98
* Branch new tcmalloc_linux.cc into new chromium\src branch. Update newsgk@chromium.org2009-11-251-0/+4
| | | | | | | | | base\allocator\allocator.gyp with merged changes from tcmalloc.gyp. BUG=27911 TEST=none Review URL: http://codereview.chromium.org/432021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33047 0039d316-1c4b-4281-b951-d872f2087c98
* Branch the files in the shim layer that switches between thesgk@chromium.org2009-11-258-0/+1340
| | | | | | | | | | memory allocation implementations (tcmalloc, jemalloc, etc.) into a base\allocator library. BUG=27911 TEST=none Review URL: http://codereview.chromium.org/434067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33043 0039d316-1c4b-4281-b951-d872f2087c98
* Enable TCMalloc on Linux by default.willchan@chromium.org2009-11-254-31/+26
| | | | | | | | | | This change also reworks the tcmalloc dependency to be added only to chrome and test_shell, instead of base. This is necessary since otherwise tcmalloc will be double initialized (by both the main executable and dlopen'd shared objects like the npapitestplugin.so). Add valgrind suppressions. This are invalid reads on static initialization in the VDSOSupport module. I haven't investigated it yet, but I suspect they're benign. BUG=http://crbug.com/28149, http://crbug.com/28385 Review URL: http://codereview.chromium.org/399081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33010 0039d316-1c4b-4281-b951-d872f2087c98
* linux: fix a warning in the process_util unittestvandebo@chromium.org2009-11-241-4/+5
| | | | | | | | | | | Original review: http://codereview.chromium.org/422003 BUG=none TEST=compiles on gcc 4.4 Review URL: http://codereview.chromium.org/431034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32972 0039d316-1c4b-4281-b951-d872f2087c98
* Make calloc return NULL while initializing.vandebo@chromium.org2009-11-241-18/+37
| | | | | | | | | BUG=28244 TEST=Run chrome in shared library mode Review URL: http://codereview.chromium.org/431025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32953 0039d316-1c4b-4281-b951-d872f2087c98
* This adds the first version of SyncSocket to base, along with a trivial ↵sehr@google.com2009-11-243-0/+212
| | | | | | | | | | unittest. SyncSocket provides a blocking send/receive that can be used for synchronization. Review URL: http://codereview.chromium.org/418004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32927 0039d316-1c4b-4281-b951-d872f2087c98
* Move base64 from 'net/base' into 'base'.hayato@chromium.org2009-11-245-0/+99
| | | | | | | | | BUG=13572 TEST=none Review URL: http://codereview.chromium.org/399068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32918 0039d316-1c4b-4281-b951-d872f2087c98
* posix: split OS-specific bits out of sys_info_posixevan@chromium.org2009-11-235-50/+104
| | | | | | | | Split into Linux and BSD-specific files. Review URL: http://codereview.chromium.org/427010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32860 0039d316-1c4b-4281-b951-d872f2087c98
* Fix environment variables not being used after switching to ↵jam@chromium.org2009-11-232-7/+8
| | | | | | | | | | ChildProcessLauncher. BUG=28602 TEST=verified flash works on Mac Review URL: http://codereview.chromium.org/439005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32854 0039d316-1c4b-4281-b951-d872f2087c98
* Notify race detectors (e.g. ThreadSanitizer) about the thread namestimurrrr@chromium.org2009-11-231-0/+2
| | | | | | | | | ThreadSanitizer will print the name of the threads in data race reports. ANNOTATE_THREAD_NAME is a no-op in Release non-valgrind build Review URL: http://codereview.chromium.org/434009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32821 0039d316-1c4b-4281-b951-d872f2087c98
* posix: refactor duplicated path-handling codeevan@chromium.org2009-11-217-64/+27
| | | | | | | | | We had the same code in three headers, and an "if FREEBSD" in a _linux.cc file. Review URL: http://codereview.chromium.org/414063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32722 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use logging from the OOM killers; it allocates memory.avi@google.com2009-11-211-9/+9
| | | | | | | | | BUG=none TEST=watch crash logs; the OOM killer functions should never be called from another OOM killer function. Review URL: http://codereview.chromium.org/411006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32717 0039d316-1c4b-4281-b951-d872f2087c98
* Remove old files.nsylvain@chromium.org2009-11-207-297/+0
| | | | | | Review URL: http://codereview.chromium.org/425008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32711 0039d316-1c4b-4281-b951-d872f2087c98
* Use AutoReset (formerly ScopedBool) where possible.pkasting@chromium.org2009-11-205-33/+44
| | | | | | | | | | This frequently saves a tiny bit of code, but even when it doesn't I think it's more future-proof (less error-prone). BUG=none TEST=none Review URL: http://codereview.chromium.org/399096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32708 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
* Don't do work in the SharedIOBuffer constructor; use an Init method instead. ↵hawk@chromium.org2009-11-201-4/+2
| | | | | | | | | | | | This eliminates instances of allocated-but-invalid SharedIOBuffers. Also clean up some CHECKs and TODOs associated with the bug. The upshot is that we no longer crash in AsyncResourceHandler::OnResponseCompleted() when we can't allocate shared memory. We now crash (properly, I believe) in the renderer process if the shared memory that failed to allocate was the TransportDIB, since the renderer can't communicate with the browser without it. BUG=16371 TEST=none Review URL: http://codereview.chromium.org/391009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32701 0039d316-1c4b-4281-b951-d872f2087c98
* linux: fix a warning in the process_util unittestevan@chromium.org2009-11-201-1/+4
| | | | | | Review URL: http://codereview.chromium.org/422003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32648 0039d316-1c4b-4281-b951-d872f2087c98
* posix: use PLOG to print useful error messagesevan@chromium.org2009-11-201-6/+3
| | | | | | | | Rather than printing errno, this macro prints useful error messages. Review URL: http://codereview.chromium.org/420006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32642 0039d316-1c4b-4281-b951-d872f2087c98
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-2010-43/+103
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* Set prop app id for chromium/application shortcut.xiyuan@chromium.org2009-11-195-86/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow up change after andrew's patch for win7 shortcut to properly set app id for chromium/application shortcut. - Move PKEY_AppUserModel_ID and code to set it from app/win_util.cc to base/win_util.cc as SetAppIdForPropertyStore to share with file_util shortcut code; - Add an app_id args to file_util's CreateShortcutLink and UpdateShortcutLink; - Update code that calls the above two function in installer and UserDataManager so that the chromium shortcuts are created with proper app id (except the uninstall shortcut which is not tagged with any app id). - Move ComputeApplicationNameFromURL from Browser to web_app namespace and use it as app id for application shortcut. This makes pinned shortcut and browser window use the same app id and Win7 correctly groups them; - Rename ComputeApplicationNameFromURL to GenerateApplicationNameFromURL per Ben's comments; - Add a DCHECK in SetAppIdForPropertyStore to ensure app id is less than 128 chars and contains no space per msdn; - Change default app id from IDS_PRODUCT_NAME to chrome::kBrowserAppName BUG=28104 TEST=On Win7, pinned shortcut should no longer be separated from running instance of chrome for both chrome and web application. Review URL: http://codereview.chromium.org/399045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32508 0039d316-1c4b-4281-b951-d872f2087c98
* Isolate tests by running AtExit callbacks between them.phajdan.jr@chromium.org2009-11-198-31/+76
| | | | | | | | | | | | | | | | | | | | For now, this is only for base_unittests. The plan is to enable it for all unit tests. This should finally fix mysterious problems cause by Singletons surviving after one test etc. This change also adapts LazyInstance so that it can be reused after being destroyed. It is used very frequently, for example each time a MessageLoop is used. It is also worth noting that we had some problems in the past related to the MessageLoop being destroyed and re-instantiated in the same test executable. This patch should also fix that. TEST=none BUG=12710 Review URL: http://codereview.chromium.org/372057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32507 0039d316-1c4b-4281-b951-d872f2087c98
* Refactors RenderWidget to extract a PaintAggregator class.darin@chromium.org2009-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | After this change, I plan on changing the PaintAggregator algorithm. Some things to note: 1- Previously, it was possible to send overlapping ViewHostMsg_PaintRect and ViewHostMsg_ScrollRect messages. This happened when scrolling a page since the scrollbar would need to be repainted while the contents of the page are being scrolled. With this CL, this overlapping behavior is a bit more explicit. 2- There was a TODO about view_size clipping that I've eliminated. I was able to eliminate it because I realized that it is correct to clip the rects passed by didInvalidateRect and didScrollRect to the size of the RenderWidget. Apparently WebKit can sometimes invalidate regions outside the view. R=brettw BUG=25905 TEST=none Review URL: http://codereview.chromium.org/403005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32496 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Fix some callers of CreateNewTempDirectory to remove the ↵evan@chromium.org2009-11-192-16/+0
| | | | | | | | | | | | | deprecated version. BUG=None TEST=unit_tests Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/385112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32487 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the unused ProcessFilter destructor.evan@chromium.org2009-11-191-1/+0
| | | | | | | | | | | Adding some code elsewhere was causing pure call errors related to this code, but only for Release builds on gcc 4.2.4. My gcc 4.4.1 computer was fine. I know better than to claim it's a compiler bug, but this destructor is unused anyway so this change is harmless. Review URL: http://codereview.chromium.org/402080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32483 0039d316-1c4b-4281-b951-d872f2087c98
* No need to run out of memory test under valgrind - they will obviously leak, ↵vandebo@chromium.org2009-11-181-0/+4
| | | | | | | | | | | but we don't care. BUG=28179 TEST=none Review URL: http://codereview.chromium.org/404036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32437 0039d316-1c4b-4281-b951-d872f2087c98
* Moved bits.h from O3D to Chrome base.apatrick@google.com2009-11-183-0/+97
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/373001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32428 0039d316-1c4b-4281-b951-d872f2087c98
* For Linux, override malloc and friends so that we can detect and then stop ↵vandebo@chromium.org2009-11-182-1/+193
| | | | | | | | | | | on out of memory. BUG=27222 TEST=new base unittests Review URL: http://codereview.chromium.org/391044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32395 0039d316-1c4b-4281-b951-d872f2087c98
* linux: StackTrace test isn't expected to work in Release builds anymoreevan@chromium.org2009-11-181-0/+7
| | | | | | | | | | Dropping the exception unwind data cut our executable size considerably, but it means we can't get stack traces anymore in Release builds, so stop this test early in that case. Review URL: http://codereview.chromium.org/399069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32346 0039d316-1c4b-4281-b951-d872f2087c98
* Launch processes asynchronously so as not to block the UI thread. For now, ↵jam@chromium.org2009-11-181-4/+2
| | | | | | | | | renderer only, I'll take care of plugin/worker/utility processes in a followup change. (relanding 32203) BUG=6844 Review URL: http://codereview.chromium.org/397031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32264 0039d316-1c4b-4281-b951-d872f2087c98
* Fix race conditions where an object's constructor uses PostTask on itself. ↵jam@chromium.org2009-11-171-0/+7
| | | | | | | | | This isn't safe since the posted task can execute before the constructor returns, leading to destruction of the object. BUG=27944 Review URL: http://codereview.chromium.org/399016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32213 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac/Linux] Fix WordIterator::GetWord() for UTF-16 surrogate pairs.shess@chromium.org2009-11-172-0/+63
| | | | | | | | | | | | | | | | For systems where !defined(WCHART_T_IS_UTF16), WordIterator transforms the input into UChar data. But GetWord() was using the resulting offsets as indices into the original string, so it could return incorrect data and/or attempt to index off the end of the input. This changes GetWord() to do do the inverse conversion from Init() for those systems. BUG=27698 TEST=See bug. Review URL: http://codereview.chromium.org/399010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32199 0039d316-1c4b-4281-b951-d872f2087c98
* Implement web app shortcuts natively per issue 25528xiyuan@chromium.org2009-11-172-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement a CreateApplicationShortcutView similar to the current Gears-based one; - Add a few profile prefs to persist user's last checked shortcut locations - Implement a web_app::CreateShortcut that stores icon under "<profile>/Web Applications" in a similar layout as gears (i.e. <host>/<scheme_port>/<web_app_title>.ico) and calls file_util code to creates shortcut on Windows; - Add Win7 taskbar pin/unpin support function to file_util; - Update TabContents to replace gears with new code; Note: - Gears dialog is modaless but this one is a modal dialog. - Gear's icon store is not migrated because gears icons could still be used by shortcuts created by gears and thus we could not delete them even after migration. And we are not using the local ico files in the dialog even if they exists. - New CreateApplicationShortcutView is included when TOOLKIT_VIEW is defined. However on platforms other than Windows, the actual CreateShortCut code is not implemented. Right now it calls ShellIntegration's CreateDesktopShort if OS_LINUX is defined and NOTREACHED() for other platforms. BUG=25528 TEST=Verify the new UI provides the same functionality as gears under XP/Vista and support pinning on Win 7. Review URL: http://codereview.chromium.org/372012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32165 0039d316-1c4b-4281-b951-d872f2087c98
* TBR: willchanwillchan@chromium.org2009-11-172-10/+20
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32159 0039d316-1c4b-4281-b951-d872f2087c98
* Experiment: enable TCMalloc on Linux by default.willchan@chromium.org2009-11-172-20/+10
| | | | | | | | | Will revert after looking at the Linux memory bot and perf cycler. TBR=willchan Review URL: http://codereview.chromium.org/403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32158 0039d316-1c4b-4281-b951-d872f2087c98
* reland 31875. Revert was:estade@chromium.org2009-11-164-49/+45
| | | | | | | | | | | | | | ------ Revert 31875 to see whether it fixes reliability bot. BUG=25677 TEST=None ------ TBR=huanr Review URL: http://codereview.chromium.org/397017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32112 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: fix uninit warnings when building -Os.agl@chromium.org2009-11-161-1/+1
| | | | | | http://codereview.chromium.org/401002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32105 0039d316-1c4b-4281-b951-d872f2087c98
* Add another variant of the PrependInteger UMR stack.erikkay@chromium.org2009-11-161-0/+20
| | | | | | | | | BUG=18795 TBR=idana Review URL: http://codereview.chromium.org/401003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32081 0039d316-1c4b-4281-b951-d872f2087c98