diff options
author | Steve Block <steveblock@google.com> | 2012-01-10 15:57:26 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2012-01-11 15:26:20 +0000 |
commit | 3c3d37e22bc472db3c836a0d97e7467058f62c9e (patch) | |
tree | 3d573bb20a34afd03d6d1eaf9fc17a4d67b00d8a /Source/WebKit/android | |
parent | e65004065e90be33dd07d0156623c0777e0cb24d (diff) | |
download | external_webkit-3c3d37e22bc472db3c836a0d97e7467058f62c9e.zip external_webkit-3c3d37e22bc472db3c836a0d97e7467058f62c9e.tar.gz external_webkit-3c3d37e22bc472db3c836a0d97e7467058f62c9e.tar.bz2 |
Fix code including Chromium headers to use WebKit LOG macro, rather than framework LOG macro
Previosuly, the framework, WebKit and Chromium all defined a LOG macro. Logic
in ChromiumIncludes.h made sure that LOG always referred to the framework
implementation.
The framework LOG macro has now been renamed ALOG (b/5449033), so we should
update this logic to make LOG refer to the WebKit implementation.
Bug: 5449033
Change-Id: Ia4793114a8ec0d9da7cbbd261093b73dd9657c93
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h b/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h index e720de2..1c898a0 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h +++ b/Source/WebKit/android/WebCoreSupport/ChromiumIncludes.h @@ -31,12 +31,11 @@ #include "config.h" -// Undefine LOG before including chrome code, and if it was defined attempt to -// set the macro to the Android logging macro (which is the only one that -// actually logs). - +// Both WebKit and Chromium define LOG. In AOSP, the framework also defines +// LOG. To avoid conflicts, we undefine LOG before including Chromium code, +// then define it back to the WebKit macro. #ifdef LOG -#define LOG_WAS_DEFINED LOG +#define LOG_WAS_DEFINED #undef LOG #endif @@ -116,8 +115,15 @@ #endif #undef LOG -#if defined(LOG_WAS_DEFINED) && defined(LOG_PRI) -#define LOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) +// If LOG was defined, restore it to the WebKit macro. +#ifdef LOG_WAS_DEFINED +// If LOG was defined, JOIN_LOG_CHANNEL_WITH_PREFIX must be too. +// Copied from Assertions.h. +#if LOG_DISABLED +#define LOG(channel, ...) ((void)0) +#else +#define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) +#endif #endif #endif |