summaryrefslogtreecommitdiffstats
path: root/base
Commit message (Collapse)AuthorAgeFilesLines
* ObjectWatcher needs to know when the current thread's MessageLoop is being ↵darin@google.com2008-08-055-6/+94
| | | | | | 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
* Allow string-to-int conversions to provide a return value indicating ↵mmentovai@google.com2008-08-055-17/+421
| | | | | | success. Implement them consistently on all platforms. Fill in a couple of necessary missing pieces. Eliminate the need for many uses of sscanf. Add tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@405 0039d316-1c4b-4281-b951-d872f2087c98
* Add base_paths_win.cc to SCons build.sgk@google.com2008-08-051-4/+9
| | | | | | | Use the occasion to collect the other *_win.cc source files in a Windows-specific block. TBR: erikkay git-svn-id: svn://svn.chromium.org/chrome/trunk/src@400 0039d316-1c4b-4281-b951-d872f2087c98
* Bring over the changes from the Mac branch.paulg@google.com2008-08-052-0/+23
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@392 0039d316-1c4b-4281-b951-d872f2087c98
* refactor base_paths so that windows-specific paths are pulled out into their ↵erikkay@google.com2008-08-056-102/+232
| | | | | | own file. Note that some of the same path key names will exist in other platform-specific files. For example, base_paths_mac.mm will have FILE_EXE and DIR_APP_DATA (among others). git-svn-id: svn://svn.chromium.org/chrome/trunk/src@389 0039d316-1c4b-4281-b951-d872f2087c98
* Fix an issue where U_WCHAR_IS_UTF16 would not be defined systematically. ↵maruel@google.com2008-08-051-3/+1
| | | | | | This would result in WordIterator definition not being consistent and random crashes would occur. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@387 0039d316-1c4b-4281-b951-d872f2087c98
* Revert base\gfx changes because it breaks the buildnsylvain@google.com2008-08-057-112/+7
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@386 0039d316-1c4b-4281-b951-d872f2087c98
* Unix line-endings.evanm@google.com2008-08-052-283/+283
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@384 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for missing build info.avi@google.com2008-08-052-0/+4
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/1128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@383 0039d316-1c4b-4281-b951-d872f2087c98
* Fix basic geometric types.avi@google.com2008-08-057-7/+108
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/1106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@381 0039d316-1c4b-4281-b951-d872f2087c98
* Reworking unit test target to start all over, with gtest static library and ↵pinkerton@google.com2008-08-051-212/+144
| | | | | | pulling in only files we know compile. Define UNIT_TEST as some tests rely on that. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@375 0039d316-1c4b-4281-b951-d872f2087c98
* Import base::LINKER_INITIALIZED from google-perftools / tcmalloc. This is ↵deanm@google.com2008-08-051-0/+17
| | | | | | effectively just an annotation; a class can describe that it's ok to be used as a global static object because it will be zero initialized, so construction order doesn't matter. This also makes it clear from someone using it as a global object that it's safe. This will be used for spinlocks. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@374 0039d316-1c4b-4281-b951-d872f2087c98
* UTF16 vs 32 issues.avi@google.com2008-08-052-0/+23
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/1091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@373 0039d316-1c4b-4281-b951-d872f2087c98
* Use the build_config defines in atomicops.h. This still uses the ↵deanm@google.com2008-08-051-13/+10
| | | | | | compiler/platform specific defines in the platform dependent internals headers, keeping them closer to the original implementation. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@372 0039d316-1c4b-4281-b951-d872f2087c98
* New atomic operation foundation code and interfaces. Based on the atomic ↵deanm@google.com2008-08-057-0/+1206
| | | | | | | | | | | operations in google-perftools / tcmalloc. - Makes atomic operations cross-platform (win/mac/linux). - Supports 64 bit operations on 64 bit processors. - Make atomic operations more correct on Windows (barriers). - Introduces a better / safer interface, and abstracts away most common atomic operations, reference counting and sequence numbers. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@370 0039d316-1c4b-4281-b951-d872f2087c98
* (Mac port.) Work around Mac gcc getting confused by an integer.evanm@google.com2008-08-051-1/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@358 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the base build of single_unittests.exe, which was trying to link in the ↵sgk@google.com2008-08-041-1/+2
| | | | | | | | .dll as a .lib. TBR: bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@349 0039d316-1c4b-4281-b951-d872f2087c98
* Provide OS_ and COMPILER_ macros for OS and compiler differentiationmmentovai@google.com2008-08-041-1/+3
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/1108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@338 0039d316-1c4b-4281-b951-d872f2087c98
* Checking in the rest of the .lib changes, previous commit was only done from ↵sgk@google.com2008-08-041-35/+43
| | | | | | | | | chrome/ and only got those SConscript files. R=evanm,bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@331 0039d316-1c4b-4281-b951-d872f2087c98
* Adding specializations of hash() for various string types. GCC requires you ↵pinkerton@google.com2008-08-041-5/+66
| | | | | | | | bring your own hash function for maps and sets. Review URL: http://chrome-reviews.prom.corp.google.com/1085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@327 0039d316-1c4b-4281-b951-d872f2087c98
* fix builddarin@google.com2008-08-041-1/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@324 0039d316-1c4b-4281-b951-d872f2087c98
* Revise the ObjectWatcher API to be one-to-one with the object being watched. ↵darin@google.com2008-08-045-157/+126
| | | | | | | | | | | | 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
* Fix gcc/msvc differencespinkerton@google.com2008-08-041-2/+3
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/1104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@321 0039d316-1c4b-4281-b951-d872f2087c98
* Fix missing comma new string_piece.cc file.sgk@google.com2008-08-041-1/+1
| | | | | | TBR: deanm git-svn-id: svn://svn.chromium.org/chrome/trunk/src@316 0039d316-1c4b-4281-b951-d872f2087c98
* Remove incorrect scoping on method declarations.deanm@google.com2008-08-041-4/+4
| | | | | | TBR=evanm git-svn-id: svn://svn.chromium.org/chrome/trunk/src@314 0039d316-1c4b-4281-b951-d872f2087c98
* Add StringPiece to the scons build.deanm@google.com2008-08-041-0/+2
| | | | | | TBR=sgk git-svn-id: svn://svn.chromium.org/chrome/trunk/src@313 0039d316-1c4b-4281-b951-d872f2087c98
* Pull the block of common Windows system libraries that we link with ↵sgk@google.com2008-08-041-21/+0
| | | | | | | | everywhere into the base Windows environment. TBR: evanm,bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@310 0039d316-1c4b-4281-b951-d872f2087c98
* Convert submodules SConscript files to psuedo-builder calls.sgk@google.com2008-08-032-5/+5
| | | | | | | | TBR: evanm,bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@304 0039d316-1c4b-4281-b951-d872f2087c98
* Rollback message loop testjar@google.com2008-08-033-21/+18
| | | | | | TBR git-svn-id: svn://svn.chromium.org/chrome/trunk/src@299 0039d316-1c4b-4281-b951-d872f2087c98
* This is a test, and will rollback asap after a build/test cycle starts.jar@google.com2008-08-033-18/+21
| | | | | | | | | | I use a counter of MessageLoop::Quit() calls so that I can re-post "extra" calls when MessageLoop::Run() terminates. This assures that no quits are lost... but I'm not sure if some code abused the Quit() calls, and already posts many-too-many quits :-/. I want to see if the tree tests go red, and how the distributed reliability test responds. The test should already pass the basic unit_test and base_unittest, but I'm not sure what the rest of the UI tests etc will do. If I'm lucky, they'll be "less" flakey. ...but they may just go red all over :-( TBR git-svn-id: svn://svn.chromium.org/chrome/trunk/src@298 0039d316-1c4b-4281-b951-d872f2087c98
* Call ResetBirthTime before dispatching the user's Task. Also, remove ↵darin@google.com2008-08-023-13/+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
* I think this is the crashercpu@google.com2008-08-021-1/+2
| | | | | | | | | - I want to test this on the bots. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271 0039d316-1c4b-4281-b951-d872f2087c98
* Include trivial definition of method in release mode (where we don't do ↵jar@google.com2008-08-011-0/+1
| | | | | | | | | | | | | tracking) Repair tree bustage TBR=darin M base/tracked.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266 0039d316-1c4b-4281-b951-d872f2087c98
* A new (private) interface is supplied that allows the object watcher (coding injar@google.com2008-08-014-3/+35
| | | | | | | | | | | | | | | | | | | | | proress by Darin) to Post the task (when the object is signaled) into a message loop. I also cleaned up the time-of-birth for tasks that sleep for a while before running (such as those held by the timer, or by passed to this new PostSignaledTask() interface. r=darin M base/tracked.cc M base/message_loop.h M base/message_loop.cc M base/tracked.h git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262 0039d316-1c4b-4281-b951-d872f2087c98
* SCons build:sgk@google.com2008-08-011-0/+2
| | | | | | | | | | | | * Add base\object{,_watcher}.cc. * Add chrome\browser\bookmark_{codec,storage}.cc. * Add chrome\views\frame\browser_window_factory.cc. * Split of app\main.cc into app\chrome_{dll,exe}_main.cc, with added CPPDEFINES for {BROWSER,RENDERER,PLUGIN}_DLL. * Move $CSCRIPT, $PLATFORMSDK* and $VISUAL_STUDIO variables to the win32-specific construction environment. * Remove unnecessary comments. TBR: bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261 0039d316-1c4b-4281-b951-d872f2087c98
* A helper class for calling RegisterWaitForSingleObject with the objective of ↵darin@google.com2008-08-015-0/+411
| | | | | | | | | | | | | | | | | | | | 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
* Update xcodeprojsmmentovai@google.com2008-08-011-354/+940
| | | | | | Review URL: http://chrome-reviews.prom.corp.google.com/996 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256 0039d316-1c4b-4281-b951-d872f2087c98
* The addition of the AtExitManager test in the singleton dll test makes ↵cpu@google.com2008-08-012-4/+2
| | | | | | | | | | | purify-sub angry. - Not sure what is the issue, purify reports FMM (freeing mismatched memory), but I don't see why. - Don't do the frees inside the dll unload callback directly. TBR=erikkay git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252 0039d316-1c4b-4281-b951-d872f2087c98
* Add new base\at_exit{,_unittest}.cc files to SCons build.sgk@google.com2008-08-011-0/+2
| | | | | | TBR=cpu git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221 0039d316-1c4b-4281-b951-d872f2087c98
* Adds new class AtExitManager which manages the dtors of all singletons.cpu@google.com2008-08-019-40/+302
| | | | | | | | | - Previously this job was done by the CRT's atexit() which runs later than we want and under the loader lock. - Had to modify most main() functions for the testing executables so we don't trigger leak detectors. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219 0039d316-1c4b-4281-b951-d872f2087c98
* Revert my UTF change until we can figure out what to do with the sandbox.brettw@google.com2008-08-016-316/+121
| | | | | | BUG=1201008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215 0039d316-1c4b-4281-b951-d872f2087c98
* Write our own utf8<->wide conversion functions. This gives us more control ↵brettw@google.com2008-08-016-121/+316
| | | | | | over error handling instead of getting a blank string for invalid encodings. It also allows us to decrease the amount of platform-specific code. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211 0039d316-1c4b-4281-b951-d872f2087c98
* Support RanAllPending() rather than RunOnce(), and integrated into ↵jar@google.com2008-07-312-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ipc_sync_channel. RunOnce() semantics were not sufficient to support the effort to pump messages in ipc_sync_channel, as ipc_sync_channel is not able to detect pending Tasks. This change list switches to RunAllPending() tasks, rather than just Running the items that avail themselves in one run of the loop. This is a very small mod of the existing code. I'm still trying to stay focused on the bug at hand, and minimize chances of unrelated regressions (we only modify IPC channel semantics). The slight semantic change (from original attempts to call Quit() externally and then Run()) is that we now terminate the message loop after also servicing the high-resolution timer tasks. bug=1291034 r=darin M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176 0039d316-1c4b-4281-b951-d872f2087c98
* Initial cleanups en route to coalescing the get-it-built cut-and-paste from ↵sgk@google.com2008-07-312-19/+1
| | | | | | | | | | | | | | | | | | various SConscripts into readable and maintainable shape. To wit: * Put the near-universal settings of /DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS, /DWIN32_LEAN_AND_MEAN, /wd4503 and /wd4819 in the base construction environment. * Sort various unsorted source file lists. * Fix indentation and quoting for consistency in a couple SConscript files that escaped previous dragnets. * Eliminate two left-over uses of Split() for input file lists. * Give the devenv invocation to build v8_shell.exe the full path to the relevant .vcproj file. * Add /nologo to the base LINKFLAGS setting. * Remove various CPPPATH and other settings that have been hanging around commented out from the Visual Studio build (in case we needed them, which we evidently don't). * Get rid of unnecessary env.File() and env.Dir() calls in various settings (esp. CPPPATH) and source file lists. * Add copyright notice to an overlooked SConscript file. * Clean up version.bat invocation. TBR: bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174 0039d316-1c4b-4281-b951-d872f2087c98
* (Re-landing of) Support RunOnce() in message loop.jar@google.com2008-07-302-44/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | Deeply nested calls to MessageLoop::Run() were made, and a multitude of Quit() messages were handled at the most nested level. This left outer invocations hung, waiting for "their" kQuitMsg to arrive (but the the nested loop had already discarded them in its processing of pending messages before exit :-/ ). We now use a more controlled run of the message loop, which does not rely on kQuitMsg. This re-landing doesn't have the anti-hang assertion, which was breaking a lot of tests. bug=1291034 r=darin,mpcomplete M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130 0039d316-1c4b-4281-b951-d872f2087c98
* Use own our bzip2 error handler instead of the default which prints error ↵deanm@google.com2008-07-301-0/+1
| | | | | | | | | messages to STDERR and calls exit(1). This is better, since we will now crash instead of exiting. This also removes some unnecessary code and error strings from bzip2. BUG=1289861 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121 0039d316-1c4b-4281-b951-d872f2087c98
* Use own our bzip2 error handler instead of the default which prints error ↵deanm@google.com2008-07-303-0/+41
| | | | | | | | messages to STDERR and calls exit(1). This is better, since we will now crash instead of exiting. This also removes some unnecessary code and error strings from bzip2. BUG=1289861 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115 0039d316-1c4b-4281-b951-d872f2087c98
* Fix most issues when building base as a x64 target.maruel@google.com2008-07-308-14/+80
| | | | | | BUG=1282556 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112 0039d316-1c4b-4281-b951-d872f2087c98
* Rollback 109jar@google.com2008-07-302-57/+44
| | | | | | | | | | M base/message_loop.h M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110 0039d316-1c4b-4281-b951-d872f2087c98
* M base/message_loop.hjar@google.com2008-07-302-44/+57
| | | | | | | | M base/message_loop.cc M chrome/common/ipc_sync_channel.cc git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109 0039d316-1c4b-4281-b951-d872f2087c98