summaryrefslogtreecommitdiffstats
path: root/base/base.gypi
Commit message (Collapse)AuthorAgeFilesLines
* base: Remove discardable memory types.reveman2015-03-121-5/+0
| | | | | | | | | | No need for this. There's only one type. BUG=442945,422953 Review URL: https://codereview.chromium.org/1002623002 Cr-Commit-Position: refs/heads/master@{#320344}
* base: Remove unused DiscardableMemoryManager class.reveman2015-03-121-2/+0
| | | | | | | | BUG=442945,422953 Review URL: https://codereview.chromium.org/999903002 Cr-Commit-Position: refs/heads/master@{#320224}
* base: Remove DiscardableMemoryMach.reveman2015-03-111-4/+0
| | | | | | | | | | Remove unused DiscardableMemory implementation. BUG=442945,422953 Review URL: https://codereview.chromium.org/963233003 Cr-Commit-Position: refs/heads/master@{#320171}
* base: Remove DiscardableMemoryAshmem.reveman2015-03-111-8/+0
| | | | | | | | | | Remove unused DiscardableMemory implementation. BUG=442945,422953 Review URL: https://codereview.chromium.org/963883002 Cr-Commit-Position: refs/heads/master@{#320081}
* base: Remove DiscardableMemoryEmulated.reveman2015-03-111-2/+0
| | | | | | | | | | Remove unused DiscardableMemory implementation. BUG=442945,422953 Review URL: https://codereview.chromium.org/963813002 Cr-Commit-Position: refs/heads/master@{#320056}
* [Android] Add animation frame time histogram UMA facility.kkimlabs2015-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't have any metric for measuring Android UI animation jankiness before, and recently it came to our attention that animations are very janky on some low-end devices. It will be useful to know how the animations are doing on various user devices. This class can be used to record animation frame times histogram, for example: AnimationFrameTimeHistogram histogram = new AnimationFrameTimeHistogram(HISTOGRAM_NAME); histogram.startRecording(); // An animation to measure histogram.endRecording(); or animator.addListener(AnimationFrameTimeHistogram.getAnimatorRecorder( HISTOGRAM_NAME); To my knowledge, the closest thing we have is measuring each task runtime using TaskStopwatch class, but that doesn't suit for us since Android animation frame tasks are managed by Android, and even if we can use, it will require a JNI call for each frame. BUG=461066 Review URL: https://codereview.chromium.org/949613002 Cr-Commit-Position: refs/heads/master@{#318533}
* [tracing] memory maps dump provider skeletonprimiano2015-02-241-0/+4
| | | | | | | | | | | | | This CL introduces the skeleton (data model and dump provider stub) for snapshotting memory maps into the traces (via MemoryDumpManager). In the next CLs, the actual code to retrieve the data for the various OSs (or at least some of them) will be introduced. BUG=460884 Review URL: https://codereview.chromium.org/928723004 Cr-Commit-Position: refs/heads/master@{#317821}
* Separate OnJNIOnLoadmichaelbai2015-02-211-1/+0
| | | | | | | | | | | Separate it into OnJNIOnLoadRegisterJNI() and OnJNIOnLoadInit(), so they could be called by embedder when needed. BUG=447393 Review URL: https://codereview.chromium.org/935413004 Cr-Commit-Position: refs/heads/master@{#317479}
* [tracing] Add a dump provider to dump process memory totals.primiano2015-02-201-0/+4
| | | | | | | | | | | This CL introduces a dump provider which is able to capture the process Resident Set Size and the corresponding unittest. BUG=442731,458295 Review URL: https://codereview.chromium.org/934323002 Cr-Commit-Position: refs/heads/master@{#317336}
* [tracing] Introduce memory tracing skeleton.primiano2015-02-171-0/+5
| | | | | | | | | | | | | | | | | | | This is the first step towards the introduction of memory as a metric in chromium tracing. This change introduces the core memory dump manager which will coordinate the memory dumps. Specifically, the following concepts are introduced by this CL: - memory_dump_manager: the front-end interface exposed to the rest of the codebase to create memory dump points. - memory_dump_provider: the contract interface that memory dumpers need to expose in order to coordinate with the manager. This CL does NOT expose any user-visible tracing functionality. BUG=458295 Review URL: https://codereview.chromium.org/933613002 Cr-Commit-Position: refs/heads/master@{#316700}
* Upstream CRBProtocolObserverstuartmorgan2015-02-141-0/+2
| | | | | | | | | | | Upstreams an iOS helper class for managing lists of observers using an ObjC protocol. BUG=None Review URL: https://codereview.chromium.org/912783003 Cr-Commit-Position: refs/heads/master@{#316401}
* Sort GYP files under base using tools/sort_sources.pysatorux2015-02-131-41/+41
| | | | | | | | | | | | For tools/sort_sources.py to be useful, existing GYP files should be sorted. BUG=456014 TEST=everything should build as before Review URL: https://codereview.chromium.org/917083002 Cr-Commit-Position: refs/heads/master@{#316164}
* removing all the code related to chrome://statscpu2015-02-121-4/+0
| | | | | | | | | | | | | this is all broken and has been for a while. Since then, 2012 to 2013 other, sytem-specific systems have been used. Note that there is a v8 test that is using the stats table. Hoping to sort this now. BUG=149742 Review URL: https://codereview.chromium.org/899753002 Cr-Commit-Position: refs/heads/master@{#315890}
* Revert of Temporary commit to evaluate perf impact of prototype CPU profiler ↵wittman2015-02-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #10 id:170001 of https://codereview.chromium.org/888923004/) Reason for revert: Reverting temporary commit. Original issue's description: > Temporary commit to evaluate perf impact of prototype CPU profiler > > Design doc: https://docs.google.com/document/d/1Bv-I1yM9AjgY3t27ixdyWHCAW9IpVx02YQ-nSbIqccc > > BUG= > > Committed: https://crrev.com/47c6093645b62fbc9f68cf50375fc0626e32516c > Cr-Commit-Position: refs/heads/master@{#315196} TBR=cpu@chromium.org,wfh@chromium.org,vadimt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/904233002 Cr-Commit-Position: refs/heads/master@{#315217}
* Temporary commit to evaluate perf impact of prototype CPU profilerwittman2015-02-071-0/+4
| | | | | | | | | | Design doc: https://docs.google.com/document/d/1Bv-I1yM9AjgY3t27ixdyWHCAW9IpVx02YQ-nSbIqccc BUG= Review URL: https://codereview.chromium.org/888923004 Cr-Commit-Position: refs/heads/master@{#315196}
* Move OpenProcessHandle to Process::Open.rvargas2015-02-041-1/+0
| | | | | | | | | | This removes another source of raw process handles. BUG=417532 Review URL: https://codereview.chromium.org/868543002 Cr-Commit-Position: refs/heads/master@{#314633}
* Deleting the forwarding header files base/debug/trace_event*ssid2015-02-031-5/+0
| | | | | | | | | | | | | | | | | | | Now that the migration of the tracing files is completed and all the tracing clients have been updated to point to base/trace_event/, it is safe to remove the forwarding headers from the old location. The only purpose of those headers, in fact, was to handle the renames in smaller CLs. The only thing left, at this point, is gradually renaming the namespaces, which is going to be handled in the upcoming CLs. See crrev.com/837303004 and the related bug for motivations. BUG=451032 TBR=jam@chromium.org,sky@chromium.org Review URL: https://codereview.chromium.org/897663002 Cr-Commit-Position: refs/heads/master@{#314357}
* This is the first patch to separate JNI registration with initialization, ↵michaelbai2015-01-281-0/+3
| | | | | | | | | | | | | | | | | | currently, we have JNI_OnLoad defined multiple places which has a lot of duplicated code and JNI registration and initialization are mixed; This patch - Added JNIOnLoadDelegate class for each component specific initialization. - Added base::android::OnJNIOnLoad() to call a list of delegates - Migrate testing, content_shell, chrome_shell. BUG=447393 TBR=thakis Review URL: https://codereview.chromium.org/864563002 Cr-Commit-Position: refs/heads/master@{#313592}
* Move base/debug/trace_event* to base/trace_event/ [part 1]ssid2015-01-271-9/+16
| | | | | | | | | | | | | | | | | Trace Event used to be a single file, base/debug/trace_event.h. Then we added more functionality, so it was base/debug/trace_event*.* For many years, we have had per-file OWNERS for Trace Event based off of trace_event*. This let us do trace_event improvements/iteration out of band with the much slower base/OWNERS process. But, this leads to a lot of poor filename choices for tracing related features, specifically to fall under trace event reviewers instead of base/ reviewers. That's clearly wrong. BUG=451032 Review URL: https://codereview.chromium.org/837303004 Cr-Commit-Position: refs/heads/master@{#313266}
* Filter out a few more files from NaCl build of base/jvoung2015-01-231-0/+6
| | | | | | | | | | | | | | | | | | | Some files like important_file_writer, and stack_trace will fail to link if they are ever linked in, because what they depend on has already been filtered out (file_util, file_util_posix and stack_trace_posix). Others just don't seem necessary (parts of base/process/). This helps a little w/ an upcoming pnacl LLVM 3.6 merge, but doesn't fully solve a linking problem. Otherwise it's fewer files to build w/ a NaCl compiler. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4026 Review URL: https://codereview.chromium.org/870863003 Cr-Commit-Position: refs/heads/master@{#312852}
* Cleanup dead code in base/ as found by Scythe.thestig2015-01-221-1/+0
| | | | | | | | Some parts just needed to be ifdefed. Review URL: https://codereview.chromium.org/853903003 Cr-Commit-Position: refs/heads/master@{#312576}
* Add a Java API for UMA histograms.ppi2015-01-221-0/+2
| | | | | | | | | | | | | | This patch adds a simple Java API for base/metrics, allowing to record boolean and enumerated histograms directly from the Java code. A test util (HistogramDelta) for histograms is also upstreamed from Chrome for Android and used for testing the new API. BUG=442300 Review URL: https://codereview.chromium.org/794273004 Cr-Commit-Position: refs/heads/master@{#312513}
* Fixes for Clang plugin checks in base/dmichael2014-12-181-0/+1
| | | | | | | | | | | The Clang Chromium "FindBadConstructs" plugin currently ignores templates and PODs (see the bug). This fixes some of the latent issues found in base/. BUG=441916 Review URL: https://codereview.chromium.org/806223004 Cr-Commit-Position: refs/heads/master@{#309088}
* Upstream WeakNSObject in //base/iosdroger2014-12-121-0/+2
| | | | | | Review URL: https://codereview.chromium.org/792443004 Cr-Commit-Position: refs/heads/master@{#308114}
* Generalizing conditional compilation logic for systems with native utf8 locale.halliwell2014-12-121-0/+5
| | | | | | | | | | | This change was needed for Chromecast, while avoiding adding yet another preprocessor condition. BUG=438331 Review URL: https://codereview.chromium.org/790903003 Cr-Commit-Position: refs/heads/master@{#308109}
* Adding a memory pressure observer for ChromeOS.skuhne2014-12-101-0/+2
| | | | | | | | | | | | | | | This is a memory observer for ChromeOS which triggers the existing memory pressure listening objects to release memory. Part of this code came from the old Athena project (see https://codereview.chromium.org/5113830031). Note that all this code resides for the time being behind a flag. BUG=439493 TEST=- Review URL: https://codereview.chromium.org/788713003 Cr-Commit-Position: refs/heads/master@{#307759}
* File with simple block types.eugenebut2014-11-251-0/+1
| | | | | | | | | | | | | Added the following typedefs: typedef bool (^ConditionBlock)(void); typedef void (^ProceduralBlock)(void); BUG=None Review URL: https://codereview.chromium.org/733163005 Cr-Commit-Position: refs/heads/master@{#305529}
* Split macros from base/metrics/histogram.h to histogram_macros.h.asvitkine2014-11-151-0/+1
| | | | | | | | | | | | | | | | | Moves all the histogram macro definitions to a new header file, base/metrics/histogram_macros.h. The intention is for that file to be included directly when a file only uses the macros to log histograms. For now, leaves base/metrics/histogram.h including the new header file with a TODO to remove the include and update the callers to include histogram_macros.h directly. BUG=416479 Review URL: https://codereview.chromium.org/730623003 Cr-Commit-Position: refs/heads/master@{#304332}
* Creating infrastructure for profiler instrumentation only in developer build ↵vadimt2014-10-281-2/+4
| | | | | | | | | | | | | | | and Canary channel. This introduces TrackingProfile class that is equivalent to ScopedProfile what tracking is enabled and does nothing otherwise. There is an idea to remove the single-parametered ScopedProfile constructor, but for this CL, I’m leaving it. Otherwise, I’d have to replace ~100 ScopedProfile instantiations throughout the code with TrackingProfile, and the substantial changes would be lost in these changes. I’ll do this in a separate CL. I replaced one ScopedProfile just to make sure this will compile. BUG=401560 TBR=asanka@chromium.org Review URL: https://codereview.chromium.org/663093005 Cr-Commit-Position: refs/heads/master@{#301695}
* Fix for a problem on low-memory devices caused by ↵petrcermak2014-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/643803003. This patch prevents low-memory devices from crashing on Chrome start up. Instead of relying on the Linker.sInBrowserProcess field, which can have an incorrect value on these devices, the mmap check (whether the device supports loading libraries directly from APK files) is performed inside LibraryLoader.onNativeInitializationComplete, which is guaranteed to be called only in the process thread. In addition, two extra possible values are added to the UMA histogram: Unknown (the mmap check was not carried out) and Successful (a library was successfully loaded directly from the APK). Finally, this patch removes the deprecated LibraryLoader.onNativeInitializationComplete() method (with no arguments), which was replaced by LibraryLoader.onNativeInitializationComplete(Context context) in https://codereview.chromium.org/643923004/. BUG=423699,390618 Review URL: https://codereview.chromium.org/663543003 Cr-Commit-Position: refs/heads/master@{#301342}
* Re-land: Add browser-wide discardable memory implementation.reveman2014-10-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a platform agnostic implementation of discardable memory based on shared memory. Managment of discardable memory is moved to the browser process instead of being local to each renderer. This provides much better control over chromium's total discardable memory usage. A round-trip to the browser IO thread is necessary for a renderer to allocate a new discardable memory segment but the cost of this can be reduced by maintaining free lists on the renderer side and have discardable memory instances share the same discardable memory segment. The implementation of this optimization is left as a follow up. Note: while the general implementation is platform agnostic, it takes advantage of the ftruncate syscall available on Posix platforms. This syscall makes it possible to release discardable memory segments immediately to the OS from the browser process. BUG=381178,400423,422953 TEST=base_unittests --gtest_filter=DiscardableMemoryTests*, base_unittests --gtest_filter=DiscardableSharedMemory.*, content_unittests --gtest_filter=HostDiscardableSharedMemoryManagerTest.* Review URL: https://codereview.chromium.org/531343002 Cr-Commit-Position: refs/heads/master@{#301247}
* Revert of Add browser-wide discardable memory implementation. (patchset #23 ↵avi2014-10-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:910001 of https://codereview.chromium.org/531343002/) Reason for revert: Causes compile error. http://build.chromium.org/p/chromium.linux/builders/Android%20Builder/builds/39232 ../../base/memory/discardable_shared_memory.cc:208:5:error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] ftruncate(handle.fd, sizeof(SharedState)); ^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Original issue's description: > Add browser-wide discardable memory implementation. > > This provides a platform agnostic implementation of discardable > memory based on shared memory. Managment of discardable memory is > moved to the browser process instead of being local to each renderer. > This provides much better control over chromium's total discardable > memory usage. > > A round-trip to the browser IO thread is necessary for a renderer > to allocate a new discardable memory segment but the cost of this > can be reduced by maintaining free lists on the renderer side and > have discardable memory instances share the same discardable > memory segment. The implementation of this optimization is left as > a follow up. > > Note: while the general implementation is platform agnostic, it > takes advantage of the ftruncate syscall available on Posix > platforms. This syscall makes it possible to release discardable > memory segments immediately to the OS from the browser process. > > BUG=381178,400423,422953 > TEST=base_unittests --gtest_filter=DiscardableMemoryTests*, base_unittests --gtest_filter=DiscardableSharedMemory.*, content_unittests --gtest_filter=HostDiscardableSharedMemoryManagerTest.* > > Committed: https://crrev.com/2ac2d83d86b0206b908eea0d6e1002850d238a88 > Cr-Commit-Position: refs/heads/master@{#301152} TBR=skuhne@chromium.org,rmcilroy@chromium.org,danakj@chromium.org,rsesek@chromium.org,nasko@chromium.org,reveman@chromium.org NOTREECHECKS=true NOTRY=true BUG=381178,400423,422953 Review URL: https://codereview.chromium.org/678603003 Cr-Commit-Position: refs/heads/master@{#301156}
* Add browser-wide discardable memory implementation.reveman2014-10-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a platform agnostic implementation of discardable memory based on shared memory. Managment of discardable memory is moved to the browser process instead of being local to each renderer. This provides much better control over chromium's total discardable memory usage. A round-trip to the browser IO thread is necessary for a renderer to allocate a new discardable memory segment but the cost of this can be reduced by maintaining free lists on the renderer side and have discardable memory instances share the same discardable memory segment. The implementation of this optimization is left as a follow up. Note: while the general implementation is platform agnostic, it takes advantage of the ftruncate syscall available on Posix platforms. This syscall makes it possible to release discardable memory segments immediately to the OS from the browser process. BUG=381178,400423,422953 TEST=base_unittests --gtest_filter=DiscardableMemoryTests*, base_unittests --gtest_filter=DiscardableSharedMemory.*, content_unittests --gtest_filter=HostDiscardableSharedMemoryManagerTest.* Review URL: https://codereview.chromium.org/531343002 Cr-Commit-Position: refs/heads/master@{#301152}
* [Android] Simplify logic for grabbing initial country-code.yfriedman2014-10-201-0/+2
| | | | | | | | | | | | | The old way involved start-up code reading a value and setting a global in template_url_prepopulate_data. Since the value can be computed on-demand from device-information, just fetch it as needed instead. BUG=169106 TBR=thakis Review URL: https://codereview.chromium.org/628263004 Cr-Commit-Position: refs/heads/master@{#300317}
* base: Rename and move Mach implementation of discardable memory to a ↵reveman2014-10-141-0/+4
| | | | | | | | | | | | | | | | | | separate file. This will hopefully reduce confusion about the N-M mapping between platforms and discardable memory implementations by not having an implementation named after a platform. This also moves the Mach implementation of discardable memory used on mac to a separate file for consistency with other platforms and discardable memory implementations. BUG=422953 Review URL: https://codereview.chromium.org/649233002 Cr-Commit-Position: refs/heads/master@{#299528}
* Use C++11 atomicsjfb2014-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL moves the Chrome code base to C++11 atomics instead of inline assembly for the toolchains that support C++11's <atomic>. The patch is constructed to modify as little code as possible, and will be followed-up with other patches to clean up the rest of the code base. This change should allow compilers to emit better code when dealing with atomics (LLVM has recently seen substantial improvements thanks to morisset's work), be more portable, eventually delete a bunch of code, and in subsequent changes atomicity will be based on memory location instead of individual accesses (making the code less error-prone, and easier to analyze). This patch stems from a fix I recently made to V8 to build under NaCl and PNaCl. This was gating V8's C++11 migration: they needed to move to the LLVM-based NaCl toolchain which didn't work with atomicops' inline assembly. V8 currently uses the __sync_* primitives for the NaCl/PNaCl build, which imply sequential consistency and are therefore suboptimal. Before doing further work I want to fix Chrome's own headers, and trickle these changes to V8. Future changes: * The atomicops headers are copied in 8 locations [0] in the Chrome code base, not all of them are up to date. Those should all be updated in their individual repositories (some are in thiry_party). * The signature of functions should be updated to take an atomic location instead of the pointer argument, and all call sites should be updated (there are current 127 such calls [1] in chromium/src in non-implementation and non-test files). * Atomic operations should be used directly. A few things worth noting: * The atomicops_internals_portable.h file contains the main implementation, and has extra notes on implementation choices. * The CL removes x86 CPU features detection from the portable implementation: - Because the headers are copied in a few places and the x86 CPU feature detection uses a static global that parses cpuid, the atomicops_internals_x86_gcc.cc file was only built once, but its struct interface was declared external and used in protobuf and tcmalloc. Removing the struct from Chrome's own base makes the linker sad because of the two uses. This has two implications: # Don't specialize atomics for SSE2 versus non SSE2. This is a non-issue since Chrome requires a minimum of SSE2. The code is therefore faster (skip a branch). # The code doesn't detect the AMD Opteron Rev E memory barrier bug from AMD errata 147 [2]. This bug affects Opterons 1xx/2xx/8xx that shipped in 2003-2004. In general compilers should work around this bug, not library code. GCC has had this workaround since 2009 [3], but it is still an open bug in LLVM [4]. See comment #27 on the code review: this CPU is used by 0.02% of Chrome users, for whom the race would have to occur and the compiler not have the workaround for the bug to manifest. This also makes the code faster by skipping a branch. * The CL moves the declaration of the x86 CPU features struct to atomicops.h, and matches its fields with the ones duplicated across the code base. This is transitional: it fixes a link failure because tcmalloc relied on the x86_gcc.{h,cc} declaration and implementation, and it fixes an ODR violation where the struct didn't always have 3 members (and the other members were sometimes accessed, uninitialized). * tsan already rewrites all atomics to its own primitives, its header is therefore now unnecessary. The implementation takes care to detect and error out if that turns out not to be true. * MemoryBarrier works around a libstdc++ bug in older versions [5]. The workaround is exactly the non-buggy code for libstdc++ (call out to the compiler's builtin). * The assembly generated by GCC 4.8 and LLVM 3.6 for x86-32/x86-64/ARM when using this portable implementation can be found in [6]. [0]: find . -name "atomicops.h" ./base/atomicops.h ./v8/src/base/atomicops.h ./native_client_sdk/src/libraries/sdk_util/atomicops.h ./third_party/webrtc/base/atomicops.h ./third_party/tcmalloc/chromium/src/base/atomicops.h ./third_party/tcmalloc/vendor/src/base/atomicops.h ./third_party/re2/util/atomicops.h ./third_party/protobuf/src/google/protobuf/stubs/atomicops.h [1]: git grep Barrier_ | grep -v atomicops | grep -v unittest | wc -l [2]: http://support.amd.com/us/Processor_TechDocs/25759.pdf [3]: https://gcc.gnu.org/ml/gcc-patches/2009-10/txt00046.txt [4]: http://llvm.org/bugs/show_bug.cgi?id=5934 [5]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51038 [6]: https://code.google.com/p/chromium/issues/detail?id=423074 TEST=ninja -C out/Release base_unittests TEST=trybots BUG=246514 BUG=234215 BUG=420970 BUG=423074 R= dvyukov@google.com, thakis@chromium.org, glider@chromium.org, hboehm@google.com, morisset@google.com, willchan@chromium.org Review URL: https://codereview.chromium.org/636783002 Cr-Commit-Position: refs/heads/master@{#299485}
* base: Remove non-caching discardable memory implementation.reveman2014-10-131-2/+0
| | | | | | | | | | | | | | | | | | This removes the "malloc" implementation of discardable memory. This implementation exists for test and debugging purproses but we currently don't have any tests that depend on it so it can be removed to reduce code size. This implementation can still be very useful to manually track down bugs and performance issues in discardable memory clients but can be maintained separately to reduce code size. BUG=422953 TBR=danakj@chromium.org Review URL: https://codereview.chromium.org/651913003 Cr-Commit-Position: refs/heads/master@{#299374}
* Make base::PowerMonitor work on Chrome OS.derat2014-10-071-0/+6
| | | | | | | | | | | | | | On Chrome OS, updates about the system power status are received via D-Bus messages on the UI thread. Being in base/, PowerMonitor can't depend on the code in chromeos/ that receives those messages, so make the Chrome OS code instead notify PowerMonitor when it receives updates. BUG=326534 Review URL: https://codereview.chromium.org/622693004 Cr-Commit-Position: refs/heads/master@{#298367}
* Add base::Reversed() as an adapter for range-based for loops in reversemdempsky2014-09-291-0/+1
| | | | | | | | See also https://groups.google.com/a/chromium.org/d/msg/chromium-dev/utDItV2a7aE/IeVDbl5L77cJ Review URL: https://codereview.chromium.org/605243003 Cr-Commit-Position: refs/heads/master@{#297216}
* Revert of Check to ensure PowerObservers are added and removed on the same ↵dcheng2014-09-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | thread (patchset #7 id:120001 of https://codereview.chromium.org/502003003/) Reason for revert: Causing failures on Mac try jobs: ExtensionServiceTest.ExternalExtensionAutoAcknowledgement (run #1): [ RUN ] ExtensionServiceTest.ExternalExtensionAutoAcknowledgement [8427:1799:0904/211500:4724222818698:FATAL:power_monitor.cc(38)] Check failed: obs->power_monitor_thread_checker_. Original issue's description: > Check to ensure PowerObservers are added and removed on the same thread > > This behavior is required by ObserverListThreadSafe and may leads to crashes if not followed > > BUG=404767 > > Committed: https://chromium.googlesource.com/chromium/src/+/518c46fbba70c91169bfc0c64b542f06e56b3915 TBR=thakis@chromium.org,brettw@chromium.org,scottmg@chromium.org,bajones@chromium.org NOTREECHECKS=true NOTRY=true BUG=404767 Review URL: https://codereview.chromium.org/544913003 Cr-Commit-Position: refs/heads/master@{#293448}
* Check to ensure PowerObservers are added and removed on the same threadbajones2014-09-041-0/+1
| | | | | | | | | | This behavior is required by ObserverListThreadSafe and may leads to crashes if not followed BUG=404767 Review URL: https://codereview.chromium.org/502003003 Cr-Commit-Position: refs/heads/master@{#293230}
* Make class lookup lazy in jni_generator when using lazy method lookup.mkosiba@chromium.org2014-08-211-0/+2
| | | | | | | | | | | | This removes the eager class registration from RegisterNatives when possible. BUG=402003 TBR=sievers@chromium.org, brettw@chromium.org, torne@chromium.org Review URL: https://codereview.chromium.org/491043002 Cr-Commit-Position: refs/heads/master@{#291095} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291095 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 290810 "Make class lookup lazy in jni_generator when usin..."ygorshenin@chromium.org2014-08-201-2/+0
| | | | | | | | | | | | | | | | | | > Make class lookup lazy in jni_generator when using lazy method lookup. > > This removes the eager class registration from RegisterNatives when possible. > > BUG=402003 > TBR=sievers@chromium.org, brettw@chromium.org > > Review URL: https://codereview.chromium.org/472553002 TBR=mkosiba@chromium.org Review URL: https://codereview.chromium.org/492713002 Cr-Commit-Position: refs/heads/master@{#290813} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290813 0039d316-1c4b-4281-b951-d872f2087c98
* Make class lookup lazy in jni_generator when using lazy method lookup.mkosiba@chromium.org2014-08-201-0/+2
| | | | | | | | | | | | This removes the eager class registration from RegisterNatives when possible. BUG=402003 TBR=sievers@chromium.org, brettw@chromium.org Review URL: https://codereview.chromium.org/472553002 Cr-Commit-Position: refs/heads/master@{#290810} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290810 0039d316-1c4b-4281-b951-d872f2087c98
* base: Factor task debug annotations out of MessageLoopskyostil@chromium.org2014-08-141-0/+2
| | | | | | | | | | | | | | | The MessageLoop has some code for adding debug annotations such as trace flows and memory usage tags to posted tasks. Since we want to use these annotations more generally for tasks that are scheduled outside the base message loop, this patch factors it out into a standalone class. TEST=TaskAnnotatorTest BUG=391005 Review URL: https://codereview.chromium.org/455833004 Cr-Commit-Position: refs/heads/master@{#289560} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289560 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_util to base/files/ directory.brettw@chromium.org2014-08-131-11/+11
| | | | | | | | | | | This updates the includes in base but leaves a forwarding header for the rest of the project for now. R=yzshen@chromium.org Review URL: https://codereview.chromium.org/468253002 Cr-Commit-Position: refs/heads/master@{#289360} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289360 0039d316-1c4b-4281-b951-d872f2087c98
* Add ScopedObjCClassSwizzler in base/mac, absorbs objc_method_swizzle and ↵tapted@chromium.org2014-08-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | ScopedClassSwizzler ScopedClassSwizzler from ui/test is wanted for new tests where it can't currently be accessed. It also re-implements a concept in chrome/common/mac/objc_method_swizzle.* This change adds base::mac::ScopedObjCClassSwizzler, merges concepts from objc_method_swizzle, and adjusts chrome_browser_application_mac.mm to use the new swizzler. The test from objc_method_swizzle is adapted and extended for the scoped swizzler. BUG=378134 TEST=base_unittests Review URL: https://codereview.chromium.org/345243007 Cr-Commit-Position: refs/heads/master@{#288943} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288943 0039d316-1c4b-4281-b951-d872f2087c98
* Move ini_parser from base to chrome/commonbrettw@chromium.org2014-08-111-2/+0
| | | | | | | | | | This was moved to base apparently thinking it could be shared with a media gallery thing that seems not to have panned out. Review URL: https://codereview.chromium.org/453703002 Cr-Commit-Position: refs/heads/master@{#288814} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288814 0039d316-1c4b-4281-b951-d872f2087c98
* Add builders for tracing event's structural argumentsyurys@chromium.org2014-08-011-0/+2
| | | | | | | | | | | | | | | | The new classes allow building JSON-like structural arguments. Current implementation uses base::Value as backing store but that can be replaced in the future with something more efficient without changing client code. All clients of cc/debug/traced_value.h should eventually switch to use the new builders. BUG=361045 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286849 R=alph@chromium.org, dsinclair@chromium.org, nduca@chromium.org, willchan@chromium.org Review URL: https://codereview.chromium.org/380763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286984 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Add builders for tracing event's structural arguments ↵erikchen@chromium.org2014-07-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/380763002/) Reason for revert: linux ASAN errors. http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/4493/steps/base_unittests/logs/stdio Original issue's description: > Add builders for tracing event's structural arguments > > The new classes allow building JSON-like structural arguments. Current implementation uses base::Value as backing store but that can be replaced in the future with something more efficient without changing client code. > > All clients of cc/debug/traced_value.h should eventually switch to use the new builders. > > BUG=361045 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286849 TBR=alph, caseq, dsinclair, nduca, willchan, yurys NOTREECHECKS=true NOTRY=true BUG=361045 Review URL: https://codereview.chromium.org/421183003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286862 0039d316-1c4b-4281-b951-d872f2087c98