mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 0bfd25d4 (#381305)
- Delete include/cef_runnable.h (issue #1336). - Build the cef_unittests target using all Chromium headers. Add a USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests target to support this. This change avoids compile errors due to the divergence of CEF and Chromium base/ header implementations. The libcef_dll_wrapper sources must now compile successfully with both CEF and Chromium base/ headers (issue #1632). - The onbeforeunload message specified via JavaScript is no longer passed to the client (see http://crbug.com/587940).
This commit is contained in:
@ -44,10 +44,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/atomic_ref_count.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -121,6 +121,6 @@ inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_
|
||||
|
@ -59,10 +59,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/atomicops.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -193,6 +193,6 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
|
||||
#include "include/base/internal/cef_atomicops_atomicword_compat.h"
|
||||
#endif
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/bind.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -543,6 +543,6 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_BIND_H_
|
||||
|
@ -175,10 +175,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/bind_helpers.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -581,6 +581,6 @@ void DeletePointer(T* obj) {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_
|
||||
|
@ -32,10 +32,10 @@
|
||||
#define CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/compiler_specific.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -165,7 +165,7 @@
|
||||
#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
|
||||
#endif
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
// Annotate a virtual method indicating it must be overriding a virtual method
|
||||
// in the parent class.
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/callback.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -802,6 +802,6 @@ typedef Callback<void(void)> Closure;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/callback_forward.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -54,6 +54,6 @@ typedef Callback<void(void)> Closure;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !!BUILDING_CEF_SHARED
|
||||
#endif // !!USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_
|
||||
|
@ -46,10 +46,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/callback_helpers.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -88,6 +88,6 @@ class ScopedClosureRunner {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/callback_list.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -439,6 +439,6 @@ class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_
|
||||
|
@ -74,10 +74,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/cancelable_callback.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -309,6 +309,6 @@ typedef CancelableCallback<void(void)> CancelableClosure;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/synchronization/lock.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -162,6 +162,6 @@ class AutoUnlock {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_
|
||||
|
@ -149,10 +149,10 @@
|
||||
#define DCHECK_IS_ON() 1
|
||||
#endif
|
||||
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/logging.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -747,6 +747,6 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
|
||||
EAT_STREAM_PARAMETERS
|
||||
#endif
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_
|
||||
|
@ -32,10 +32,14 @@
|
||||
#define CEF_INCLUDE_BASE_CEF_MACROS_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/macros.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
|
||||
// Chromium uses movable types.
|
||||
#define MOVE_SCOPED_PTR(var) std::move(var)
|
||||
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -43,40 +47,8 @@
|
||||
#include <stddef.h> // For size_t.
|
||||
#include "include/base/cef_build.h" // For COMPILER_MSVC
|
||||
|
||||
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
|
||||
#if defined(COMPILER_MSVC)
|
||||
|
||||
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
||||
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
||||
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
|
||||
__pragma(warning(disable:n))
|
||||
|
||||
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
|
||||
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
|
||||
// warnings.
|
||||
#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n))
|
||||
|
||||
// Pop effects of innermost MSVC_PUSH_* macro.
|
||||
#define MSVC_POP_WARNING() __pragma(warning(pop))
|
||||
|
||||
// Allows |this| to be passed as an argument in constructor initializer lists.
|
||||
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
|
||||
// having the warning be disabled for more than just |code|.
|
||||
//
|
||||
// Example usage:
|
||||
// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {}
|
||||
//
|
||||
// Compiler warning C4355: 'this': used in base member initializer list:
|
||||
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||
code \
|
||||
MSVC_POP_WARNING()
|
||||
#else // !COMPILER_MSVC
|
||||
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
||||
|
||||
#endif // !COMPILER_MSVC
|
||||
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
|
||||
// CEF does not use movable types.
|
||||
#define MOVE_SCOPED_PTR(var) var.Pass()
|
||||
|
||||
#if !defined(arraysize)
|
||||
|
||||
@ -214,6 +186,41 @@ struct CompileAssert {
|
||||
|
||||
#endif // !defined(COMPILE_ASSERT)
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST)
|
||||
#if defined(COMPILER_MSVC)
|
||||
|
||||
// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled.
|
||||
// The warning remains disabled until popped by MSVC_POP_WARNING.
|
||||
#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
|
||||
__pragma(warning(disable:n))
|
||||
|
||||
// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level
|
||||
// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all
|
||||
// warnings.
|
||||
#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n))
|
||||
|
||||
// Pop effects of innermost MSVC_PUSH_* macro.
|
||||
#define MSVC_POP_WARNING() __pragma(warning(pop))
|
||||
|
||||
// Allows |this| to be passed as an argument in constructor initializer lists.
|
||||
// This uses push/pop instead of the seemingly simpler suppress feature to avoid
|
||||
// having the warning be disabled for more than just |code|.
|
||||
//
|
||||
// Example usage:
|
||||
// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {}
|
||||
//
|
||||
// Compiler warning C4355: 'this': used in base member initializer list:
|
||||
// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
|
||||
code \
|
||||
MSVC_POP_WARNING()
|
||||
#else // !COMPILER_MSVC
|
||||
|
||||
#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
|
||||
|
||||
#endif // !COMPILER_MSVC
|
||||
#endif // !ALLOW_THIS_IN_INITIALIZER_LIST
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_
|
||||
|
@ -36,10 +36,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/move.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -254,6 +254,6 @@
|
||||
typedef void MoveOnlyTypeForCPP03; \
|
||||
private:
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_MOVE_H_
|
||||
|
@ -40,10 +40,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/threading/platform_thread.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -108,6 +108,6 @@ inline PlatformThreadRef CurrentRef() {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_
|
||||
|
@ -38,10 +38,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/memory/ref_counted.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -381,6 +381,6 @@ scoped_refptr<T> make_scoped_refptr(T* t) {
|
||||
return scoped_refptr<T>(t);
|
||||
}
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_
|
||||
|
@ -119,10 +119,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -619,6 +619,6 @@ scoped_ptr<T> make_scoped_ptr(T* ptr) {
|
||||
return scoped_ptr<T>(ptr);
|
||||
}
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/strings/string16.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -222,6 +222,6 @@ class std::basic_string<base::char16, base::string16_char_traits>;
|
||||
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_STRING16_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/template_util.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -187,6 +187,6 @@ struct enable_if<true, T> { typedef T type; };
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/threading/thread_checker.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -121,6 +121,6 @@ class ThreadChecker : public cef_internal::ThreadCheckerDoNothing {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_
|
||||
|
@ -37,10 +37,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/threading/thread_collision_warner.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -282,6 +282,6 @@ class ThreadCollisionWarner {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_
|
||||
|
@ -145,10 +145,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/debug/trace_event.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -422,6 +422,6 @@ class CefTraceEndOnScopeClose {
|
||||
|
||||
} // cef_trace_event
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_
|
||||
|
@ -57,84 +57,14 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(BASE_TUPLE_H_)
|
||||
// The Chromium header has already been included.
|
||||
// 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
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
|
||||
// For legacy compatibility, we name the first 8 tuple elements "a", "b", ...
|
||||
// TODO(cef): Remove this code when cef_runnable.h is deleted.
|
||||
|
||||
namespace base {
|
||||
|
||||
#define DEFINE_TUPLE_LEAF(N, x) \
|
||||
template <typename T> \
|
||||
struct TupleLeaf<N, T> { \
|
||||
TupleLeaf() {} \
|
||||
explicit TupleLeaf(typename TupleTraits<T>::ParamType x) : x(x) {} \
|
||||
\
|
||||
T& get() { return x; } \
|
||||
const T& get() const { return x; } \
|
||||
\
|
||||
T x; \
|
||||
}
|
||||
|
||||
DEFINE_TUPLE_LEAF(0, a);
|
||||
DEFINE_TUPLE_LEAF(1, b);
|
||||
DEFINE_TUPLE_LEAF(2, c);
|
||||
DEFINE_TUPLE_LEAF(3, d);
|
||||
DEFINE_TUPLE_LEAF(4, e);
|
||||
DEFINE_TUPLE_LEAF(5, f);
|
||||
DEFINE_TUPLE_LEAF(6, g);
|
||||
DEFINE_TUPLE_LEAF(7, h);
|
||||
|
||||
#undef DEFINE_TUPLE_LEAF
|
||||
|
||||
// Deprecated compat aliases
|
||||
// TODO(cef): Remove this code when cef_runnable.h is deleted.
|
||||
|
||||
using Tuple0 = Tuple<>;
|
||||
template <typename A>
|
||||
using Tuple1 = Tuple<A>;
|
||||
template <typename A, typename B>
|
||||
using Tuple2 = Tuple<A, B>;
|
||||
template <typename A, typename B, typename C>
|
||||
using Tuple3 = Tuple<A, B, C>;
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
using Tuple4 = Tuple<A, B, C, D>;
|
||||
template <typename A, typename B, typename C, typename D, typename E>
|
||||
using Tuple5 = Tuple<A, B, C, D, E>;
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F>
|
||||
using Tuple6 = Tuple<A, B, C, D, E, F>;
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F,
|
||||
typename G>
|
||||
using Tuple7 = Tuple<A, B, C, D, E, F, G>;
|
||||
template <typename A,
|
||||
typename B,
|
||||
typename C,
|
||||
typename D,
|
||||
typename E,
|
||||
typename F,
|
||||
typename G,
|
||||
typename H>
|
||||
using Tuple8 = Tuple<A, B, C, D, E, F, G, H>;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/tuple.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -1402,6 +1332,6 @@ inline void DispatchToMethod(ObjT* obj, Method method,
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_
|
||||
|
@ -101,10 +101,10 @@
|
||||
// This can happen in cases where Chromium code is used directly by the
|
||||
// client application. When using Chromium code directly always include
|
||||
// the Chromium header first to avoid type conflicts.
|
||||
#elif defined(BUILDING_CEF_SHARED)
|
||||
#elif defined(USING_CHROMIUM_INCLUDES)
|
||||
// When building CEF include the Chromium header directly.
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#else // !BUILDING_CEF_SHARED
|
||||
#else // !USING_CHROMIUM_INCLUDES
|
||||
// The following is substantially similar to the Chromium implementation.
|
||||
// If the Chromium implementation diverges the below implementation should be
|
||||
// updated to match.
|
||||
@ -383,6 +383,6 @@ WeakPtr<Derived> AsWeakPtr(Derived* t) {
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
#endif // !USING_CHROMIUM_INCLUDES
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#if defined(OS_MACOSX) && defined(__OBJC__)
|
||||
|
||||
#ifdef BUILDING_CEF_SHARED
|
||||
#ifdef USING_CHROMIUM_INCLUDES
|
||||
|
||||
// Use the existing CrAppControlProtocol definition.
|
||||
#import "base/mac/scoped_sending_event.h"
|
||||
@ -52,7 +52,7 @@
|
||||
// Use the existing empty protocol definitions.
|
||||
#import "base/mac/sdk_forward_declarations.h"
|
||||
|
||||
#else // BUILDING_CEF_SHARED
|
||||
#else // USING_CHROMIUM_INCLUDES
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
@ -146,7 +146,7 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // USING_CHROMIUM_INCLUDES
|
||||
|
||||
// Forward declarations for APIs that are part of the 10.7 SDK. This will allow
|
||||
// using them when building with the 10.6 SDK.
|
||||
|
@ -1,333 +0,0 @@
|
||||
// Copyright (c) 2013 Marshall A. Greenblatt. Portions Copyright (c)
|
||||
// 2006-2011 Google Inc. All rights reserved.
|
||||
//
|
||||
// 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.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "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.
|
||||
//
|
||||
// The contents of this file are a modified extract of base/task.h
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_
|
||||
#define CEF_INCLUDE_CEF_RUNNABLE_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
// The implementation of cef_runnable.h depends on an obsolete version of
|
||||
// base/tuple.h that is implemented by cef_tuple.h for client applications but
|
||||
// is not compatible with the version used when building Chromium/CEF.
|
||||
#error This header cannot be used when building Chromium/CEF.
|
||||
#endif
|
||||
|
||||
#include "include/base/cef_tuple.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_task.h"
|
||||
|
||||
// CefRunnableMethodTraits -----------------------------------------------------
|
||||
//
|
||||
// This traits-class is used by CefRunnableMethod to manage the lifetime of the
|
||||
// callee object. By default, it is assumed that the callee supports AddRef
|
||||
// and Release methods. A particular class can specialize this template to
|
||||
// define other lifetime management. For example, if the callee is known to
|
||||
// live longer than the CefRunnableMethod object, then a CefRunnableMethodTraits
|
||||
// struct could be defined with empty RetainCallee and ReleaseCallee methods.
|
||||
//
|
||||
// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way
|
||||
// for declaring a CefRunnableMethodTraits that disables refcounting.
|
||||
|
||||
template <class T>
|
||||
struct CefRunnableMethodTraits {
|
||||
CefRunnableMethodTraits() {
|
||||
}
|
||||
|
||||
~CefRunnableMethodTraits() {
|
||||
}
|
||||
|
||||
void RetainCallee(T* obj) {
|
||||
#ifndef NDEBUG
|
||||
// Catch NewCefRunnableMethod being called in an object's constructor.
|
||||
// This isn't safe since the method can be invoked before the constructor
|
||||
// completes, causing the object to be deleted.
|
||||
obj->AddRef();
|
||||
obj->Release();
|
||||
#endif
|
||||
obj->AddRef();
|
||||
}
|
||||
|
||||
void ReleaseCallee(T* obj) {
|
||||
obj->Release();
|
||||
}
|
||||
};
|
||||
|
||||
// Convenience macro for declaring a CefRunnableMethodTraits that disables
|
||||
// refcounting of a class. This is useful if you know that the callee
|
||||
// will outlive the CefRunnableMethod object and thus do not need the ref
|
||||
// counts.
|
||||
//
|
||||
// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the
|
||||
// global namespace scope. Example:
|
||||
//
|
||||
// namespace foo {
|
||||
// class Bar {
|
||||
// ...
|
||||
// };
|
||||
// } // namespace foo
|
||||
//
|
||||
// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar);
|
||||
//
|
||||
// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the
|
||||
// class.
|
||||
#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \
|
||||
template <> \
|
||||
struct CefRunnableMethodTraits<TypeName> { \
|
||||
void RetainCallee(TypeName* manager) {} \
|
||||
void ReleaseCallee(TypeName* manager) {} \
|
||||
}
|
||||
|
||||
// CefRunnableMethod and CefRunnableFunction ----------------------------------
|
||||
//
|
||||
// CefRunnable methods are a type of task that call a function on an object
|
||||
// when they are run. We implement both an object and a set of
|
||||
// NewCefRunnableMethod and NewCefRunnableFunction functions for convenience.
|
||||
// These functions are overloaded and will infer the template types,
|
||||
// simplifying calling code.
|
||||
//
|
||||
// The template definitions all use the following names:
|
||||
// T - the class type of the object you're supplying
|
||||
// this is not needed for the Static version of the call
|
||||
// Method/Function - the signature of a pointer to the method or function you
|
||||
// want to call
|
||||
// Param - the parameter(s) to the method, possibly packed as a Tuple
|
||||
// A - the first parameter (if any) to the method
|
||||
// B - the second parameter (if any) to the method
|
||||
//
|
||||
// Put these all together and you get an object that can call a method whose
|
||||
// signature is:
|
||||
// R T::MyFunction([A[, B]])
|
||||
//
|
||||
// Usage:
|
||||
// CefPostTask(TID_UI, NewCefRunnableMethod(object, &Object::method[, a[, b]])
|
||||
// CefPostTask(TID_UI, NewCefRunnableFunction(&function[, a[, b]])
|
||||
|
||||
// CefRunnableMethod and NewCefRunnableMethod implementation ------------------
|
||||
|
||||
template <class T, class Method, class Params>
|
||||
class CefRunnableMethod : public CefTask {
|
||||
public:
|
||||
CefRunnableMethod(T* obj, Method meth, const Params& params)
|
||||
: obj_(obj), meth_(meth), params_(params) {
|
||||
traits_.RetainCallee(obj_);
|
||||
}
|
||||
|
||||
~CefRunnableMethod() {
|
||||
T* obj = obj_;
|
||||
obj_ = NULL;
|
||||
if (obj)
|
||||
traits_.ReleaseCallee(obj);
|
||||
}
|
||||
|
||||
void Execute() OVERRIDE {
|
||||
if (obj_)
|
||||
DispatchToMethod(obj_, meth_, params_);
|
||||
}
|
||||
|
||||
private:
|
||||
T* obj_;
|
||||
Method meth_;
|
||||
Params params_;
|
||||
CefRunnableMethodTraits<T> traits_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRunnableMethod);
|
||||
};
|
||||
|
||||
template <class T, class Method>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple0>(
|
||||
object, method, base::MakeTuple());
|
||||
}
|
||||
|
||||
template <class T, class Method, class A>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple1<A> >(
|
||||
object, method, base::MakeTuple(a));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple2<A, B> >(
|
||||
object, method, base::MakeTuple(a, b));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple3<A, B, C> >(
|
||||
object, method, base::MakeTuple(a, b, c));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple4<A, B, C, D> >(
|
||||
object, method, base::MakeTuple(a, b, c, d));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple5<A, B, C, D, E> >(
|
||||
object, method, base::MakeTuple(a, b, c, d, e));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E,
|
||||
class F>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple6<A, B, C, D, E, F> >(
|
||||
object, method, base::MakeTuple(a, b, c, d, e, f));
|
||||
}
|
||||
|
||||
template <class T, class Method, class A, class B, class C, class D, class E,
|
||||
class F, class G>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g) {
|
||||
return new CefRunnableMethod<T, Method, base::Tuple7<A, B, C, D, E, F, G> >(
|
||||
object, method, base::MakeTuple(a, b, c, d, e, f, g));
|
||||
}
|
||||
|
||||
// CefRunnableFunction and NewCefRunnableFunction implementation --------------
|
||||
|
||||
template <class Function, class Params>
|
||||
class CefRunnableFunction : public CefTask {
|
||||
public:
|
||||
CefRunnableFunction(Function function, const Params& params)
|
||||
: function_(function), params_(params) {
|
||||
}
|
||||
|
||||
~CefRunnableFunction() {
|
||||
}
|
||||
|
||||
void Execute() OVERRIDE {
|
||||
if (function_)
|
||||
DispatchToFunction(function_, params_);
|
||||
}
|
||||
|
||||
private:
|
||||
Function function_;
|
||||
Params params_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRunnableFunction);
|
||||
};
|
||||
|
||||
template <class Function>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function) {
|
||||
return new CefRunnableFunction<Function, base::Tuple0>(
|
||||
function, base::MakeTuple());
|
||||
}
|
||||
|
||||
template <class Function, class A>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a) {
|
||||
return new CefRunnableFunction<Function, base::Tuple1<A> >(
|
||||
function, base::MakeTuple(a));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b) {
|
||||
return new CefRunnableFunction<Function, base::Tuple2<A, B> >(
|
||||
function, base::MakeTuple(a, b));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c) {
|
||||
return new CefRunnableFunction<Function, base::Tuple3<A, B, C> >(
|
||||
function, base::MakeTuple(a, b, c));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d) {
|
||||
return new CefRunnableFunction<Function, base::Tuple4<A, B, C, D> >(
|
||||
function, base::MakeTuple(a, b, c, d));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e) {
|
||||
return new CefRunnableFunction<Function, base::Tuple5<A, B, C, D, E> >(
|
||||
function, base::MakeTuple(a, b, c, d, e));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f) {
|
||||
return new CefRunnableFunction<Function, base::Tuple6<A, B, C, D, E, F> >(
|
||||
function, base::MakeTuple(a, b, c, d, e, f));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F, class G>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g) {
|
||||
return new CefRunnableFunction<Function, base::Tuple7<A, B, C, D, E, F, G> >(
|
||||
function, base::MakeTuple(a, b, c, d, e, f, g));
|
||||
}
|
||||
|
||||
template <class Function, class A, class B, class C, class D, class E,
|
||||
class F, class G, class H>
|
||||
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
|
||||
const A& a, const B& b,
|
||||
const C& c, const D& d,
|
||||
const E& e, const F& f,
|
||||
const G& g, const H& h) {
|
||||
return new CefRunnableFunction<Function,
|
||||
base::Tuple8<A, B, C, D, E, F, G, H> >(
|
||||
function, base::MakeTuple(a, b, c, d, e, f, g, h));
|
||||
}
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RUNNABLE_H_
|
@ -37,7 +37,7 @@
|
||||
#include "include/base/cef_string16.h"
|
||||
#include "include/internal/cef_string_types.h"
|
||||
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
#include "base/files/file_path.h"
|
||||
#endif
|
||||
|
||||
@ -696,7 +696,7 @@ class CefStringBase {
|
||||
return *this;
|
||||
}
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#if defined(BUILDING_CEF_SHARED)
|
||||
#if defined(USING_CHROMIUM_INCLUDES)
|
||||
// The base::FilePath constructor is marked as explicit so provide the
|
||||
// conversion here for convenience.
|
||||
operator base::FilePath() const {
|
||||
@ -706,7 +706,7 @@ class CefStringBase {
|
||||
return base::FilePath(ToString());
|
||||
#endif
|
||||
}
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // USING_CHROMIUM_INCLUDES
|
||||
|
||||
private:
|
||||
// Allocate the string structure if it doesn't already exist.
|
||||
|
@ -2119,7 +2119,7 @@ typedef enum {
|
||||
// addition to their special meaning. Things like escaped letters, digits,
|
||||
// and most symbols will get unescaped with this mode.
|
||||
///
|
||||
UU_NORMAL = 1,
|
||||
UU_NORMAL = 1 << 0,
|
||||
|
||||
///
|
||||
// Convert %20 to spaces. In some places where we're showing URLs, we may
|
||||
@ -2127,31 +2127,42 @@ typedef enum {
|
||||
// you wouldn't want this since it might not be interpreted in one piece
|
||||
// by other applications.
|
||||
///
|
||||
UU_SPACES = 2,
|
||||
UU_SPACES = 1 << 1,
|
||||
|
||||
///
|
||||
// Unescapes '/' and '\\'. If these characters were unescaped, the resulting
|
||||
// URL won't be the same as the source one. Moreover, they are dangerous to
|
||||
// unescape in strings that will be used as file paths or names. This value
|
||||
// should only be used when slashes don't have special meaning, like data
|
||||
// URLs.
|
||||
///
|
||||
UU_PATH_SEPARATORS = 1 << 2,
|
||||
|
||||
///
|
||||
// Unescapes various characters that will change the meaning of URLs,
|
||||
// including '%', '+', '&', '/', '#'. If we unescaped these characters, the
|
||||
// resulting URL won't be the same as the source one. This flag is used when
|
||||
// generating final output like filenames for URLs where we won't be
|
||||
// interpreting as a URL and want to do as much unescaping as possible.
|
||||
// including '%', '+', '&', '#'. Does not unescape path separators.
|
||||
// If these characters were unescaped, the resulting URL won't be the same
|
||||
// as the source one. This flag is used when generating final output like
|
||||
// filenames for URLs where we won't be interpreting as a URL and want to do
|
||||
// as much unescaping as possible.
|
||||
///
|
||||
UU_URL_SPECIAL_CHARS = 4,
|
||||
UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3,
|
||||
|
||||
///
|
||||
// Unescapes control characters such as %01. This INCLUDES NULLs. This is
|
||||
// used for rare cases such as data: URL decoding where the result is binary
|
||||
// data. This flag also unescapes BiDi control characters.
|
||||
// Unescapes characters that can be used in spoofing attempts (such as LOCK)
|
||||
// and control characters (such as BiDi control characters and %01). This
|
||||
// INCLUDES NULLs. This is used for rare cases such as data: URL decoding
|
||||
// where the result is binary data.
|
||||
//
|
||||
// DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI
|
||||
// for security reasons.
|
||||
// DO NOT use UU_SPOOFING_AND_CONTROL_CHARS if the URL is going to be
|
||||
// displayed in the UI for security reasons.
|
||||
///
|
||||
UU_CONTROL_CHARS = 8,
|
||||
UU_SPOOFING_AND_CONTROL_CHARS = 1 << 4,
|
||||
|
||||
///
|
||||
// URL queries use "+" for space. This flag controls that replacement.
|
||||
///
|
||||
UU_REPLACE_PLUS_WITH_SPACE = 16,
|
||||
UU_REPLACE_PLUS_WITH_SPACE = 1 << 5,
|
||||
} cef_uri_unescape_rule_t;
|
||||
|
||||
///
|
||||
|
Reference in New Issue
Block a user