/* * Copyright 2010, The Android Open Source Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // All source files wishing to include Chromium headers must include this file // and must not incude Chromium headers directly. #ifndef ChromiumIncludes_h #define ChromiumIncludes_h #include "config.h" // 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 #undef LOG #endif // In AOSP, the framework still uses LOG_ASSERT (as well as ALOG_ASSERT), which // conflicts with Chromium's LOG_ASSERT. So we undefine LOG_ASSERT to allow the // Chromium implementation to be picked up. We also redefine ALOG_ASSERT to the // underlying framework implementation without using LOG_ASSERT. // TODO: Remove this once LOG_ASSERT is removed from the framework in AOSP. #undef LOG_ASSERT #undef ALOG_ASSERT // Copied from log.h. #define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) // Chromium won't build without NDEBUG set, so we set it for all source files // that use Chromium code. This means that if NDEBUG was previously unset, we // have to redefine ASSERT() to a no-op, as this is enabled in debug builds. // Unfortunately, ASSERT() is defined from config.h, so we can't get in first. #ifndef NDEBUG #define NDEBUG 1 #undef ASSERT #define ASSERT(assertion) (void(0)) #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if ENABLE(WEB_AUTOFILL) #include #include #include #include #include #include #include #include #include #include #include #include #endif #undef LOG // 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