summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 18:39:53 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 18:39:53 +0000
commit46ce5b568acd801330e52a4e04534d9689990835 (patch)
tree86944486c8faf85322981d343013f2de8ecfbb91 /base
parentac201f961a6c0151dc596829584339c199527ba5 (diff)
downloadchromium_src-46ce5b568acd801330e52a4e04534d9689990835.zip
chromium_src-46ce5b568acd801330e52a4e04534d9689990835.tar.gz
chromium_src-46ce5b568acd801330e52a4e04534d9689990835.tar.bz2
Revert 49982 - patch
TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2825006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/linked_list.h6
-rw-r--r--base/logging.h23
-rw-r--r--base/message_loop_unittest.cc12
-rw-r--r--base/message_pump_libevent.cc12
-rw-r--r--base/string_util.h8
-rw-r--r--base/third_party/dmg_fp/dtoa.cc2
6 files changed, 23 insertions, 40 deletions
diff --git a/base/linked_list.h b/base/linked_list.h
index 7464997..5b5184f 100644
--- a/base/linked_list.h
+++ b/base/linked_list.h
@@ -125,10 +125,6 @@ class LinkNode {
return static_cast<T*>(this);
}
- void set(LinkNode<T>* prev, LinkNode<T>* next) {
- previous_ = prev; next_ = next;
- }
-
private:
LinkNode<T>* previous_;
LinkNode<T>* next_;
@@ -140,7 +136,7 @@ class LinkedList {
// The "root" node is self-referential, and forms the basis of a circular
// list (root_.next() will point back to the start of the list,
// and root_->previous() wraps around to the end of the list).
- LinkedList() { root_.set(&root_, &root_); }
+ LinkedList() : root_(&root_, &root_) {}
// Appends |e| to the end of the linked list.
void Append(LinkNode<T>* e) {
diff --git a/base/logging.h b/base/logging.h
index f11d3b2..07a0d0f 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -101,18 +101,6 @@
// There is also the special severity of DFATAL, which logs FATAL in
// debug mode, ERROR_REPORT in normal mode.
-// XXX better comment -- must be before we use << and in global namespace
-// These functions are provided as a convenience for logging, which is where we
-// use streams (it is against Google style to use streams in other places). It
-// is designed to allow you to emit non-ASCII Unicode strings to the log file,
-// which is normally ASCII. It is relatively slow, so try not to use it for
-// common cases. Non-ASCII characters will be converted to UTF-8 by these
-// operators.
-std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
-inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
- return out << wstr.c_str();
-}
-
namespace logging {
// Where to record logging output? A flat file and/or system debug log via
@@ -825,6 +813,17 @@ void RawLog(int level, const char* message);
} // namespace logging
+// These functions are provided as a convenience for logging, which is where we
+// use streams (it is against Google style to use streams in other places). It
+// is designed to allow you to emit non-ASCII Unicode strings to the log file,
+// which is normally ASCII. It is relatively slow, so try not to use it for
+// common cases. Non-ASCII characters will be converted to UTF-8 by these
+// operators.
+std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
+inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
+ return out << wstr.c_str();
+}
+
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.
//
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index 6069f20..6208e99 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -1578,10 +1578,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) {
// and don't run the message loop, just destroy it.
}
}
- if (HANDLE_EINTR(close(pipefds[0])) < 0)
- PLOG(WARNING) << "close";
- if (HANDLE_EINTR(close(pipefds[1])) < 0)
- PLOG(WARNING) << "close";
+ HANDLE_EINTR(close(pipefds[0]));
+ HANDLE_EINTR(close(pipefds[1]));
}
TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) {
@@ -1603,10 +1601,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) {
controller.StopWatchingFileDescriptor();
}
}
- if (HANDLE_EINTR(close(pipefds[0])) < 0)
- PLOG(WARNING) << "close";
- if (HANDLE_EINTR(close(pipefds[1])) < 0)
- PLOG(WARNING) << "close";
+ HANDLE_EINTR(close(pipefds[0]));
+ HANDLE_EINTR(close(pipefds[1]));
}
} // namespace
diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc
index 3a749b4..c2390b4 100644
--- a/base/message_pump_libevent.cc
+++ b/base/message_pump_libevent.cc
@@ -160,14 +160,10 @@ MessagePumpLibevent::~MessagePumpLibevent() {
DCHECK(event_base_);
event_del(wakeup_event_);
delete wakeup_event_;
- if (wakeup_pipe_in_ >= 0) {
- if (HANDLE_EINTR(close(wakeup_pipe_in_)) < 0)
- PLOG(WARNING) << "close";
- }
- if (wakeup_pipe_out_ >= 0) {
- if (HANDLE_EINTR(close(wakeup_pipe_out_)) < 0)
- PLOG(WARNING) << "close";
- }
+ if (wakeup_pipe_in_ >= 0)
+ HANDLE_EINTR(close(wakeup_pipe_in_));
+ if (wakeup_pipe_out_ >= 0)
+ HANDLE_EINTR(close(wakeup_pipe_out_));
event_base_free(event_base_);
}
diff --git a/base/string_util.h b/base/string_util.h
index 87865b6..11a9fd2 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -54,10 +54,6 @@ int vswprintf(wchar_t* buffer, size_t size,
// Some of these implementations need to be inlined.
-// CLANG NOTE
-// Qualified calls with base:: is to work around
-// http://llvm.org/bugs/show_bug.cgi?id=6762
-
// We separate the declaration from the implementation of this inline
// function just so the PRINTF_FORMAT works.
inline int snprintf(char* buffer, size_t size, const char* format, ...)
@@ -65,7 +61,7 @@ inline int snprintf(char* buffer, size_t size, const char* format, ...)
inline int snprintf(char* buffer, size_t size, const char* format, ...) {
va_list arguments;
va_start(arguments, format);
- int result = base::vsnprintf(buffer, size, format, arguments);
+ int result = vsnprintf(buffer, size, format, arguments);
va_end(arguments);
return result;
}
@@ -77,7 +73,7 @@ inline int swprintf(wchar_t* buffer, size_t size, const wchar_t* format, ...)
inline int swprintf(wchar_t* buffer, size_t size, const wchar_t* format, ...) {
va_list arguments;
va_start(arguments, format);
- int result = base::vswprintf(buffer, size, format, arguments);
+ int result = vswprintf(buffer, size, format, arguments);
va_end(arguments);
return result;
}
diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
index ad71fb6..3f7e794 100644
--- a/base/third_party/dmg_fp/dtoa.cc
+++ b/base/third_party/dmg_fp/dtoa.cc
@@ -1559,7 +1559,7 @@ hexnan
CONST char *s;
int c1, havedig, udx0, xshift;
- if (!hexdig[(int)'0'])
+ if (!hexdig['0'])
hexdig_init();
x[0] = x[1] = 0;
havedig = xshift = 0;