Update to Chromium revision 14bd12d6 (#333041)

- Remove CefNavigationEntry::GetFrameName() (see http://crbug.com/477150#c5).
- Devirtualize base::BindState (see http://crbug.com/486594).
- Move Tuple to the base namespace.
This commit is contained in:
Marshall Greenblatt
2015-06-05 18:06:48 -04:00
parent d820080479
commit 378a64b39a
77 changed files with 523 additions and 549 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'c03558c9998c74e25c302a1f5e9e164b572b9373',
'chromium_checkout': '14bd12d63019fbdd6f9d6c16b986a5f64a21264b',
}

View File

@ -874,11 +874,13 @@
# zip_analyzer_results.h via chrome_utility_messages.h
'<(DEPTH)/chrome/chrome.gyp:safe_browsing_proto',
'<(DEPTH)/components/components.gyp:crash_component_breakpad_mac_to_be_deleted',
'<(DEPTH)/components/components.gyp:devtools_discovery',
'<(DEPTH)/components/components.gyp:devtools_http_handler',
'<(DEPTH)/components/components.gyp:keyed_service_content',
'<(DEPTH)/components/components.gyp:keyed_service_core',
'<(DEPTH)/components/components.gyp:navigation_interception',
'<(DEPTH)/components/components.gyp:pdf_renderer',
'<(DEPTH)/components/components.gyp:plugins_renderer',
'<(DEPTH)/components/components.gyp:pref_registry',
'<(DEPTH)/components/components.gyp:printing_common',
'<(DEPTH)/components/components.gyp:printing_renderer',

View File

@ -57,7 +57,7 @@
namespace base {
namespace subtle {
namespace cef_subtle {
class RefCountedBase {
public:
@ -141,7 +141,7 @@ class RefCountedThreadSafeBase {
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
};
} // namespace subtle
} // namespace cef_subtle
//
// A base class for reference counted classes. Otherwise, known as a cheap
@ -158,16 +158,16 @@ class RefCountedThreadSafeBase {
// You should always make your destructor private, to avoid any code deleting
// the object accidently while there are references to it.
template <class T>
class RefCounted : public subtle::RefCountedBase {
class RefCounted : public cef_subtle::RefCountedBase {
public:
RefCounted() {}
void AddRef() const {
subtle::RefCountedBase::AddRef();
cef_subtle::RefCountedBase::AddRef();
}
void Release() const {
if (subtle::RefCountedBase::Release()) {
if (cef_subtle::RefCountedBase::Release()) {
delete static_cast<const T*>(this);
}
}
@ -208,16 +208,16 @@ struct DefaultRefCountedThreadSafeTraits {
// friend class base::RefCountedThreadSafe<MyFoo>;
// ~MyFoo();
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase {
class RefCountedThreadSafe : public cef_subtle::RefCountedThreadSafeBase {
public:
RefCountedThreadSafe() {}
void AddRef() const {
subtle::RefCountedThreadSafeBase::AddRef();
cef_subtle::RefCountedThreadSafeBase::AddRef();
}
void Release() const {
if (subtle::RefCountedThreadSafeBase::Release()) {
if (cef_subtle::RefCountedThreadSafeBase::Release()) {
Traits::Destruct(static_cast<const T*>(this));
}
}

View File

@ -56,7 +56,7 @@
#define CEF_INCLUDE_BASE_CEF_TUPLE_H_
#pragma once
#if defined(BASE_TUPLE_H__)
#if defined(BASE_TUPLE_H_)
// 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
@ -65,6 +65,8 @@
// 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> { \
@ -127,6 +129,8 @@ template <typename A,
typename H>
using Tuple8 = Tuple<A, B, C, D, E, F, G, H>;
} // namespace base
#elif defined(BUILDING_CEF_SHARED)
// When building CEF include the Chromium header directly.
#include "base/tuple.h"
@ -137,6 +141,8 @@ using Tuple8 = Tuple<A, B, C, D, E, F, G, H>;
#include "include/base/cef_bind_helpers.h"
namespace base {
// Traits ----------------------------------------------------------------------
//
// A simple traits class for tuple arguments.
@ -1394,6 +1400,8 @@ inline void DispatchToMethod(ObjT* obj, Method method,
&out->e);
}
} // namespace base
#endif // !BUILDING_CEF_SHARED
#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_

View File

@ -2554,22 +2554,27 @@ template <typename Runnable, typename RunType, typename BoundArgsType>
struct BindState;
template <typename Runnable, typename RunType>
struct BindState<Runnable, RunType, void()> : public BindStateBase {
struct BindState<Runnable, RunType, void()> final : public BindStateBase {
typedef Runnable RunnableType;
typedef false_type IsWeakCall;
typedef Invoker<0, BindState, RunType> InvokerType;
typedef typename InvokerType::UnboundRunType UnboundRunType;
explicit BindState(const Runnable& runnable)
: runnable_(runnable) {
: BindStateBase(&Destroy),
runnable_(runnable) {
}
virtual ~BindState() { }
~BindState() { }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
};
template <typename Runnable, typename RunType, typename P1>
struct BindState<Runnable, RunType, void(P1)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1)> final : public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<1, BindState, RunType> InvokerType;
@ -2579,20 +2584,25 @@ struct BindState<Runnable, RunType, void(P1)> : public BindStateBase {
typedef UnwrapTraits<P1> Bound1UnwrapTraits;
BindState(const Runnable& runnable, const P1& p1)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1) {
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
};
template <typename Runnable, typename RunType, typename P1, typename P2>
struct BindState<Runnable, RunType, void(P1, P2)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2)> final : public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<2, BindState, RunType> InvokerType;
@ -2603,15 +2613,20 @@ struct BindState<Runnable, RunType, void(P1, P2)> : public BindStateBase {
typedef UnwrapTraits<P2> Bound2UnwrapTraits;
BindState(const Runnable& runnable, const P1& p1, const P2& p2)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2) {
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;
@ -2619,7 +2634,8 @@ struct BindState<Runnable, RunType, void(P1, P2)> : public BindStateBase {
template <typename Runnable, typename RunType, typename P1, typename P2,
typename P3>
struct BindState<Runnable, RunType, void(P1, P2, P3)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2, P3)> final
: public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<3, BindState, RunType> InvokerType;
@ -2631,16 +2647,21 @@ struct BindState<Runnable, RunType, void(P1, P2, P3)> : public BindStateBase {
typedef UnwrapTraits<P3> Bound3UnwrapTraits;
BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2),
p3_(p3) {
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;
@ -2649,8 +2670,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3)> : public BindStateBase {
template <typename Runnable, typename RunType, typename P1, typename P2,
typename P3, typename P4>
struct BindState<Runnable, RunType, void(P1, P2, P3,
P4)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2, P3, P4)> final
: public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<4, BindState, RunType> InvokerType;
@ -2664,7 +2685,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3,
BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
const P4& p4)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2),
p3_(p3),
@ -2672,9 +2694,13 @@ struct BindState<Runnable, RunType, void(P1, P2, P3,
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;
@ -2684,8 +2710,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3,
template <typename Runnable, typename RunType, typename P1, typename P2,
typename P3, typename P4, typename P5>
struct BindState<Runnable, RunType, void(P1, P2, P3, P4,
P5)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5)> final
: public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<5, BindState, RunType> InvokerType;
@ -2700,7 +2726,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4,
BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
const P4& p4, const P5& p5)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2),
p3_(p3),
@ -2709,9 +2736,13 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4,
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;
@ -2722,8 +2753,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4,
template <typename Runnable, typename RunType, typename P1, typename P2,
typename P3, typename P4, typename P5, typename P6>
struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,
P6)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6)> final
: public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<6, BindState, RunType> InvokerType;
@ -2739,7 +2770,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,
BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
const P4& p4, const P5& p5, const P6& p6)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2),
p3_(p3),
@ -2749,9 +2781,13 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;
@ -2763,8 +2799,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5,
template <typename Runnable, typename RunType, typename P1, typename P2,
typename P3, typename P4, typename P5, typename P6, typename P7>
struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6,
P7)> : public BindStateBase {
struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7)> final
: public BindStateBase {
typedef Runnable RunnableType;
typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall;
typedef Invoker<7, BindState, RunType> InvokerType;
@ -2781,7 +2817,8 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6,
BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3,
const P4& p4, const P5& p5, const P6& p6, const P7& p7)
: runnable_(runnable),
: BindStateBase(&Destroy),
runnable_(runnable),
p1_(p1),
p2_(p2),
p3_(p3),
@ -2792,9 +2829,13 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6,
MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_);
}
virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value,
P1>::Release(p1_); }
static void Destroy(BindStateBase* self) {
delete static_cast<BindState*>(self);
}
RunnableType runnable_;
P1 p1_;
P2 p2_;

View File

@ -38,25 +38,43 @@
#include <stddef.h>
#include "include/base/cef_atomic_ref_count.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/base/cef_template_util.h"
template <typename T>
class ScopedVector;
namespace base {
namespace cef_internal {
class CallbackBase;
// BindStateBase is used to provide an opaque handle that the Callback
// class can use to represent a function object with bound arguments. It
// behaves as an existential type that is used by a corresponding
// DoInvoke function to perform the function execution. This allows
// us to shield the Callback class from the types of the bound argument via
// "type erasure."
class BindStateBase : public RefCountedThreadSafe<BindStateBase> {
// At the base level, the only task is to add reference counting data. Don't use
// RefCountedThreadSafe since it requires the destructor to be a virtual method.
// Creating a vtable for every BindState template instantiation results in a lot
// of bloat. Its only task is to call the destructor which can be done with a
// function pointer.
class BindStateBase {
protected:
friend class RefCountedThreadSafe<BindStateBase>;
virtual ~BindStateBase() {}
explicit BindStateBase(void (*destructor)(BindStateBase*))
: ref_count_(0), destructor_(destructor) {}
~BindStateBase() = default;
private:
friend class scoped_refptr<BindStateBase>;
friend class CallbackBase;
void AddRef();
void Release();
AtomicRefCount ref_count_;
// Pointer to a function that will properly destroy |this|.
void (*destructor_)(BindStateBase*);
DISALLOW_COPY_AND_ASSIGN(BindStateBase);
};
// Holds the Callback methods that don't require specialization to reduce

View File

@ -101,14 +101,6 @@ typedef struct _cef_navigation_entry_t {
///
int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self);
///
// Returns the name of the sub-frame that navigated or an NULL value if the
// main frame navigated.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_frame_name)(
struct _cef_navigation_entry_t* self);
///
// Returns the time for the last known successful navigation completion. A
// navigation may be completed more than once if the page is reloaded. May be

View File

@ -93,13 +93,6 @@ class CefNavigationEntry : public virtual CefBase {
/*--cef()--*/
virtual bool HasPostData() =0;
///
// Returns the name of the sub-frame that navigated or an empty value if the
// main frame navigated.
///
/*--cef()--*/
virtual CefString GetFrameName() =0;
///
// Returns the time for the last known successful navigation completion. A
// navigation may be completed more than once if the page is reloaded. May be

View File

@ -164,41 +164,38 @@ class CefRunnableMethod : public CefTask {
template <class T, class Method>
inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method) {
return new CefRunnableMethod<T, Method, Tuple0>(object, method, MakeTuple());
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, Tuple1<A> >(object,
method,
MakeTuple(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, Tuple2<A, B> >(object, method,
MakeTuple(a, 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, Tuple3<A, B, C> >(object, method,
MakeTuple(a, b,
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, Tuple4<A, B, C, D> >(object, method,
MakeTuple(a, b,
c,
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>
@ -206,12 +203,8 @@ 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,
Tuple5<A, B, C, D, E> >(object,
method,
MakeTuple(a, b, c, d,
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,
@ -220,12 +213,8 @@ 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,
Tuple6<A, B, C, D, E, F> >(object,
method,
MakeTuple(a, b, c, d,
e, 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,
@ -235,13 +224,8 @@ inline CefRefPtr<CefTask> NewCefRunnableMethod(T* object, Method method,
const C& c, const D& d,
const E& e, const F& f,
const G& g) {
return new CefRunnableMethod<T,
Method,
Tuple7<A, B, C, D, E, F, G> >(object,
method,
MakeTuple(a, b, c,
d, e, f,
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 --------------
@ -270,39 +254,38 @@ class CefRunnableFunction : public CefTask {
template <class Function>
inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function) {
return new CefRunnableFunction<Function, Tuple0>(function, MakeTuple());
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, Tuple1<A> >(function, MakeTuple(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, Tuple2<A, B> >(function,
MakeTuple(a, 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, Tuple3<A, B, C> >(function,
MakeTuple(a, b,
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, Tuple4<A, B, C, D> >(function,
MakeTuple(a, b,
c,
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>
@ -310,8 +293,8 @@ 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, Tuple5<A, B, C, D, E> >(function,
MakeTuple(a, b, c, d, 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,
@ -320,8 +303,8 @@ 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, Tuple6<A, B, C, D, E, F> >(function,
MakeTuple(a, b, c, d, e, 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,
@ -331,8 +314,8 @@ inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const C& c, const D& d,
const E& e, const F& f,
const G& g) {
return new CefRunnableFunction<Function, Tuple7<A, B, C, D, E, F, G> >(
function, MakeTuple(a, b, c, d, e, f, 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,
@ -342,8 +325,9 @@ inline CefRefPtr<CefTask> NewCefRunnableFunction(Function function,
const C& c, const D& d,
const E& e, const F& f,
const G& g, const H& h) {
return new CefRunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >(
function, MakeTuple(a, b, c, d, e, f, g, 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_

View File

@ -3226,7 +3226,6 @@ void CefBrowserHostImpl::OnRunFileChooserUploadFolderDelegateCallback(
} else {
lister_.reset(new net::DirectoryLister(
file_paths[0],
true,
net::DirectoryLister::NO_SORT,
new UploadFolderHelper(
base::Bind(&CefBrowserHostImpl::OnRunFileChooserDelegateCallback,

View File

@ -211,8 +211,8 @@ class CefBrowserURLRequest::Context
fetcher_delegate_.reset(
new CefURLFetcherDelegate(this, request_->GetFlags()));
fetcher_.reset(net::URLFetcher::Create(url, request_type,
fetcher_delegate_.get()));
fetcher_ = net::URLFetcher::Create(url, request_type,
fetcher_delegate_.get());
DCHECK(url_request_getter_.get());
fetcher_->SetRequestContext(url_request_getter_.get());

View File

@ -18,9 +18,9 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/net/sqlite_persistent_cookie_store.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/parsed_cookie.h"
#include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
#include "net/url_request/url_request_context.h"
#include "url/gurl.h"
@ -309,7 +309,7 @@ bool CefCookieManagerImpl::SetStoragePath(
return true;
}
scoped_refptr<content::SQLitePersistentCookieStore> persistent_store;
scoped_refptr<net::SQLitePersistentCookieStore> persistent_store;
if (!new_path.empty()) {
// TODO(cef): Move directory creation to the blocking pool instead of
// allowing file IO on this thread.
@ -318,12 +318,11 @@ bool CefCookieManagerImpl::SetStoragePath(
base::CreateDirectory(new_path)) {
const base::FilePath& cookie_path = new_path.AppendASCII("Cookies");
persistent_store =
new content::SQLitePersistentCookieStore(
new net::SQLitePersistentCookieStore(
cookie_path,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
persist_session_cookies,
NULL,
NULL);
} else {
NOTREACHED() << "The cookie storage directory could not be created";

View File

@ -17,8 +17,9 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/devtools_agent_host.h"
#include "base/time/time.h"
#include "components/devtools_discovery/basic_target_descriptor.h"
#include "components/devtools_discovery/devtools_discovery_manager.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/devtools_target.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
@ -35,10 +36,6 @@
namespace {
const char kTargetTypePage[] = "page";
const char kTargetTypeServiceWorker[] = "service_worker";
const char kTargetTypeOther[] = "other";
const int kBackLog = 10;
class TCPServerSocketFactory
@ -72,67 +69,6 @@ scoped_ptr<devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>
new TCPServerSocketFactory("127.0.0.1", port));
}
class Target : public content::DevToolsTarget {
public:
explicit Target(scoped_refptr<content::DevToolsAgentHost> agent_host);
std::string GetId() const override { return agent_host_->GetId(); }
std::string GetParentId() const override { return std::string(); }
std::string GetType() const override {
switch (agent_host_->GetType()) {
case content::DevToolsAgentHost::TYPE_WEB_CONTENTS:
return kTargetTypePage;
case content::DevToolsAgentHost::TYPE_SERVICE_WORKER:
return kTargetTypeServiceWorker;
default:
break;
}
return kTargetTypeOther;
}
std::string GetTitle() const override {
return agent_host_->GetTitle();
}
std::string GetDescription() const override { return std::string(); }
GURL GetURL() const override { return agent_host_->GetURL(); }
GURL GetFaviconURL() const override { return favicon_url_; }
base::TimeTicks GetLastActivityTime() const override {
return last_activity_time_;
}
bool IsAttached() const override {
return agent_host_->IsAttached();
}
scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const
override {
return agent_host_;
}
bool Activate() const override;
bool Close() const override;
private:
scoped_refptr<content::DevToolsAgentHost> agent_host_;
GURL favicon_url_;
base::TimeTicks last_activity_time_;
};
Target::Target(scoped_refptr<content::DevToolsAgentHost> agent_host)
: agent_host_(agent_host) {
if (content::WebContents* web_contents = agent_host_->GetWebContents()) {
content::NavigationController& controller = web_contents->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry();
if (entry != NULL && entry->GetURL().is_valid())
favicon_url_ = entry->GetFavicon().url;
last_activity_time_ = web_contents->GetLastActiveTime();
}
}
bool Target::Activate() const {
return agent_host_->Activate();
}
bool Target::Close() const {
return agent_host_->Close();
}
} // namespace
// CefDevToolsDelegate
@ -142,7 +78,6 @@ CefDevToolsDelegate::CefDevToolsDelegate(uint16 port) {
CreateSocketFactory(port),
std::string(),
this,
new CefDevToolsManagerDelegate(),
base::FilePath(),
base::FilePath(),
std::string(),
@ -167,6 +102,10 @@ std::string CefDevToolsDelegate::GetDiscoveryPageHTML() {
IDR_CEF_DEVTOOLS_DISCOVERY_PAGE, ui::SCALE_FACTOR_NONE).as_string();
}
std::string CefDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
return std::string();
}
std::string CefDevToolsDelegate::GetFrontendResource(
const std::string& path) {
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
@ -190,24 +129,3 @@ base::DictionaryValue* CefDevToolsManagerDelegate::HandleCommand(
base::DictionaryValue* command) {
return NULL;
}
std::string CefDevToolsManagerDelegate::GetPageThumbnailData(
const GURL& url) {
return std::string();
}
scoped_ptr<content::DevToolsTarget>
CefDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
return scoped_ptr<content::DevToolsTarget>();
}
void CefDevToolsManagerDelegate::EnumerateTargets(TargetCallback callback) {
TargetList targets;
content::DevToolsAgentHost::List agents =
content::DevToolsAgentHost::GetOrCreateAll();
for (content::DevToolsAgentHost::List::iterator it = agents.begin();
it != agents.end(); ++it) {
targets.push_back(new Target(*it));
}
callback.Run(targets);
}

View File

@ -33,6 +33,7 @@ class CefDevToolsDelegate :
// DevToolsHttpHandlerDelegate overrides.
std::string GetDiscoveryPageHTML() override;
std::string GetFrontendResource(const std::string& path) override;
std::string GetPageThumbnailData(const GURL& url) override;
// Returns the chrome-devtools URL.
std::string GetChromeDevToolsURL();
@ -56,10 +57,6 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
base::DictionaryValue* HandleCommand(
content::DevToolsAgentHost* agent_host,
base::DictionaryValue* command) override;
scoped_ptr<content::DevToolsTarget> CreateNewTarget(
const GURL& url) override;
void EnumerateTargets(TargetCallback callback) override;
std::string GetPageThumbnailData(const GURL& url) override;
private:
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate);

View File

@ -204,7 +204,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
std::string method;
base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL;
scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
scoped_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message ||
!parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method)) {
@ -241,7 +241,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
}
net::URLFetcher* fetcher =
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this);
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release();
pending_requests_[fetcher] = request_id;
fetcher->SetRequestContext(web_contents()->GetBrowserContext()->
GetRequestContext());
@ -292,9 +292,9 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
base::FundamentalValue total_size(static_cast<int>(message.length()));
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
base::StringValue message_value(message.substr(pos, kMaxMessageChunkSize));
std::string param;
base::JSONWriter::Write(&message_value, &param);
base::JSONWriter::Write(
base::StringValue(message.substr(pos, kMaxMessageChunkSize)), &param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
@ -333,13 +333,13 @@ void CefDevToolsFrontend::CallClientFunction(
std::string javascript = function_name + "(";
if (arg1) {
std::string json;
base::JSONWriter::Write(arg1, &json);
base::JSONWriter::Write(*arg1, &json);
javascript.append(json);
if (arg2) {
base::JSONWriter::Write(arg2, &json);
base::JSONWriter::Write(*arg2, &json);
javascript.append(", ").append(json);
if (arg3) {
base::JSONWriter::Write(arg3, &json);
base::JSONWriter::Write(*arg3, &json);
javascript.append(", ").append(json);
}
}

View File

@ -51,11 +51,6 @@ bool CefNavigationEntryImpl::HasPostData() {
return const_value().GetHasPostData();
}
CefString CefNavigationEntryImpl::GetFrameName() {
CEF_VALUE_VERIFY_RETURN(false, CefString());
return const_value().GetFrameToNavigate();
}
CefTime CefNavigationEntryImpl::GetCompletionTime() {
CefTime time;
CEF_VALUE_VERIFY_RETURN(false, time);

View File

@ -13,7 +13,7 @@ namespace content {
class NavigationEntry;
}
// CefDownloadItem implementation
// CefNavigationEntry implementation
class CefNavigationEntryImpl
: public CefValueBase<CefNavigationEntry, content::NavigationEntry> {
public:
@ -27,7 +27,6 @@ class CefNavigationEntryImpl
CefString GetTitle() override;
TransitionType GetTransitionType() override;
bool HasPostData() override;
CefString GetFrameName() override;
CefTime GetCompletionTime() override;
int GetHttpStatusCode() override;

View File

@ -56,13 +56,13 @@ void GetMachineIDAsync(
DeviceIDFetcher::DeviceIDFetcher(int render_process_id)
: in_progress_(false), render_process_id_(render_process_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
DeviceIDFetcher::~DeviceIDFetcher() {}
bool DeviceIDFetcher::Start(const IDCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (in_progress_)
return false;
@ -80,11 +80,8 @@ bool DeviceIDFetcher::Start(const IDCallback& callback) {
// static
void DeviceIDFetcher::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* prefs) {
prefs->RegisterBooleanPref(prefs::kEnableDRM,
true,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
prefs->RegisterStringPref(
prefs::kDRMSalt, "", user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
prefs->RegisterBooleanPref(prefs::kEnableDRM, true);
prefs->RegisterStringPref(prefs::kDRMSalt, "");
}
// static
@ -94,7 +91,7 @@ base::FilePath DeviceIDFetcher::GetLegacyDeviceIDPath(
}
void DeviceIDFetcher::CheckPrefsOnUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderProcessHost* render_process_host =
RenderProcessHost::FromID(render_process_id_);
@ -142,7 +139,7 @@ void DeviceIDFetcher::CheckPrefsOnUIThread() {
void DeviceIDFetcher::ComputeOnUIThread(const std::string& salt,
const std::string& machine_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (machine_id.empty()) {
LOG(ERROR) << "Empty machine id";

View File

@ -62,7 +62,7 @@ CefPermissionManager::~CefPermissionManager() {
void CefPermissionManager::RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& requesting_origin,
bool user_gesture,
@ -77,7 +77,7 @@ void CefPermissionManager::RequestPermission(
bool proceed = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
CefBrowserHostImpl::GetBrowserForHost(render_frame_host);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
@ -105,7 +105,7 @@ void CefPermissionManager::RequestPermission(
void CefPermissionManager::CancelPermissionRequest(
content::PermissionType permission,
content::WebContents* web_contents,
content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& requesting_origin) {
CEF_REQUIRE_UIT();
@ -114,7 +114,7 @@ void CefPermissionManager::CancelPermissionRequest(
return;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
CefBrowserHostImpl::GetBrowserForHost(render_frame_host);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {

View File

@ -17,13 +17,13 @@ class CefPermissionManager : public content::PermissionManager {
// PermissionManager implementation.
void RequestPermission(
content::PermissionType permission,
content::WebContents* web_contents,
content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override;
void CancelPermissionRequest(content::PermissionType permission,
content::WebContents* web_contents,
content::RenderFrameHost* render_frame_host,
int request_id,
const GURL& requesting_origin) override;
void ResetPermission(content::PermissionType permission,

View File

@ -10,6 +10,7 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "cc/base/switches.h"
#include "cc/output/copy_output_request.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "content/browser/bad_message.h"
@ -710,9 +711,6 @@ void CefRenderWidgetHostViewOSR::MovePluginWindows(
const std::vector<content::WebPluginGeometry>& moves) {
}
void CefRenderWidgetHostViewOSR::Blur() {
}
void CefRenderWidgetHostViewOSR::UpdateCursor(
const content::WebCursor& cursor) {
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::UpdateCursor");
@ -1280,7 +1278,7 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() {
}
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableBeginFrameScheduling)) {
if (command_line->HasSwitch(cc::switches::kEnableBeginFrameScheduling)) {
if (begin_frame_timer_.get()) {
begin_frame_timer_->SetFrameRateThresholdMs(frame_rate_threshold_ms_);
} else {

View File

@ -123,7 +123,6 @@ class CefRenderWidgetHostViewOSR
content::RenderWidgetHostView* reference_host_view) override;
void MovePluginWindows(
const std::vector<content::WebPluginGeometry>& moves) override;
void Blur() override;
void UpdateCursor(const content::WebCursor& cursor) override;
void SetIsLoading(bool is_loading) override;
void TextInputTypeChanged(ui::TextInputType type,

View File

@ -92,7 +92,10 @@ void CefResourceDispatcherHostDelegate::RequestBeginning(
bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
const GURL& url,
int child_id,
int route_id) {
int route_id,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture) {
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForView(child_id, route_id);
if (browser.get())

View File

@ -25,7 +25,10 @@ class CefResourceDispatcherHostDelegate
ScopedVector<content::ResourceThrottle>* throttles) override;
bool HandleExternalProtocol(const GURL& url,
int child_id,
int route_id) override;
int route_id,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture) override;
void OnRequestRedirected(
const GURL& redirect_url,
net::URLRequest* request,

View File

@ -81,14 +81,6 @@ void CefSoftwareOutputDeviceOSR::EndPaint(cc::SoftwareFrameData* frame_data) {
OnPaint(damage_rect_);
}
void CefSoftwareOutputDeviceOSR::CopyToPixels(const gfx::Rect& rect,
void* pixels) {
CEF_REQUIRE_UIT();
DCHECK(canvas_.get());
SkImageInfo info = SkImageInfo::MakeN32Premul(rect.width(), rect.height());
canvas_->readPixels(info, pixels, info.minRowBytes(), rect.x(), rect.y());
}
void CefSoftwareOutputDeviceOSR::SetActive(bool active) {
if (active == active_)
return;

View File

@ -31,7 +31,6 @@ class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice {
float scale_factor) override;
SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
void EndPaint(cc::SoftwareFrameData* frame_data) override;
void CopyToPixels(const gfx::Rect& rect, void* pixels) override;
void SetActive(bool active);

View File

@ -84,3 +84,14 @@ SSLHostStateDelegate::CertJudgment CefSSLHostStateDelegate::QueryPolicy(
? SSLHostStateDelegate::ALLOWED
: SSLHostStateDelegate::DENIED;
}
void CefSSLHostStateDelegate::RevokeUserAllowExceptions(
const std::string& host) {
cert_policy_for_host_.erase(host);
}
bool CefSSLHostStateDelegate::HasAllowException(const std::string& host) const {
auto policy_iterator = cert_policy_for_host_.find(host);
return policy_iterator != cert_policy_for_host_.end() &&
policy_iterator->second.HasAllowException();
}

View File

@ -13,6 +13,8 @@
#include "net/cert/cert_status_flags.h"
#include "net/cert/x509_certificate.h"
// Implementation based on android_webview/browser/aw_ssl_host_state_delegate.h.
namespace internal {
// This class maintains the policy for storing actions on certificate errors.
@ -29,6 +31,10 @@ class CertPolicy {
// remember the user's choice.
void Allow(const net::X509Certificate& cert, net::CertStatus error);
// Returns true if and only if there exists a user allow exception for some
// certificate.
bool HasAllowException() const { return allowed_.size() > 0; }
private:
// The set of fingerprints of allowed certificates.
std::map<net::SHA256HashValue, net::CertStatus, net::SHA256HashValueLessThan>
@ -42,27 +48,21 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate {
CefSSLHostStateDelegate();
~CefSSLHostStateDelegate() override;
// Records that |cert| is permitted to be used for |host| in the future, for
// a specified |error| type.
// SSLHostStateDelegate methods:
void AllowCert(const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error) override;
void Clear() override;
// Queries whether |cert| is allowed or denied for |host| and |error|.
content::SSLHostStateDelegate::CertJudgment QueryPolicy(
const std::string& host,
const net::X509Certificate& cert,
net::CertStatus error,
bool* expired_previous_decision) override;
// Records that a host has run insecure content.
void HostRanInsecureContent(const std::string& host, int pid) override;
// Returns whether the specified host ran insecure content.
bool DidHostRunInsecureContent(const std::string& host,
int pid) const override;
void RevokeUserAllowExceptions(const std::string& host) override;
bool HasAllowException(const std::string& host) const override;
private:
// Certificate policies for each host.

View File

@ -48,5 +48,5 @@ bool CefEndTracing(const CefString& tracing_file,
}
int64 CefNowFromSystemTraceTime() {
return base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
return base::TraceTicks::Now().ToInternalValue();
}

View File

@ -57,8 +57,7 @@ bool CefTraceSubscriber::BeginTracing(
}
TracingController::GetInstance()->EnableRecording(
base::trace_event::CategoryFilter(categories),
base::trace_event::TraceOptions(),
base::trace_event::TraceConfig(categories, ""),
done_callback);
return true;
}

View File

@ -25,13 +25,13 @@
#include "base/threading/thread_restrictions.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/net/proxy_service_factory.h"
#include "content/browser/net/sqlite_persistent_cookie_store.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "net/cert/cert_verifier.h"
#include "net/cookies/cookie_monster.h"
#include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
#include "net/dns/host_resolver.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_handler_factory.h"
@ -294,7 +294,7 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath(
return;
}
scoped_refptr<content::SQLitePersistentCookieStore> persistent_store;
scoped_refptr<net::SQLitePersistentCookieStore> persistent_store;
if (!path.empty()) {
// TODO(cef): Move directory creation to the blocking pool instead of
// allowing file IO on this thread.
@ -303,12 +303,11 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath(
base::CreateDirectory(path)) {
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
persistent_store =
new content::SQLitePersistentCookieStore(
new net::SQLitePersistentCookieStore(
cookie_path,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
persist_session_cookies,
NULL,
NULL);
} else {
NOTREACHED() << "The cookie storage directory could not be created";

View File

@ -31,7 +31,9 @@ struct ParamTraits<net::UploadElement> {
}
}
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
static bool Read(const Message* m,
base::PickleIterator* iter,
param_type* r) {
int type;
if (!ReadParam(m, iter, &type))
return false;
@ -80,8 +82,9 @@ void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m,
}
}
bool ParamTraits<scoped_refptr<net::UploadData> >::Read(const Message* m,
PickleIterator* iter,
bool ParamTraits<scoped_refptr<net::UploadData> >::Read(
const Message* m,
base::PickleIterator* iter,
param_type* r) {
bool has_object;
if (!ReadParam(m, iter, &has_object))

View File

@ -211,7 +211,7 @@ template <>
struct ParamTraits<scoped_refptr<net::UploadData> > {
typedef scoped_refptr<net::UploadData> param_type;
static void Write(Message* m, const param_type& p);
static bool Read(const Message* m, PickleIterator* iter, param_type* r);
static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
static void Log(const param_type& p, std::string* l);
};

View File

@ -87,12 +87,12 @@ bool CefCommandLineImpl::HasSwitches() {
bool CefCommandLineImpl::HasSwitch(const CefString& name) {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().HasSwitch(name);
return const_value().HasSwitch(name.ToString());
}
CefString CefCommandLineImpl::GetSwitchValue(const CefString& name) {
CEF_VALUE_VERIFY_RETURN(false, CefString());
return const_value().GetSwitchValueNative(name);
return const_value().GetSwitchValueNative(name.ToString());
}
void CefCommandLineImpl::GetSwitches(SwitchMap& switches) {

View File

@ -34,10 +34,10 @@ int GetJSONWriterOptions(cef_json_writer_options_t options) {
CefRefPtr<CefValue> CefParseJSON(const CefString& json_string,
cef_json_parser_options_t options) {
const std::string& json = json_string.ToString();
base::Value* parse_result =
scoped_ptr<base::Value> parse_result =
base::JSONReader::Read(json, GetJSONReaderOptions(options));
if (parse_result)
return new CefValueImpl(parse_result);
return new CefValueImpl(parse_result.release());
return NULL;
}
@ -50,10 +50,10 @@ CefRefPtr<CefValue> CefParseJSONAndReturnError(
int error_code;
std::string error_msg;
base::Value* parse_result = base::JSONReader::ReadAndReturnError(
scoped_ptr<base::Value> parse_result = base::JSONReader::ReadAndReturnError(
json, GetJSONReaderOptions(options), &error_code, &error_msg);
if (parse_result)
return new CefValueImpl(parse_result);
return new CefValueImpl(parse_result.release());
error_code_out = static_cast<cef_json_parser_error_t>(error_code);
error_msg_out = error_msg;
@ -69,7 +69,7 @@ CefString CefWriteJSON(CefRefPtr<CefValue> node,
CefValueImpl::ScopedLockedValue scoped_value(impl);
std::string json_string;
if (base::JSONWriter::WriteWithOptions(scoped_value.value(),
if (base::JSONWriter::WriteWithOptions(*scoped_value.value(),
GetJSONWriterOptions(options),
&json_string)) {
return json_string;

View File

@ -11,7 +11,7 @@
// static
CefRefPtr<CefValue> CefValue::Create() {
return new CefValueImpl(base::Value::CreateNullValue());
return new CefValueImpl(base::Value::CreateNullValue().release());
}
// static
@ -290,7 +290,7 @@ CefRefPtr<CefListValue> CefValueImpl::GetList() {
}
bool CefValueImpl::SetNull() {
SetValue(base::Value::CreateNullValue());
SetValue(base::Value::CreateNullValue().release());
return true;
}
@ -676,7 +676,7 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::Copy(
base::DictionaryValue* value;
if (exclude_empty_children) {
value = const_cast<base::DictionaryValue&>(
const_value()).DeepCopyWithoutEmptyChildren();
const_value()).DeepCopyWithoutEmptyChildren().release();
} else {
value = const_value().DeepCopy();
}
@ -884,7 +884,7 @@ bool CefDictionaryValueImpl::SetValue(const CefString& key,
bool CefDictionaryValueImpl::SetNull(const CefString& key) {
CEF_VALUE_VERIFY_RETURN(true, false);
SetInternal(key, base::Value::CreateNullValue());
SetInternal(key, base::Value::CreateNullValue().release());
return true;
}
@ -1285,7 +1285,7 @@ bool CefListValueImpl::SetValue(int index, CefRefPtr<CefValue> value) {
bool CefListValueImpl::SetNull(int index) {
CEF_VALUE_VERIFY_RETURN(true, false);
SetInternal(index, base::Value::CreateNullValue());
SetInternal(index, base::Value::CreateNullValue().release());
return true;
}

View File

@ -149,10 +149,6 @@ class CefPrintWebViewHelperDelegate :
return blink::WebElement();
}
bool IsOutOfProcessPdfEnabled() override {
return false;
}
bool IsPrintPreviewEnabled() override {
return false;
}
@ -234,10 +230,6 @@ void CefContentRendererClient::WebKitInitialized() {
// TODO(cef): Enable these once the implementation supports it.
blink::WebRuntimeFeatures::enableNotifications(false);
// TODO(cef): Remove this line once off-screen rendering is fixed to work
// with the new popup menu implementation (issue #1566).
blink::WebRuntimeFeatures::enableFeatureFromString("HTMLPopupMenu", false);
const CefContentClient::SchemeInfoList* schemes =
CefContentClient::Get()->GetCustomSchemes();
if (!schemes->empty()) {

View File

@ -388,7 +388,7 @@ CefString CefDOMNodeImpl::GetElementInnerText() {
}
WebElement element = node_.to<blink::WebElement>();
const WebString& text = element.innerText();
const WebString& text = element.textContent();
if (!text.isNull())
str = text;

View File

@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "content/common/devtools_messages.h"
#include "content/renderer/devtools/devtools_agent.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "url/gurl.h"
@ -31,15 +32,17 @@ void CefRenderMessageFilter::OnFilterRemoved() {
bool CefRenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
if (message.type() == DevToolsAgentMsg_Attach::ID ||
message.type() == DevToolsAgentMsg_Detach::ID) {
// Observe the DevTools messages but don't handle them.
if (message.type() == DevToolsAgentMsg_Attach::ID) {
handled = false;
} else if (message.type() == DevToolsAgentMsg_Detach::ID) {
OnDevToolsAgentDetach(message.routing_id());
return false;
}
IPC_BEGIN_MESSAGE_MAP(CefRenderMessageFilter, message)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Attach, OnDevToolsAgentAttach)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Detach, OnDevToolsAgentDetach)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@ -51,12 +54,10 @@ void CefRenderMessageFilter::OnDevToolsAgentAttach(
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentAttach_RT, this));
}
void CefRenderMessageFilter::OnDevToolsAgentDetach() {
// CefContentRendererClient::DevToolsAgentDetached() needs to be called after
// the IPC message has been handled by DevToolsAgent. A workaround for this is
// to first post to the IO thread and then post to the renderer thread.
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_IOT, this));
void CefRenderMessageFilter::OnDevToolsAgentDetach(int32 routing_id) {
CEF_POST_TASK_RT(
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, this,
routing_id));
}
void CefRenderMessageFilter::OnDevToolsAgentAttach_RT() {
@ -64,12 +65,21 @@ void CefRenderMessageFilter::OnDevToolsAgentAttach_RT() {
CefContentRendererClient::Get()->DevToolsAgentAttached();
}
void CefRenderMessageFilter::OnDevToolsAgentDetach_IOT() {
CEF_POST_TASK_RT(
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, this));
}
void CefRenderMessageFilter::OnDevToolsAgentDetach_RT() {
void CefRenderMessageFilter::OnDevToolsAgentDetach_RT(int32 routing_id) {
CEF_REQUIRE_RT();
// Wait for the DevToolsAgent to detach. It would be better to receive
// notification when the DevToolsAgent detaches but that's not currently
// available.
content::DevToolsAgent* agent =
content::DevToolsAgent::FromRoutingId(routing_id);
if (agent && agent->IsAttached()) {
// Try again in a bit.
CEF_POST_DELAYED_TASK_RT(
base::Bind(&CefRenderMessageFilter::OnDevToolsAgentDetach_RT, this,
routing_id), 50);
return;
}
CefContentRendererClient::Get()->DevToolsAgentDetached();
}

View File

@ -24,11 +24,10 @@ class CefRenderMessageFilter : public IPC::MessageFilter {
private:
// Message handlers called on the IO thread.
void OnDevToolsAgentAttach(const std::string& host_id);
void OnDevToolsAgentDetach();
void OnDevToolsAgentDetach(int32 routing_id);
void OnDevToolsAgentAttach_RT();
void OnDevToolsAgentDetach_IOT();
void OnDevToolsAgentDetach_RT();
void OnDevToolsAgentDetach_RT(int32 routing_id);
IPC::Sender* sender_;

View File

@ -654,7 +654,6 @@ void MessageListenerCallbackImpl(v8::Handle<v8::Message> message,
v8::Isolate* isolate = GetIsolateManager()->isolate();
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
v8::Local<v8::StackTrace> v8Stack = message->GetStackTrace();
DCHECK(!v8Stack.IsEmpty());
CefRefPtr<CefV8StackTrace> stackTrace =
new CefV8StackTraceImpl(isolate, v8Stack);
@ -2049,11 +2048,14 @@ CefRefPtr<CefV8StackTrace> CefV8StackTrace::GetCurrent(int frame_limit) {
CefV8StackTraceImpl::CefV8StackTraceImpl(
v8::Isolate* isolate,
v8::Local<v8::StackTrace> handle) {
if (!handle.IsEmpty()) {
int frame_count = handle->GetFrameCount();
if (frame_count > 0) {
frames_.reserve(frame_count);
for (int i = 0; i < frame_count; ++i)
frames_.push_back(new CefV8StackFrameImpl(isolate, handle->GetFrame(i)));
frames_.push_back(
new CefV8StackFrameImpl(isolate, handle->GetFrame(i)));
}
}
}

View File

@ -76,7 +76,7 @@ std::string DumpDocumentText(blink::WebFrame* frame) {
if (document_element.isNull())
return std::string();
return document_element.innerText().utf8();
return document_element.textContent().utf8();
}
bool SetNodeValue(blink::WebNode& node, const blink::WebString& value) {

View File

@ -9,6 +9,15 @@
namespace base {
namespace cef_internal {
void BindStateBase::AddRef() {
AtomicRefCountInc(&ref_count_);
}
void BindStateBase::Release() {
if (!AtomicRefCountDec(&ref_count_))
destructor_(this);
}
void CallbackBase::Reset() {
polymorphic_invoke_ = NULL;
// NULL the bind_state_ last, since it may be holding the last ref to whatever
@ -24,7 +33,7 @@ bool CallbackBase::Equals(const CallbackBase& other) const {
CallbackBase::CallbackBase(BindStateBase* bind_state)
: bind_state_(bind_state),
polymorphic_invoke_(NULL) {
DCHECK(!bind_state_.get() || bind_state_->HasOneRef());
DCHECK(!bind_state_.get() || bind_state_->ref_count_ == 1);
}
CallbackBase::~CallbackBase() {

View File

@ -7,7 +7,7 @@
namespace base {
namespace subtle {
namespace cef_subtle {
bool RefCountedThreadSafeBase::HasOneRef() const {
return AtomicRefCountIsOne(
@ -48,6 +48,6 @@ bool RefCountedThreadSafeBase::Release() const {
return false;
}
} // namespace subtle
} // namespace cef_subtle
} // namespace base

View File

@ -67,7 +67,8 @@ void CEF_CALLBACK drag_handler_on_draggable_regions_changed(
std::vector<CefDraggableRegion > regionsList;
if (regionsCount > 0) {
for (size_t i = 0; i < regionsCount; ++i) {
regionsList.push_back(regions[i]);
CefDraggableRegion regionsVal = regions[i];
regionsList.push_back(regionsVal);
}
}

View File

@ -123,21 +123,6 @@ int CEF_CALLBACK navigation_entry_has_post_data(
return _retval;
}
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_frame_name(
struct _cef_navigation_entry_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetFrameName();
// Return type: string
return _retval.DetachToUserFree();
}
cef_time_t CEF_CALLBACK navigation_entry_get_completion_time(
struct _cef_navigation_entry_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -181,7 +166,6 @@ CefNavigationEntryCppToC::CefNavigationEntryCppToC() {
GetStruct()->get_title = navigation_entry_get_title;
GetStruct()->get_transition_type = navigation_entry_get_transition_type;
GetStruct()->has_post_data = navigation_entry_has_post_data;
GetStruct()->get_frame_name = navigation_entry_get_frame_name;
GetStruct()->get_completion_time = navigation_entry_get_completion_time;
GetStruct()->get_http_status_code = navigation_entry_get_http_status_code;
}

View File

@ -209,7 +209,8 @@ void CEF_CALLBACK print_settings_set_page_ranges(
std::vector<CefPageRange > rangesList;
if (rangesCount > 0) {
for (size_t i = 0; i < rangesCount; ++i) {
rangesList.push_back(ranges[i]);
CefPageRange rangesVal = ranges[i];
rangesList.push_back(rangesVal);
}
}

View File

@ -235,7 +235,8 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
std::vector<CefRect > dirtyRectsList;
if (dirtyRectsCount > 0) {
for (size_t i = 0; i < dirtyRectsCount; ++i) {
dirtyRectsList.push_back(dirtyRects[i]);
CefRect dirtyRectsVal = dirtyRects[i];
dirtyRectsList.push_back(dirtyRectsVal);
}
}

View File

@ -231,7 +231,8 @@ int CEF_CALLBACK translator_test_set_int_list(
std::vector<int > valList;
if (valCount > 0) {
for (size_t i = 0; i < valCount; ++i) {
valList.push_back(val[i]);
int valVal = val[i];
valList.push_back(valVal);
}
}
@ -586,7 +587,8 @@ int CEF_CALLBACK translator_test_set_point_list(
std::vector<CefPoint > valList;
if (valCount > 0) {
for (size_t i = 0; i < valCount; ++i) {
valList.push_back(val[i]);
CefPoint valVal = val[i];
valList.push_back(valVal);
}
}
@ -770,7 +772,9 @@ int CEF_CALLBACK translator_test_set_object_list(
std::vector<CefRefPtr<CefTranslatorTestObject> > valList;
if (valCount > 0) {
for (size_t i = 0; i < valCount; ++i) {
valList.push_back(CefTranslatorTestObjectCppToC::Unwrap(val[i]));
CefRefPtr<CefTranslatorTestObject> valVal =
CefTranslatorTestObjectCppToC::Unwrap(val[i]);
valList.push_back(valVal);
}
}
@ -943,7 +947,9 @@ int CEF_CALLBACK translator_test_set_handler_list(
std::vector<CefRefPtr<CefTranslatorTestHandler> > valList;
if (valCount > 0) {
for (size_t i = 0; i < valCount; ++i) {
valList.push_back(CefTranslatorTestHandlerCToCpp::Wrap(val[i]));
CefRefPtr<CefTranslatorTestHandler> valVal =
CefTranslatorTestHandlerCToCpp::Wrap(val[i]);
valList.push_back(valVal);
}
}

View File

@ -52,7 +52,8 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self,
std::vector<CefRefPtr<CefV8Value> > argumentsList;
if (argumentsCount > 0) {
for (size_t i = 0; i < argumentsCount; ++i) {
argumentsList.push_back(CefV8ValueCToCpp::Wrap(arguments[i]));
CefRefPtr<CefV8Value> argumentsVal = CefV8ValueCToCpp::Wrap(arguments[i]);
argumentsList.push_back(argumentsVal);
}
}
// Translate param: retval; type: refptr_diff_byref

View File

@ -863,7 +863,9 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function(
std::vector<CefRefPtr<CefV8Value> > argumentsList;
if (argumentsCount > 0) {
for (size_t i = 0; i < argumentsCount; ++i) {
argumentsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i]));
CefRefPtr<CefV8Value> argumentsVal = CefV8ValueCppToC::Unwrap(
arguments[i]);
argumentsList.push_back(argumentsVal);
}
}
@ -899,7 +901,9 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function_with_context(
std::vector<CefRefPtr<CefV8Value> > argumentsList;
if (argumentsCount > 0) {
for (size_t i = 0; i < argumentsCount; ++i) {
argumentsList.push_back(CefV8ValueCppToC::Unwrap(arguments[i]));
CefRefPtr<CefV8Value> argumentsVal = CefV8ValueCppToC::Unwrap(
arguments[i]);
argumentsList.push_back(argumentsVal);
}
}

View File

@ -122,22 +122,6 @@ bool CefNavigationEntryCToCpp::HasPostData() {
return _retval?true:false;
}
CefString CefNavigationEntryCToCpp::GetFrameName() {
cef_navigation_entry_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_frame_name))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = _struct->get_frame_name(_struct);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefTime CefNavigationEntryCToCpp::GetCompletionTime() {
cef_navigation_entry_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_completion_time))

View File

@ -38,7 +38,6 @@ class CefNavigationEntryCToCpp
CefString GetTitle() OVERRIDE;
TransitionType GetTransitionType() OVERRIDE;
bool HasPostData() OVERRIDE;
CefString GetFrameName() OVERRIDE;
CefTime GetCompletionTime() OVERRIDE;
int GetHttpStatusCode() OVERRIDE;
};

View File

@ -1,10 +1,10 @@
diff --git web_contents_impl.cc web_contents_impl.cc
index 3ce4b68..465b5e1 100644
index 4ab69e9..7c119d1 100644
--- web_contents_impl.cc
+++ web_contents_impl.cc
@@ -1205,22 +1205,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
params.browser_context, params.site_instance, params.routing_id,
@@ -1232,22 +1232,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
params.main_frame_routing_id);
frame_tree_.root()->SetFrameName(params.main_frame_name);
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@ -48,7 +48,7 @@ index 3ce4b68..465b5e1 100644
}
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -1556,6 +1563,9 @@ void WebContentsImpl::CreateNewWindow(
@@ -1583,6 +1590,9 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -58,7 +58,7 @@ index 3ce4b68..465b5e1 100644
if (delegate_ &&
!delegate_->ShouldCreateWebContents(this,
route_id,
@@ -1564,7 +1574,9 @@ void WebContentsImpl::CreateNewWindow(
@@ -1591,7 +1601,9 @@ void WebContentsImpl::CreateNewWindow(
params.frame_name,
params.target_url,
partition_id,
@ -69,8 +69,8 @@ index 3ce4b68..465b5e1 100644
if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
@@ -1584,6 +1596,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.main_frame_routing_id = main_frame_route_id;
@@ -1612,6 +1624,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.main_frame_name = base::UTF16ToUTF8(params.frame_name);
create_params.opener = this;
create_params.opener_suppressed = params.opener_suppressed;
+ create_params.view = view;

View File

@ -1,5 +1,5 @@
diff --git common.gypi common.gypi
index 7c3074b..53e5f64 100644
index cfa4352..b701fcc 100644
--- common.gypi
+++ common.gypi
@@ -9,6 +9,9 @@

View File

@ -1,8 +1,8 @@
diff --git ui/browser.cc ui/browser.cc
index 8ba7764..16e15da 100644
index 1cc78f2..e2c4de0 100644
--- ui/browser.cc
+++ ui/browser.cc
@@ -1596,7 +1596,9 @@ bool Browser::ShouldCreateWebContents(
@@ -1606,7 +1606,9 @@ bool Browser::ShouldCreateWebContents(
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -14,7 +14,7 @@ index 8ba7764..16e15da 100644
// If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents(route_id,
diff --git ui/browser.h ui/browser.h
index f5d2c62..d8af427 100644
index c4a3a62..0cfedfa 100644
--- ui/browser.h
+++ ui/browser.h
@@ -590,7 +590,9 @@ class Browser : public TabStripModelObserver,

View File

@ -1,10 +1,10 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index f2d1b39..faf1f48 100644
index 68ee72c..6c8e8eb7 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -131,6 +131,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
@@ -141,6 +141,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
scoped_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
+ if (compositor->delegate()) {
+ scoped_ptr<cc::SoftwareOutputDevice> output_device =
@ -14,10 +14,10 @@ index f2d1b39..faf1f48 100644
+ }
+
#if defined(OS_WIN)
return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceWin(
compositor));
return scoped_ptr<cc::SoftwareOutputDevice>(
new SoftwareOutputDeviceWin(software_backing_.get(), compositor));
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index cf115b0..cddbaa0 100644
index e82c49d..97b438bf 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -15,6 +15,7 @@
@ -28,7 +28,7 @@ index cf115b0..cddbaa0 100644
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -147,6 +148,17 @@ class COMPOSITOR_EXPORT CompositorBeginFrameObserver {
@@ -149,6 +150,17 @@ class COMPOSITOR_EXPORT CompositorBeginFrameObserver {
virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) = 0;
};
@ -46,7 +46,7 @@ index cf115b0..cddbaa0 100644
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -168,6 +180,9 @@ class COMPOSITOR_EXPORT Compositor
@@ -170,6 +182,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@ -56,7 +56,7 @@ index cf115b0..cddbaa0 100644
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -324,6 +339,8 @@ class COMPOSITOR_EXPORT Compositor
@@ -331,6 +346,8 @@ class COMPOSITOR_EXPORT Compositor
ui::ContextFactory* context_factory_;

View File

@ -1,8 +1,8 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 6e66fe3..32957fc 100644
index 524a6cd..29aac98 100644
--- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc
@@ -99,7 +99,6 @@ bool ContentRendererClient::AllowPopup() {
@@ -101,7 +101,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
@ -10,7 +10,7 @@ index 6e66fe3..32957fc 100644
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
DocumentState* document_state,
@@ -111,7 +110,6 @@ bool ContentRendererClient::HandleNavigation(
@@ -113,7 +112,6 @@ bool ContentRendererClient::HandleNavigation(
bool is_redirect) {
return false;
}
@ -19,10 +19,10 @@ index 6e66fe3..32957fc 100644
bool ContentRendererClient::ShouldFork(blink::WebFrame* frame,
const GURL& url,
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index e4e8f03..f4392d9 100644
index 8c7d4fe..b88a6c9 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -193,7 +193,6 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -197,7 +197,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
@ -30,7 +30,7 @@ index e4e8f03..f4392d9 100644
// TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351
@@ -208,7 +207,6 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -212,7 +211,6 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect);
@ -39,10 +39,10 @@ index e4e8f03..f4392d9 100644
// Returns true if we should fork a new process for the given navigation.
// If |send_referrer| is set to false (which is the default), no referrer
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 3cf9e9b..21cebc8 100644
index f67a40a..4b5b3f2 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -4186,7 +4186,6 @@ void RenderFrameImpl::OnFailedNavigation(
@@ -4088,7 +4088,6 @@ void RenderFrameImpl::OnFailedNavigation(
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
RenderFrame* render_frame,
const NavigationPolicyInfo& info) {
@ -50,7 +50,7 @@ index 3cf9e9b..21cebc8 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
@@ -4201,7 +4200,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
@@ -4103,7 +4102,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
info.isRedirect)) {
return blink::WebNavigationPolicyIgnore;
}

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids
index d56ba05..e754058 100644
index 20fc28b..85f1566 100644
--- resource_ids
+++ resource_ids
@@ -14,6 +14,12 @@

View File

@ -1,15 +1,15 @@
diff --git input_method_win.cc input_method_win.cc
index 6961683..1f8c4b2 100644
index 29413f5..e1e2bd0 100644
--- input_method_win.cc
+++ input_method_win.cc
@@ -601,7 +601,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
@@ -571,8 +571,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
// receiving keyboard input as long as it is an active window. This works well
// even when the |attached_window_handle| becomes active but has not received
// WM_FOCUS yet.
- return attached_window_handle && GetActiveWindow() == attached_window_handle;
+ // With CEF |attached_window_handle| may be a child window.
+ return attached_window_handle &&
+ GetActiveWindow() == ::GetAncestor(attached_window_handle, GA_ROOT);
+ // With CEF |toplevel_window_handle_| may be a child window.
return toplevel_window_handle_ &&
- GetActiveWindow() == toplevel_window_handle_;
+ GetActiveWindow() == ::GetAncestor(toplevel_window_handle_, GA_ROOT);
}
bool InputMethodWin::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) {

View File

@ -1,10 +1,10 @@
diff --git message_loop.cc message_loop.cc
index eb0f968..1852eb1 100644
index 4222c77..bbc04b4 100644
--- message_loop.cc
+++ message_loop.cc
@@ -152,12 +152,6 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current());
@@ -134,12 +134,6 @@ MessageLoop::~MessageLoop() {
// bound to a thread.
DCHECK(current() == this || !current());
- // iOS just attaches to the loop, it doesn't Run it.
- // TODO(stuartmorgan): Consider wiring up a Detach().

View File

@ -1,10 +1,10 @@
diff --git url_request.h url_request.h
index e623c20..c6c9058 100644
index a2b2f6b..150f19f 100644
--- url_request.h
+++ url_request.h
@@ -608,10 +608,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
return proxy_server_;
}
@@ -614,10 +614,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// or after the response headers are received.
void GetConnectionAttempts(ConnectionAttempts* out) const;
- protected:
// Allow the URLRequestJob class to control the is_pending() flag.

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index 53f1128..46bbcf8 100644
index 9c8e453..03f5d51 100644
--- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h
@@ -194,6 +194,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
@@ -192,6 +192,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,10 +11,10 @@ index 53f1128..46bbcf8 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index b61e1dc..5b55207 100644
index 6279aba..242fd16 100644
--- public/common/web_preferences.cc
+++ public/common/web_preferences.cc
@@ -189,6 +189,7 @@ WebPreferences::WebPreferences()
@@ -187,6 +187,7 @@ WebPreferences::WebPreferences()
pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
@ -23,10 +23,10 @@ index b61e1dc..5b55207 100644
slimming_paint_enabled(false),
cookie_enabled(true),
diff --git public/common/web_preferences.h public/common/web_preferences.h
index 8d25487..23b25ae 100644
index 5dfc5d5..150bdf5 100644
--- public/common/web_preferences.h
+++ public/common/web_preferences.h
@@ -181,6 +181,7 @@ struct CONTENT_EXPORT WebPreferences {
@@ -179,6 +179,7 @@ struct CONTENT_EXPORT WebPreferences {
int pinch_overlay_scrollbar_thickness;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
@ -35,10 +35,10 @@ index 8d25487..23b25ae 100644
bool slimming_paint_enabled;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 66d2c0d..1502e0a 100644
index 53ba225..d5ebdd8 100644
--- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc
@@ -950,6 +950,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
@@ -945,6 +945,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->setJavaEnabled(prefs.java_enabled);

View File

@ -1,8 +1,8 @@
diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc
index cef7a95..f05255a 100644
index 313d12d..558052c 100644
--- printing/renderer/print_web_view_helper.cc
+++ printing/renderer/print_web_view_helper.cc
@@ -73,6 +73,7 @@ const double kMinDpi = 1.0;
@@ -75,6 +75,7 @@ const double kMinDpi = 1.0;
bool g_is_preview_enabled_ = false;
#else
bool g_is_preview_enabled_ = true;
@ -10,7 +10,7 @@ index cef7a95..f05255a 100644
const char kPageLoadScriptFormat[] =
"document.open(); document.write(%s); document.close();";
@@ -87,7 +88,6 @@ void ExecuteScript(blink::WebFrame* frame,
@@ -89,7 +90,6 @@ void ExecuteScript(blink::WebFrame* frame,
std::string script = base::StringPrintf(script_format, json.c_str());
frame->executeScript(blink::WebString(base::UTF8ToUTF16(script)));
}
@ -18,7 +18,7 @@ index cef7a95..f05255a 100644
int GetDPI(const PrintMsg_Print_Params* print_params) {
#if defined(OS_MACOSX)
@@ -484,7 +484,6 @@ blink::WebView* FrameReference::view() {
@@ -474,7 +474,6 @@ blink::WebView* FrameReference::view() {
return view_;
}
@ -26,7 +26,7 @@ index cef7a95..f05255a 100644
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas,
@@ -541,7 +540,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
@@ -532,7 +531,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->close();
frame->close();
}
@ -35,10 +35,10 @@ index cef7a95..f05255a 100644
// static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h
index d040dbc..72dd76e 100644
index 341ec8e..47777b8 100644
--- printing/renderer/print_web_view_helper.h
+++ printing/renderer/print_web_view_helper.h
@@ -305,7 +305,6 @@ class PrintWebViewHelper
@@ -309,7 +309,6 @@ class PrintWebViewHelper
double* scale_factor,
PageSizeMargins* page_layout_in_points);
@ -46,7 +46,7 @@ index d040dbc..72dd76e 100644
// Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas.
static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
@@ -315,7 +314,6 @@ class PrintWebViewHelper
@@ -319,7 +318,6 @@ class PrintWebViewHelper
float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params);

View File

@ -1,8 +1,8 @@
diff --git web_contents.cc web_contents.cc
index aece7c6..63da2c9 100644
index a0c8a4d..1c102ae 100644
--- web_contents.cc
+++ web_contents.cc
@@ -18,7 +18,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
@@ -19,7 +19,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
initially_hidden(false),
guest_delegate(nullptr),
context(nullptr),
@ -13,7 +13,7 @@ index aece7c6..63da2c9 100644
WebContents::CreateParams::CreateParams(
BrowserContext* context, SiteInstance* site)
@@ -31,7 +33,9 @@ WebContents::CreateParams::CreateParams(
@@ -33,7 +35,9 @@ WebContents::CreateParams::CreateParams(
initially_hidden(false),
guest_delegate(nullptr),
context(nullptr),
@ -25,7 +25,7 @@ index aece7c6..63da2c9 100644
WebContents::CreateParams::~CreateParams() {
}
diff --git web_contents.h web_contents.h
index 4380412..a67739d 100644
index 768ece2..9c2d863 100644
--- web_contents.h
+++ web_contents.h
@@ -52,9 +52,11 @@ class PageState;
@ -40,7 +40,7 @@ index 4380412..a67739d 100644
struct CustomContextMenuContext;
struct DropData;
struct Manifest;
@@ -128,6 +130,10 @@ class WebContents : public PageNavigator,
@@ -139,6 +141,10 @@ class WebContents : public PageNavigator,
// RenderFrame, have already been created on the renderer side, and
// WebContents construction should take this into account.
bool renderer_initiated_creation;
@ -52,10 +52,10 @@ index 4380412..a67739d 100644
// Creates a new WebContents.
diff --git web_contents_delegate.cc web_contents_delegate.cc
index d4028fb..285f0c3 100644
index b1fc250..555e25d 100644
--- web_contents_delegate.cc
+++ web_contents_delegate.cc
@@ -133,7 +133,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
@@ -136,7 +136,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -67,7 +67,7 @@ index d4028fb..285f0c3 100644
}
diff --git web_contents_delegate.h web_contents_delegate.h
index ef73451..17374f1 100644
index 66439df..c8779c9 100644
--- web_contents_delegate.h
+++ web_contents_delegate.h
@@ -37,9 +37,11 @@ class DownloadItem;
@ -82,7 +82,7 @@ index ef73451..17374f1 100644
struct ColorSuggestion;
struct ContextMenuParams;
struct DropData;
@@ -292,7 +294,9 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -296,7 +298,9 @@ class CONTENT_EXPORT WebContentsDelegate {
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,

View File

@ -1,8 +1,8 @@
diff --git render_process_host_impl.cc render_process_host_impl.cc
index 1e20d8e..6c0f5f4 100644
index f32d2bb..9874d50 100644
--- render_process_host_impl.cc
+++ render_process_host_impl.cc
@@ -2111,6 +2111,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
@@ -2120,6 +2120,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
#endif
RemoveUserData(kSessionStorageHolderKey);
@ -11,7 +11,7 @@ index 1e20d8e..6c0f5f4 100644
IDMap<IPC::Listener>::iterator iter(&listeners_);
while (!iter.IsAtEnd()) {
iter.GetCurrentValue()->OnMessageReceived(
@@ -2120,8 +2122,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
@@ -2129,8 +2131,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
iter.Advance();
}

View File

@ -1,5 +1,5 @@
diff --git spellcheck_factory.cc spellcheck_factory.cc
index bd4ac1f..ce1d28e 100644
index edbed40..b9a192b 100644
--- spellcheck_factory.cc
+++ spellcheck_factory.cc
@@ -16,6 +16,13 @@

View File

@ -1,5 +1,5 @@
diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc
index 714069f..56c7fa5 100644
index c9285a0..f82f90a 100644
--- os_exchange_data_provider_aurax11.cc
+++ os_exchange_data_provider_aurax11.cc
@@ -158,7 +158,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,

View File

@ -12,10 +12,10 @@ index a8e088c..838b6a0 100644
return host ? host->GetAcceleratedWidget() : NULL;
}
diff --git desktop_aura/desktop_window_tree_host_win.cc desktop_aura/desktop_window_tree_host_win.cc
index b53fc7f..0b24d2a 100644
index a663f38..a3dacca 100644
--- desktop_aura/desktop_window_tree_host_win.cc
+++ desktop_aura/desktop_window_tree_host_win.cc
@@ -134,7 +134,9 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window,
@@ -132,7 +132,9 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window,
native_widget_delegate_);
HWND parent_hwnd = NULL;
@ -26,24 +26,16 @@ index b53fc7f..0b24d2a 100644
parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
@@ -821,6 +823,7 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
@@ -799,6 +801,7 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
// TODO(beng): inform the native_widget_delegate_.
+ GetWidget()->GetNativeWindow()->Focus();
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnFocus();
@@ -828,6 +831,7 @@ void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
}
void DesktopWindowTreeHostWin::HandleNativeBlur(HWND focused_window) {
// TODO(beng): inform the native_widget_delegate_.
+ GetWidget()->GetNativeWindow()->Blur();
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnBlur();
diff --git desktop_aura/desktop_window_tree_host_x11.cc desktop_aura/desktop_window_tree_host_x11.cc
index 125e8f0..275e0d8 100644
index 4a8f64c..369867b 100644
--- desktop_aura/desktop_window_tree_host_x11.cc
+++ desktop_aura/desktop_window_tree_host_x11.cc
@@ -153,7 +153,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
@ -66,7 +58,7 @@ index 125e8f0..275e0d8 100644
xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed();
@@ -452,6 +454,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
@@ -466,6 +468,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
}
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -75,7 +67,7 @@ index 125e8f0..275e0d8 100644
return ToDIPRect(bounds_in_pixels_);
}
@@ -894,6 +898,8 @@ void DesktopWindowTreeHostX11::Hide() {
@@ -906,6 +910,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
}
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
@ -84,7 +76,7 @@ index 125e8f0..275e0d8 100644
return bounds_in_pixels_;
}
@@ -950,6 +956,8 @@ void DesktopWindowTreeHostX11::SetBounds(
@@ -962,6 +968,8 @@ void DesktopWindowTreeHostX11::SetBounds(
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
@ -93,7 +85,7 @@ index 125e8f0..275e0d8 100644
return bounds_in_pixels_.origin();
}
@@ -1070,9 +1078,13 @@ void DesktopWindowTreeHostX11::InitX11Window(
@@ -1082,9 +1090,13 @@ void DesktopWindowTreeHostX11::InitX11Window(
}
}
@ -108,7 +100,7 @@ index 125e8f0..275e0d8 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(),
0, // border width
@@ -1719,6 +1731,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
@@ -1731,6 +1743,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
@ -120,7 +112,7 @@ index 125e8f0..275e0d8 100644
if (xev->xfocus.mode != NotifyGrab) {
ReleaseCapture();
diff --git desktop_aura/desktop_window_tree_host_x11.h desktop_aura/desktop_window_tree_host_x11.h
index 94d4b1b..2609f46 100644
index e2fd61f..46434af 100644
--- desktop_aura/desktop_window_tree_host_x11.h
+++ desktop_aura/desktop_window_tree_host_x11.h
@@ -86,6 +86,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@ -153,7 +145,7 @@ index 94d4b1b..2609f46 100644
};
diff --git widget.cc widget.cc
index 64e131e..aec1b43 100644
index b4d2a48..3890ab0 100644
--- widget.cc
+++ widget.cc
@@ -110,6 +110,7 @@ Widget::InitParams::InitParams()
@ -196,7 +188,7 @@ index 64e131e..aec1b43 100644
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git widget.h widget.h
index 59e7b1d..bf888d7 100644
index 9c21ea2..aa610fd 100644
--- widget.h
+++ widget.h
@@ -234,6 +234,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,

View File

@ -1,8 +1,8 @@
diff --git ThemeMac.mm ThemeMac.mm
index a35aaea..c049569 100644
index 20a4ff0..38cb2c4 100644
--- ThemeMac.mm
+++ ThemeMac.mm
@@ -490,7 +490,7 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
@@ -482,7 +482,7 @@ static void paintButton(ControlPart part, ControlStates states, GraphicsContext*
[buttonCell drawWithFrame:NSRect(inflatedRect) inView:view];
#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
@ -12,19 +12,18 @@ index a35aaea..c049569 100644
#endif
[buttonCell setControlView:nil];
diff --git WebCoreNSCellExtras.h WebCoreNSCellExtras.h
index 8623826..b9f683d 100644
index 54e9c9a..075e076 100644
--- WebCoreNSCellExtras.h
+++ WebCoreNSCellExtras.h
@@ -26,12 +26,12 @@
@@ -26,11 +26,11 @@
#import <AppKit/AppKit.h>
#include "platform/PlatformExport.h"
-#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING (!defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
-#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING (!defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7)
+#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 1
#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
// FIXME: Might want to use this on Mac once we only support OS X 10.8+
-@interface NSCell (WebCoreFocusRingDrawing)
+PLATFORM_EXPORT @interface NSCell (WebCoreFocusRingDrawing)
- (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;

View File

@ -1,21 +1,21 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index b47a0c6..1c59701 100644
index e1fd006..fa9486b 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -754,7 +754,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, PopupMenuClient* client)
@@ -768,7 +768,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::openPopupMenu(LocalFrame& frame, PopupMenuClient* client)
{
notifyPopupOpeningObservers();
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return adoptRefWillBeNoop(new ExternalPopupMenu(frame, client, *m_webView));
if (RuntimeEnabledFeatures::htmlPopupMenuEnabled() && RuntimeEnabledFeatures::pagePopupEnabled())
ASSERT(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index ee49268..ce794e9 100644
index 9a4161a..cf68085 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -394,6 +394,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
@@ -397,6 +397,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false)
@ -23,7 +23,7 @@ index ee49268..ce794e9 100644
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0)
@@ -4006,9 +4007,14 @@ void WebViewImpl::pageScaleFactorChanged()
@@ -3946,9 +3947,14 @@ void WebViewImpl::pageScaleFactorChanged()
m_client->pageScaleFactorChanged();
}
@ -40,10 +40,10 @@ index ee49268..ce794e9 100644
void WebViewImpl::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index 285d824..765a2dd 100644
index f222ca0..51478ce 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -391,7 +391,8 @@ public:
@@ -390,7 +390,8 @@ public:
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
@ -53,7 +53,7 @@ index 285d824..765a2dd 100644
bool contextMenuAllowed() const
{
@@ -685,6 +686,8 @@ private:
@@ -677,6 +678,8 @@ private:
bool m_contextMenuAllowed;
@ -63,10 +63,10 @@ index 285d824..765a2dd 100644
bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h
index be2c85b..1e0057e 100644
index 4046206..fd01e64 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -395,6 +395,7 @@ public:
@@ -387,6 +387,7 @@ public:
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);

View File

@ -14,6 +14,33 @@
#include "cefclient/browser/bytes_write_handler.h"
#include "cefclient/browser/main_message_loop.h"
// Forward declare methods and constants that are only available with newer SDK
// versions to avoid -Wpartial-availability compiler warnings.
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
@interface NSEvent (LionSDK)
- (NSEventPhase)phase;
@end
@interface NSView (LionSDK)
- (NSRect)convertRectFromBacking:(NSRect)aRect;
- (NSRect)convertRectToBacking:(NSRect)aRect;
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
@end
@interface NSWindow (LionSDK)
- (CGFloat)backingScaleFactor;
@end
extern "C" {
extern NSString* const NSWindowDidChangeBackingPropertiesNotification;
} // extern "C"
#endif // MAC_OS_X_VERSION_10_7
@interface BrowserOpenGLView
: NSOpenGLView <NSDraggingSource, NSDraggingDestination> {
@private
@ -652,9 +679,11 @@ BrowserOpenGLView* GLView(NSView* view) {
// This delegate method is only called on 10.7 and later, so don't worry about
// other backing changes calling it on 10.6 or earlier
CGFloat newBackingScaleFactor = [self getDeviceScaleFactor];
NSNumber* oldBackingScaleFactor =
[[notification userInfo] objectForKey:NSBackingPropertyOldScaleFactorKey];
if (newBackingScaleFactor != [oldBackingScaleFactor doubleValue]) {
CGFloat oldBackingScaleFactor = (CGFloat)[
[notification.userInfo objectForKey:@"NSBackingPropertyOldScaleFactorKey"]
doubleValue
];
if (newBackingScaleFactor != oldBackingScaleFactor) {
CefRefPtr<CefBrowser> browser = [self getBrowser];
if (browser.get())
browser->GetHost()->NotifyScreenInfoChanged();

View File

@ -323,7 +323,6 @@ class NavigationEntryVisitor : public CefNavigationEntryVisitor {
EXPECT_EQ(TT_EXPLICIT, entry->GetTransitionType());
EXPECT_FALSE(entry->HasPostData());
EXPECT_TRUE(entry->GetFrameName().empty());
EXPECT_GT(entry->GetCompletionTime().GetTimeT(), 0);
EXPECT_EQ(200, entry->GetHttpStatusCode());

View File

@ -76,7 +76,7 @@ const CefRect kExpectedRectLI[] = {
const CefRect kEditBoxRect(412, 245, 60, 22);
const CefRect kNavigateButtonRect(360, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(465, 42, 81, 302);
const CefRect kExpandedSelectRect(466, 42, 81, 334);
const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 17;
@ -85,7 +85,7 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
const CefRect kEditBoxRect(442, 251, 46, 16);
const CefRect kNavigateButtonRect(375, 275, 130, 20);
const CefRect kSelectRect(461, 21, 87, 26);
const CefRect kExpandedSelectRect(465, 42, 80, 262);
const CefRect kExpandedSelectRect(466, 42, 81, 286);
const CefRect kDropDivRect(9, 330, 52, 52);
const CefRect kDragDivRect(60, 330, 52, 52);
const int kVerticalScrollbarWidth = 15;
@ -93,7 +93,7 @@ const int kVerticalScrollbarWidth = 15;
const CefRect kEditBoxRect(434, 246, 60, 20);
const CefRect kNavigateButtonRect(380, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(465, 42, 80, 302);
const CefRect kExpandedSelectRect(466, 42, 79, 334);
const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 14;
@ -383,7 +383,10 @@ class OSRTestHandler : public RoutingTestHandler,
if (started()) {
switch (test_type_) {
case OSR_TEST_POPUP_SIZE:
EXPECT_EQ(kExpandedSelectRect, rect);
EXPECT_EQ(kExpandedSelectRect.x, rect.x);
EXPECT_EQ(kExpandedSelectRect.y, rect.y);
EXPECT_EQ(kExpandedSelectRect.width, rect.width);
EXPECT_EQ(kExpandedSelectRect.height, rect.height);
DestroySucceededTestSoon();
break;
default:
@ -564,46 +567,14 @@ class OSRTestHandler : public RoutingTestHandler,
size_t word_length = strlen(kKeyTestWord);
for (size_t i = 0; i < word_length; ++i) {
#if defined(OS_WIN)
BYTE VkCode = LOBYTE(VkKeyScanA(kKeyTestWord[i]));
UINT scanCode = MapVirtualKey(VkCode, MAPVK_VK_TO_VSC);
event.native_key_code = (scanCode << 16) | // key scan code
1; // key repeat count
event.windows_key_code = VkCode;
SendKeyEvent(browser, kKeyTestWord[i]);
#elif defined(OS_MACOSX)
osr_unittests::GetKeyEvent(event, kKeyTestCodes[i], 0);
SendKeyEvent(browser, kKeyTestCodes[i]);
#elif defined(OS_LINUX)
event.native_key_code = kNativeKeyTestCodes[i];
event.windows_key_code = kKeyTestCodes[i];
event.character = event.unmodified_character =
kNativeKeyTestCodes[i];
SendKeyEvent(browser, kNativeKeyTestCodes[i], kKeyTestCodes[i]);
#else
NOTREACHED();
#error "Unsupported platform"
#endif
event.type = KEYEVENT_RAWKEYDOWN;
browser->GetHost()->SendKeyEvent(event);
#if defined(OS_WIN)
event.windows_key_code = kKeyTestWord[i];
#elif defined(OS_MACOSX)
osr_unittests::GetKeyEvent(event, kKeyTestCodes[i], 0);
#elif defined(OS_LINUX)
event.native_key_code = kNativeKeyTestCodes[i];
event.windows_key_code = kKeyTestCodes[i];
event.character = event.unmodified_character =
kNativeKeyTestCodes[i];
#endif
event.type = KEYEVENT_CHAR;
browser->GetHost()->SendKeyEvent(event);
#if defined(OS_WIN)
event.windows_key_code = VkCode;
// bits 30 and 31 should be always 1 for WM_KEYUP
event.native_key_code |= 0xC0000000;
#elif defined(OS_MACOSX)
osr_unittests::GetKeyEvent(event, kKeyTestCodes[i], 0);
#elif defined(OS_LINUX)
event.native_key_code = kKeyTestCodes[i];
#endif
event.type = KEYEVENT_KEYUP;
browser->GetHost()->SendKeyEvent(event);
}
// click button to navigate
mouse_event.x = MiddleX(kNavigateButtonRect);
@ -690,25 +661,15 @@ class OSRTestHandler : public RoutingTestHandler,
ExpandDropDown();
// Wait for the first popup paint to occur
} else if (type == PET_POPUP) {
CefKeyEvent event;
event.is_system_key = false;
#if defined(OS_WIN)
BYTE VkCode = LOBYTE(VK_ESCAPE);
UINT scanCode = MapVirtualKey(VkCode, MAPVK_VK_TO_VSC);
event.native_key_code = (scanCode << 16) | // key scan code
1; // key repeat count
event.windows_key_code = VkCode;
SendKeyEvent(browser, VK_ESCAPE);
#elif defined(OS_MACOSX)
osr_unittests::GetKeyEvent(event, ui::VKEY_ESCAPE, 0);
SendKeyEvent(browser, ui::VKEY_ESCAPE);
#elif defined(OS_LINUX)
event.windows_key_code = ui::VKEY_ESCAPE;
event.native_key_code = XK_Escape;
event.character = event.unmodified_character = XK_Escape;
SendKeyEvent(browser, XK_Escape, ui::VKEY_ESCAPE);
#else
#error "Unsupported platform"
#endif // defined(OS_WIN)
event.type = KEYEVENT_CHAR;
browser->GetHost()->SendKeyEvent(event);
#endif
}
break;
case OSR_TEST_POPUP_SHOW:
@ -729,7 +690,14 @@ class OSRTestHandler : public RoutingTestHandler,
expanded_select_rect.width,
expanded_select_rect.height));
// first pixel of border
EXPECT_EQ(*(reinterpret_cast<const uint32*>(buffer)), 0xff7f9db9);
#if defined(OS_MACOSX)
EXPECT_EQ(0xff719bc1, *(reinterpret_cast<const uint32*>(buffer)));
#else
if (scale_factor_ == 1.0f)
EXPECT_EQ(0xffd69c2b, *(reinterpret_cast<const uint32*>(buffer)));
else if (scale_factor_ == 2.0f)
EXPECT_EQ(0xffe59700, *(reinterpret_cast<const uint32*>(buffer)));
#endif
EXPECT_EQ(expanded_select_rect.width, width);
EXPECT_EQ(expanded_select_rect.height, height);
DestroySucceededTestSoon();
@ -977,6 +945,49 @@ class OSRTestHandler : public RoutingTestHandler,
mouse_event, MBT_LEFT, false, 1);
}
void SendKeyEvent(CefRefPtr<CefBrowser> browser,
#if defined(OS_LINUX)
unsigned int native_key_code,
#endif
int key_code) {
CefKeyEvent event;
event.is_system_key = false;
event.modifiers = 0;
#if defined(OS_WIN)
BYTE VkCode = LOBYTE(VkKeyScanA(key_code));
UINT scanCode = MapVirtualKey(VkCode, MAPVK_VK_TO_VSC);
event.native_key_code = (scanCode << 16) | // key scan code
1; // key repeat count
event.windows_key_code = VkCode;
#elif defined(OS_MACOSX)
osr_unittests::GetKeyEvent(
event, static_cast<ui::KeyboardCode>(key_code), 0);
#elif defined(OS_LINUX)
event.native_key_code = native_key_code;
event.windows_key_code = key_code;
event.character = event.unmodified_character = native_key_code;
#else
NOTREACHED();
#endif
event.type = KEYEVENT_RAWKEYDOWN;
browser->GetHost()->SendKeyEvent(event);
#if defined(OS_WIN)
event.windows_key_code = key_code;
#endif
event.type = KEYEVENT_CHAR;
browser->GetHost()->SendKeyEvent(event);
#if defined(OS_WIN)
event.windows_key_code = VkCode;
// bits 30 and 31 should be always 1 for WM_KEYUP
event.native_key_code |= 0xC0000000;
#endif
event.type = KEYEVENT_KEYUP;
browser->GetHost()->SendKeyEvent(event);
}
// true if the events for this test are already sent
bool started() { return started_; }

View File

@ -14,7 +14,7 @@ namespace base {
class CommandLine;
}
class CefTestSuite : public TestSuite {
class CefTestSuite : public base::TestSuite {
public:
CefTestSuite(int argc, char** argv);

View File

@ -2027,9 +2027,11 @@ class V8TestHandler : public TestHandler {
void OnBeforeClose(CefRefPtr<CefBrowser> browser) override {
if (test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS &&
browser->IsPopup()) {
// Generate the uncaught exception in the main browser.
// Generate the uncaught exception in the main browser. Use a 200ms delay
// because there's a bit of a lag between destroying the DevToolsAgent and
// re-registering for uncaught exceptions.
GetBrowser()->GetMainFrame()->ExecuteJavaScript(
"window.setTimeout(test, 0);",
"window.setTimeout(test, 200);",
GetBrowser()->GetMainFrame()->GetURL(), 0);
}

View File

@ -254,7 +254,8 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
'\n std::vector<'+vec_type+' > '+arg_name+'List;'\
'\n if ('+arg_name+'Count > 0) {'\
'\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\
'\n '+arg_name+'List.push_back('+assign+');'\
'\n '+vec_type+' '+arg_name+'Val = '+assign+';'\
'\n '+arg_name+'List.push_back('+arg_name+'Val);'\
'\n }'\
'\n }'
params.append(arg_name+'List')