Remove misc unneeded modifications in libchrome. am: 31babce11b am: db381cdb15
am: eadbb40208
Change-Id: I2203586ae123f9e07820fc29dbd8b0abdf00c109
diff --git a/base/macros.h b/base/macros.h
index 4c62300..b5b03bb 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 eba68a7..3d55920 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -641,8 +641,6 @@
//------------------------------------------------------------------------------
// 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 6b4765b..fa054f4 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -559,7 +559,8 @@
//
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 3da6793..9b94891 100644
--- a/base/process/process_posix.cc
+++ b/base/process/process_posix.cc
@@ -126,12 +126,7 @@
}
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 29076ed..35b2603 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 ff997ea..e54595b 100644
--- a/base/synchronization/lock_impl_posix.cc
+++ b/base/synchronization/lock_impl_posix.cc
@@ -21,7 +21,7 @@
// 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 7d37146..36119ab 100644
--- a/base/sys_info_posix.cc
+++ b/base/sys_info_posix.cc
@@ -85,7 +85,10 @@
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 5752d5f..7776228 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 bb6fa1b..e87665b 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.