├── src
├── base
│ ├── test
│ │ ├── data
│ │ │ ├── file_util
│ │ │ │ ├── empty1.txt
│ │ │ │ ├── empty2.txt
│ │ │ │ ├── shortened.txt
│ │ │ │ ├── crlf.txt
│ │ │ │ ├── original.txt
│ │ │ │ ├── same.txt
│ │ │ │ ├── different.txt
│ │ │ │ ├── different_last.txt
│ │ │ │ ├── same_length.txt
│ │ │ │ ├── different_first.txt
│ │ │ │ ├── blank_line.txt
│ │ │ │ ├── first2.txt
│ │ │ │ ├── blank_line_crlf.txt
│ │ │ │ ├── first1.txt
│ │ │ │ ├── red.png
│ │ │ │ ├── binary_file.bin
│ │ │ │ ├── binary_file_diff.bin
│ │ │ │ └── binary_file_same.bin
│ │ │ ├── prefs
│ │ │ │ ├── invalid.json
│ │ │ │ ├── read.json
│ │ │ │ └── write.golden.json
│ │ │ ├── serializer_test_nowhitespace.json
│ │ │ ├── serializer_test.json
│ │ │ ├── json
│ │ │ │ └── bom_feff.json
│ │ │ └── serializer_nested_test.json
│ │ ├── OWNERS
│ │ ├── expectations
│ │ │ └── OWNERS
│ │ ├── DEPS
│ │ ├── android
│ │ │ ├── OWNERS
│ │ │ └── javatests
│ │ │ │ └── src
│ │ │ │ └── org
│ │ │ │ └── chromium
│ │ │ │ └── base
│ │ │ │ └── test
│ │ │ │ └── util
│ │ │ │ ├── MinAndroidSdkLevel.java
│ │ │ │ ├── TimeoutScale.java
│ │ │ │ ├── DisabledTest.java
│ │ │ │ ├── Manual.java
│ │ │ │ ├── HostDrivenTest.java
│ │ │ │ ├── EnormousTest.java
│ │ │ │ ├── IntegrationTest.java
│ │ │ │ ├── InstrumentationUtils.java
│ │ │ │ ├── Feature.java
│ │ │ │ └── ScalableTimeout.java
│ │ ├── run_all_perftests.cc
│ │ ├── mock_devices_changed_observer.cc
│ │ ├── test_listener_ios.h
│ │ ├── perf_test_suite.h
│ │ ├── launcher
│ │ │ ├── test_launcher_ios.cc
│ │ │ └── unit_test_launcher_ios.cc
│ │ ├── simple_test_clock.cc
│ │ ├── simple_test_tick_clock.cc
│ │ ├── scoped_locale.cc
│ │ ├── test_file_util.cc
│ │ ├── test_support_ios.h
│ │ ├── scoped_locale.h
│ │ ├── test_file_util_linux.cc
│ │ ├── perf_time_logger.cc
│ │ ├── test_support_android.h
│ │ ├── null_task_runner.cc
│ │ ├── opaque_ref_counted.h
│ │ ├── perf_log.h
│ │ ├── mock_time_provider.cc
│ │ ├── trace_to_file.h
│ │ ├── mock_devices_changed_observer.h
│ │ ├── gtest_util.h
│ │ ├── opaque_ref_counted.cc
│ │ ├── test_file_util_android.cc
│ │ ├── test_shortcut_win.h
│ │ ├── mock_chrome_application_mac.h
│ │ ├── perf_time_logger.h
│ │ ├── simple_test_clock.h
│ │ ├── thread_test_helper.cc
│ │ ├── simple_test_tick_clock.h
│ │ ├── perf_log.cc
│ │ ├── run_all_unittests.cc
│ │ └── null_task_runner.h
│ ├── numerics
│ │ └── OWNERS
│ ├── third_party
│ │ ├── nspr
│ │ │ ├── OWNERS
│ │ │ ├── README.chromium
│ │ │ └── BUILD.gn
│ │ ├── symbolize
│ │ │ ├── DEPS
│ │ │ ├── glog
│ │ │ │ ├── logging.h
│ │ │ │ └── raw_logging.h
│ │ │ ├── config.h
│ │ │ ├── utilities.h
│ │ │ ├── README.chromium
│ │ │ └── BUILD.gn
│ │ ├── superfasthash
│ │ │ ├── OWNERS
│ │ │ └── README.chromium
│ │ ├── xdg_user_dirs
│ │ │ ├── README.chromium
│ │ │ ├── BUILD.gn
│ │ │ └── LICENSE
│ │ ├── xdg_mime
│ │ │ ├── compile.patch
│ │ │ ├── README.chromium
│ │ │ ├── README
│ │ │ └── BUILD.gn
│ │ ├── dmg_fp
│ │ │ ├── float_precision_crash.patch
│ │ │ ├── gcc_64_bit.patch
│ │ │ ├── LICENSE
│ │ │ ├── README.chromium
│ │ │ └── dmg_fp.h
│ │ ├── valgrind
│ │ │ └── README.chromium
│ │ ├── dynamic_annotations
│ │ │ ├── BUILD.gn
│ │ │ └── README.chromium
│ │ └── icu
│ │ │ └── README.chromium
│ ├── threading
│ │ ├── OWNERS
│ │ ├── non_thread_safe_impl.cc
│ │ ├── thread_local_android.cc
│ │ ├── thread_local_storage_posix.cc
│ │ ├── thread_checker_impl.cc
│ │ ├── thread_local_win.cc
│ │ └── thread_local_posix.cc
│ ├── win
│ │ ├── OWNERS
│ │ ├── iunknown_impl.cc
│ │ ├── iunknown_impl.h
│ │ ├── i18n.h
│ │ ├── scoped_hglobal.h
│ │ └── scoped_select_object.h
│ ├── metrics
│ │ ├── OWNERS
│ │ └── user_metrics_action.h
│ ├── files
│ │ ├── OWNERS
│ │ ├── file_util_android.cc
│ │ ├── file_enumerator.cc
│ │ ├── file_path_constants.cc
│ │ ├── file_path_watcher_stub.cc
│ │ ├── protect_file_posix.gypi
│ │ ├── scoped_file.cc
│ │ ├── file_posix_hooks_internal.h
│ │ └── dir_reader_fallback.h
│ ├── strings
│ │ ├── OWNERS
│ │ ├── nullable_string16.cc
│ │ ├── latin1_string_conversions.cc
│ │ ├── sys_string_conversions_mac_unittest.mm
│ │ └── stringize_macros.h
│ ├── prefs
│ │ ├── OWNERS
│ │ ├── README
│ │ ├── pref_store.cc
│ │ ├── pref_observer.h
│ │ ├── base_prefs_export.h
│ │ ├── mock_pref_change_callback.cc
│ │ ├── pref_notifier.h
│ │ ├── pref_store_observer_mock.cc
│ │ ├── scoped_user_pref_update.cc
│ │ └── pref_store_observer_mock.h
│ ├── debug
│ │ ├── OWNERS
│ │ ├── trace_event_unittest.h
│ │ ├── alias.cc
│ │ ├── debugger_win.cc
│ │ ├── alias.h
│ │ ├── gdi_debug_util_win.h
│ │ ├── dump_without_crashing.cc
│ │ ├── stack_trace.cc
│ │ ├── dump_without_crashing.h
│ │ └── trace_event_impl_constants.cc
│ ├── time
│ │ ├── clock.cc
│ │ ├── tick_clock.cc
│ │ ├── default_clock.cc
│ │ ├── default_tick_clock.cc
│ │ ├── default_clock.h
│ │ └── default_tick_clock.h
│ ├── bind_helpers.cc
│ ├── process
│ │ ├── launch_ios.cc
│ │ ├── memory_stubs.cc
│ │ ├── process_metrics_unittest_ios.cc
│ │ ├── process_info_win.cc
│ │ ├── memory.cc
│ │ ├── process_info.h
│ │ ├── kill.cc
│ │ ├── process_info_linux.cc
│ │ ├── process_handle_linux.cc
│ │ ├── process_info_mac.cc
│ │ ├── process_handle_mac.cc
│ │ ├── memory_unittest_mac.h
│ │ ├── process_handle_freebsd.cc
│ │ └── process_iterator_win.cc
│ ├── allocator
│ │ ├── debugallocation_shim.cc
│ │ ├── unittest_utils.cc
│ │ ├── type_profiler_control.cc
│ │ ├── type_profiler_control.h
│ │ ├── type_profiler_tcmalloc.h
│ │ ├── allocator_shim.h
│ │ └── type_profiler_tcmalloc.cc
│ ├── power_monitor
│ │ ├── power_monitor_device_source_posix.cc
│ │ ├── power_monitor_device_source_android.h
│ │ ├── power_observer.h
│ │ └── power_monitor_device_source_chromeos.cc
│ ├── message_loop
│ │ ├── message_loop_proxy.cc
│ │ ├── message_pump.cc
│ │ └── timer_slack.h
│ ├── callback_forward.h
│ ├── timer
│ │ ├── elapsed_timer.cc
│ │ ├── hi_res_timer_manager_posix.cc
│ │ ├── elapsed_timer.h
│ │ ├── hi_res_timer_manager_win.cc
│ │ └── mock_timer.h
│ ├── os_compat_nacl.h
│ ├── critical_closure_internal_ios.mm
│ ├── DEPS
│ ├── synchronization
│ │ ├── cancellation_flag.cc
│ │ ├── lock_impl_win.cc
│ │ └── lock.cc
│ ├── base_paths_mac.h
│ ├── hash.cc
│ ├── os_compat_nacl.cc
│ ├── profiler
│ │ ├── scoped_tracker.cc
│ │ ├── scoped_profile.cc
│ │ └── alternate_timer.cc
│ ├── mac
│ │ ├── OWNERS
│ │ ├── scoped_sending_event.mm
│ │ ├── os_crash_dumps.h
│ │ ├── scoped_nsautorelease_pool.mm
│ │ ├── scoped_mach_vm.cc
│ │ ├── mac_logging.cc
│ │ └── launchd.h
│ ├── check_example.cc
│ ├── memory
│ │ ├── scoped_policy.h
│ │ └── scoped_handle.h
│ ├── base_paths_android.h
│ ├── guid.cc
│ ├── sys_info_internal.h
│ ├── tracking_info.cc
│ ├── event_recorder_stubs.cc
│ ├── debug_message.cc
│ ├── base64.h
│ ├── float_util.h
│ ├── scoped_clear_errno.h
│ ├── os_compat_android.h
│ ├── base_paths_posix.h
│ ├── event_types.h
│ ├── build_time.cc
│ ├── value_conversions.h
│ ├── sha1.h
│ ├── build_time.h
│ ├── nix
│ │ └── mime_util_xdg.h
│ ├── sys_info_freebsd.cc
│ ├── sequenced_task_runner.cc
│ ├── base_export.h
│ ├── callback_helpers.cc
│ ├── guid_win.cc
│ ├── guid.h
│ ├── json
│ │ └── json_value_converter.cc
│ ├── rand_util_nacl.cc
│ ├── barrier_closure.h
│ ├── bits.h
│ ├── base_switches.h
│ ├── callback_internal.cc
│ └── hash.h
├── third_party
│ ├── superfasthash
│ │ ├── OWNERS
│ │ └── README.chromium
│ ├── sqlite3
│ │ └── sqlite3.lib
│ └── libevent
│ │ ├── autogen.sh
│ │ ├── sample
│ │ └── Makefile.am
│ │ ├── test
│ │ ├── regress.rpc
│ │ ├── test-init.c
│ │ └── Makefile.am
│ │ ├── nacl_nonsfi
│ │ └── random.c
│ │ ├── strlcpy-internal.h
│ │ ├── event-config.h
│ │ ├── mkinstalldirs
│ │ ├── BUILD.gn
│ │ └── README.chromium
├── test_qt
│ ├── test_qt.qrc
│ ├── main.cpp
│ ├── global_def.h
│ ├── test_qt.ui
│ └── test_qt.h
└── build
│ └── filename_rules.gypi
├── README.md
├── Debug
└── sqlite3.dll
├── .gitignore
└── .travis.yml
/src/base/test/data/file_util/empty1.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/empty2.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/base/test/OWNERS:
--------------------------------------------------------------------------------
1 | phajdan.jr@chromium.org
2 |
--------------------------------------------------------------------------------
/src/base/test/data/prefs/invalid.json:
--------------------------------------------------------------------------------
1 | !@#$%^&
--------------------------------------------------------------------------------
/src/base/test/data/file_util/shortened.txt:
--------------------------------------------------------------------------------
1 | This file is the
--------------------------------------------------------------------------------
/src/base/test/expectations/OWNERS:
--------------------------------------------------------------------------------
1 | rsesek@chromium.org
2 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/crlf.txt:
--------------------------------------------------------------------------------
1 | This file is the same.
2 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/original.txt:
--------------------------------------------------------------------------------
1 | This file is the same.
2 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/same.txt:
--------------------------------------------------------------------------------
1 | This file is the same.
2 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/different.txt:
--------------------------------------------------------------------------------
1 | This file is different.
2 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/different_last.txt:
--------------------------------------------------------------------------------
1 | This file is the same.
--------------------------------------------------------------------------------
/src/base/test/data/file_util/same_length.txt:
--------------------------------------------------------------------------------
1 | This file is not same.
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/README.md
--------------------------------------------------------------------------------
/src/base/numerics/OWNERS:
--------------------------------------------------------------------------------
1 | jschuh@chromium.org
2 | tsepez@chromium.org
3 |
4 |
--------------------------------------------------------------------------------
/src/base/test/DEPS:
--------------------------------------------------------------------------------
1 | include_rules = [
2 | "+third_party/libxml",
3 | ]
4 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/different_first.txt:
--------------------------------------------------------------------------------
1 | this file is the same.
2 |
--------------------------------------------------------------------------------
/src/base/third_party/nspr/OWNERS:
--------------------------------------------------------------------------------
1 | rsleevi@chromium.org
2 | wtc@chromium.org
3 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/DEPS:
--------------------------------------------------------------------------------
1 | include_rules = [
2 | "+glog",
3 | ]
4 |
--------------------------------------------------------------------------------
/src/base/threading/OWNERS:
--------------------------------------------------------------------------------
1 | # For thread_resrictions.*
2 | jam@chromium.org
3 |
--------------------------------------------------------------------------------
/src/base/win/OWNERS:
--------------------------------------------------------------------------------
1 | cpu@chromium.org
2 | grt@chromium.org
3 | rvargas@chromium.org
4 |
--------------------------------------------------------------------------------
/src/third_party/superfasthash/OWNERS:
--------------------------------------------------------------------------------
1 | mgiuca@chromium.org
2 | rvargas@chromium.org
3 |
--------------------------------------------------------------------------------
/Debug/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/Debug/sqlite3.dll
--------------------------------------------------------------------------------
/src/base/third_party/superfasthash/OWNERS:
--------------------------------------------------------------------------------
1 | mgiuca@chromium.org
2 | rvargas@chromium.org
3 |
--------------------------------------------------------------------------------
/src/base/metrics/OWNERS:
--------------------------------------------------------------------------------
1 | asvitkine@chromium.org
2 | isherman@chromium.org
3 | jar@chromium.org
4 |
--------------------------------------------------------------------------------
/src/base/test/android/OWNERS:
--------------------------------------------------------------------------------
1 | feng@chromium.org
2 | nyquist@chromium.org
3 | yfriedman@chromium.org
4 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/blank_line.txt:
--------------------------------------------------------------------------------
1 | The next line is blank.
2 |
3 | But this one isn't.
4 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/first2.txt:
--------------------------------------------------------------------------------
1 | The first line is the same.
2 | The second line is not.
3 |
--------------------------------------------------------------------------------
/src/test_qt/test_qt.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/base/files/OWNERS:
--------------------------------------------------------------------------------
1 | rvargas@chromium.org
2 |
3 | per-file file_path_watcher*=mnissler@chromium.org
4 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/blank_line_crlf.txt:
--------------------------------------------------------------------------------
1 | The next line is blank.
2 |
3 | But this one isn't.
4 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/first1.txt:
--------------------------------------------------------------------------------
1 | The first line is the same.
2 | The second line is different.
3 |
--------------------------------------------------------------------------------
/src/base/strings/OWNERS:
--------------------------------------------------------------------------------
1 | per-file safe_sprintf*=jln@chromium.org
2 | per-file safe_sprintf*=mdempsky@chromium.org
3 |
--------------------------------------------------------------------------------
/src/base/test/data/serializer_test_nowhitespace.json:
--------------------------------------------------------------------------------
1 | {"bool":true,"int":42,"list":[1,2],"null":null,"real":3.14,"string":"hello"}
--------------------------------------------------------------------------------
/src/base/test/data/file_util/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/src/base/test/data/file_util/red.png
--------------------------------------------------------------------------------
/src/third_party/sqlite3/sqlite3.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/src/third_party/sqlite3/sqlite3.lib
--------------------------------------------------------------------------------
/src/base/prefs/OWNERS:
--------------------------------------------------------------------------------
1 | battre@chromium.org
2 | bauerb@chromium.org
3 | gab@chromium.org
4 | mnissler@chromium.org
5 | pam@chromium.org
6 |
--------------------------------------------------------------------------------
/src/base/test/data/file_util/binary_file.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/src/base/test/data/file_util/binary_file.bin
--------------------------------------------------------------------------------
/src/base/test/data/file_util/binary_file_diff.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/src/base/test/data/file_util/binary_file_diff.bin
--------------------------------------------------------------------------------
/src/base/test/data/file_util/binary_file_same.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ryderfang/chromium_base/HEAD/src/base/test/data/file_util/binary_file_same.bin
--------------------------------------------------------------------------------
/src/base/third_party/nspr/README.chromium:
--------------------------------------------------------------------------------
1 | Name: Netscape Portable Runtime (NSPR)
2 | URL: http://www.mozilla.org/projects/nspr/
3 | License: MPL 1.1/GPL 2.0/LGPL 2.1
4 |
--------------------------------------------------------------------------------
/src/base/debug/OWNERS:
--------------------------------------------------------------------------------
1 | per-file trace_event*=nduca@chromium.org
2 | per-file trace_event*=dsinclair@chromium.org
3 | per-file trace_event_android.cc=wangxianzhu@chromium.org
4 |
--------------------------------------------------------------------------------
/src/base/test/data/serializer_test.json:
--------------------------------------------------------------------------------
1 | {
2 | "bool": true,
3 | "int": 42,
4 | "list": [ 1, 2 ],
5 | "null": null,
6 | "real": 3.14,
7 | "string": "hello"
8 | }
9 |
--------------------------------------------------------------------------------
/src/base/test/data/prefs/read.json:
--------------------------------------------------------------------------------
1 | {
2 | "homepage": "http://www.cnn.com",
3 | "some_directory": "/usr/local/",
4 | "tabs": {
5 | "new_windows_in_tabs": true,
6 | "max_tabs": 20
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/glog/logging.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // Empty.
6 |
--------------------------------------------------------------------------------
/src/base/test/data/prefs/write.golden.json:
--------------------------------------------------------------------------------
1 | {
2 | "homepage": "http://www.cnn.com",
3 | "long_int": {
4 | "pref": "214748364842"
5 | },
6 | "some_directory": "/usr/sbin/",
7 | "tabs": {
8 | "max_tabs": 10,
9 | "new_windows_in_tabs": false
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/third_party/libevent/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | LIBTOOLIZE=libtoolize
3 | SYSNAME=`uname`
4 | if [ "x$SYSNAME" = "xDarwin" ] ; then
5 | LIBTOOLIZE=glibtoolize
6 | fi
7 | aclocal && \
8 | autoheader && \
9 | $LIBTOOLIZE && \
10 | autoconf && \
11 | automake --add-missing --copy
12 |
--------------------------------------------------------------------------------
/src/base/test/data/json/bom_feff.json:
--------------------------------------------------------------------------------
1 | {
2 | "appName": {
3 | "message": "Gmail",
4 | "description": "App name."
5 | },
6 | "appDesc": {
7 | "message": "بريد إلكتروني يوفر إمكانية البحث مع مقدار أقل من الرسائل غير المرغوب فيها.",
8 | "description":"App description."
9 | }
10 | }
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/glog/raw_logging.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #define WARNING 1;
6 | #define RAW_LOG(severity, ...); // Do nothing.
7 |
--------------------------------------------------------------------------------
/src/base/prefs/README:
--------------------------------------------------------------------------------
1 | Prefs is a general-purpose key-value store for application preferences.
2 |
3 | The Prefs code lives in base/prefs but is not part of the
4 | 'base/base.gyp:base' library because of a desire to keep its use
5 | optional. If you use Prefs, you should add a GYP dependency on
6 | base/base.gyp:base_prefs.
7 |
--------------------------------------------------------------------------------
/src/base/time/clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/time/clock.h"
6 |
7 | namespace base {
8 |
9 | Clock::~Clock() {}
10 |
11 | } // namespace base
12 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_user_dirs/README.chromium:
--------------------------------------------------------------------------------
1 | Name: xdg-user-dirs
2 | URL: http://www.freedesktop.org/wiki/Software/xdg-user-dirs
3 | License: MIT
4 |
5 | This directory include xdg-user-dir-lookup.c renamed as xdg_user_dir_lookup.cc
6 | from xdg-user-dirs 0.10. We made xdg_user_dir_lookup() non-static and added a
7 | xdg_user_dir_lookup.h.
8 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/config.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #define GOOGLE_NAMESPACE google
6 | #define _END_GOOGLE_NAMESPACE_ }
7 | #define _START_GOOGLE_NAMESPACE_ namespace google {
8 |
--------------------------------------------------------------------------------
/src/base/time/tick_clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/time/tick_clock.h"
6 |
7 | namespace base {
8 |
9 | TickClock::~TickClock() {}
10 |
11 | } // namespace base
12 |
--------------------------------------------------------------------------------
/src/base/test/run_all_perftests.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/perf_test_suite.h"
6 |
7 | int main(int argc, char** argv) {
8 | return base::PerfTestSuite(argc, argv).Run();
9 | }
10 |
--------------------------------------------------------------------------------
/src/base/bind_helpers.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/bind_helpers.h"
6 |
7 | #include "base/callback.h"
8 |
9 | namespace base {
10 |
11 | void DoNothing() {
12 | }
13 |
14 | } // namespace base
15 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_mime/compile.patch:
--------------------------------------------------------------------------------
1 | --- a/xdgmimecache.c
2 | +++ b/xdgmimecache.c
3 | @@ -40,6 +40,8 @@
4 |
5 | #include /* for ntohl/ntohs */
6 |
7 | +#define HAVE_MMAP 1
8 | +
9 | #ifdef HAVE_MMAP
10 | #include
11 | #else
12 | @@ -1000,5 +1002,3 @@
13 | dump_glob_node (cache, offset + 20 * j, 0);
14 | }
15 | }
16 | -
17 | -
18 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_user_dirs/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | source_set("xdg_user_dirs") {
6 | visibility = [ "//base/*" ]
7 | sources = [
8 | "xdg_user_dir_lookup.cc",
9 | "xdg_user_dir_lookup.h",
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/base/process/launch_ios.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/launch.h"
6 |
7 | namespace base {
8 |
9 | void RaiseProcessToHighPriority() {
10 | // Impossible on iOS. Do nothing.
11 | }
12 |
13 | } // namespace base
14 |
--------------------------------------------------------------------------------
/src/base/test/data/serializer_nested_test.json:
--------------------------------------------------------------------------------
1 | {
2 | "bool": true,
3 | "dict": {
4 | "bool": true,
5 | "dict": {
6 | "bees": "knees",
7 | "cats": "meow"
8 | },
9 | "foos": "bar",
10 | "list": [ 3.4, "second", null ]
11 | },
12 | "int": 42,
13 | "list": [ 1, 2 ],
14 | "null": null,
15 | "real": 3.14,
16 | "string": "hello"
17 | }
18 |
--------------------------------------------------------------------------------
/src/third_party/libevent/sample/Makefile.am:
--------------------------------------------------------------------------------
1 | AUTOMAKE_OPTIONS = foreign no-dependencies
2 |
3 | LDADD = ../libevent.la
4 | AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat
5 |
6 | noinst_PROGRAMS = event-test time-test signal-test
7 |
8 | event_test_sources = event-test.c
9 | time_test_sources = time-test.c
10 | signal_test_sources = signal-test.c
11 |
12 | verify:
13 |
14 | DISTCLEANFILES = *~
15 |
--------------------------------------------------------------------------------
/src/base/prefs/pref_store.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/prefs/pref_store.h"
6 |
7 | bool PrefStore::HasObservers() const {
8 | return false;
9 | }
10 |
11 | bool PrefStore::IsInitializationComplete() const {
12 | return true;
13 | }
14 |
--------------------------------------------------------------------------------
/src/base/allocator/debugallocation_shim.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #if defined(TCMALLOC_FOR_DEBUGALLOCATION)
6 | #include "third_party/tcmalloc/chromium/src/debugallocation.cc"
7 | #else
8 | #include "third_party/tcmalloc/chromium/src/tcmalloc.cc"
9 | #endif
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 | *.obj
6 | *.sdf
7 | *.user
8 | *.suo
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 |
18 | # Fortran module files
19 | *.mod
20 |
21 | # Compiled Static libraries
22 | *.lai
23 | *.la
24 | *.a
25 | *.ilk
26 | *.pdb
27 | *.opensdf
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
--------------------------------------------------------------------------------
/src/base/time/default_clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/time/default_clock.h"
6 |
7 | namespace base {
8 |
9 | DefaultClock::~DefaultClock() {}
10 |
11 | Time DefaultClock::Now() {
12 | return Time::Now();
13 | }
14 |
15 | } // namespace base
16 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/utilities.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 | typedef uint64_t uint64;
10 | #define HAVE_SYMBOLIZE 1
11 | #define ATTRIBUTE_NOINLINE __attribute__ ((noinline))
12 |
--------------------------------------------------------------------------------
/src/test_qt/main.cpp:
--------------------------------------------------------------------------------
1 | #include "test_qt.h"
2 | #include
3 |
4 | #include "qt_windows.h"
5 |
6 | #include "base/at_exit.h"
7 | #include "base/command_line.h"
8 |
9 | int main(int argc, char *argv[])
10 | {
11 | QApplication a(argc, argv);
12 |
13 | base::CommandLine::Init(0, NULL);
14 | base::AtExitManager exit_manager;
15 |
16 | test_qt w;
17 | w.show();
18 | return a.exec();
19 | }
20 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_mime/README.chromium:
--------------------------------------------------------------------------------
1 | Name: xdg-mime
2 | URL: http://freedesktop.org
3 | License: Academic Free License version 2.0 or LGPL v2
4 |
5 | The code in this directory is synced from:
6 | git://anongit.freedesktop.org/xdg/xdgmime
7 | @ 2cdd8d36d7930d5a594587286cb1949ff62f7027 on 2012/08/06.
8 |
9 | In addition, we have the following patch(es):
10 | - compile.patch: small tweaks to make the code compile.
11 | - Added a LICENSE file.
12 |
--------------------------------------------------------------------------------
/src/base/time/default_tick_clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/time/default_tick_clock.h"
6 |
7 | namespace base {
8 |
9 | DefaultTickClock::~DefaultTickClock() {}
10 |
11 | TimeTicks DefaultTickClock::NowTicks() {
12 | return TimeTicks::Now();
13 | }
14 |
15 | } // namespace base
16 |
--------------------------------------------------------------------------------
/src/base/power_monitor/power_monitor_device_source_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/power_monitor/power_monitor_device_source.h"
6 |
7 | namespace base {
8 |
9 | bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() {
10 | NOTIMPLEMENTED();
11 | return false;
12 | }
13 |
14 | } // namespace base
15 |
--------------------------------------------------------------------------------
/src/third_party/libevent/test/regress.rpc:
--------------------------------------------------------------------------------
1 | /* tests data packing and unpacking */
2 |
3 | struct msg {
4 | string from_name = 1;
5 | string to_name = 2;
6 | optional struct[kill] attack = 3;
7 | array struct[run] run = 4;
8 | }
9 |
10 | struct kill {
11 | string weapon = 0x10121;
12 | string action = 2;
13 | optional int how_often = 3;
14 | }
15 |
16 | struct run {
17 | string how = 1;
18 | optional bytes some_bytes = 2;
19 | bytes fixed_bytes[24] = 3;
20 | }
21 |
--------------------------------------------------------------------------------
/src/base/message_loop/message_loop_proxy.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/message_loop/message_loop_proxy.h"
6 |
7 | #include "base/bind.h"
8 |
9 | namespace base {
10 |
11 | MessageLoopProxy::MessageLoopProxy() {
12 | }
13 |
14 | MessageLoopProxy::~MessageLoopProxy() {
15 | }
16 |
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/src/base/message_loop/message_pump.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/message_loop/message_pump.h"
6 |
7 | namespace base {
8 |
9 | MessagePump::MessagePump() {
10 | }
11 |
12 | MessagePump::~MessagePump() {
13 | }
14 |
15 | void MessagePump::SetTimerSlack(TimerSlack) {
16 | }
17 |
18 | } // namespace base
19 |
--------------------------------------------------------------------------------
/src/base/third_party/dmg_fp/float_precision_crash.patch:
--------------------------------------------------------------------------------
1 | diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
2 | index 3f7e794..3312fa4 100644
3 | --- dtoa.cc
4 | +++ dtoa.cc
5 | @@ -3891,7 +3891,7 @@ dtoa
6 | goto no_digits;
7 | goto one_digit;
8 | }
9 | - for(i = 1;; i++, dval(&u) *= 10.) {
10 | + for(i = 1; i <= k + 1; i++, dval(&u) *= 10.) {
11 | L = (Long)(dval(&u) / ds);
12 | dval(&u) -= L*ds;
13 | #ifdef Check_FLT_ROUNDS
14 |
--------------------------------------------------------------------------------
/src/base/callback_forward.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_CALLBACK_FORWARD_H_
6 | #define BASE_CALLBACK_FORWARD_H_
7 |
8 | namespace base {
9 |
10 | template
11 | class Callback;
12 |
13 | typedef Callback Closure;
14 |
15 | } // namespace base
16 |
17 | #endif // BASE_CALLBACK_FORWARD_H
18 |
--------------------------------------------------------------------------------
/src/base/debug/trace_event_unittest.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/time/time.h"
6 |
7 | namespace base {
8 | namespace debug {
9 |
10 | // Sleep until HighResNow has advanced by at least |elapsed|.
11 | void HighResSleepForTraceTest(base::TimeDelta elapsed);
12 |
13 | } // namespace debug
14 | } // namespace base
15 |
--------------------------------------------------------------------------------
/src/base/timer/elapsed_timer.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/timer/elapsed_timer.h"
6 |
7 | namespace base {
8 |
9 | ElapsedTimer::ElapsedTimer() {
10 | begin_ = TimeTicks::Now();
11 | }
12 |
13 | TimeDelta ElapsedTimer::Elapsed() const {
14 | return TimeTicks::Now() - begin_;
15 | }
16 |
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/src/third_party/libevent/nacl_nonsfi/random.c:
--------------------------------------------------------------------------------
1 | /* Copyright 2014 The Chromium Authors. All rights reserved.
2 | * Use of this source code is governed by a BSD-style license that can be
3 | * found in the LICENSE file.
4 | */
5 |
6 | #include
7 |
8 | /* The newlib-based PNaCl toolchain does not provide random(). So, here we
9 | * define it. It just redirects to the rand(), which is provided by the
10 | * toolchain. */
11 | long int random() {
12 | return rand();
13 | }
14 |
--------------------------------------------------------------------------------
/src/third_party/libevent/strlcpy-internal.h:
--------------------------------------------------------------------------------
1 | #ifndef _STRLCPY_INTERNAL_H_
2 | #define _STRLCPY_INTERNAL_H_
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | #ifdef HAVE_CONFIG_H
9 | #include "config.h"
10 | #endif /* HAVE_CONFIG_H */
11 |
12 | #ifndef HAVE_STRLCPY
13 | #include
14 | size_t _event_strlcpy(char *dst, const char *src, size_t siz);
15 | #define strlcpy _event_strlcpy
16 | #endif
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 | #endif
23 |
24 |
--------------------------------------------------------------------------------
/src/base/test/mock_devices_changed_observer.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/mock_devices_changed_observer.h"
6 |
7 | namespace base {
8 |
9 | MockDevicesChangedObserver::MockDevicesChangedObserver() {
10 | }
11 |
12 | MockDevicesChangedObserver::~MockDevicesChangedObserver() {
13 | }
14 |
15 | } // namespace base
16 |
--------------------------------------------------------------------------------
/src/base/third_party/valgrind/README.chromium:
--------------------------------------------------------------------------------
1 | Name: valgrind
2 | URL: http://valgrind.org
3 | License: BSD
4 |
5 | Header files in this directory define runtime macros that determine whether the
6 | current process is running under Valgrind and tell Memcheck tool about custom
7 | memory allocators.
8 |
9 | These header files were taken from Valgrind source code
10 | (svn://svn.valgrind.org/valgrind/trunk@11504, dated 21 Jan 2011). The files are
11 | covered under BSD license as described within.
12 |
--------------------------------------------------------------------------------
/src/base/os_compat_nacl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_OS_COMPAT_NACL_H_
6 | #define BASE_OS_COMPAT_NACL_H_
7 |
8 | #include
9 |
10 | #if !defined (__GLIBC__)
11 | // NaCl has no timegm().
12 | extern "C" time_t timegm(struct tm* const t);
13 | #endif // !defined (__GLIBC__)
14 |
15 | #endif // BASE_OS_COMPAT_NACL_H_
16 |
17 |
--------------------------------------------------------------------------------
/src/base/process/memory_stubs.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/memory.h"
6 |
7 | namespace base {
8 |
9 | void EnableTerminationOnOutOfMemory() {
10 | }
11 |
12 | void EnableTerminationOnHeapCorruption() {
13 | }
14 |
15 | bool AdjustOOMScore(ProcessId process, int score) {
16 | return false;
17 | }
18 |
19 | } // namespace base
20 |
--------------------------------------------------------------------------------
/src/base/critical_closure_internal_ios.mm:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/critical_closure.h"
6 |
7 | #import
8 |
9 | namespace base {
10 | namespace internal {
11 |
12 | bool IsMultiTaskingSupported() {
13 | return [[UIDevice currentDevice] isMultitaskingSupported];
14 | }
15 |
16 | } // namespace internal
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/src/base/DEPS:
--------------------------------------------------------------------------------
1 | include_rules = [
2 | "+jni",
3 | "+third_party/ashmem",
4 | "+third_party/apple_apsl",
5 | "+third_party/libevent",
6 | "+third_party/dmg_fp",
7 | "+third_party/google_toolbox_for_mac/src",
8 | "+third_party/mach_override",
9 | "+third_party/modp_b64",
10 | "+third_party/tcmalloc",
11 |
12 | # These are implicitly brought in from the root, and we don't want them.
13 | "-ipc",
14 | "-url",
15 |
16 | # ICU dependendencies must be separate from the rest of base.
17 | "-i18n",
18 | ]
19 |
--------------------------------------------------------------------------------
/src/base/files/file_util_android.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/files/file_util.h"
6 |
7 | #include "base/files/file_path.h"
8 | #include "base/path_service.h"
9 |
10 | namespace base {
11 |
12 | bool GetShmemTempDir(bool executable, base::FilePath* path) {
13 | return PathService::Get(base::DIR_CACHE, path);
14 | }
15 |
16 | } // namespace base
17 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/README.chromium:
--------------------------------------------------------------------------------
1 | Name: google-glog's symbolization library
2 | URL: http://code.google.com/p/google-glog/
3 | License: BSD
4 |
5 | The following files are copied AS-IS from:
6 | http://code.google.com/p/google-glog/source/browse/#svn/trunk/src (r141)
7 |
8 | - demangle.cc
9 | - demangle.h
10 | - symbolize.cc
11 | - symbolize.h
12 |
13 | The following files are minimal stubs created for use in Chromium:
14 |
15 | - config.h
16 | - glog/logging.h
17 | - glog/raw_logging.h
18 | - utilities.h
19 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_mime/README:
--------------------------------------------------------------------------------
1 | This module is a simple module that parses the proposed MIME spec listed
2 | at http://freedesktop.org/. It is currently targetted at version 0.12.
3 | There are no formal releases planned for this module, and it is not
4 | intended to be installed at this time. Rather, it is meant to be used
5 | by other libraries or applications to add support for the MIME system.
6 |
7 | It is dual-licensed under the terms of the GNU Lesser General Public
8 | License, and the Academic Free License, version 2.0.
9 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 |
3 | before_install:
4 | # We need this line to have g++4.8 available in apt
5 | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
6 | - sudo apt-get update -qq
7 |
8 | install:
9 | - sudo apt-get install -qq gcc-4.8 g++-4.8
10 | # We want to compile with g++ 4.8 when rather than the default g++
11 | - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
12 |
13 | compiler:
14 | - gcc
15 |
16 | notifications:
17 | email: false
18 |
19 | script: ./script/cibuild
20 |
--------------------------------------------------------------------------------
/src/base/test/test_listener_ios.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_TEST_LISTENER_IOS_H_
6 | #define BASE_TEST_TEST_LISTENER_IOS_H_
7 |
8 | namespace base {
9 | namespace test_listener_ios {
10 |
11 | // Register an IOSRunLoopListener.
12 | void RegisterTestEndListener();
13 |
14 | } // namespace test_listener_ios
15 | } // namespace base
16 |
17 | #endif // BASE_TEST_TEST_LISTENER_IOS_H_
18 |
--------------------------------------------------------------------------------
/src/base/third_party/dynamic_annotations/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | source_set("dynamic_annotations") {
6 | sources = [
7 | "dynamic_annotations.c",
8 | "dynamic_annotations.h",
9 | "../valgrind/valgrind.h",
10 | ]
11 | if (is_android && !is_debug) {
12 | configs -= [ "//build/config/compiler:optimize" ]
13 | configs += [ "//build/config/compiler:optimize_max" ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/base/debug/alias.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/debug/alias.h"
6 | #include "build/build_config.h"
7 |
8 | namespace base {
9 | namespace debug {
10 |
11 | #if defined(COMPILER_MSVC)
12 | #pragma optimize("", off)
13 | #endif
14 |
15 | void Alias(const void* var) {
16 | }
17 |
18 | #if defined(COMPILER_MSVC)
19 | #pragma optimize("", on)
20 | #endif
21 |
22 | } // namespace debug
23 | } // namespace base
24 |
--------------------------------------------------------------------------------
/src/base/strings/nullable_string16.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/strings/nullable_string16.h"
6 |
7 | #include
8 |
9 | #include "base/strings/utf_string_conversions.h"
10 |
11 | namespace base {
12 |
13 | std::ostream& operator<<(std::ostream& out, const NullableString16& value) {
14 | return value.is_null() ? out << "(null)" : out << UTF16ToUTF8(value.string());
15 | }
16 |
17 | } // namespace base
18 |
--------------------------------------------------------------------------------
/src/test_qt/global_def.h:
--------------------------------------------------------------------------------
1 | #ifndef GLOBAL_DEF_H_
2 | #define GLOBAL_DEF_H_
3 |
4 | #include "base/basictypes.h"
5 |
6 | #include
7 | #include
8 |
9 | struct VideoInfo {
10 | VideoInfo() : offset(0) {
11 | }
12 |
13 | VideoInfo(const std::string& name) :
14 | file_name(name),
15 | offset(0) {
16 | }
17 |
18 | size_t sz() { return piece.size(); }
19 |
20 | std::string file_name;
21 |
22 | std::string file_hash;
23 |
24 | size_t offset;
25 |
26 | std::vector piece;
27 | };
28 |
29 | #endif // !GLOBAL_DEF_H_
--------------------------------------------------------------------------------
/src/base/debug/debugger_win.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/debug/debugger.h"
6 |
7 | #include
8 | #include
9 |
10 | namespace base {
11 | namespace debug {
12 |
13 | bool BeingDebugged() {
14 | return ::IsDebuggerPresent() != 0;
15 | }
16 |
17 | void BreakDebugger() {
18 | if (IsDebugUISuppressed())
19 | _exit(1);
20 |
21 | __debugbreak();
22 | }
23 |
24 | } // namespace debug
25 | } // namespace base
26 |
--------------------------------------------------------------------------------
/src/base/allocator/unittest_utils.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // The unittests need a this in order to link up without pulling in tons
6 | // of other libraries
7 |
8 | #include
9 |
10 | inline int snprintf(char* buffer, size_t count, const char* format, ...) {
11 | int result;
12 | va_list args;
13 | va_start(args, format);
14 | result = _vsnprintf(buffer, count, format, args);
15 | va_end(args);
16 | return result;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/src/base/test/perf_test_suite.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_PERF_TEST_SUITE_H_
6 | #define BASE_TEST_PERF_TEST_SUITE_H_
7 |
8 | #include "base/test/test_suite.h"
9 |
10 | namespace base {
11 |
12 | class PerfTestSuite : public TestSuite {
13 | public:
14 | PerfTestSuite(int argc, char** argv);
15 |
16 | void Initialize() override;
17 | void Shutdown() override;
18 | };
19 |
20 | } // namespace base
21 |
22 | #endif // BASE_TEST_PERF_TEST_SUITE_H_
23 |
--------------------------------------------------------------------------------
/src/base/third_party/symbolize/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | source_set("symbolize") {
6 | visibility = [ "//base/*" ]
7 | sources = [
8 | "config.h",
9 | "demangle.cc",
10 | "demangle.h",
11 | "glog/logging.h",
12 | "glog/raw_logging.h",
13 | "symbolize.cc",
14 | "symbolize.h",
15 | "utilities.h",
16 | ]
17 |
18 | configs -= [ "//build/config/compiler:chromium_code" ]
19 | configs += [ "//build/config/compiler:no_chromium_code" ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/base/process/process_metrics_unittest_ios.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/process_metrics.h"
6 |
7 | #include "base/memory/scoped_ptr.h"
8 | #include "testing/gtest/include/gtest/gtest.h"
9 |
10 | TEST(ProcessMetricsTestIos, Memory) {
11 | scoped_ptr process_metrics(
12 | base::ProcessMetrics::CreateProcessMetrics(
13 | base::GetCurrentProcessHandle()));
14 |
15 | ASSERT_NE(0u, process_metrics->GetWorkingSetSize());
16 | }
17 |
--------------------------------------------------------------------------------
/src/base/power_monitor/power_monitor_device_source_android.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_ANDROID_H_
6 | #define BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_ANDROID_H_
7 |
8 | #include
9 |
10 | namespace base {
11 |
12 | // Registers the JNI bindings for PowerMonitorDeviceSource.
13 | bool RegisterPowerMonitor(JNIEnv* env);
14 |
15 | } // namespace base
16 |
17 | #endif // BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_ANDROID_H_
18 |
--------------------------------------------------------------------------------
/src/base/test/launcher/test_launcher_ios.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/launcher/test_launcher.h"
6 |
7 | #include "base/at_exit.h"
8 | #include "base/bind.h"
9 | #include "base/test/launcher/unit_test_launcher.h"
10 |
11 | namespace {
12 |
13 | int DummyRunTestSuite(void) {
14 | return -1;
15 | }
16 |
17 | } // namespace
18 |
19 | int main(int argc, char** argv) {
20 | base::AtExitManager at_exit;
21 | return base::LaunchUnitTests(argc, argv, base::Bind(&DummyRunTestSuite));
22 | }
23 |
--------------------------------------------------------------------------------
/src/base/synchronization/cancellation_flag.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/synchronization/cancellation_flag.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 |
11 | void CancellationFlag::Set() {
12 | #if !defined(NDEBUG)
13 | DCHECK_EQ(set_on_, PlatformThread::CurrentId());
14 | #endif
15 | base::subtle::Release_Store(&flag_, 1);
16 | }
17 |
18 | bool CancellationFlag::IsSet() const {
19 | return base::subtle::Acquire_Load(&flag_) != 0;
20 | }
21 |
22 | } // namespace base
23 |
--------------------------------------------------------------------------------
/src/base/strings/latin1_string_conversions.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/strings/latin1_string_conversions.h"
6 |
7 | namespace base {
8 |
9 | string16 Latin1OrUTF16ToUTF16(size_t length,
10 | const Latin1Char* latin1,
11 | const char16* utf16) {
12 | if (!length)
13 | return string16();
14 | if (latin1)
15 | return string16(latin1, latin1 + length);
16 | return string16(utf16, utf16 + length);
17 | }
18 |
19 | } // namespace base
20 |
--------------------------------------------------------------------------------
/src/base/threading/non_thread_safe_impl.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/non_thread_safe_impl.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 |
11 | bool NonThreadSafeImpl::CalledOnValidThread() const {
12 | return thread_checker_.CalledOnValidThread();
13 | }
14 |
15 | NonThreadSafeImpl::~NonThreadSafeImpl() {
16 | DCHECK(CalledOnValidThread());
17 | }
18 |
19 | void NonThreadSafeImpl::DetachFromThread() {
20 | thread_checker_.DetachFromThread();
21 | }
22 |
23 | } // namespace base
24 |
--------------------------------------------------------------------------------
/src/base/third_party/nspr/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | source_set("nspr") {
6 | visibility = [ "//base" ]
7 | sources = [
8 | "prtime.cc",
9 | "prtime.h",
10 | ]
11 |
12 | # In GYP this project is part of base, so it uses the base implementation
13 | # define. TODO(brettw) rename this define.
14 | defines = [ "BASE_IMPLEMENTATION" ]
15 |
16 | if (is_android && !is_debug) {
17 | configs -= [ "//build/config/compiler:optimize" ]
18 | configs += [ "//build/config/compiler:optimize_max" ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/base/base_paths_mac.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_PATHS_MAC_H_
6 | #define BASE_BASE_PATHS_MAC_H_
7 |
8 | // This file declares Mac-specific path keys for the base module.
9 | // These can be used with the PathService to access various special
10 | // directories and files.
11 |
12 | namespace base {
13 |
14 | enum {
15 | PATH_MAC_START = 200,
16 |
17 | DIR_APP_DATA, // ~/Library/Application Support
18 |
19 | PATH_MAC_END
20 | };
21 |
22 | } // namespace base
23 |
24 | #endif // BASE_BASE_PATHS_MAC_H_
25 |
--------------------------------------------------------------------------------
/src/base/debug/alias.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_DEBUG_ALIAS_H_
6 | #define BASE_DEBUG_ALIAS_H_
7 |
8 | #include "base/base_export.h"
9 |
10 | namespace base {
11 | namespace debug {
12 |
13 | // Make the optimizer think that var is aliased. This is to prevent it from
14 | // optimizing out variables that that would not otherwise be live at the point
15 | // of a potential crash.
16 | void BASE_EXPORT Alias(const void* var);
17 |
18 | } // namespace debug
19 | } // namespace base
20 |
21 | #endif // BASE_DEBUG_ALIAS_H_
22 |
--------------------------------------------------------------------------------
/src/base/hash.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/hash.h"
6 |
7 | // Definition in base/third_party/superfasthash/superfasthash.c. (Third-party
8 | // code did not come with its own header file, so declaring the function here.)
9 | // Note: This algorithm is also in Blink under Source/wtf/StringHasher.h.
10 | extern "C" uint32_t SuperFastHash(const char* data, int len);
11 |
12 | namespace base {
13 |
14 | uint32 SuperFastHash(const char* data, int len) {
15 | return ::SuperFastHash(data, len);
16 | }
17 |
18 | } // namespace base
19 |
--------------------------------------------------------------------------------
/src/base/files/file_enumerator.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/files/file_enumerator.h"
6 |
7 | #include "base/files/file_util.h"
8 |
9 | namespace base {
10 |
11 | FileEnumerator::FileInfo::~FileInfo() {
12 | }
13 |
14 | bool FileEnumerator::ShouldSkip(const FilePath& path) {
15 | FilePath::StringType basename = path.BaseName().value();
16 | return basename == FILE_PATH_LITERAL(".") ||
17 | (basename == FILE_PATH_LITERAL("..") &&
18 | !(INCLUDE_DOT_DOT & file_type_));
19 | }
20 |
21 | } // namespace base
22 |
--------------------------------------------------------------------------------
/src/base/third_party/icu/README.chromium:
--------------------------------------------------------------------------------
1 | Name: ICU
2 | URL: http://site.icu-project.org/
3 | License: MIT
4 | License File: NOT_SHIPPED
5 |
6 | This file has the relevant components from ICU copied to handle basic
7 | UTF8/16/32 conversions. Components are copied from utf.h utf8.h utf16.h and
8 | utf_impl.c
9 |
10 | The same module appears in third_party/icu, so we don't repeat the license
11 | file here.
12 |
13 | The main change is that U_/U8_/U16_ prefixes have been replaced with
14 | CBU_/CBU8_/CBU16_ (for "Chrome Base") to avoid confusion with the "real" ICU
15 | macros should ICU be in use on the system. For the same reason, the functions
16 | and types have been put in the "base_icu" namespace.
17 |
--------------------------------------------------------------------------------
/src/test_qt/test_qt.ui:
--------------------------------------------------------------------------------
1 |
2 | test_qtClass
3 |
4 |
5 | test_qtClass
6 |
7 |
8 |
9 | 0
10 | 0
11 | 600
12 | 400
13 |
14 |
15 |
16 | test_qt
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/MinAndroidSdkLevel.java:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Inherited;
9 | import java.lang.annotation.Retention;
10 | import java.lang.annotation.RetentionPolicy;
11 | import java.lang.annotation.Target;
12 |
13 | @Inherited
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Target({ElementType.TYPE})
16 | public @interface MinAndroidSdkLevel {
17 | int value() default 0;
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/src/base/test/simple_test_clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/simple_test_clock.h"
6 |
7 | namespace base {
8 |
9 | SimpleTestClock::SimpleTestClock() {}
10 |
11 | SimpleTestClock::~SimpleTestClock() {}
12 |
13 | Time SimpleTestClock::Now() {
14 | AutoLock lock(lock_);
15 | return now_;
16 | }
17 |
18 | void SimpleTestClock::Advance(TimeDelta delta) {
19 | AutoLock lock(lock_);
20 | now_ += delta;
21 | }
22 |
23 | void SimpleTestClock::SetNow(Time now) {
24 | AutoLock lock(lock_);
25 | now_ = now;
26 | }
27 |
28 | } // namespace base
29 |
--------------------------------------------------------------------------------
/src/base/third_party/dmg_fp/gcc_64_bit.patch:
--------------------------------------------------------------------------------
1 | Index: dtoa.cc
2 | --- dtoa.cc (old copy)
3 | +++ dtoa.cc (working copy)
4 | @@ -183,8 +183,12 @@
5 | #define NO_HEX_FP
6 |
7 | #ifndef Long
8 | +#if __LP64__
9 | +#define Long int
10 | +#else
11 | #define Long long
12 | #endif
13 | +#endif
14 | #ifndef ULong
15 | typedef unsigned Long ULong;
16 | #endif
17 | @@ -221,7 +225,7 @@ extern void *MALLOC(size_t);
18 | #ifndef PRIVATE_MEM
19 | #define PRIVATE_MEM 2304
20 | #endif
21 | -#define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double))
22 | +#define PRIVATE_mem ((unsigned)((PRIVATE_MEM+sizeof(double)-1)/sizeof(double)))
23 | static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/src/base/os_compat_nacl.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/os_compat_nacl.h"
6 |
7 | #include
8 | #include
9 |
10 | #if !defined (__GLIBC__)
11 |
12 | extern "C" {
13 | // Native Client has no timegm().
14 | time_t timegm(struct tm* tm) {
15 | time_t ret;
16 | char* tz;
17 | tz = getenv("TZ");
18 | setenv("TZ", "", 1);
19 | tzset();
20 | ret = mktime(tm);
21 | if (tz)
22 | setenv("TZ", tz, 1);
23 | else
24 | unsetenv("TZ");
25 | tzset();
26 | return ret;
27 | }
28 | } // extern "C"
29 |
30 | #endif // !defined (__GLIBC__)
31 |
--------------------------------------------------------------------------------
/src/base/time/default_clock.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_DEFAULT_CLOCK_H_
6 | #define BASE_DEFAULT_CLOCK_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/compiler_specific.h"
10 | #include "base/time/clock.h"
11 |
12 | namespace base {
13 |
14 | // DefaultClock is a Clock implementation that uses Time::Now().
15 | class BASE_EXPORT DefaultClock : public Clock {
16 | public:
17 | ~DefaultClock() override;
18 |
19 | // Simply returns Time::Now().
20 | Time Now() override;
21 | };
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_DEFAULT_CLOCK_H_
26 |
--------------------------------------------------------------------------------
/src/base/message_loop/timer_slack.h:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MESSAGE_LOOP_TIMER_SLACK_H_
6 | #define BASE_MESSAGE_LOOP_TIMER_SLACK_H_
7 |
8 | namespace base {
9 |
10 | // Amount of timer slack to use for delayed timers. Increasing timer slack
11 | // allows the OS to coalesce timers more effectively.
12 | enum TimerSlack {
13 | // Lowest value for timer slack allowed by OS.
14 | TIMER_SLACK_NONE,
15 |
16 | // Maximal value for timer slack allowed by OS.
17 | TIMER_SLACK_MAXIMUM
18 | };
19 |
20 | } // namespace base
21 |
22 | #endif // BASE_MESSAGE_LOOP_TIMER_SLACK_H_
23 |
--------------------------------------------------------------------------------
/src/base/prefs/pref_observer.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_PREFS_PREF_OBSERVER_H_
6 | #define BASE_PREFS_PREF_OBSERVER_H_
7 |
8 | #include
9 |
10 | class PrefService;
11 |
12 | // Used internally to the Prefs subsystem to pass preference change
13 | // notifications between PrefService, PrefNotifierImpl and
14 | // PrefChangeRegistrar.
15 | class PrefObserver {
16 | public:
17 | virtual void OnPreferenceChanged(PrefService* service,
18 | const std::string& pref_name) = 0;
19 | };
20 |
21 | #endif // BASE_PREFS_PREF_OBSERVER_H_
22 |
--------------------------------------------------------------------------------
/src/base/profiler/scoped_tracker.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/profiler/scoped_tracker.h"
6 |
7 | #include "base/bind.h"
8 |
9 | namespace tracked_objects {
10 |
11 | namespace {
12 |
13 | ScopedProfile::Mode g_scoped_profile_mode = ScopedProfile::DISABLED;
14 |
15 | } // namespace
16 |
17 | // static
18 | void ScopedTracker::Enable() {
19 | g_scoped_profile_mode = ScopedProfile::ENABLED;
20 | }
21 |
22 | ScopedTracker::ScopedTracker(const Location& location)
23 | : scoped_profile_(location, g_scoped_profile_mode) {
24 | }
25 |
26 | } // namespace tracked_objects
27 |
--------------------------------------------------------------------------------
/src/base/process/process_info_win.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/process_info.h"
6 |
7 | #include
8 |
9 | #include "base/basictypes.h"
10 | #include "base/time/time.h"
11 |
12 | namespace base {
13 |
14 | //static
15 | const Time CurrentProcessInfo::CreationTime() {
16 | FILETIME creation_time = {};
17 | FILETIME ignore = {};
18 | if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore,
19 | &ignore, &ignore) == false)
20 | return Time();
21 |
22 | return Time::FromFileTime(creation_time);
23 | }
24 |
25 | } // namespace base
26 |
--------------------------------------------------------------------------------
/src/base/test/simple_test_tick_clock.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/simple_test_tick_clock.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 |
11 | SimpleTestTickClock::SimpleTestTickClock() {}
12 |
13 | SimpleTestTickClock::~SimpleTestTickClock() {}
14 |
15 | TimeTicks SimpleTestTickClock::NowTicks() {
16 | AutoLock lock(lock_);
17 | return now_ticks_;
18 | }
19 |
20 | void SimpleTestTickClock::Advance(TimeDelta delta) {
21 | AutoLock lock(lock_);
22 | DCHECK(delta >= TimeDelta());
23 | now_ticks_ += delta;
24 | }
25 |
26 | } // namespace base
27 |
--------------------------------------------------------------------------------
/src/base/test/scoped_locale.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/scoped_locale.h"
6 |
7 | #include
8 |
9 | #include "testing/gtest/include/gtest/gtest.h"
10 |
11 | namespace base {
12 |
13 | ScopedLocale::ScopedLocale(const std::string& locale) {
14 | prev_locale_ = setlocale(LC_ALL, NULL);
15 | EXPECT_TRUE(setlocale(LC_ALL, locale.c_str()) != NULL) <<
16 | "Failed to set locale: " << locale;
17 | }
18 |
19 | ScopedLocale::~ScopedLocale() {
20 | EXPECT_STREQ(prev_locale_.c_str(), setlocale(LC_ALL, prev_locale_.c_str()));
21 | }
22 |
23 | } // namespace base
24 |
--------------------------------------------------------------------------------
/src/base/mac/OWNERS:
--------------------------------------------------------------------------------
1 | mark@chromium.org
2 | thakis@chromium.org
3 |
4 | # sdk_forward_declarations.[h|mm] will likely need to be modified by Cocoa
5 | # developers in general; keep in sync with OWNERS of //chrome/browser/ui/cocoa.
6 | per-file sdk_forward_declarations.*=asvitkine@chromium.org
7 | per-file sdk_forward_declarations.*=avi@chromium.org
8 | per-file sdk_forward_declarations.*=groby@chromium.org
9 | per-file sdk_forward_declarations.*=jeremy@chromium.org
10 | per-file sdk_forward_declarations.*=mark@chromium.org
11 | per-file sdk_forward_declarations.*=rohitrao@chromium.org
12 | per-file sdk_forward_declarations.*=rsesek@chromium.org
13 | per-file sdk_forward_declarations.*=shess@chromium.org
14 | per-file sdk_forward_declarations.*=thakis@chromium.org
15 |
--------------------------------------------------------------------------------
/src/base/test/test_file_util.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/test_file_util.h"
6 |
7 | #include "base/test/test_timeouts.h"
8 | #include "base/threading/platform_thread.h"
9 |
10 | namespace base {
11 |
12 | bool EvictFileFromSystemCacheWithRetry(const FilePath& path) {
13 | const int kCycles = 10;
14 | const TimeDelta kDelay = TestTimeouts::action_timeout() / kCycles;
15 | for (int i = 0; i < kCycles; i++) {
16 | if (EvictFileFromSystemCache(path))
17 | return true;
18 | PlatformThread::Sleep(kDelay);
19 | }
20 | return false;
21 | }
22 |
23 | } // namespace base
24 |
--------------------------------------------------------------------------------
/src/base/timer/hi_res_timer_manager_posix.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/timer/hi_res_timer_manager.h"
6 |
7 | // On POSIX we don't need to do anything special with the system timer.
8 |
9 | namespace base {
10 |
11 | HighResolutionTimerManager::HighResolutionTimerManager()
12 | : hi_res_clock_available_(false) {
13 | }
14 |
15 | HighResolutionTimerManager::~HighResolutionTimerManager() {
16 | }
17 |
18 | void HighResolutionTimerManager::OnPowerStateChange(bool on_battery_power) {
19 | }
20 |
21 | void HighResolutionTimerManager::UseHiResClock(bool use) {
22 | }
23 |
24 | } // namespace base
25 |
--------------------------------------------------------------------------------
/src/base/process/memory.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/memory.h"
6 |
7 | namespace base {
8 |
9 | // Defined in memory_mac.mm for Mac.
10 | #if !defined(OS_MACOSX)
11 |
12 | bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
13 | const size_t alloc_size = num_items * size;
14 |
15 | // Overflow check
16 | if (size && ((alloc_size / size) != num_items)) {
17 | *result = NULL;
18 | return false;
19 | }
20 |
21 | if (!UncheckedMalloc(alloc_size, result))
22 | return false;
23 |
24 | memset(*result, 0, alloc_size);
25 | return true;
26 | }
27 |
28 | #endif
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/base/test/test_support_ios.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_TEST_SUPPORT_IOS_H_
6 | #define BASE_TEST_TEST_SUPPORT_IOS_H_
7 |
8 | #include "base/test/test_suite.h"
9 |
10 | namespace base {
11 |
12 | // Inits the message loop for tests on iOS.
13 | void InitIOSTestMessageLoop();
14 |
15 | // Inits the run hook for tests on iOS.
16 | void InitIOSRunHook(TestSuite* suite, int argc, char* argv[]);
17 |
18 | // Launches an iOS app that runs the tests in the suite passed to
19 | // InitIOSRunHook.
20 | void RunTestsFromIOSApp();
21 |
22 | } // namespace base
23 |
24 | #endif // BASE_TEST_TEST_SUPPORT_IOS_H_
25 |
--------------------------------------------------------------------------------
/src/base/mac/scoped_sending_event.mm:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #import "base/mac/scoped_sending_event.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 | namespace mac {
11 |
12 | ScopedSendingEvent::ScopedSendingEvent()
13 | : app_(static_cast*>(NSApp)) {
14 | DCHECK([app_ conformsToProtocol:@protocol(CrAppControlProtocol)]);
15 | handling_ = [app_ isHandlingSendEvent];
16 | [app_ setHandlingSendEvent:YES];
17 | }
18 |
19 | ScopedSendingEvent::~ScopedSendingEvent() {
20 | [app_ setHandlingSendEvent:handling_];
21 | }
22 |
23 | } // namespace mac
24 | } // namespace base
25 |
--------------------------------------------------------------------------------
/src/base/time/default_tick_clock.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_DEFAULT_TICK_CLOCK_H_
6 | #define BASE_DEFAULT_TICK_CLOCK_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/compiler_specific.h"
10 | #include "base/time/tick_clock.h"
11 |
12 | namespace base {
13 |
14 | // DefaultClock is a Clock implementation that uses TimeTicks::Now().
15 | class BASE_EXPORT DefaultTickClock : public TickClock {
16 | public:
17 | ~DefaultTickClock() override;
18 |
19 | // Simply returns TimeTicks::Now().
20 | TimeTicks NowTicks() override;
21 | };
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_DEFAULT_CLOCK_H_
26 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/TimeoutScale.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * This annotation can be used to scale a specific test timeout.
14 | */
15 | @Target(ElementType.METHOD)
16 | @Retention(RetentionPolicy.RUNTIME)
17 | public @interface TimeoutScale {
18 | /**
19 | * @return A number to scale the test timeout.
20 | */
21 | public int value();
22 | }
23 |
--------------------------------------------------------------------------------
/src/base/check_example.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file is meant for analyzing the code generated by the CHECK
6 | // macros in a small executable file that's easy to disassemble.
7 |
8 | #include "base/logging.h"
9 |
10 | // An official build shouldn't generate code to print out messages for
11 | // the CHECK* macros, nor should it have the strings in the
12 | // executable.
13 |
14 | void DoCheck(bool b) {
15 | CHECK(b) << "DoCheck " << b;
16 | }
17 |
18 | void DoCheckEq(int x, int y) {
19 | CHECK_EQ(x, y);
20 | }
21 |
22 | int main(int argc, const char* argv[]) {
23 | DoCheck(argc > 1);
24 | DoCheckEq(argc, 1);
25 | }
26 |
--------------------------------------------------------------------------------
/src/base/test/scoped_locale.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_SCOPED_LOCALE_H_
6 | #define BASE_TEST_SCOPED_LOCALE_H_
7 |
8 | #include
9 |
10 | #include "base/basictypes.h"
11 |
12 | namespace base {
13 |
14 | // Sets the given |locale| on construction, and restores the previous locale
15 | // on destruction.
16 | class ScopedLocale {
17 | public:
18 | explicit ScopedLocale(const std::string& locale);
19 | ~ScopedLocale();
20 |
21 | private:
22 | std::string prev_locale_;
23 |
24 | DISALLOW_COPY_AND_ASSIGN(ScopedLocale);
25 | };
26 |
27 | } // namespace base
28 |
29 | #endif // BASE_TEST_SCOPED_LOCALE_H_
30 |
--------------------------------------------------------------------------------
/src/base/mac/os_crash_dumps.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MAC_OS_CRASH_DUMPS_H_
6 | #define BASE_MAC_OS_CRASH_DUMPS_H_
7 |
8 | #include "base/base_export.h"
9 |
10 | namespace base {
11 | namespace mac {
12 |
13 | // On Mac OS X, it can take a really long time for the OS crash handler to
14 | // process a Chrome crash when debugging symbols are available. This
15 | // translates into a long wait until the process actually dies. This call
16 | // disables Apple Crash Reporter entirely.
17 | BASE_EXPORT void DisableOSCrashDumps();
18 |
19 | } // namespace mac
20 | } // namespace base
21 |
22 | #endif // BASE_MAC_OS_CRASH_DUMPS_H_
23 |
--------------------------------------------------------------------------------
/src/base/memory/scoped_policy.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_MEMORY_SCOPED_POLICY_H_
6 | #define BASE_MEMORY_SCOPED_POLICY_H_
7 |
8 | namespace base {
9 | namespace scoped_policy {
10 |
11 | // Defines the ownership policy for a scoped object.
12 | enum OwnershipPolicy {
13 | // The scoped object takes ownership of an object by taking over an existing
14 | // ownership claim.
15 | ASSUME,
16 |
17 | // The scoped object will retain the the object and any initial ownership is
18 | // not changed.
19 | RETAIN
20 | };
21 |
22 | } // namespace scoped_policy
23 | } // namespace base
24 |
25 | #endif // BASE_MEMORY_SCOPED_POLICY_H_
26 |
--------------------------------------------------------------------------------
/src/base/strings/sys_string_conversions_mac_unittest.mm:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #import
6 |
7 | #include "base/strings/string16.h"
8 | #include "base/strings/sys_string_conversions.h"
9 | #include "testing/gtest/include/gtest/gtest.h"
10 |
11 | namespace base {
12 |
13 | TEST(SysStrings, ConversionsFromNSString) {
14 | EXPECT_STREQ("Hello, world!", SysNSStringToUTF8(@"Hello, world!").c_str());
15 |
16 | // Conversions should be able to handle a NULL value without crashing.
17 | EXPECT_STREQ("", SysNSStringToUTF8(nil).c_str());
18 | EXPECT_EQ(string16(), SysNSStringToUTF16(nil));
19 | }
20 |
21 | } // namespace base
22 |
--------------------------------------------------------------------------------
/src/base/base_paths_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE_PATHS_ANDROID_H_
6 | #define BASE_BASE_PATHS_ANDROID_H_
7 |
8 | // This file declares Android-specific path keys for the base module.
9 | // These can be used with the PathService to access various special
10 | // directories and files.
11 |
12 | namespace base {
13 |
14 | enum {
15 | PATH_ANDROID_START = 300,
16 |
17 | DIR_ANDROID_APP_DATA, // Directory where to put Android app's data.
18 | DIR_ANDROID_EXTERNAL_STORAGE, // Android external storage directory.
19 |
20 | PATH_ANDROID_END
21 | };
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_BASE_PATHS_ANDROID_H_
26 |
--------------------------------------------------------------------------------
/src/base/guid.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/guid.h"
6 |
7 | #include "base/strings/string_util.h"
8 |
9 | namespace base {
10 |
11 | bool IsValidGUID(const std::string& guid) {
12 | const size_t kGUIDLength = 36U;
13 | if (guid.length() != kGUIDLength)
14 | return false;
15 |
16 | for (size_t i = 0; i < guid.length(); ++i) {
17 | char current = guid[i];
18 | if (i == 8 || i == 13 || i == 18 || i == 23) {
19 | if (current != '-')
20 | return false;
21 | } else {
22 | if (!IsHexDigit(current))
23 | return false;
24 | }
25 | }
26 |
27 | return true;
28 | }
29 |
30 | } // namespace base
31 |
--------------------------------------------------------------------------------
/src/base/process/process_info.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_PROCESS_PROCESS_PROCESS_INFO_H_
6 | #define BASE_PROCESS_PROCESS_PROCESS_INFO_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/basictypes.h"
10 |
11 | namespace base {
12 |
13 | class Time;
14 |
15 | // Vends information about the current process.
16 | class BASE_EXPORT CurrentProcessInfo {
17 | public:
18 | // Returns the time at which the process was launched. May be empty if an
19 | // error occurred retrieving the information.
20 | static const Time CreationTime();
21 | };
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_PROCESS_PROCESS_PROCESS_INFO_H_
26 |
--------------------------------------------------------------------------------
/src/base/sys_info_internal.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_SYS_INFO_INTERNAL_H_
6 | #define BASE_SYS_INFO_INTERNAL_H_
7 |
8 | #include "base/basictypes.h"
9 |
10 | namespace base {
11 |
12 | namespace internal {
13 |
14 | template
15 | class LazySysInfoValue {
16 | public:
17 | LazySysInfoValue()
18 | : value_(F()) { }
19 |
20 | ~LazySysInfoValue() { }
21 |
22 | T value() { return value_; }
23 |
24 | private:
25 | const T value_;
26 |
27 | DISALLOW_COPY_AND_ASSIGN(LazySysInfoValue);
28 | };
29 |
30 | } // namespace internal
31 |
32 | } // namespace base
33 |
34 | #endif // BASE_SYS_INFO_INTERNAL_H_
35 |
--------------------------------------------------------------------------------
/src/base/debug/gdi_debug_util_win.h:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_
6 | #define BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_
7 |
8 | #include
9 |
10 | #include "base/base_export.h"
11 |
12 | namespace base {
13 | namespace debug {
14 |
15 | // Crashes the process leaving valuable information on the dump via
16 | // debug::alias so we can find what is causing the allocation failures.
17 | void BASE_EXPORT GDIBitmapAllocFailure(BITMAPINFOHEADER* header,
18 | HANDLE shared_section);
19 |
20 | } // namespace debug
21 | } // namespace base
22 |
23 | #endif // BASE_DEBUG_GDI_DEBUG_UTIL_WIN_H_
24 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/DisabledTest.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * This annotation is for disabled tests.
14 | *
15 | * Tests with this annotation will not be run on any of the normal bots.
16 | * Please note that they might eventually run on a special bot.
17 | */
18 | @Target(ElementType.METHOD)
19 | @Retention(RetentionPolicy.RUNTIME)
20 | public @interface DisabledTest {
21 | }
22 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/Manual.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * This annotation can be used to mark a test that should only be run manually.
14 | *
15 | * Tests with this annotation will not be run on bots, because they take too long
16 | * or need manual monitoring.
17 | */
18 | @Target(ElementType.METHOD)
19 | @Retention(RetentionPolicy.RUNTIME)
20 | public @interface Manual {
21 | }
22 |
--------------------------------------------------------------------------------
/src/base/tracking_info.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/tracking_info.h"
6 |
7 | #include
8 | #include "base/tracked_objects.h"
9 |
10 | namespace base {
11 |
12 | TrackingInfo::TrackingInfo()
13 | : birth_tally(NULL) {
14 | }
15 |
16 | TrackingInfo::TrackingInfo(
17 | const tracked_objects::Location& posted_from,
18 | base::TimeTicks delayed_run_time)
19 | : birth_tally(
20 | tracked_objects::ThreadData::TallyABirthIfActive(posted_from)),
21 | time_posted(TimeTicks::Now()),
22 | delayed_run_time(delayed_run_time) {
23 | }
24 |
25 | TrackingInfo::~TrackingInfo() {}
26 |
27 | } // namespace base
28 |
29 |
--------------------------------------------------------------------------------
/src/base/event_recorder_stubs.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/event_recorder.h"
6 |
7 | // This file implements a link stub for EventRecorder that can be used on
8 | // platforms that don't have a working EventRecorder implementation.
9 |
10 | namespace base {
11 |
12 | EventRecorder* EventRecorder::current_; // Our singleton.
13 |
14 | bool EventRecorder::StartRecording(const FilePath& filename) {
15 | return true;
16 | }
17 |
18 | void EventRecorder::StopRecording() {
19 | }
20 |
21 | bool EventRecorder::StartPlayback(const FilePath& filename) {
22 | return false;
23 | }
24 |
25 | void EventRecorder::StopPlayback() {
26 | }
27 |
28 | } // namespace
29 |
--------------------------------------------------------------------------------
/src/third_party/libevent/event-config.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file is Chromium-specific, and brings in the appropriate
6 | // event-config.h depending on your platform.
7 |
8 | #if defined(__native_client_nonsfi__)
9 | #include "nacl_nonsfi/event-config.h"
10 | #elif defined(__APPLE__)
11 | #include "mac/event-config.h"
12 | #elif defined(ANDROID)
13 | #include "android/event-config.h"
14 | #elif defined(__linux__)
15 | #include "linux/event-config.h"
16 | #elif defined(__FreeBSD__)
17 | #include "freebsd/event-config.h"
18 | #elif defined(__sun)
19 | #include "solaris/event-config.h"
20 | #else
21 | #error generate event-config.h for your platform
22 | #endif
23 |
--------------------------------------------------------------------------------
/src/third_party/libevent/test/test-init.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Compile with:
3 | * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
4 | */
5 | #ifdef HAVE_CONFIG_H
6 | #include "config.h"
7 | #endif
8 |
9 | #ifdef WIN32
10 | #include
11 | #endif
12 |
13 | #include
14 | #include
15 | #ifdef HAVE_SYS_TIME_H
16 | #include
17 | #endif
18 | #ifdef HAVE_SYS_SOCKET_H
19 | #include
20 | #endif
21 | #include
22 | #include
23 | #include
24 | #include
25 | #ifdef HAVE_UNISTD_H
26 | #include
27 | #endif
28 | #include
29 |
30 | #include
31 |
32 | int
33 | main(int argc, char **argv)
34 | {
35 | /* Initalize the event library */
36 | event_init();
37 |
38 | return (0);
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/src/base/debug_message.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include
6 |
7 | // Display the command line. This program is designed to be called from
8 | // another process to display assertions. Since the other process has
9 | // complete control of our command line, we assume that it did *not*
10 | // add the program name as the first parameter. This allows us to just
11 | // show the command line directly as the message.
12 | int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
13 | LPSTR lpCmdLine, int nCmdShow) {
14 | LPWSTR cmdline = GetCommandLineW();
15 | MessageBox(NULL, cmdline, L"Kr\x00d8m", MB_TOPMOST);
16 | return 0;
17 | }
18 |
--------------------------------------------------------------------------------
/src/base/test/test_file_util_linux.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/test_file_util.h"
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | #include "base/files/file_path.h"
13 | #include "base/files/scoped_file.h"
14 |
15 | namespace base {
16 |
17 | bool EvictFileFromSystemCache(const FilePath& file) {
18 | ScopedFD fd(open(file.value().c_str(), O_RDONLY));
19 | if (!fd.is_valid())
20 | return false;
21 | if (fdatasync(fd.get()) != 0)
22 | return false;
23 | if (posix_fadvise(fd.get(), 0, 0, POSIX_FADV_DONTNEED) != 0)
24 | return false;
25 | return true;
26 | }
27 |
28 | } // namespace base
29 |
--------------------------------------------------------------------------------
/src/base/third_party/xdg_mime/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | source_set("xdg_mime") {
6 | visibility = [ "//base/*" ]
7 | sources = [
8 | "xdgmime.c",
9 | "xdgmime.h",
10 | "xdgmimealias.c",
11 | "xdgmimealias.h",
12 | "xdgmimecache.c",
13 | "xdgmimecache.h",
14 | "xdgmimeglob.c",
15 | "xdgmimeglob.h",
16 | "xdgmimeicon.c",
17 | "xdgmimeicon.h",
18 | "xdgmimeint.c",
19 | "xdgmimeint.h",
20 | "xdgmimemagic.c",
21 | "xdgmimemagic.h",
22 | "xdgmimeparent.c",
23 | "xdgmimeparent.h",
24 | ]
25 |
26 | configs -= [ "//build/config/compiler:chromium_code" ]
27 | configs += [ "//build/config/compiler:no_chromium_code" ]
28 | }
29 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/HostDrivenTest.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * This annotation is for host-driven tests.
14 | *
15 | * Tests with these annotations are run explicitly by HostDrivenTestCase-derived
16 | * python tests on the host and are excluded from regular instrumentation test runs.
17 | *
18 | */
19 | @Target(ElementType.METHOD)
20 | @Retention(RetentionPolicy.RUNTIME)
21 | public @interface HostDrivenTest {
22 | }
23 |
--------------------------------------------------------------------------------
/src/base/timer/elapsed_timer.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TIMER_ELAPSED_TIMER_H_
6 | #define BASE_TIMER_ELAPSED_TIMER_H_
7 |
8 | #include "base/base_export.h"
9 | #include "base/basictypes.h"
10 | #include "base/time/time.h"
11 |
12 | namespace base {
13 |
14 | // A simple wrapper around TimeTicks::Now().
15 | class BASE_EXPORT ElapsedTimer {
16 | public:
17 | ElapsedTimer();
18 | virtual ~ElapsedTimer() {}
19 |
20 | // Returns the time elapsed since object construction.
21 | virtual TimeDelta Elapsed() const;
22 |
23 | private:
24 | TimeTicks begin_;
25 |
26 | DISALLOW_COPY_AND_ASSIGN(ElapsedTimer);
27 | };
28 |
29 | } // namespace base
30 |
31 | #endif // BASE_TIMER_ELAPSED_TIMER_H_
32 |
--------------------------------------------------------------------------------
/src/base/process/kill.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/process/kill.h"
6 |
7 | #include "base/process/process_iterator.h"
8 |
9 | namespace base {
10 |
11 | bool KillProcesses(const FilePath::StringType& executable_name,
12 | int exit_code,
13 | const ProcessFilter* filter) {
14 | bool result = true;
15 | NamedProcessIterator iter(executable_name, filter);
16 | while (const ProcessEntry* entry = iter.NextProcessEntry()) {
17 | #if defined(OS_WIN)
18 | result &= KillProcessById(entry->pid(), exit_code, true);
19 | #else
20 | result &= KillProcess(entry->pid(), exit_code, true);
21 | #endif
22 | }
23 | return result;
24 | }
25 |
26 | } // namespace base
27 |
--------------------------------------------------------------------------------
/src/base/test/perf_time_logger.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/perf_time_logger.h"
6 |
7 | #include "base/test/perf_log.h"
8 |
9 | namespace base {
10 |
11 | PerfTimeLogger::PerfTimeLogger(const char* test_name)
12 | : logged_(false), test_name_(test_name) {}
13 |
14 | PerfTimeLogger::~PerfTimeLogger() {
15 | if (!logged_)
16 | Done();
17 | }
18 |
19 | void PerfTimeLogger::Done() {
20 | // we use a floating-point millisecond value because it is more
21 | // intuitive than microseconds and we want more precision than
22 | // integer milliseconds
23 | LogPerfResult(test_name_.c_str(), timer_.Elapsed().InMillisecondsF(), "ms");
24 | logged_ = true;
25 | }
26 |
27 | } // namespace base
28 |
--------------------------------------------------------------------------------
/src/base/test/test_support_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_TEST_SUPPORT_ANDROID_H_
6 | #define BASE_TEST_TEST_SUPPORT_ANDROID_H_
7 |
8 | #include "base/base_export.h"
9 |
10 | namespace base {
11 |
12 | // Init logging for tests on Android. Logs will be output into Android's logcat.
13 | BASE_EXPORT void InitAndroidTestLogging();
14 |
15 | // Init path providers for tests on Android.
16 | BASE_EXPORT void InitAndroidTestPaths();
17 |
18 | // Init the message loop for tests on Android.
19 | BASE_EXPORT void InitAndroidTestMessageLoop();
20 |
21 | // Do all of the initializations above.
22 | BASE_EXPORT void InitAndroidTest();
23 |
24 | } // namespace base
25 |
26 | #endif // BASE_TEST_TEST_SUPPORT_ANDROID_H_
27 |
--------------------------------------------------------------------------------
/src/base/base64.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_BASE64_H__
6 | #define BASE_BASE64_H__
7 |
8 | #include
9 |
10 | #include "base/base_export.h"
11 | #include "base/strings/string_piece.h"
12 |
13 | namespace base {
14 |
15 | // Encodes the input string in base64. The encoding can be done in-place.
16 | BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
17 |
18 | // Decodes the base64 input string. Returns true if successful and false
19 | // otherwise. The output string is only modified if successful. The decoding can
20 | // be done in-place.
21 | BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
22 |
23 | } // namespace base
24 |
25 | #endif // BASE_BASE64_H__
26 |
--------------------------------------------------------------------------------
/src/base/test/null_task_runner.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/test/null_task_runner.h"
6 |
7 | namespace base {
8 |
9 | NullTaskRunner::NullTaskRunner() {}
10 |
11 | NullTaskRunner::~NullTaskRunner() {}
12 |
13 | bool NullTaskRunner::PostDelayedTask(
14 | const tracked_objects::Location& from_here,
15 | const base::Closure& task,
16 | base::TimeDelta delay) {
17 | return false;
18 | }
19 |
20 | bool NullTaskRunner::PostNonNestableDelayedTask(
21 | const tracked_objects::Location& from_here,
22 | const base::Closure& task,
23 | base::TimeDelta delay) {
24 | return false;
25 | }
26 |
27 | bool NullTaskRunner::RunsTasksOnCurrentThread() const {
28 | return true;
29 | }
30 |
31 | } // namespace
32 |
--------------------------------------------------------------------------------
/src/base/debug/dump_without_crashing.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/debug/dump_without_crashing.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace {
10 |
11 | // Pointer to the function that's called by DumpWithoutCrashing() to dump the
12 | // process's memory.
13 | void (CDECL *dump_without_crashing_function_)() = NULL;
14 |
15 | } // namespace
16 |
17 | namespace base {
18 |
19 | namespace debug {
20 |
21 | void DumpWithoutCrashing() {
22 | if (dump_without_crashing_function_)
23 | (*dump_without_crashing_function_)();
24 | }
25 |
26 | void SetDumpWithoutCrashingFunction(void (CDECL *function)()) {
27 | dump_without_crashing_function_ = function;
28 | }
29 |
30 | } // namespace debug
31 |
32 | } // namespace base
33 |
--------------------------------------------------------------------------------
/src/base/threading/thread_local_android.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/threading/thread_local.h"
6 |
7 | #include "base/logging.h"
8 |
9 | namespace base {
10 | namespace internal {
11 |
12 | // static
13 | void ThreadLocalPlatform::AllocateSlot(SlotType* slot) {
14 | bool succeed = slot->Initialize(NULL);
15 | CHECK(succeed);
16 | }
17 |
18 | // static
19 | void ThreadLocalPlatform::FreeSlot(SlotType slot) {
20 | slot.Free();
21 | }
22 |
23 | // static
24 | void* ThreadLocalPlatform::GetValueFromSlot(SlotType slot) {
25 | return slot.Get();
26 | }
27 |
28 | // static
29 | void ThreadLocalPlatform::SetValueInSlot(SlotType slot, void* value) {
30 | slot.Set(value);
31 | }
32 |
33 | } // namespace internal
34 | } // namespace base
35 |
--------------------------------------------------------------------------------
/src/base/float_util.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_FLOAT_UTIL_H_
6 | #define BASE_FLOAT_UTIL_H_
7 |
8 | #include "build/build_config.h"
9 |
10 | #include
11 |
12 | #include
13 |
14 | namespace base {
15 |
16 | template
17 | inline bool IsFinite(const Float& number) {
18 | #if defined(OS_POSIX)
19 | return std::isfinite(number) != 0;
20 | #elif defined(OS_WIN)
21 | return _finite(number) != 0;
22 | #endif
23 | }
24 |
25 | template
26 | inline bool IsNaN(const Float& number) {
27 | #if defined(OS_POSIX)
28 | return std::isnan(number) != 0;
29 | #elif defined(OS_WIN)
30 | return _isnan(number) != 0;
31 | #endif
32 | }
33 |
34 | } // namespace base
35 |
36 | #endif // BASE_FLOAT_UTIL_H_
37 |
--------------------------------------------------------------------------------
/src/base/scoped_clear_errno.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_SCOPED_CLEAR_ERRNO_H_
6 | #define BASE_SCOPED_CLEAR_ERRNO_H_
7 |
8 | #include
9 |
10 | #include "base/basictypes.h"
11 |
12 | namespace base {
13 |
14 | // Simple scoper that saves the current value of errno, resets it to 0, and on
15 | // destruction puts the old value back.
16 | class ScopedClearErrno {
17 | public:
18 | ScopedClearErrno() : old_errno_(errno) {
19 | errno = 0;
20 | }
21 | ~ScopedClearErrno() {
22 | if (errno == 0)
23 | errno = old_errno_;
24 | }
25 |
26 | private:
27 | const int old_errno_;
28 |
29 | DISALLOW_COPY_AND_ASSIGN(ScopedClearErrno);
30 | };
31 |
32 | } // namespace base
33 |
34 | #endif // BASE_SCOPED_CLEAR_ERRNO_H_
35 |
--------------------------------------------------------------------------------
/src/base/test/opaque_ref_counted.h:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_OPAQUE_REF_COUNTED_H_
6 | #define BASE_TEST_OPAQUE_REF_COUNTED_H_
7 |
8 | #include "base/memory/ref_counted.h"
9 |
10 | namespace base {
11 |
12 | // OpaqueRefCounted is a test class for scoped_refptr to ensure it still works
13 | // when the pointed-to type is opaque (i.e., incomplete).
14 | class OpaqueRefCounted;
15 |
16 | // Test functions that return and accept scoped_refptr values.
17 | scoped_refptr MakeOpaqueRefCounted();
18 | void TestOpaqueRefCounted(scoped_refptr p);
19 |
20 | } // namespace base
21 |
22 | extern template class scoped_refptr;
23 |
24 | #endif // BASE_TEST_OPAQUE_REF_COUNTED_H_
25 |
--------------------------------------------------------------------------------
/src/base/test/android/javatests/src/org/chromium/base/test/util/EnormousTest.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | package org.chromium.base.test.util;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * This annotation is for enormous tests.
14 | *
15 | * Examples of enormous tests are tests that depend on external web sites or
16 | * tests that are long running.
17 | *
18 | * Such tests are likely NOT reliable enough to run on tree closing bots and
19 | * should only be run on FYI bots.
20 | */
21 | @Target(ElementType.METHOD)
22 | @Retention(RetentionPolicy.RUNTIME)
23 | public @interface EnormousTest {
24 | }
25 |
--------------------------------------------------------------------------------
/src/base/test/perf_log.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_TEST_PERF_LOG_H_
6 | #define BASE_TEST_PERF_LOG_H_
7 |
8 | namespace base {
9 |
10 | class FilePath;
11 |
12 | // Initializes and finalizes the perf log. These functions should be
13 | // called at the beginning and end (respectively) of running all the
14 | // performance tests. The init function returns true on success.
15 | bool InitPerfLog(const FilePath& log_path);
16 | void FinalizePerfLog();
17 |
18 | // Writes to the perf result log the given 'value' resulting from the
19 | // named 'test'. The units are to aid in reading the log by people.
20 | void LogPerfResult(const char* test_name, double value, const char* units);
21 |
22 | } // namespace base
23 |
24 | #endif // BASE_TEST_PERF_LOG_H_
25 |
--------------------------------------------------------------------------------
/src/base/prefs/base_prefs_export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_PREFS_BASE_PREFS_EXPORT_H_
6 | #define BASE_PREFS_BASE_PREFS_EXPORT_H_
7 |
8 | #if defined(COMPONENT_BUILD)
9 | #if defined(WIN32)
10 |
11 | #if defined(BASE_PREFS_IMPLEMENTATION)
12 | #define BASE_PREFS_EXPORT __declspec(dllexport)
13 | #else
14 | #define BASE_PREFS_EXPORT __declspec(dllimport)
15 | #endif // defined(BASE_PREFS_IMPLEMENTATION)
16 |
17 | #else // defined(WIN32)
18 | #if defined(BASE_PREFS_IMPLEMENTATION)
19 | #define BASE_PREFS_EXPORT __attribute__((visibility("default")))
20 | #else
21 | #define BASE_PREFS_EXPORT
22 | #endif
23 | #endif
24 |
25 | #else // defined(COMPONENT_BUILD)
26 | #define BASE_PREFS_EXPORT
27 | #endif
28 |
29 | #endif // BASE_PREFS_BASE_PREFS_EXPORT_H_
30 |
--------------------------------------------------------------------------------
/src/third_party/libevent/mkinstalldirs:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | # mkinstalldirs --- make directory hierarchy
3 | # Author: Noah Friedman
4 | # Created: 1993-05-16
5 | # Public domain
6 |
7 | # $Id: mkinstalldirs 11 2002-04-09 17:52:23Z nprovos $
8 |
9 | errstatus=0
10 |
11 | for file
12 | do
13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
14 | shift
15 |
16 | pathcomp=
17 | for d
18 | do
19 | pathcomp="$pathcomp$d"
20 | case "$pathcomp" in
21 | -* ) pathcomp=./$pathcomp ;;
22 | esac
23 |
24 | if test ! -d "$pathcomp"; then
25 | echo "mkdir $pathcomp"
26 |
27 | mkdir "$pathcomp" || lasterr=$?
28 |
29 | if test ! -d "$pathcomp"; then
30 | errstatus=$lasterr
31 | fi
32 | fi
33 |
34 | pathcomp="$pathcomp/"
35 | done
36 | done
37 |
38 | exit $errstatus
39 |
40 | # mkinstalldirs ends here
41 |
--------------------------------------------------------------------------------
/src/base/os_compat_android.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BASE_OS_COMPAT_ANDROID_H_
6 | #define BASE_OS_COMPAT_ANDROID_H_
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | // Not implemented in Bionic.
13 | extern "C" int futimes(int fd, const struct timeval tv[2]);
14 |
15 | // Not exposed or implemented in Bionic.
16 | extern "C" char* mkdtemp(char* path);
17 |
18 | // Android has no timegm().
19 | extern "C" time_t timegm(struct tm* const t);
20 |
21 | // The lockf() function is not available on Android; we translate to flock().
22 | #define F_LOCK LOCK_EX
23 | #define F_ULOCK LOCK_UN
24 | inline int lockf(int fd, int cmd, off_t ignored_len) {
25 | return flock(fd, cmd);
26 | }
27 |
28 | #endif // BASE_OS_COMPAT_ANDROID_H_
29 |
--------------------------------------------------------------------------------
/src/base/test/mock_time_provider.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "base/logging.h"
6 | #include "base/test/mock_time_provider.h"
7 |
8 | using ::testing::DefaultValue;
9 |
10 | namespace base {
11 |
12 | MockTimeProvider* MockTimeProvider::instance_ = NULL;
13 |
14 | MockTimeProvider::MockTimeProvider() {
15 | DCHECK(!instance_) << "Only one instance of MockTimeProvider can exist";
16 | DCHECK(!DefaultValue