summaryrefslogtreecommitdiffstats
path: root/base
Commit message (Collapse)AuthorAgeFilesLines
* Add assert() for scoped_refptr<T>::operator->()akalin@chromium.org2012-01-311-1/+6
| | | | | | | | | | | | | | This is to make NULL dereference crashes more obvious. Also matches scoped_ptr (which uses assert) and weak_ptr (which uses DCHECK). DCHECK wasn't used because it pulls in logging.h, and that somehow conflicts with a webkit #define of LOG. BUG= TEST= Review URL: http://codereview.chromium.org/9232069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119820 0039d316-1c4b-4281-b951-d872f2087c98
* Make NOTIMPLEMENTED_POLICY=0 actually work.torne@chromium.org2012-01-301-1/+1
| | | | | | | | | | | | Various places in the code use NOTIMPLEMENTED() with << "message" like the other logging macros; this doesn't work when NOTIMPLEMENTED expands to a semicolon. Expand it to EAT_STREAM_PARAMETERS instead so any parameters are simply compiled away in this case. Review URL: http://codereview.chromium.org/9244006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119711 0039d316-1c4b-4281-b951-d872f2087c98
* Make it possible to use ThreadLocalStorage::Slot as a static withoutthakis@chromium.org2012-01-306-30/+48
| | | | | | | | | | | | | | | | | introducing static initializers. Member variables can stay TLS::Slots and their behavior doesn't change. Static instances use TLS::StaticSlot instead. Kind of like http://codereview.chromium.org/8491043 but for TLS. BUG=none TEST=none TBR=agl Review URL: https://chromiumcodereview.appspot.com/9297010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119679 0039d316-1c4b-4281-b951-d872f2087c98
* (re-land) Add StringToSizeT to base/string_number_conversions.kalman@chromium.org2012-01-282-0/+11
| | | | | | | | | | | BUG= TEST= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=119540 Review URL: http://codereview.chromium.org/9296002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119585 0039d316-1c4b-4281-b951-d872f2087c98
* Make DFAKE_MUTEX a typedef when using NDEBUG, so that pedantic compilers ↵rsleevi@chromium.org2012-01-281-2/+2
| | | | | | | | | | | don't warn about an extra ; in a class definition BUG=111583 Review URL: http://codereview.chromium.org/9121034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119574 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 119540 - Add StringToSizeT to base/string_number_conversions.yoz@chromium.org2012-01-282-4/+15
| | | | | | | | | | | | | | Compile error in webrequest_api.cc. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/9296002 TBR=kalman@chromium.org Review URL: https://chromiumcodereview.appspot.com/9296027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119549 0039d316-1c4b-4281-b951-d872f2087c98
* Make ETW unittests shardable to quench flakyness on trybots.siggi@chromium.org2012-01-282-54/+110
| | | | | | | | | | | | | Use a per-process ETW session name, and a per-test provider GUID to avoid name collisions under test sharding on trybots. R=thakis@chromium.org,jar@chromium.org BUG=111240 TEST=No more spurious failures on trybots. Review URL: http://codereview.chromium.org/9288075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119544 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Add a perf test that counts the number of Mach ports in the browser.rsesek@chromium.org2012-01-282-2/+48
| | | | | | | | | | BUG=105513 TEST=This is one. Review URL: http://codereview.chromium.org/9193024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119541 0039d316-1c4b-4281-b951-d872f2087c98
* Add StringToSizeT to base/string_number_conversions.kalman@chromium.org2012-01-282-15/+4
| | | | | | | | | BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/9296002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119540 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove static storage for variables in an unnamed namespace.jhawkins@chromium.org2012-01-284-12/+14
| | | | | | | | | | BUG=none TEST=none R=binji Review URL: https://chromiumcodereview.appspot.com/9271061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119535 0039d316-1c4b-4281-b951-d872f2087c98
* Remove pointer mangling API from trace_event.h and use an addTraceEvent flag ↵jbates@chromium.org2012-01-273-47/+52
| | | | | | | | | | instead BUG=109779 Review URL: https://chromiumcodereview.appspot.com/9223005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119519 0039d316-1c4b-4281-b951-d872f2087c98
* Add OSSTATUS_LOG API.mark@chromium.org2012-01-276-12/+126
| | | | | | Review URL: https://chromiumcodereview.appspot.com/9235084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119511 0039d316-1c4b-4281-b951-d872f2087c98
* Need the unsigned constants marked as unsigned.backer@chromium.org2012-01-271-9/+9
| | | | | | | | | | TBR=mad BUG=none TEST=linux bot compiles without warning Review URL: https://chromiumcodereview.appspot.com/9296008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119451 0039d316-1c4b-4281-b951-d872f2087c98
* Added a Unique ID for a Field Trial containing it's hashed name and the ↵mad@chromium.org2012-01-273-13/+158
| | | | | | | | | | | | selected group ID. Also returns the list of UIDs of all currently running Field Trials BUG=None TEST=FieldTrialTest.UIDs Review URL: https://chromiumcodereview.appspot.com/9117037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119444 0039d316-1c4b-4281-b951-d872f2087c98
* Adding a scoped_nsprotocolqsr@chromium.org2012-01-271-1/+64
| | | | | | | | | | | | | This allow to easily own protocol. The syntax is: scoped_nsobject<id<MyProtocol> > object; BUG= none TEST= none Review URL: http://codereview.chromium.org/9290046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119419 0039d316-1c4b-4281-b951-d872f2087c98
* Remove reinterpret_cast on JSONValueConvertertzik@chromium.org2012-01-273-31/+11
| | | | | | | | | | BUG=None TEST='JSONValueConverterTest.*' Review URL: http://codereview.chromium.org/9289040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119393 0039d316-1c4b-4281-b951-d872f2087c98
* Convert use of int ms to TimeDelta in files owned by brettw.tedvessenes@gmail.com2012-01-272-5/+5
| | | | | | | | | | BUG=108171 TEST= Review URL: http://codereview.chromium.org/9233018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119321 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a potential memory leak bug.mukai@chromium.org2012-01-262-6/+23
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/9113075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119269 0039d316-1c4b-4281-b951-d872f2087c98
* Adding GetProcId unittestcpu@chromium.org2012-01-261-1/+15
| | | | | | | | | | | - I want to refactor the windows version. But first I need a test. BUG=none TEST=yes it is. Review URL: http://codereview.chromium.org/9283009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119201 0039d316-1c4b-4281-b951-d872f2087c98
* Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leakyfischman@chromium.org2012-01-266-23/+21
| | | | | | | | | | | | | and hide LeakyLazyInstanceTraits in base::internal to discourage cargo-culting new users. BUG=none TEST=none Review URL: http://codereview.chromium.org/9117038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119173 0039d316-1c4b-4281-b951-d872f2087c98
* Add StringToUint and StringToUint64 methods to base/string_number_conversions.h.kalman@chromium.org2012-01-262-2/+25
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/9288012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119150 0039d316-1c4b-4281-b951-d872f2087c98
* Use a 'defines' block instead of adding -Dfoo to cflags.evan@chromium.org2012-01-251-6/+8
| | | | | | | | | Should be equivalent, but simpler. Review URL: http://codereview.chromium.org/9235021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119087 0039d316-1c4b-4281-b951-d872f2087c98
* Implement support for a cancelable SyncSocket.tommi@chromium.org2012-01-253-89/+246
| | | | | | | | | | | | Currently, blocking SyncSocket operations can not be unblocked from other threads, but this is now supported by using the CancelableSyncSocket class. The implementation on Mac and Linux is very simple and basically consists of adding a call to shutdown(). On Windows however things are a tiny bit more complex since we use named pipes with synchronous IO and canceling synchronous IO is simply not possible on XP and arguably tricky on Vista+. So, what we do instead is to use asynchronous IO in a synchronous fashion to support the SyncSocket semantics and as well as allowing the connection to be correctly shut down from another thread. Review URL: https://chromiumcodereview.appspot.com/8965053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119051 0039d316-1c4b-4281-b951-d872f2087c98
* Transition to base/mac/bundle_locations.h step 3jeremy@chromium.org2012-01-251-3/+4
| | | | | | | | | | | | Convert some instances of [NSBundle mainBundle] to equivalent calls in base/mac/bundle_locations.h BUG=None TEST=Code should compile and all unit tests should pass. Review URL: http://codereview.chromium.org/9240004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119030 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup trace_event, fix webkit API naming.jbates@chromium.org2012-01-251-14/+14
| | | | | | | | Remove unused TRACE_EVENT_API_ADD_COUNTER_EVENT and improve comments in trace_event.h. Review URL: http://codereview.chromium.org/9234007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118999 0039d316-1c4b-4281-b951-d872f2087c98
* Add scoped_ptr<>::PassAs<>().sergeyu@chromium.org2012-01-254-0/+67
| | | | | | | | | The new PassAs<>() method can be used to explicitly upcast scoped_ptr instances. Review URL: http://codereview.chromium.org/9283028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118958 0039d316-1c4b-4281-b951-d872f2087c98
* linux: remove no_strict_aliasing gyp variableevan@chromium.org2012-01-241-8/+1
| | | | | | | | | | | | We won't build in -fstrict-aliasing mode anyway, so there's little point putting it behind a flag. Anyone who wanted to experiment with this could just as well edit the build file directly. BUG=32204 Review URL: http://codereview.chromium.org/9117017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118799 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] In PlatformThread::CurrentId(), use pthread_self() instead of ↵rsesek@chromium.org2012-01-243-17/+19
| | | | | | | | | | | | mach_thread_self(). BUG=105513 TEST=none Review URL: http://codereview.chromium.org/9281011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118780 0039d316-1c4b-4281-b951-d872f2087c98
* Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T.fischman@chromium.org2012-01-2310-22/+24
| | | | | | | | | | | | | Converted the first 20 or so hits for LeakyLazyInstanceTraits on codesearch to demonstrate the benefit at callsites. The real change is base/lazy_instance.h; everything else is example. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9192024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118754 0039d316-1c4b-4281-b951-d872f2087c98
* Split up trace_event.h into trace_event_impl.h and add webkitplatform support.jbates@chromium.org2012-01-235-1127/+1113
| | | | | | | | | | No new features here, this is just a code split and API glue. (Good news! I copied over trace_event.h to WebKit and verified that this all works!) Review URL: https://chromiumcodereview.appspot.com/9213013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118733 0039d316-1c4b-4281-b951-d872f2087c98
* windows: Fix a few things clang complains about.thakis@chromium.org2012-01-234-6/+7
| | | | | | | | | | | | No functionality change. BUG=82385 TEST=none Review URL: http://codereview.chromium.org/9200009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118725 0039d316-1c4b-4281-b951-d872f2087c98
* check for successful exit code in WaitForSingleProcess on Windows tobruening@chromium.org2012-01-231-3/+5
| | | | | | | | | | | | | | | | match other platforms. consequentially, in browser tests, add PROCESS_QUERY_INFORMATION to the rights requested when opening a child serviceprocess handle so the exit code can be queried. BUG=106234 TEST=Ran base_unittests.exe --gtest_filter="ProcessUtilTest.SpawnChild" with the child custom-tweaked to fail and verified that prior to my change (with HEAD) the failure is NOT detected and the test passes; with this change the failure is detected. Review URL: http://codereview.chromium.org/8964004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118695 0039d316-1c4b-4281-b951-d872f2087c98
* [ChromeOS] Add option to set controlling terminal when launching process.tbarzic@chromium.org2012-01-212-2/+29
| | | | | | | | | | | | | This is needed to expose crosh process to hterm (if pseudo terminal used for communication between terminalPrivateApi and crosh process is not controlling, job control in the crosh process won't work, and it won't be able to e.g. process signals). TEST=None BUG=chromium-os:23273 Review URL: https://chromiumcodereview.appspot.com/9176013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118585 0039d316-1c4b-4281-b951-d872f2087c98
* Move operator<< for StringPiece into string_piece.{h,cc}akalin@chromium.org2012-01-204-25/+15
| | | | | | | | | BUG=110651 TEST= Review URL: https://chromiumcodereview.appspot.com/9159005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118416 0039d316-1c4b-4281-b951-d872f2087c98
* remove ; which breaks nacl_integration since they use -pedanticajwong@chromium.org2012-01-202-4/+4
| | | | | | | | | | BUG=none TEST=nacl_integration goes green TBR=darin Review URL: https://chromiumcodereview.appspot.com/9195035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118391 0039d316-1c4b-4281-b951-d872f2087c98
* Transfer the C++03 move-only type emulation into base/move.h and also make ↵ajwong@chromium.org2012-01-205-51/+293
| | | | | | | | | | | | | | | | | ScopedVector move-only. Also: * Add a lot of documentation explaining what this macro does. * Change the implementation of RValue so it cannot be instantiated. The change to always use RValue& makes for more efficent code in debug builds. Looking at the disassembly for a simple use case (calling a function with one parameter), it removes the creation of one temporary. BUG=96118 TEST=new unittests. exist code still compiles. Review URL: https://chromiumcodereview.appspot.com/9207021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118388 0039d316-1c4b-4281-b951-d872f2087c98
* Transition to base/mac/bundle_locations.h step 2jeremy@chromium.org2012-01-193-15/+2
| | | | | | | | | | | Remove MainAppBundle() in favor of FrameworkBundle() and update all callsites + code comments. BUG=None TEST=Code should compile and all unit tests should pass. Review URL: https://chromiumcodereview.appspot.com/9220005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118293 0039d316-1c4b-4281-b951-d872f2087c98
* Transition to base/mac/bundle_locations.h step 1jeremy@chromium.org2012-01-193-41/+15
| | | | | | | | | | | | | | | | | Initial transition steps, trying to do this in small steps so it's easier to review. foundation_util.h: * Remove SetOverride*() methods and modify all callsites to use bundle_location.h version. * MainAppBundle() - call through to bundle_location version as an interim step. * Rename PathForFrameworkBundleResource() and modify callers. * Remove one instance of [NSBundle mainBundle]. BUG=None TEST=Chrome/Mac should launch correctly and all unit tests should pass. Review URL: http://codereview.chromium.org/9187053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118284 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up the SequencedWorkerPool to the browser thread.brettw@chromium.org2012-01-192-15/+80
| | | | | | | | | | | [re-land of 116816 http://codereview.chromium.org/9065009] This does some refactoring of the static data in the browser thread so we only have one global object instead of a bunch fo separate arrays. It also hooks up the visited link master's I/O to use this new system as a proof of concept. Review URL: https://chromiumcodereview.appspot.com/9124033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118236 0039d316-1c4b-4281-b951-d872f2087c98
* Change sandbox policy so we can create sync socketscpu@chromium.org2012-01-191-17/+20
| | | | | | | | | | | - Security-wise no change, we could do this already for a different prefix (chrome.nacl) - Improve the sync socket as not to have silly infinite loop. BUG=103975,103985 TEST=see bug Review URL: https://chromiumcodereview.appspot.com/9252003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118234 0039d316-1c4b-4281-b951-d872f2087c98
* Watchdog - Added a JOINABLE state to avoid StartupTimebombrtenneti@chromium.org2012-01-192-13/+37
| | | | | | | | | | | | | | | | | | | | | blocking UI thread during Watchdog thread join. StartupTimebomb deletes the startup_watchdog thread only if it is joinable. This fixes the case when UI thread is blocked until watchdog thread finishes generating the dump. StartupTimebomb keeps calling IsJoinable on startup_watchdog thread every 10 secs until it is joinable until it is deleted. The delete method calls Cleanup to set the state to SHUTDOWN for backward compatability. BUG=110055 R=jar TEST=base unit tests and browser ui and unit tests. Review URL: http://codereview.chromium.org/9173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118209 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 118118 - Temporarily revert 117127 for perf analysis.rsesek@chromium.org2012-01-183-22/+24
| | | | | | | | | | | BUG=110555 TBR=rsesek@chromium.org Review URL: https://chromiumcodereview.appspot.com/9252014 TBR=rsesek@chromium.org Review URL: https://chromiumcodereview.appspot.com/9250014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118152 0039d316-1c4b-4281-b951-d872f2087c98
* Temporarily revert 117127 for perf analysis.rsesek@chromium.org2012-01-183-24/+22
| | | | | | | | BUG=110555 TBR=rsesek@chromium.org Review URL: https://chromiumcodereview.appspot.com/9252014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118118 0039d316-1c4b-4281-b951-d872f2087c98
* Match whole path components in DevicePathToDriveLetterPath(). Add tests.skerner@chromium.org2012-01-173-49/+128
| | | | | | | | | | | | | +rvargas, who understands the code +brettw, who is in OWNERS BUG=109577 TEST=FileUtilTest.DevicePathToDriveLetter Review URL: http://codereview.chromium.org/9167004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117986 0039d316-1c4b-4281-b951-d872f2087c98
* Add back in stack_trace_android.cc on Android.jrg@google.com2012-01-171-1/+0
| | | | | | | | | | | | Needed to make net_unittests link. Does not reference JNI so it was improperly excluded. BUG=None TEST= Review URL: https://chromiumcodereview.appspot.com/9242023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117959 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw.hbono@chromium.org2012-01-162-5/+5
| | | | | | | | | | | | | | | | | | | | This change broke Linux and Mac bots. I would recommend to ask committers to run your next change on trybots. (*1) http://chromegw.corp.google.com/i/chromium/builders/Mac/builds/10788/steps/compile/logs/stdio (*2) http://chromegw.corp.google.com/i/chromium/builders/Linux/builds/19313/steps/compile/logs/stdio (*3) http://chromegw.corp.google.com/i/chromium/builders/Linux%20x64/builds/21385/steps/compile/logs/stdio R=brettw@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9185026 TBR=tedvessenes@gmail.com Review URL: http://codereview.chromium.org/9215005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117825 0039d316-1c4b-4281-b951-d872f2087c98
* Convert use of int ms to TimeDelta in files owned by brettw.tedvessenes@gmail.com2012-01-162-5/+5
| | | | | | | | | | | R=brettw@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9185026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117824 0039d316-1c4b-4281-b951-d872f2087c98
* Use ScopedVector instead of std::vector in case of repeated messages.mukai@chromium.org2012-01-142-48/+51
| | | | | | | | | | | | | | | During using this library, I realized that we want to use DISALLOW_COPY_AND_ASSIGN for the messages and RepeatedMessageConverter is inconsistent with such ones because it uses a copy constructor as "push_back(NestedType())". Then I now think to use ScopedVector. BUG=109375 TEST=passed locally Review URL: http://codereview.chromium.org/9187047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117786 0039d316-1c4b-4281-b951-d872f2087c98
* Allow tracing in third_party librariesjbates@chromium.org2012-01-137-572/+819
| | | | | | | | | | | | | | | | This is step 1 -- refactor the code to allow us to split up trace_event.h into trace_event.h and trace_event_export.h/cc. Step 2 is to cut out trace_event_export.h/cc. The _export.h/cc will be laid out so they can be copied to other third_party libraries and then tweaked to call through to chromium's internal tracing API via platform APIs or function pointers. To make these APIs easily exportable, this change primarily aims to eliminate the custom objects (ie: TraceValue) and types that will cause problems when defined in multiple libraries. The macros and internal namespace are destined for trace_event_export.h/cc in a future CL. BUG=109779 Review URL: http://codereview.chromium.org/9155024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117598 0039d316-1c4b-4281-b951-d872f2087c98
* Add custom field converter to JSONValueConverter.mukai@chromium.org2012-01-132-0/+85
| | | | | | | | | | | | | | | | In the real JSON results, sometimes string value does not literally mean a string, but labels (enum), URLs, or timestamps. Custom field accepts those string values and converting functions for such fields. See http://codereview.chromium.org/9147060 for the real use cases. BUG=109375 TEST=passed Review URL: http://codereview.chromium.org/9184002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117580 0039d316-1c4b-4281-b951-d872f2087c98