Commit 8d127305 authored by joth@chromium.org's avatar joth@chromium.org

Only define ERROR on windows builds

This is to stop people accidentally using the ERROR macro for other uses,
e.g. VLOG(ERROR) is not meaningful.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11669010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175998 0039d316-1c4b-4281-b951-d872f2087c98
parent 21456cb1
...@@ -330,6 +330,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL; ...@@ -330,6 +330,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
#define COMPACT_GOOGLE_LOG_DFATAL \ #define COMPACT_GOOGLE_LOG_DFATAL \
COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage)
#if defined(OS_WIN)
// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets // wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets
// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us // substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us
// to keep using this syntax, we define this macro to do the same thing // to keep using this syntax, we define this macro to do the same thing
...@@ -341,6 +342,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL; ...@@ -341,6 +342,7 @@ const LogSeverity LOG_DFATAL = LOG_FATAL;
#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR #define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
// Needed for LOG_IS_ON(ERROR). // Needed for LOG_IS_ON(ERROR).
const LogSeverity LOG_0 = LOG_ERROR; const LogSeverity LOG_0 = LOG_ERROR;
#endif
// As special cases, we can assume that LOG_IS_ON(ERROR_REPORT) and // As special cases, we can assume that LOG_IS_ON(ERROR_REPORT) and
// LOG_IS_ON(FATAL) always hold. Also, LOG_IS_ON(DFATAL) always holds // LOG_IS_ON(FATAL) always hold. Also, LOG_IS_ON(DFATAL) always holds
......
...@@ -423,7 +423,7 @@ bool DialServiceImpl::CheckResult(const char* operation, int result) { ...@@ -423,7 +423,7 @@ bool DialServiceImpl::CheckResult(const char* operation, int result) {
if (result < net::OK && result != net::ERR_IO_PENDING) { if (result < net::OK && result != net::ERR_IO_PENDING) {
CloseSocket(); CloseSocket();
std::string error_str(net::ErrorToString(result)); std::string error_str(net::ErrorToString(result));
DVLOG(ERROR) << "dial socket error: " << error_str; DVLOG(0) << "dial socket error: " << error_str;
FOR_EACH_OBSERVER(Observer, observer_list_, OnError(this, error_str)); FOR_EACH_OBSERVER(Observer, observer_list_, OnError(this, error_str));
return false; return false;
} }
......
...@@ -41,13 +41,13 @@ bool TransferBufferManager::RegisterTransferBuffer( ...@@ -41,13 +41,13 @@ bool TransferBufferManager::RegisterTransferBuffer(
base::SharedMemory* shared_memory, base::SharedMemory* shared_memory,
size_t size) { size_t size) {
if (id <= 0) { if (id <= 0) {
DVLOG(ERROR) << "Cannot register transfer buffer with non-positive ID."; DVLOG(0) << "Cannot register transfer buffer with non-positive ID.";
return false; return false;
} }
// Fail if the ID is in use. // Fail if the ID is in use.
if (registered_buffers_.find(id) != registered_buffers_.end()) { if (registered_buffers_.find(id) != registered_buffers_.end()) {
DVLOG(ERROR) << "Buffer ID already in use."; DVLOG(0) << "Buffer ID already in use.";
return false; return false;
} }
...@@ -55,7 +55,7 @@ bool TransferBufferManager::RegisterTransferBuffer( ...@@ -55,7 +55,7 @@ bool TransferBufferManager::RegisterTransferBuffer(
base::SharedMemoryHandle duped_shared_memory_handle; base::SharedMemoryHandle duped_shared_memory_handle;
if (!shared_memory->ShareToProcess(base::GetCurrentProcessHandle(), if (!shared_memory->ShareToProcess(base::GetCurrentProcessHandle(),
&duped_shared_memory_handle)) { &duped_shared_memory_handle)) {
DVLOG(ERROR) << "Failed to duplicate shared memory handle."; DVLOG(0) << "Failed to duplicate shared memory handle.";
return false; return false;
} }
scoped_ptr<SharedMemory> duped_shared_memory( scoped_ptr<SharedMemory> duped_shared_memory(
...@@ -63,7 +63,7 @@ bool TransferBufferManager::RegisterTransferBuffer( ...@@ -63,7 +63,7 @@ bool TransferBufferManager::RegisterTransferBuffer(
// Map the shared memory into this process. This validates the size. // Map the shared memory into this process. This validates the size.
if (!duped_shared_memory->Map(size)) { if (!duped_shared_memory->Map(size)) {
DVLOG(ERROR) << "Failed to map shared memory."; DVLOG(0) << "Failed to map shared memory.";
return false; return false;
} }
...@@ -85,7 +85,7 @@ bool TransferBufferManager::RegisterTransferBuffer( ...@@ -85,7 +85,7 @@ bool TransferBufferManager::RegisterTransferBuffer(
void TransferBufferManager::DestroyTransferBuffer(int32 id) { void TransferBufferManager::DestroyTransferBuffer(int32 id) {
BufferMap::iterator it = registered_buffers_.find(id); BufferMap::iterator it = registered_buffers_.find(id);
if (it == registered_buffers_.end()) { if (it == registered_buffers_.end()) {
DVLOG(ERROR) << "Transfer buffer ID was not registered."; DVLOG(0) << "Transfer buffer ID was not registered.";
return; return;
} }
......
...@@ -85,8 +85,8 @@ void BalsaFrame::Reset() { ...@@ -85,8 +85,8 @@ void BalsaFrame::Reset() {
const char* BalsaFrameEnums::ParseStateToString( const char* BalsaFrameEnums::ParseStateToString(
BalsaFrameEnums::ParseState error_code) { BalsaFrameEnums::ParseState error_code) {
switch (error_code) { switch (error_code) {
case ERROR: case PARSE_ERROR:
return "ERROR"; return "PARSE_ERROR";
case READING_HEADER_AND_FIRSTLINE: case READING_HEADER_AND_FIRSTLINE:
return "READING_HEADER_AND_FIRSTLINE"; return "READING_HEADER_AND_FIRSTLINE";
case READING_CHUNK_LENGTH: case READING_CHUNK_LENGTH:
......
...@@ -15,7 +15,7 @@ namespace { ...@@ -15,7 +15,7 @@ namespace {
void CheckIfFailed(HRESULT hr) { void CheckIfFailed(HRESULT hr) {
DCHECK(!FAILED(hr)); DCHECK(!FAILED(hr));
if (FAILED(hr)) if (FAILED(hr))
DVLOG(ERROR) << "Direct3D call failed, hr = " << hr; DVLOG(0) << "Direct3D call failed, hr = " << hr;
} }
float GetLogicalDpi() { float GetLogicalDpi() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment