blob: ae94e8e8f5344d77fbe641f173ef2e8541898222 [file] [log] [blame]
diff --git include/base/cef_atomicops.h include/base/cef_atomicops.h
index 96aebab..501788f 100644
--- include/base/cef_atomicops.h
+++ include/base/cef_atomicops.h
@@ -54,7 +54,7 @@
#define CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_
#pragma once
-#if defined(BASE_ATOMICOPS_H_)
+#if defined(BASE_ATOMICOPS_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
@@ -92,9 +92,13 @@
// http://code.google.com/p/nativeclient/issues/detail?id=1162
typedef int64_t Atomic64;
#else
+#if defined(USING_GOOGLE3_INCLUDES)
+typedef int64_t Atomic64;
+#else
typedef intptr_t Atomic64;
#endif
#endif
+#endif
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
// Atomic64 routines below, depending on your architecture.
diff --git include/base/cef_basictypes.h include/base/cef_basictypes.h
index e38f4f729..fcb0a5916 100644
--- include/base/cef_basictypes.h
+++ include/base/cef_basictypes.h
@@ -37,6 +37,11 @@
#include "include/base/cef_build.h"
+#if defined(USING_GOOGLE3_INCLUDES)
+// When building CEF in google3, use the google3 header directly.
+#include "base/integral_types.h"
+#else // !USING_GOOGLE3_INCLUDES
+
// The NSPR system headers define 64-bit as |long| when possible, except on
// Mac OS X. In order to not have typedef mismatches, we do the same on LP64.
//
@@ -74,6 +79,8 @@ typedef short int16;
typedef unsigned short uint16;
#endif
+#endif // !USING_GOOGLE3_INCLUDES
+
// UTF-16 character type.
// This should be kept synchronized with base/strings/string16.h
#ifndef char16
diff --git include/base/cef_bind.h include/base/cef_bind.h
index 77c9c5573..a917a1887 100644
--- include/base/cef_bind.h
+++ include/base/cef_bind.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_BIND_H_
#pragma once
-#if defined(BASE_BIND_H_)
+#if defined(BASE_BIND_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_bind_helpers.h include/base/cef_bind_helpers.h
index 2b4798b2c..b220b9934 100644
--- include/base/cef_bind_helpers.h
+++ include/base/cef_bind_helpers.h
@@ -170,7 +170,7 @@
#define CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_
#pragma once
-#if defined(BASE_BIND_HELPERS_H_)
+#if defined(BASE_BIND_HELPERS_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_callback.h include/base/cef_callback.h
index 16e238a97..83cb0ebe4 100644
--- include/base/cef_callback.h
+++ include/base/cef_callback.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_
#pragma once
-#if defined(BASE_CALLBACK_H_)
+#if defined(BASE_CALLBACK_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_callback_forward.h include/base/cef_callback_forward.h
index d604d7cfa..e434bd12f 100644
--- include/base/cef_callback_forward.h
+++ include/base/cef_callback_forward.h
@@ -32,7 +32,7 @@
#define INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_
#pragma once
-#if defined(BASE_CALLBACK_FORWARD_H_)
+#if defined(BASE_CALLBACK_FORWARD_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
@@ -54,6 +54,27 @@ typedef Callback<void(void)> Closure;
} // namespace base
+#if defined(USING_GOOGLE3_INCLUDES)
+
+// The google3 //base/callback-specializations.h header declares class templates
+// in the base::callback_internal namespace that derive from ::Closure. However,
+// those class templates use " : public Closure" to achieve that relationship.
+// Because CEF declares a conflicting Closure type in the base namespace, the
+// google3 header picks up the incorrect Closure (CEF's base::Closure rather
+// than google3's ::Closure) when used in conjunction with the CEF header. The
+// kludge below resolves this issue by pulling the global ::Closure into the
+// base::callback_internal namespace.
+
+class Closure;
+
+namespace base {
+namespace callback_internal {
+using Closure = ::Closure;
+} // namespace callback_internal
+} // namespace base
+
+#endif // USING_GOOGLE3_INCLUDES
+
#endif // !!USING_CHROMIUM_INCLUDES
#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_
diff --git include/base/cef_callback_helpers.h include/base/cef_callback_helpers.h
index ebe074a1f..1692cfde5 100644
--- include/base/cef_callback_helpers.h
+++ include/base/cef_callback_helpers.h
@@ -41,7 +41,7 @@
#define CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
#pragma once
-#if defined(BASE_CALLBACK_HELPERS_H_)
+#if defined(BASE_CALLBACK_HELPERS_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_callback_list.h include/base/cef_callback_list.h
index e0ef3665b..8e0a5d6e5 100644
--- include/base/cef_callback_list.h
+++ include/base/cef_callback_list.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
#pragma once
-#if defined(BASE_CALLBACK_LIST_H_)
+#if defined(BASE_CALLBACK_LIST_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_cancelable_callback.h include/base/cef_cancelable_callback.h
index febce3a32..c1cfbf03d 100644
--- include/base/cef_cancelable_callback.h
+++ include/base/cef_cancelable_callback.h
@@ -69,7 +69,7 @@
#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
#pragma once
-#if defined(BASE_CANCELABLE_CALLBACK_H_)
+#if defined(BASE_CANCELABLE_CALLBACK_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_lock.h include/base/cef_lock.h
index 6909bd6f2..cc122cafd 100644
--- include/base/cef_lock.h
+++ include/base/cef_lock.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_LOCK_H_
#pragma once
-#if defined(BASE_SYNCHRONIZATION_LOCK_H_)
+#if defined(BASE_SYNCHRONIZATION_LOCK_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_logging.h include/base/cef_logging.h
index 8d8bb889e..fef75d78b 100644
--- include/base/cef_logging.h
+++ include/base/cef_logging.h
@@ -136,7 +136,7 @@
#define CEF_INCLUDE_BASE_CEF_LOGGING_H_
#pragma once
-#if defined(DCHECK)
+#if defined(DCHECK) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the macros provided by this header already exist.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
@@ -162,6 +162,12 @@
#include <sstream>
#include <string>
+#if defined(USING_GOOGLE3_INCLUDES)
+// When building CEF in google3, use the google3 header directly, but keep the
+// namespaced CEF logging declarations and implementations (but not the macros).
+#include "base/logging.h"
+#endif // USING_GOOGLE3_INCLUDES
+
#include "include/base/cef_build.h"
#include "include/base/cef_macros.h"
#include "include/internal/cef_logging_internal.h"
@@ -198,6 +204,8 @@ const LogSeverity LOG_DFATAL = LOG_ERROR;
const LogSeverity LOG_DFATAL = LOG_FATAL;
#endif
+#if !defined(USING_GOOGLE3_INCLUDES)
+
// A few definitions of macros that don't generate much code. These are used
// by LOG() and LOG_IF, etc. Since these are used all over our code, it's
// better to have compact code for these operations.
@@ -355,6 +363,8 @@ const LogSeverity LOG_0 = LOG_ERROR;
(val1), (val2), #val1 " " #op " " #val2)) \
cef::logging::LogMessage(__FILE__, __LINE__, _result).stream()
+#endif // !USING_GOOGLE3_INCLUDES
+
// Build the error message string. This is separate from the "Impl"
// function template because it is not performance critical and so can
// be out of line, while the "Impl" code should be inline. Caller
@@ -392,6 +402,8 @@ extern template std::string* MakeCheckOpString<std::string, std::string>(
const char* name);
#endif
+#if !defined(USING_GOOGLE3_INCLUDES)
+
// Helper functions for CHECK_OP macro.
// The (int, int) specialization works around the issue that the compiler
// will not instantiate the template version of the function on values of
@@ -432,12 +444,16 @@ DEFINE_CHECK_OP_IMPL(GT, >)
#define ENABLE_DLOG 1
#endif
+#endif // !USING_GOOGLE3_INCLUDES
+
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define DCHECK_IS_ON() 0
#else
#define DCHECK_IS_ON() 1
#endif
+#if !defined(USING_GOOGLE3_INCLUDES)
+
// Definitions for DLOG et al.
#if ENABLE_DLOG
@@ -553,6 +569,8 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2)
#define DCHECK_GT(val1, val2) DCHECK_OP(GT, >, val1, val2)
+#endif // !USING_GOOGLE3_INCLUDES
+
#if defined(NDEBUG) && defined(OS_CHROMEOS)
#define NOTREACHED() \
LOG(ERROR) << "NOTREACHED() hit in " << __FUNCTION__ << ". "
@@ -560,10 +578,14 @@ const LogSeverity LOG_DCHECK = LOG_INFO;
#define NOTREACHED() DCHECK(false)
#endif
+#if !defined(USING_GOOGLE3_INCLUDES)
+
// Redefine the standard assert to use our nice log files
#undef assert
#define assert(x) DLOG_ASSERT(x)
+#endif // !USING_GOOGLE3_INCLUDES
+
// This class more or less represents a particular log message. You
// create an instance of LogMessage and then stream stuff to it.
// When you finish streaming to it, ~LogMessage is called and the
@@ -706,6 +728,8 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
return out << wstr.c_str();
}
+#if !defined(USING_GOOGLE3_INCLUDES)
+
// The NOTIMPLEMENTED() macro annotates codepaths which have
// not been implemented yet.
//
@@ -755,6 +779,8 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
EAT_STREAM_PARAMETERS
#endif
+#endif // !USING_GOOGLE3_INCLUDES
+
#endif // !USING_CHROMIUM_INCLUDES
#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_
diff --git include/base/cef_macros.h include/base/cef_macros.h
index e714529cd..67588c615 100644
--- include/base/cef_macros.h
+++ include/base/cef_macros.h
@@ -35,8 +35,10 @@
#if defined(USING_CHROMIUM_INCLUDES)
// When building CEF include the Chromium header directly.
#include "base/macros.h"
-
-#else // !USING_CHROMIUM_INCLUDES
+#elif defined(USING_GOOGLE3_INCLUDES)
+// When building CEF in google3, use the google3 header directly.
+#include "base/macros.h"
+#else // !USING_GOOGLE3_INCLUDES
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.
diff --git include/base/cef_platform_thread.h include/base/cef_platform_thread.h
index d3fdd798e..15cb0951b 100644
--- include/base/cef_platform_thread.h
+++ include/base/cef_platform_thread.h
@@ -35,7 +35,7 @@
#ifndef CEF_INCLUDE_BASE_PLATFORM_THREAD_H_
#define CEF_INCLUDE_BASE_PLATFORM_THREAD_H_
-#if defined(BASE_THREADING_PLATFORM_THREAD_H_)
+#if defined(BASE_THREADING_PLATFORM_THREAD_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_ref_counted.h include/base/cef_ref_counted.h
index 7a687070c..93d8cbeaa 100644
--- include/base/cef_ref_counted.h
+++ include/base/cef_ref_counted.h
@@ -33,7 +33,7 @@
#define CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_
#pragma once
-#if defined(BASE_MEMORY_REF_COUNTED_H_)
+#if defined(BASE_MEMORY_REF_COUNTED_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_scoped_ptr.h include/base/cef_scoped_ptr.h
index eb9e0e29b..6efc7ca85 100644
--- include/base/cef_scoped_ptr.h
+++ include/base/cef_scoped_ptr.h
@@ -114,7 +114,7 @@
#define CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_
#pragma once
-#if defined(BASE_MEMORY_SCOPED_PTR_H_)
+#if defined(BASE_MEMORY_SCOPED_PTR_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_string16.h include/base/cef_string16.h
index 6afcb79bd..e5cbaa861 100644
--- include/base/cef_string16.h
+++ include/base/cef_string16.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_STRING16_H_
#pragma once
-#if defined(BASE_STRINGS_STRING16_H_)
+#if defined(BASE_STRINGS_STRING16_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_template_util.h include/base/cef_template_util.h
index 38fa5839c..6c70dd2ac 100644
--- include/base/cef_template_util.h
+++ include/base/cef_template_util.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
#pragma once
-#if defined(BASE_TEMPLATE_UTIL_H_)
+#if defined(BASE_TEMPLATE_UTIL_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_thread_checker.h include/base/cef_thread_checker.h
index e48c8d033..c582e1377 100644
--- include/base/cef_thread_checker.h
+++ include/base/cef_thread_checker.h
@@ -32,7 +32,7 @@
#define CEF_INCLUDE_BASE_THREAD_CHECKER_H_
#pragma once
-#if defined(BASE_THREADING_THREAD_CHECKER_H_)
+#if defined(BASE_THREADING_THREAD_CHECKER_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_tuple.h include/base/cef_tuple.h
index aeb6e9cea..f6b86167f 100644
--- include/base/cef_tuple.h
+++ include/base/cef_tuple.h
@@ -56,7 +56,7 @@
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
#pragma once
-#if defined(BASE_TUPLE_H_)
+#if defined(BASE_TUPLE_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include
diff --git include/base/cef_weak_ptr.h include/base/cef_weak_ptr.h
index 1ba34b9db..2cf2f1787 100644
--- include/base/cef_weak_ptr.h
+++ include/base/cef_weak_ptr.h
@@ -96,7 +96,7 @@
#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
#pragma once
-#if defined(BASE_MEMORY_WEAK_PTR_H_)
+#if defined(BASE_MEMORY_WEAK_PTR_H_) && !defined(USING_GOOGLE3_INCLUDES)
// Do nothing if the Chromium header has already been included.
// This can happen in cases where Chromium code is used directly by the
// client application. When using Chromium code directly always include