1 /* 2 * Copyright 2010, The Android Open Source Project 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * * Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26 // All source files wishing to include Chromium headers must include this file 27 // and must not incude Chromium headers directly. 28 29 #ifndef ChromiumIncludes_h 30 #define ChromiumIncludes_h 31 32 #include "config.h" 33 34 // Both WebKit and Chromium define LOG. In AOSP, the framework also defines 35 // LOG. To avoid conflicts, we undefine LOG before including Chromium code, 36 // then define it back to the WebKit macro. 37 #ifdef LOG 38 #define LOG_WAS_DEFINED 39 #undef LOG 40 #endif 41 42 // In AOSP, the framework still uses LOG_ASSERT (as well as ALOG_ASSERT), which 43 // conflicts with Chromium's LOG_ASSERT. So we undefine LOG_ASSERT to allow the 44 // Chromium implementation to be picked up. We also redefine ALOG_ASSERT to the 45 // underlying framework implementation without using LOG_ASSERT. 46 // TODO: Remove this once LOG_ASSERT is removed from the framework in AOSP. 47 #undef LOG_ASSERT 48 #undef ALOG_ASSERT 49 // Copied from log.h. 50 #define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) 51 52 // Chromium won't build without NDEBUG set, so we set it for all source files 53 // that use Chromium code. This means that if NDEBUG was previously unset, we 54 // have to redefine ASSERT() to a no-op, as this is enabled in debug builds. 55 // Unfortunately, ASSERT() is defined from config.h, so we can't get in first. 56 #ifndef NDEBUG 57 #define NDEBUG 1 58 #undef ASSERT 59 #define ASSERT(assertion) (void(0)) 60 #endif 61 62 #include <android/net/android_network_library_impl.h> 63 #include <android/jni/jni_utils.h> 64 #include <base/callback.h> 65 #include <base/lazy_instance.h> 66 #include <base/memory/ref_counted.h> 67 #include <base/message_loop_proxy.h> 68 #include <base/openssl_util.h> 69 #include <base/string_util.h> 70 #include <base/synchronization/condition_variable.h> 71 #include <base/synchronization/lock.h> 72 #include <base/sys_string_conversions.h> 73 #include <base/threading/thread.h> 74 #include <base/time.h> 75 #include <base/tuple.h> 76 #include <base/utf_string_conversions.h> 77 #include <chrome/browser/net/sqlite_persistent_cookie_store.h> 78 #include <net/base/auth.h> 79 #include <net/base/cert_verifier.h> 80 #include <net/base/cookie_monster.h> 81 #include <net/base/cookie_policy.h> 82 #include <net/base/data_url.h> 83 #include <net/base/host_resolver.h> 84 #include <net/base/io_buffer.h> 85 #include <net/base/load_flags.h> 86 #include <net/base/net_errors.h> 87 #include <net/base/mime_util.h> 88 #include <net/base/net_util.h> 89 #include <net/base/openssl_private_key_store.h> 90 #include <net/base/ssl_cert_request_info.h> 91 #include <net/base/ssl_config_service.h> 92 #include <net/disk_cache/disk_cache.h> 93 #include <net/http/http_auth_handler_factory.h> 94 #include <net/http/http_cache.h> 95 #include <net/http/http_network_layer.h> 96 #include <net/http/http_response_headers.h> 97 #include <net/proxy/proxy_config_service_android.h> 98 #include <net/proxy/proxy_service.h> 99 #include <net/url_request/url_request.h> 100 #include <net/url_request/url_request_context.h> 101 102 #if ENABLE(WEB_AUTOFILL) 103 #include <autofill/autofill_manager.h> 104 #include <autofill/autofill_profile.h> 105 #include <autofill/personal_data_manager.h> 106 #include <base/logging.h> 107 #include <base/memory/scoped_vector.h> 108 #include <base/string16.h> 109 #include <base/utf_string_conversions.h> 110 #include <chrome/browser/autofill/autofill_host.h> 111 #include <chrome/browser/profiles/profile.h> 112 #include <content/browser/tab_contents/tab_contents.h> 113 #include <webkit/glue/form_data.h> 114 #include <webkit/glue/form_field.h> 115 #endif 116 117 #undef LOG 118 // If LOG was defined, restore it to the WebKit macro. 119 #ifdef LOG_WAS_DEFINED 120 // If LOG was defined, JOIN_LOG_CHANNEL_WITH_PREFIX must be too. 121 // Copied from Assertions.h. 122 #if LOG_DISABLED 123 #define LOG(channel, ...) ((void)0) 124 #else 125 #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) 126 #endif 127 #endif 128 129 #endif 130