Skip to content

Commit

Permalink
Revert 49982 - patch
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thakis@chromium.org committed Jun 16, 2010
1 parent ac201f9 commit 46ce5b5
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 71 deletions.
6 changes: 1 addition & 5 deletions base/linked_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand All @@ -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) {
Expand Down
23 changes: 11 additions & 12 deletions base/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
//
Expand Down
12 changes: 4 additions & 8 deletions base/message_loop_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
12 changes: 4 additions & 8 deletions base/message_pump_libevent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}

Expand Down
8 changes: 2 additions & 6 deletions base/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ 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, ...)
PRINTF_FORMAT(3, 4);
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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion base/third_party/dmg_fp/dtoa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 2 additions & 10 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,11 @@
# Set this to true to enable SELinux support.
'selinux%': 0,

# Set this to true when building with Clang.
'clang%': 1,

# Strip the binary after dumping symbols.
'linux_strip_binary%': 0,

# Disable TCMalloc. It uses variable length arrays which aren't in C++.
'linux_use_tcmalloc%': 0,
# Enable TCMalloc.
'linux_use_tcmalloc%': 1,

# Disable TCMalloc's debugallocation.
'linux_use_debugallocation%': 0,
Expand Down Expand Up @@ -813,11 +810,6 @@
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization pattern.
'-Wno-missing-field-initializers',
# Don't warn about unused variables, due to a common pattern:
# scoped_deleter_of_some_sort unused_variable(&thing_to_delete);
'-Wno-unused-variable',
# gtest confuses clang.
'-Wno-bool-conversions',
'-D_FILE_OFFSET_BITS=64',
# Don't export any symbols (for example, to plugins we dlopen()).
# Note: this is *required* to make some plugins work.
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/zygote_main_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,6 @@ static bool EnterSandbox() {

#endif // CHROMIUM_SELINUX

// CLANG HACK
int SupportsSeccompSandbox(int) { return 0; }
void SeccompSandboxSetProcSelfMaps(int) {}
void StartSeccompSandbox() {}

bool ZygoteMain(const MainFunctionParams& params) {
#if !defined(CHROMIUM_SELINUX)
g_am_zygote_or_renderer = true;
Expand Down
6 changes: 2 additions & 4 deletions ipc/ipc_message_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ struct SimilarTypeTraits {
template <class P>
static inline void WriteParam(Message* m, const P& p) {
typedef typename SimilarTypeTraits<P>::Type Type;
const Type& t = p;
ParamTraits<Type>::Write(m, t);
ParamTraits<Type>::Write(m, static_cast<const Type& >(p));
}

template <class P>
Expand All @@ -126,8 +125,7 @@ static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter,
template <class P>
static inline void LogParam(const P& p, std::wstring* l) {
typedef typename SimilarTypeTraits<P>::Type Type;
const Type& t = p;
ParamTraits<Type>::Log(t, l);
ParamTraits<Type>::Log(static_cast<const Type& >(p), l);
}

template <>
Expand Down
3 changes: 1 addition & 2 deletions media/audio/linux/alsa_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ static void Swizzle51Layout(Format* b, uint32 filled) {

} // namespace

// Not in an anonymous namespace so that it can be a friend to
// AlsaPcmOutputStream.
// Not in an anonymous so that it can be a friend to AlsaPcmOutputStream.
std::ostream& operator<<(std::ostream& os,
AlsaPcmOutputStream::InternalState state) {
switch (state) {
Expand Down
2 changes: 0 additions & 2 deletions media/audio/linux/alsa_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class AlsaPcmOutputStream :

virtual ~AlsaPcmOutputStream();

public: // clang workaround
// Flags indicating the state of the stream.
enum InternalState {
kInError = 0,
Expand All @@ -124,7 +123,6 @@ class AlsaPcmOutputStream :
kIsStopped,
kIsClosed
};
private:
friend std::ostream& operator<<(std::ostream& os, InternalState);

// Various tasks that complete actions started in the public API.
Expand Down
3 changes: 1 addition & 2 deletions net/socket/tcp_client_socket_libevent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ void TCPClientSocketLibevent::DoDisconnect() {
DCHECK(ok);
ok = write_socket_watcher_.StopWatchingFileDescriptor();
DCHECK(ok);
if (HANDLE_EINTR(close(socket_)) < 0)
PLOG(WARNING) << "close";
HANDLE_EINTR(close(socket_));
socket_ = kInvalidSocket;
}

Expand Down
4 changes: 2 additions & 2 deletions sandbox/sandbox.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
},
],
}],
[ 'OS=="linux" and selinux==0 and clang==0', {
[ 'OS=="linux" and selinux==0', {
'targets': [
{
'target_name': 'chrome_sandbox',
Expand Down Expand Up @@ -168,7 +168,7 @@
},
],
}],
[ 'OS=="linux" and (selinux==1 or clang==1)', {
[ 'OS=="linux" and selinux==1', {
# GYP requires that each file have at least one target defined.
'targets': [
{
Expand Down
1 change: 0 additions & 1 deletion skia/skia.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@
],
'defines': [
'SK_BUILD_NO_IMAGE_ENCODE',
'SK_RESTRICT=', # Remove use of __restrict__ -- not sure it's correct.
],
'sources!': [
'../third_party/skia/include/core/SkTypes.h',
Expand Down
2 changes: 1 addition & 1 deletion testing/gmock/include/gmock/gmock-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class SetArgumentPointeeAction {

template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const {
// CompileAssertTypesEqual<void, Result>();
CompileAssertTypesEqual<void, Result>();
*::std::tr1::get<N>(args) = value_;
}

Expand Down
2 changes: 0 additions & 2 deletions testing/gtest.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@
# must be instructed that RTTI is disabled here, and for any
# direct dependents that might include gtest headers.
'GTEST_HAS_RTTI=0',
'GTEST_USE_OWN_TR1_TUPLE=1',
],
'direct_dependent_settings': {
'defines': [
'GTEST_HAS_RTTI=0',
'GTEST_USE_OWN_TR1_TUPLE=1',
],
},
}],
Expand Down

0 comments on commit 46ce5b5

Please sign in to comment.