diff options
author | Hidehiko Abe <hidehiko@google.com> | 2018-02-22 16:35:51 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-22 16:35:51 +0000 |
commit | eadbb40208dd13dcd62c213773668d79d2dd5060 (patch) | |
tree | 50de4fa99f372c8487f3485b417746ee4fa67c42 | |
parent | 8d647cbaebfa6b3099c7f6feaf137bc01cdeecff (diff) | |
parent | db381cdb1505737471b0dd013868591ddb02c89e (diff) | |
download | libchrome-eadbb40208dd13dcd62c213773668d79d2dd5060.tar.gz |
Remove misc unneeded modifications in libchrome. am: 31babce11b
am: db381cdb15
Change-Id: I782170c546776fad0ca8aa06eaf74045a03f3871
-rw-r--r-- | base/macros.h | 7 | ||||
-rw-r--r-- | base/message_loop/message_loop.cc | 2 | ||||
-rw-r--r-- | base/message_loop/message_loop.h | 3 | ||||
-rw-r--r-- | base/process/process_posix.cc | 5 | ||||
-rw-r--r-- | base/strings/string_util.h | 6 | ||||
-rw-r--r-- | base/synchronization/lock_impl_posix.cc | 2 | ||||
-rw-r--r-- | base/sys_info_posix.cc | 5 | ||||
-rw-r--r-- | base/threading/non_thread_safe_unittest.cc | 8 | ||||
-rw-r--r-- | base/trace_event/common/trace_event_common.h | 9 |
9 files changed, 11 insertions, 36 deletions
diff --git a/base/macros.h b/base/macros.h index 4c62300e32..b5b03bb226 100644 --- a/base/macros.h +++ b/base/macros.h @@ -17,6 +17,8 @@ #include <android-base/macros.h> #endif // defined(ANDROID) +// We define following macros conditionally as they may be defined by another libraries. + // Put this in the declarations for a class to be uncopyable. #if !defined(DISALLOW_COPY) #define DISALLOW_COPY(TypeName) \ @@ -29,9 +31,8 @@ void operator=(const TypeName&) = delete #endif -// A macro to disallow the copy constructor and operator= functions -// This should be used in the private: declarations for a class -// We define this macro conditionally as it may be defined by another libraries. +// A macro to disallow the copy constructor and operator= functions. +// This should be used in the private: declarations for a class. #if !defined(DISALLOW_COPY_AND_ASSIGN) #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc index eba68a72ba..3d55920afd 100644 --- a/base/message_loop/message_loop.cc +++ b/base/message_loop/message_loop.cc @@ -641,8 +641,6 @@ bool MessageLoopForUI::WatchFileDescriptor( //------------------------------------------------------------------------------ // MessageLoopForIO -MessageLoopForIO::MessageLoopForIO() : MessageLoop(TYPE_IO) {} - #if !defined(OS_NACL_SFI) #if defined(OS_WIN) diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h index 6b4765bd1b..fa054f421a 100644 --- a/base/message_loop/message_loop.h +++ b/base/message_loop/message_loop.h @@ -559,7 +559,8 @@ static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForUI), // class BASE_EXPORT MessageLoopForIO : public MessageLoop { public: - MessageLoopForIO(); + MessageLoopForIO() : MessageLoop(TYPE_IO) { + } // Returns the MessageLoopForIO of the current thread. static MessageLoopForIO* current() { diff --git a/base/process/process_posix.cc b/base/process/process_posix.cc index 3da6793afb..9b94891dd9 100644 --- a/base/process/process_posix.cc +++ b/base/process/process_posix.cc @@ -126,12 +126,7 @@ static bool WaitForSingleNonChildProcess(base::ProcessHandle handle, } result = -1; -#if defined(ANDROID) - struct kevent event; - memset(&event, 0, sizeof(event)); -#else struct kevent event = {0}; -#endif while (wait_forever || remaining_delta > base::TimeDelta()) { struct timespec remaining_timespec; diff --git a/base/strings/string_util.h b/base/strings/string_util.h index 29076ed913..35b2603786 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h @@ -22,12 +22,6 @@ #include "base/strings/string_piece.h" // For implicit conversions. #include "build/build_config.h" -#if defined(ANDROID) -// On Android, bionic's stdio.h defines an snprintf macro when being built with -// clang. Undefine it here so it won't collide with base::snprintf(). -#undef snprintf -#endif // defined(ANDROID) - namespace base { // C standard-library functions that aren't cross-platform are provided as diff --git a/base/synchronization/lock_impl_posix.cc b/base/synchronization/lock_impl_posix.cc index ff997ea65f..e54595b87f 100644 --- a/base/synchronization/lock_impl_posix.cc +++ b/base/synchronization/lock_impl_posix.cc @@ -21,7 +21,7 @@ namespace internal { // Lock::PriorityInheritanceAvailable still must be checked as the code may // compile but the underlying platform still may not correctly support priority // inheritance locks. -#if defined(OS_NACL) || defined(OS_ANDROID) || defined(__ANDROID__) +#if defined(OS_NACL) || defined(OS_ANDROID) #define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 0 #else #define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 1 diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc index 7d3714663b..36119abf00 100644 --- a/base/sys_info_posix.cc +++ b/base/sys_info_posix.cc @@ -85,7 +85,10 @@ bool IsStatsZeroIfUnlimited(const base::FilePath& path) { if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0) return false; - switch (static_cast<uint32_t>(stats.f_type)) { + // In some platforms, |statfs_buf.f_type| is declared as signed, but some of + // the values will overflow it, causing narrowing warnings. Cast to the + // largest possible unsigned integer type to avoid it. + switch (static_cast<uintmax_t>(stats.f_type)) { case TMPFS_MAGIC: case HUGETLBFS_MAGIC: case RAMFS_MAGIC: diff --git a/base/threading/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc index 5752d5f2b3..7776228f2f 100644 --- a/base/threading/non_thread_safe_unittest.cc +++ b/base/threading/non_thread_safe_unittest.cc @@ -12,14 +12,6 @@ #include "base/threading/simple_thread.h" #include "testing/gtest/include/gtest/gtest.h" -// Duplicated from base/threading/non_thread_safe.h so that we can be -// good citizens there and undef the macro. -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) -#define ENABLE_NON_THREAD_SAFE 1 -#else -#define ENABLE_NON_THREAD_SAFE 0 -#endif - namespace base { namespace { diff --git a/base/trace_event/common/trace_event_common.h b/base/trace_event/common/trace_event_common.h index bb6fa1b82b..e87665b8cd 100644 --- a/base/trace_event/common/trace_event_common.h +++ b/base/trace_event/common/trace_event_common.h @@ -789,15 +789,6 @@ TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) -// Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, -// with 2 associated arguments. If the category is not enabled, then this -// does nothing. -#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \ - category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) - // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this // does nothing. |