mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d49d25f881 | ||
|
3e1975534a | ||
|
d1df1907f3 | ||
|
5aa6c55c50 | ||
|
6c5418d0e9 | ||
|
d0bfc4d2a4 | ||
|
8e7c5d6568 | ||
|
7735948042 | ||
|
7f6bb962eb | ||
|
8235330984 | ||
|
45b333fa44 | ||
|
0cf891e89a | ||
|
5211ca6298 | ||
|
bcb7529ed3 | ||
|
0fee952053 | ||
|
30bfedfb19 | ||
|
1e6d036cfe | ||
|
173d79a417 | ||
|
9dcab19430 | ||
|
049cf31b62 | ||
|
ddd0e80cbd | ||
|
828e17ec28 | ||
|
6f88af7923 | ||
|
bdc3b2a5ce | ||
|
69868374eb |
15
BUILD.gn
15
BUILD.gn
@@ -118,6 +118,7 @@ if (is_clang) {
|
||||
}
|
||||
if (is_linux) {
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
import("//third_party/fontconfig/fontconfig.gni")
|
||||
}
|
||||
if (is_mac) {
|
||||
import("//build/config/mac/rules.gni")
|
||||
@@ -148,6 +149,12 @@ if (is_clang) {
|
||||
assert(!clang_use_chrome_plugins)
|
||||
}
|
||||
|
||||
if (is_linux) {
|
||||
# Use system fontconfig. This avoids a startup hang on Ubuntu 16.04.4 (see
|
||||
# issue #2424).
|
||||
assert(!use_bundled_fontconfig)
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
# Always generate dSYM files. The make_distrib script will fail if
|
||||
# enable_dsyms=true is not explicitly set when is_official_build=false.
|
||||
@@ -1443,6 +1450,7 @@ if (is_mac) {
|
||||
|
||||
deps = [
|
||||
":libcef_static",
|
||||
"//build/config:exe_and_shlib_deps",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
@@ -1463,9 +1471,12 @@ if (is_mac) {
|
||||
]
|
||||
}
|
||||
|
||||
if (is_linux && !is_debug && !using_sanitizer && use_allocator=="none") {
|
||||
if (is_linux && !is_debug && use_allocator=="none") {
|
||||
# Only export necessary symbols from libcef.so.
|
||||
# Don't do this in Debug builds because it causes the resulting application to crash.
|
||||
# Don't do this in Debug builds because it causes the resulting
|
||||
# application to crash.
|
||||
# Also need to do this for ASAN builds to work around
|
||||
# https://crbug.com/832808.
|
||||
ldflags = [ "-Wl,--version-script=" +
|
||||
rebase_path("//cef/libcef_dll/libcef.lst") ]
|
||||
}
|
||||
|
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': '66afc5e5d10127546cc4b98b9117aff588b5e66b',
|
||||
'chromium_checkout': 'refs/tags/66.0.3359.181',
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=bede6f61d0f5b45669b8e924144e4200c41f869b$
|
||||
# $hash=67bc21133e37f5361a39f25dcfe004616d467dbc$
|
||||
#
|
||||
|
||||
{
|
||||
@@ -432,6 +432,8 @@
|
||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8accessor_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8context_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8exception_cpptoc.cc',
|
||||
@@ -712,6 +714,8 @@
|
||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8accessor_cpptoc.h',
|
||||
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/v8context_ctocpp.h',
|
||||
'libcef_dll/ctocpp/v8exception_ctocpp.cc',
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=ab31ef5d72b4b1c9809698e5fbbdae21918af713$
|
||||
// $hash=c7641e41aca6bf30b9c36092861f061d2b16ff82$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
@@ -132,6 +132,15 @@ typedef struct _cef_display_handler_t {
|
||||
int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_size_t* new_size);
|
||||
|
||||
///
|
||||
// Called when the overall page loading progress has changed. |progress|
|
||||
// ranges from 0.0 to 1.0.
|
||||
///
|
||||
void(CEF_CALLBACK* on_loading_progress_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
double progress);
|
||||
} cef_display_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=3fb1034cb02cfeddcaf02d8fde0dec5b8a18f416$
|
||||
// $hash=f2f3acb1df9815e4ac9bf34010ce260a2496ae5a$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_
|
||||
@@ -202,6 +202,17 @@ typedef struct _cef_render_handler_t {
|
||||
const cef_range_t* selected_range,
|
||||
size_t character_boundsCount,
|
||||
cef_rect_t const* character_bounds);
|
||||
|
||||
///
|
||||
// Called when text selection has changed for the specified |browser|.
|
||||
// |selected_text| is the currently selected text and |selected_range| is the
|
||||
// character range.
|
||||
///
|
||||
void(CEF_CALLBACK* on_text_selection_changed)(
|
||||
struct _cef_render_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* selected_text,
|
||||
const cef_range_t* selected_range);
|
||||
} cef_render_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=b8b5a62b11dbc48f0733c0522864e4dbda8b4f59$
|
||||
// $hash=95e44047a75693dbae0ab6b07b415d188252bfdf$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
@@ -112,12 +112,15 @@ typedef struct _cef_request_handler_t {
|
||||
// If the navigation is allowed cef_load_handler_t::OnLoadStart and
|
||||
// cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled
|
||||
// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of
|
||||
// ERR_ABORTED.
|
||||
// ERR_ABORTED. The |user_gesture| value will be true (1) if the browser
|
||||
// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
|
||||
// it navigated automatically (e.g. via the DomContentLoaded event).
|
||||
///
|
||||
int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
int user_gesture,
|
||||
int is_redirect);
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=561e4711432158fd3da971f3c0240dcf5e8e782a$
|
||||
// $hash=fd2cbc427bccf30298e26dd6c3bcef9551433f8b$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_
|
||||
@@ -127,6 +127,18 @@ typedef struct _cef_response_t {
|
||||
///
|
||||
void(CEF_CALLBACK* set_header_map)(struct _cef_response_t* self,
|
||||
cef_string_multimap_t headerMap);
|
||||
|
||||
///
|
||||
// Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_response_t* self);
|
||||
|
||||
///
|
||||
// Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
void(CEF_CALLBACK* set_url)(struct _cef_response_t* self,
|
||||
const cef_string_t* url);
|
||||
} cef_response_t;
|
||||
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=e9e43167b1cf8033bd7e6ba6931213d7cf4b69b5$
|
||||
// $hash=2303574e76708e5311aede8e66eb7f1f679e0d1f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_
|
||||
@@ -355,6 +355,25 @@ typedef struct _cef_v8exception_t {
|
||||
int(CEF_CALLBACK* get_end_column)(struct _cef_v8exception_t* self);
|
||||
} cef_v8exception_t;
|
||||
|
||||
///
|
||||
// Callback structure that is passed to cef_v8value_t::CreateArrayBuffer.
|
||||
///
|
||||
typedef struct _cef_v8array_buffer_release_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Called to release |buffer| when the ArrayBuffer JS object is garbage
|
||||
// collected. |buffer| is the value that was passed to CreateArrayBuffer along
|
||||
// with this object.
|
||||
///
|
||||
void(CEF_CALLBACK* release_buffer)(
|
||||
struct _cef_v8array_buffer_release_callback_t* self,
|
||||
void* buffer);
|
||||
} cef_v8array_buffer_release_callback_t;
|
||||
|
||||
///
|
||||
// Structure representing a V8 value handle. V8 handles can only be accessed
|
||||
// from the thread on which they are created. Valid threads for creating a V8
|
||||
@@ -425,6 +444,11 @@ typedef struct _cef_v8value_t {
|
||||
///
|
||||
int(CEF_CALLBACK* is_array)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is an ArrayBuffer.
|
||||
///
|
||||
int(CEF_CALLBACK* is_array_buffer)(struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// True if the value type is function.
|
||||
///
|
||||
@@ -639,6 +663,25 @@ typedef struct _cef_v8value_t {
|
||||
///
|
||||
int(CEF_CALLBACK* get_array_length)(struct _cef_v8value_t* self);
|
||||
|
||||
// ARRAY BUFFER METHODS - These functions are only available on ArrayBuffers.
|
||||
|
||||
///
|
||||
// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL
|
||||
// if the ArrayBuffer was not created with CreateArrayBuffer.
|
||||
///
|
||||
struct _cef_v8array_buffer_release_callback_t*(
|
||||
CEF_CALLBACK* get_array_buffer_release_callback)(
|
||||
struct _cef_v8value_t* self);
|
||||
|
||||
///
|
||||
// Prevent the ArrayBuffer from using it's memory block by setting the length
|
||||
// to zero. This operation cannot be undone. If the ArrayBuffer was created
|
||||
// with CreateArrayBuffer then
|
||||
// cef_v8array_buffer_release_callback_t::ReleaseBuffer will be called to
|
||||
// release the underlying buffer.
|
||||
///
|
||||
int(CEF_CALLBACK* neuter_array_buffer)(struct _cef_v8value_t* self);
|
||||
|
||||
// FUNCTION METHODS - These functions are only available on functions.
|
||||
|
||||
///
|
||||
@@ -751,6 +794,21 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_object(
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type ArrayBuffer which wraps the
|
||||
// provided |buffer| of size |length| bytes. The ArrayBuffer is externalized,
|
||||
// meaning that it does not own |buffer|. The caller is responsible for freeing
|
||||
// |buffer| when requested via a call to cef_v8array_buffer_release_callback_t::
|
||||
// ReleaseBuffer. This function should only be called from within the scope of a
|
||||
// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback,
|
||||
// or in combination with calling enter() and exit() on a stored cef_v8context_t
|
||||
// reference.
|
||||
///
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_array_buffer(
|
||||
void* buffer,
|
||||
size_t length,
|
||||
cef_v8array_buffer_release_callback_t* release_callback);
|
||||
|
||||
///
|
||||
// Create a new cef_v8value_t object of type function. This function should only
|
||||
// be called from within the scope of a cef_render_process_handler_t,
|
||||
|
@@ -50,7 +50,7 @@ class CefAuthCallback : public virtual CefBaseRefCounted {
|
||||
///
|
||||
// Continue the authentication request.
|
||||
///
|
||||
/*--cef(capi_name=cont,optional_param=password)--*/
|
||||
/*--cef(capi_name=cont,optional_param=username,optional_param=password)--*/
|
||||
virtual void Continue(const CefString& username,
|
||||
const CefString& password) = 0;
|
||||
|
||||
|
@@ -127,6 +127,14 @@ class CefDisplayHandler : public virtual CefBaseRefCounted {
|
||||
const CefSize& new_size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
// Called when the overall page loading progress has changed. |progress|
|
||||
// ranges from 0.0 to 1.0.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnLoadingProgressChange(CefRefPtr<CefBrowser> browser,
|
||||
double progress) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_
|
||||
|
@@ -204,6 +204,16 @@ class CefRenderHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnImeCompositionRangeChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefRange& selected_range,
|
||||
const RectList& character_bounds) {}
|
||||
|
||||
///
|
||||
// Called when text selection has changed for the specified |browser|.
|
||||
// |selected_text| is the currently selected text and |selected_range| is
|
||||
// the character range.
|
||||
///
|
||||
/*--cef(optional_param=selected_text,optional_param=selected_range)--*/
|
||||
virtual void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_
|
||||
|
@@ -106,12 +106,15 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
|
||||
// If the navigation is allowed CefLoadHandler::OnLoadStart and
|
||||
// CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled
|
||||
// CefLoadHandler::OnLoadError will be called with an |errorCode| value of
|
||||
// ERR_ABORTED.
|
||||
// ERR_ABORTED. The |user_gesture| value will be true if the browser
|
||||
// navigated via explicit user gesture (e.g. clicking a link) or false if it
|
||||
// navigated automatically (e.g. via the DomContentLoaded event).
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -128,6 +128,18 @@ class CefResponse : public virtual CefBaseRefCounted {
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetHeaderMap(const HeaderMap& headerMap) = 0;
|
||||
|
||||
///
|
||||
// Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetURL() = 0;
|
||||
|
||||
///
|
||||
// Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetURL(const CefString& url) = 0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_RESPONSE_H_
|
||||
|
@@ -407,6 +407,21 @@ class CefV8Exception : public virtual CefBaseRefCounted {
|
||||
virtual int GetEndColumn() = 0;
|
||||
};
|
||||
|
||||
///
|
||||
// Callback interface that is passed to CefV8Value::CreateArrayBuffer.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefV8ArrayBufferReleaseCallback : public virtual CefBaseRefCounted {
|
||||
public:
|
||||
///
|
||||
// Called to release |buffer| when the ArrayBuffer JS object is garbage
|
||||
// collected. |buffer| is the value that was passed to CreateArrayBuffer along
|
||||
// with this object.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void ReleaseBuffer(void* buffer) = 0;
|
||||
};
|
||||
|
||||
///
|
||||
// Class representing a V8 value handle. V8 handles can only be accessed from
|
||||
// the thread on which they are created. Valid threads for creating a V8 handle
|
||||
@@ -493,6 +508,22 @@ class CefV8Value : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateArray(int length);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type ArrayBuffer which wraps the provided
|
||||
// |buffer| of size |length| bytes. The ArrayBuffer is externalized, meaning
|
||||
// that it does not own |buffer|. The caller is responsible for freeing
|
||||
// |buffer| when requested via a call to CefV8ArrayBufferReleaseCallback::
|
||||
// ReleaseBuffer. This method should only be called from within the scope of a
|
||||
// CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in
|
||||
// combination with calling Enter() and Exit() on a stored CefV8Context
|
||||
// reference.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefV8Value> CreateArrayBuffer(
|
||||
void* buffer,
|
||||
size_t length,
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback);
|
||||
|
||||
///
|
||||
// Create a new CefV8Value object of type function. This method should only be
|
||||
// called from within the scope of a CefRenderProcessHandler, CefV8Handler or
|
||||
@@ -571,6 +602,12 @@ class CefV8Value : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
virtual bool IsArray() = 0;
|
||||
|
||||
///
|
||||
// True if the value type is an ArrayBuffer.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsArrayBuffer() = 0;
|
||||
|
||||
///
|
||||
// True if the value type is function.
|
||||
///
|
||||
@@ -793,6 +830,25 @@ class CefV8Value : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
virtual int GetArrayLength() = 0;
|
||||
|
||||
// ARRAY BUFFER METHODS - These methods are only available on ArrayBuffers.
|
||||
|
||||
///
|
||||
// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL
|
||||
// if the ArrayBuffer was not created with CreateArrayBuffer.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefV8ArrayBufferReleaseCallback>
|
||||
GetArrayBufferReleaseCallback() = 0;
|
||||
|
||||
///
|
||||
// Prevent the ArrayBuffer from using it's memory block by setting the length
|
||||
// to zero. This operation cannot be undone. If the ArrayBuffer was created
|
||||
// with CreateArrayBuffer then CefV8ArrayBufferReleaseCallback::ReleaseBuffer
|
||||
// will be called to release the underlying buffer.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool NeuterArrayBuffer() = 0;
|
||||
|
||||
// FUNCTION METHODS - These methods are only available on functions.
|
||||
|
||||
///
|
||||
|
@@ -1264,6 +1264,12 @@ typedef enum {
|
||||
// originated in the browser process.
|
||||
///
|
||||
UR_FLAG_NO_RETRY_ON_5XX = 1 << 5,
|
||||
|
||||
///
|
||||
// If set 3XX responses will cause the fetch to halt immediately rather than
|
||||
// continue through the redirect.
|
||||
///
|
||||
UR_FLAG_STOP_ON_REDIRECT = 1 << 6,
|
||||
} cef_urlrequest_flags_t;
|
||||
|
||||
///
|
||||
|
@@ -1589,10 +1589,13 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetFrameForRequest(
|
||||
content::ResourceRequestInfo::ForRequest(request);
|
||||
if (!info)
|
||||
return nullptr;
|
||||
// The value of |IsMainFrame| is unreliable when |IsDownload| returns true.
|
||||
// The value of |IsMainFrame| is unreliable in these cases.
|
||||
const bool is_main_frame_state_flaky =
|
||||
info->IsDownload() ||
|
||||
info->GetResourceType() == content::RESOURCE_TYPE_XHR;
|
||||
return GetOrCreateFrame(info->GetRenderFrameID(), info->GetFrameTreeNodeId(),
|
||||
CefFrameHostImpl::kUnspecifiedFrameId,
|
||||
info->IsMainFrame(), info->IsDownload(),
|
||||
info->IsMainFrame(), is_main_frame_state_flaky,
|
||||
base::string16(), GURL());
|
||||
}
|
||||
|
||||
@@ -2221,6 +2224,16 @@ void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::LoadProgressChanged(content::WebContents* source,
|
||||
double progress) {
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
|
||||
if (handler.get()) {
|
||||
handler->OnLoadingProgressChange(this, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::CloseContents(content::WebContents* source) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
@@ -3211,7 +3224,7 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
int frame_tree_node_id,
|
||||
int64 parent_frame_id,
|
||||
bool is_main_frame,
|
||||
bool is_download,
|
||||
bool is_main_frame_state_flaky,
|
||||
base::string16 frame_name,
|
||||
const GURL& frame_url) {
|
||||
// We need either a valid |frame_id| or a valid |frame_tree_node_id|.
|
||||
@@ -3232,13 +3245,13 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
|
||||
if (frame_id < 0) {
|
||||
// With PlzNavigate the renderer process representation might not exist yet.
|
||||
if ((is_main_frame || is_download) &&
|
||||
if ((is_main_frame || is_main_frame_state_flaky) &&
|
||||
main_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
|
||||
// Operating in the main frame. Continue using the existing main frame
|
||||
// object until the new renderer process representation is created.
|
||||
frame_id = main_frame_id_;
|
||||
} else {
|
||||
if (is_main_frame || is_download) {
|
||||
if (is_main_frame || is_main_frame_state_flaky) {
|
||||
// Always use the same pending object for the main frame.
|
||||
frame_tree_node_id = kMainFrameTreeNodeId;
|
||||
}
|
||||
@@ -3306,7 +3319,7 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
|
||||
}
|
||||
}
|
||||
|
||||
if (!frame_created && !is_download)
|
||||
if (!frame_created && !is_main_frame_state_flaky)
|
||||
frame->SetAttributes(is_main_frame, url, name, parent_frame_id);
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
|
@@ -407,6 +407,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
bool* was_blocked) override;
|
||||
void LoadingStateChanged(content::WebContents* source,
|
||||
bool to_different_document) override;
|
||||
void LoadProgressChanged(content::WebContents* source,
|
||||
double progress) override;
|
||||
void CloseContents(content::WebContents* source) override;
|
||||
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
|
||||
bool DidAddMessageToConsole(content::WebContents* source,
|
||||
@@ -584,13 +586,13 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
// if PlzNavigate is disabled; or >= 0 otherwise. |parent_frame_id| will be
|
||||
// CefFrameHostImpl::kUnspecifiedFrameId if unknown. In cases where |frame_id|
|
||||
// is < 0 either the existing main frame object or a pending object will be
|
||||
// returned depending on current state. If |is_download| is true then the
|
||||
// value of |is_main_frame| cannot be relied on.
|
||||
// returned depending on current state. If |is_main_frame_state_flaky| is true
|
||||
// then the value of |is_main_frame| cannot be relied on.
|
||||
CefRefPtr<CefFrame> GetOrCreateFrame(int64 frame_id,
|
||||
int frame_tree_node_id,
|
||||
int64 parent_frame_id,
|
||||
bool is_main_frame,
|
||||
bool is_download,
|
||||
bool is_main_frame_state_flaky,
|
||||
base::string16 frame_name,
|
||||
const GURL& frame_url);
|
||||
|
||||
|
@@ -356,6 +356,9 @@ class CefBrowserURLRequest::Context
|
||||
CefResponseImpl* responseImpl =
|
||||
static_cast<CefResponseImpl*>(response_.get());
|
||||
|
||||
responseImpl->SetURL(fetcher_->GetURL().spec());
|
||||
responseImpl->SetStatus(fetcher_->GetResponseCode());
|
||||
|
||||
net::HttpResponseHeaders* headers = fetcher_->GetResponseHeaders();
|
||||
if (headers)
|
||||
responseImpl->SetResponseHeaders(*headers);
|
||||
|
@@ -426,7 +426,8 @@ bool NavigationOnUIThread(
|
||||
request->SetReadOnly(true);
|
||||
|
||||
ignore_navigation = handler->OnBeforeBrowse(
|
||||
browser.get(), frame, request.get(), params.is_redirect());
|
||||
browser.get(), frame, request.get(), params.has_user_gesture(),
|
||||
params.is_redirect());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -336,6 +336,14 @@ bool CefResourceRequestJob::GetCharset(std::string* charset) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int CefResourceRequestJob::GetResponseCode() const {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
if (response_.get())
|
||||
return response_->GetStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CefResourceRequestJob::SendHeaders() {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
|
@@ -41,6 +41,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
|
||||
bool IsRedirectResponse(GURL* location, int* http_status_code) override;
|
||||
bool GetMimeType(std::string* mime_type) const override;
|
||||
bool GetCharset(std::string* charset) override;
|
||||
int GetResponseCode() const override;
|
||||
|
||||
void SendHeaders();
|
||||
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "cc/base/switches.h"
|
||||
#include "components/viz/common/features.h"
|
||||
#include "components/viz/common/frame_sinks/copy_output_request.h"
|
||||
@@ -93,7 +94,7 @@ class CefCopyFrameGenerator {
|
||||
&CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
|
||||
weak_ptr_factory_.GetWeakPtr(), damage_rect));
|
||||
|
||||
request->set_area(gfx::Rect(view_->GetPhysicalBackingSize()));
|
||||
request->set_area(gfx::Rect(view_->GetCompositorViewportPixelSize()));
|
||||
view_->GetRootLayer()->RequestCopyOfOutput(std::move(request));
|
||||
}
|
||||
|
||||
@@ -664,7 +665,7 @@ gfx::Size CefRenderWidgetHostViewOSR::GetRequestedRendererSize() const {
|
||||
return GetDelegatedFrameHost()->GetRequestedRendererSize();
|
||||
}
|
||||
|
||||
gfx::Size CefRenderWidgetHostViewOSR::GetPhysicalBackingSize() const {
|
||||
gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() const {
|
||||
return gfx::ScaleToCeiledSize(GetRequestedRendererSize(),
|
||||
current_device_scale_factor_);
|
||||
}
|
||||
@@ -814,6 +815,31 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
|
||||
RequestImeCompositionUpdate(false);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text,
|
||||
size_t offset,
|
||||
const gfx::Range& range) {
|
||||
RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
|
||||
|
||||
if (!browser_impl_.get())
|
||||
return;
|
||||
|
||||
CefString selected_text;
|
||||
if (!range.is_empty() && !text.empty()) {
|
||||
size_t pos = range.GetMin() - offset;
|
||||
size_t n = range.length();
|
||||
if (pos + n <= text.length())
|
||||
selected_text = text.substr(pos, n);
|
||||
}
|
||||
|
||||
CefRefPtr<CefRenderHandler> handler =
|
||||
browser_impl_->GetClient()->GetRenderHandler();
|
||||
if (handler.get()) {
|
||||
CefRange cef_range(range.start(), range.end());
|
||||
handler->OnTextSelectionChanged(browser_impl_.get(), selected_text,
|
||||
cef_range);
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
|
||||
SetFrameRate();
|
||||
|
||||
@@ -1025,7 +1051,7 @@ void CefRenderWidgetHostViewOSR::Invalidate(
|
||||
return;
|
||||
}
|
||||
|
||||
InvalidateInternal(gfx::Rect(GetPhysicalBackingSize()));
|
||||
InvalidateInternal(gfx::Rect(GetCompositorViewportPixelSize()));
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::SendKeyEvent(
|
||||
|
@@ -150,7 +150,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
void SetTooltipText(const base::string16& tooltip_text) override;
|
||||
|
||||
gfx::Size GetRequestedRendererSize() const override;
|
||||
gfx::Size GetPhysicalBackingSize() const override;
|
||||
gfx::Size GetCompositorViewportPixelSize() const override;
|
||||
void CopyFromSurface(
|
||||
const gfx::Rect& src_rect,
|
||||
const gfx::Size& output_size,
|
||||
@@ -184,6 +184,10 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
||||
gfx::PointF* transformed_point) override;
|
||||
void DidNavigate() override;
|
||||
|
||||
void SelectionChanged(const base::string16& text,
|
||||
size_t offset,
|
||||
const gfx::Range& range) override;
|
||||
|
||||
// ui::CompositorDelegate implementation.
|
||||
std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) override;
|
||||
|
@@ -64,6 +64,8 @@ class MacHelper : public content::BrowserCompositorMacClient,
|
||||
view_->render_widget_host()->DidReceiveFirstFrameAfterNavigation();
|
||||
}
|
||||
|
||||
void DestroyCompositorForShutdown() override {}
|
||||
|
||||
private:
|
||||
// Guaranteed to outlive this object.
|
||||
CefRenderWidgetHostViewOSR* view_;
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/printing/browser/print_composite_client.h"
|
||||
@@ -42,12 +43,14 @@
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "mojo/public/cpp/system/buffer.h"
|
||||
#include "printing/features/features.h"
|
||||
#include "printing/pdf_metafile_skia.h"
|
||||
#include "printing/print_settings.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/command_line.h"
|
||||
@@ -59,6 +62,18 @@ using content::BrowserThread;
|
||||
|
||||
namespace printing {
|
||||
|
||||
namespace {
|
||||
|
||||
bool PrintingPdfContent(content::RenderFrameHost* rfh) {
|
||||
GURL url = rfh->GetLastCommittedURL();
|
||||
// Whether it is inside print preview or pdf plugin extension.
|
||||
return url.GetOrigin() == chrome::kChromeUIPrintURL ||
|
||||
(url.SchemeIs(extensions::kExtensionScheme) &&
|
||||
url.host_piece() == extension_misc::kPdfExtensionId);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefPrintViewManagerBase::CefPrintViewManagerBase(
|
||||
content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
@@ -121,6 +136,11 @@ void CefPrintViewManagerBase::PrintDocument(
|
||||
print_job_->StartPdfToEmfConversion(print_data, page_size, content_area,
|
||||
print_text_with_gdi);
|
||||
}
|
||||
// Indicate that the PDF is fully rendered and we no longer need the renderer
|
||||
// and web contents, so the print job does not need to be cancelled if they
|
||||
// die. This is needed on Windows because the PrintedDocument will not be
|
||||
// considered complete until PDF conversion finishes.
|
||||
document->SetConvertingPdf();
|
||||
#else
|
||||
std::unique_ptr<PdfMetafileSkia> metafile =
|
||||
std::make_unique<PdfMetafileSkia>();
|
||||
@@ -210,8 +230,7 @@ void CefPrintViewManagerBase::OnDidPrintDocument(
|
||||
}
|
||||
|
||||
auto* client = PrintCompositeClient::FromWebContents(web_contents());
|
||||
if (IsOopifEnabled() && !client->for_preview() &&
|
||||
document->settings().is_modifiable()) {
|
||||
if (IsOopifEnabled() && !PrintingPdfContent(render_frame_host)) {
|
||||
client->DoCompositeDocumentToPdf(
|
||||
params.document_cookie, render_frame_host, content.metafile_data_handle,
|
||||
content.data_size, content.subframe_content_info,
|
||||
@@ -358,18 +377,18 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() {
|
||||
if (!print_job_.get() || !print_job_->is_job_pending())
|
||||
return false;
|
||||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents() || !web_contents()->GetRenderViewHost() ||
|
||||
!web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is the document already complete?
|
||||
if (print_job_->document() && print_job_->document()->IsComplete()) {
|
||||
printing_succeeded_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents() || !web_contents()->GetRenderViewHost() ||
|
||||
!web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// WebContents is either dying or a second consecutive request to print
|
||||
// happened before the first had time to finish. We need to render all the
|
||||
// pages in an hurry if a print_job_ is still pending. No need to wait for it
|
||||
@@ -413,8 +432,6 @@ bool CefPrintViewManagerBase::CreateNewPrintJob(PrintJobWorkerOwner* job) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ask the renderer to generate the print preview, create the print preview
|
||||
// view and switch to it, initialize the printer and show the print dialog.
|
||||
DCHECK(!print_job_.get());
|
||||
DCHECK(job);
|
||||
if (!job)
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "base/environment.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
@@ -239,6 +240,29 @@ std::string NormalizeCrashKey(const base::StringPiece& key) {
|
||||
return str;
|
||||
}
|
||||
|
||||
void ParseURL(const std::string& value, std::string* url) {
|
||||
if (value.find("http://") == 0 || value.find("https://") == 0) {
|
||||
*url = value;
|
||||
if (url->rfind('/') <= 8) {
|
||||
// Make sure the URL includes a path component. Otherwise, crash
|
||||
// upload will fail on older Windows versions due to
|
||||
// https://crbug.com/826564.
|
||||
*url += "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ParseBool(const std::string& value) {
|
||||
return base::EqualsCaseInsensitiveASCII(value, "true") || value == "1";
|
||||
}
|
||||
|
||||
int ParseZeroBasedInt(const std::string& value) {
|
||||
int int_val;
|
||||
if (base::StringToInt(value, &int_val) && int_val > 0)
|
||||
return int_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@@ -387,30 +411,19 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
|
||||
|
||||
if (current_section == kConfigSection) {
|
||||
if (name_str == "ServerURL") {
|
||||
if (val_str.find("http://") == 0 || val_str.find("https://") == 0)
|
||||
server_url_ = val_str;
|
||||
ParseURL(val_str, &server_url_);
|
||||
} else if (name_str == "ProductName") {
|
||||
product_name_ = val_str;
|
||||
} else if (name_str == "ProductVersion") {
|
||||
product_version_ = val_str;
|
||||
} else if (name_str == "RateLimitEnabled") {
|
||||
rate_limit_ = (base::EqualsCaseInsensitiveASCII(val_str, "true") ||
|
||||
val_str == "1");
|
||||
rate_limit_ = ParseBool(val_str);
|
||||
} else if (name_str == "MaxUploadsPerDay") {
|
||||
if (base::StringToInt(val_str, &max_uploads_)) {
|
||||
if (max_uploads_ < 0)
|
||||
max_uploads_ = 0;
|
||||
}
|
||||
max_uploads_ = ParseZeroBasedInt(val_str);
|
||||
} else if (name_str == "MaxDatabaseSizeInMb") {
|
||||
if (base::StringToInt(val_str, &max_db_size_)) {
|
||||
if (max_db_size_ < 0)
|
||||
max_db_size_ = 0;
|
||||
}
|
||||
max_db_size_ = ParseZeroBasedInt(val_str);
|
||||
} else if (name_str == "MaxDatabaseAgeInDays") {
|
||||
if (base::StringToInt(val_str, &max_db_age_)) {
|
||||
if (max_db_age_ < 0)
|
||||
max_db_age_ = 0;
|
||||
}
|
||||
max_db_age_ = ParseZeroBasedInt(val_str);
|
||||
}
|
||||
#if defined(OS_WIN)
|
||||
else if (name_str == "ExternalHandler") {
|
||||
@@ -425,9 +438,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
|
||||
}
|
||||
#elif defined(OS_MACOSX)
|
||||
else if (name_str == "BrowserCrashForwardingEnabled") {
|
||||
enable_browser_crash_forwarding_ =
|
||||
(base::EqualsCaseInsensitiveASCII(val_str, "true") ||
|
||||
val_str == "1");
|
||||
enable_browser_crash_forwarding_ = ParseBool(val_str);
|
||||
}
|
||||
#endif
|
||||
} else if (current_section == kCrashKeysSection) {
|
||||
@@ -499,6 +510,19 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
|
||||
}
|
||||
}
|
||||
|
||||
// Allow override of some values via environment variables.
|
||||
{
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::string val_str;
|
||||
|
||||
if (env->GetVar("CEF_CRASH_REPORTER_SERVER_URL", &val_str)) {
|
||||
ParseURL(val_str, &server_url_);
|
||||
}
|
||||
if (env->GetVar("CEF_CRASH_REPORTER_RATE_LIMIT_ENABLED", &val_str)) {
|
||||
rate_limit_ = ParseBool(val_str);
|
||||
}
|
||||
}
|
||||
|
||||
has_crash_config_file_ = true;
|
||||
return true;
|
||||
}
|
||||
|
@@ -745,6 +745,8 @@ void CefRequestImpl::Get(net::URLFetcher& fetcher,
|
||||
|
||||
if (flags & UR_FLAG_NO_RETRY_ON_5XX)
|
||||
fetcher.SetAutomaticallyRetryOn5xx(false);
|
||||
if (flags & UR_FLAG_STOP_ON_REDIRECT)
|
||||
fetcher.SetStopOnRedirect(true);
|
||||
|
||||
int net_flags = 0;
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "net/url_request/url_request.h"
|
||||
#include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h"
|
||||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/platform/WebURLResponse.h"
|
||||
|
||||
#define CHECK_READONLY_RETURN_VOID() \
|
||||
@@ -95,6 +96,17 @@ CefString CefResponseImpl::GetHeader(const CefString& name) {
|
||||
return value;
|
||||
}
|
||||
|
||||
CefString CefResponseImpl::GetURL() {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
return url_;
|
||||
}
|
||||
|
||||
void CefResponseImpl::SetURL(const CefString& url) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
CHECK_READONLY_RETURN_VOID();
|
||||
url_ = url;
|
||||
}
|
||||
|
||||
void CefResponseImpl::GetHeaderMap(HeaderMap& map) {
|
||||
base::AutoLock lock_scope(lock_);
|
||||
map = header_map_;
|
||||
@@ -190,6 +202,8 @@ void CefResponseImpl::Set(const blink::WebURLResponse& response) {
|
||||
status_text_ = str.Utf16();
|
||||
str = response.MimeType();
|
||||
mime_type_ = str.Utf16();
|
||||
str = response.Url().GetString();
|
||||
url_ = str.Utf16();
|
||||
|
||||
class HeaderVisitor : public blink::WebHTTPHeaderVisitor {
|
||||
public:
|
||||
|
@@ -13,7 +13,7 @@
|
||||
namespace net {
|
||||
class HttpResponseHeaders;
|
||||
class URLRequest;
|
||||
}
|
||||
} // namespace net
|
||||
|
||||
namespace blink {
|
||||
class WebURLResponse;
|
||||
@@ -37,6 +37,8 @@ class CefResponseImpl : public CefResponse {
|
||||
CefString GetHeader(const CefString& name) override;
|
||||
void GetHeaderMap(HeaderMap& headerMap) override;
|
||||
void SetHeaderMap(const HeaderMap& headerMap) override;
|
||||
CefString GetURL() override;
|
||||
void SetURL(const CefString& url) override;
|
||||
|
||||
net::HttpResponseHeaders* GetResponseHeaders();
|
||||
void SetResponseHeaders(const net::HttpResponseHeaders& headers);
|
||||
@@ -51,6 +53,7 @@ class CefResponseImpl : public CefResponse {
|
||||
int status_code_;
|
||||
CefString status_text_;
|
||||
CefString mime_type_;
|
||||
CefString url_;
|
||||
HeaderMap header_map_;
|
||||
bool read_only_;
|
||||
|
||||
|
@@ -214,7 +214,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
|
||||
for (WebFrame* cur_frame = web_view->MainFrame(); cur_frame;
|
||||
cur_frame = cur_frame->TraverseNext()) {
|
||||
if (cur_frame->IsWebLocalFrame() &&
|
||||
render_frame_util::GetUniqueName(cur_frame->ToWebLocalFrame()) ==
|
||||
render_frame_util::GetName(cur_frame->ToWebLocalFrame()) ==
|
||||
searchname) {
|
||||
frame = cur_frame;
|
||||
break;
|
||||
@@ -269,8 +269,7 @@ void CefBrowserImpl::GetFrameNames(std::vector<CefString>& names) {
|
||||
for (WebFrame* frame = render_view()->GetWebView()->MainFrame(); frame;
|
||||
frame = frame->TraverseNext()) {
|
||||
if (frame->IsWebLocalFrame())
|
||||
names.push_back(
|
||||
render_frame_util::GetUniqueName(frame->ToWebLocalFrame()));
|
||||
names.push_back(render_frame_util::GetName(frame->ToWebLocalFrame()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +355,7 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
|
||||
frame->Parent()->ToWebLocalFrame())
|
||||
: webkit_glue::kInvalidFrameId;
|
||||
const base::string16& name =
|
||||
base::UTF8ToUTF16(render_frame_util::GetUniqueName(frame));
|
||||
base::UTF8ToUTF16(render_frame_util::GetName(frame));
|
||||
|
||||
// Notify the browser that the frame has been identified.
|
||||
Send(new CefHostMsg_FrameIdentified(routing_id(), frame_id, parent_id, name));
|
||||
|
@@ -188,7 +188,7 @@ CefString CefFrameImpl::GetName() {
|
||||
CEF_REQUIRE_RT_RETURN(name);
|
||||
|
||||
if (frame_)
|
||||
name = render_frame_util::GetUniqueName(frame_);
|
||||
name = render_frame_util::GetName(frame_);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,14 @@ int64_t GetIdentifier(blink::WebLocalFrame* frame) {
|
||||
return webkit_glue::kInvalidFrameId;
|
||||
}
|
||||
|
||||
std::string GetUniqueName(blink::WebLocalFrame* frame) {
|
||||
std::string GetName(blink::WebLocalFrame* frame) {
|
||||
DCHECK(frame);
|
||||
// Return the assigned name if it is non-empty. This represents the name
|
||||
// property on the frame DOM element. If the assigned name is empty, revert to
|
||||
// the internal unique name.
|
||||
if (frame->AssignedName().length() > 0) {
|
||||
return frame->AssignedName().Utf8();
|
||||
}
|
||||
content::RenderFrameImpl* render_frame =
|
||||
content::RenderFrameImpl::FromWebFrame(frame);
|
||||
DCHECK(render_frame);
|
||||
|
@@ -17,7 +17,7 @@ class WebLocalFrame;
|
||||
namespace render_frame_util {
|
||||
|
||||
int64_t GetIdentifier(blink::WebLocalFrame* frame);
|
||||
std::string GetUniqueName(blink::WebLocalFrame* frame);
|
||||
std::string GetName(blink::WebLocalFrame* frame);
|
||||
|
||||
} // namespace render_frame_util
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "third_party/WebKit/public/platform/WebURLRequest.h"
|
||||
#include "third_party/WebKit/public/platform/WebURLResponse.h"
|
||||
|
||||
using blink::WebReferrerPolicy;
|
||||
using blink::WebString;
|
||||
using blink::WebURL;
|
||||
using blink::WebURLError;
|
||||
@@ -52,6 +53,13 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
|
||||
int64_t total_encoded_data_length,
|
||||
int64_t total_encoded_body_length,
|
||||
int64_t total_decoded_body_length) override;
|
||||
bool WillFollowRedirect(const WebURL& new_url,
|
||||
const WebURL& new_site_for_cookies,
|
||||
const WebString& new_referrer,
|
||||
WebReferrerPolicy new_referrer_policy,
|
||||
const WebString& new_method,
|
||||
const WebURLResponse& passed_redirect_response,
|
||||
bool& report_raw_headers) override;
|
||||
|
||||
protected:
|
||||
// The context_ pointer will outlive this object.
|
||||
@@ -127,6 +135,28 @@ class CefRenderURLRequest::Context
|
||||
loader_->Cancel();
|
||||
}
|
||||
|
||||
void OnStopRedirect(const WebURL& redirect_url,
|
||||
const WebURLResponse& response) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
|
||||
response_was_cached_ = webkit_glue::ResponseWasCached(response);
|
||||
response_ = CefResponse::Create();
|
||||
CefResponseImpl* responseImpl =
|
||||
static_cast<CefResponseImpl*>(response_.get());
|
||||
|
||||
// In case of StopOnRedirect we only set these fields. Everything else is
|
||||
// left blank. This also replicates the behaviour of the browser urlrequest
|
||||
// fetcher.
|
||||
responseImpl->SetStatus(response.HttpStatusCode());
|
||||
responseImpl->SetURL(redirect_url.GetString().Utf16());
|
||||
responseImpl->SetReadOnly(true);
|
||||
|
||||
status_ = UR_CANCELED;
|
||||
error_code_ = ERR_ABORTED;
|
||||
|
||||
OnComplete();
|
||||
}
|
||||
|
||||
void OnResponse(const WebURLResponse& response) {
|
||||
DCHECK(CalledOnValidThread());
|
||||
|
||||
@@ -277,6 +307,21 @@ void CefWebURLLoaderClient::DidFail(const WebURLError& error,
|
||||
context_->OnError(error);
|
||||
}
|
||||
|
||||
bool CefWebURLLoaderClient::WillFollowRedirect(
|
||||
const WebURL& new_url,
|
||||
const WebURL& new_site_for_cookies,
|
||||
const WebString& new_referrer,
|
||||
WebReferrerPolicy new_referrer_policy,
|
||||
const WebString& new_method,
|
||||
const WebURLResponse& passed_redirect_response,
|
||||
bool& report_raw_headers) {
|
||||
if (request_flags_ & UR_FLAG_STOP_ON_REDIRECT) {
|
||||
context_->OnStopRedirect(new_url, passed_redirect_response);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CefRenderURLRequest --------------------------------------------------------
|
||||
|
@@ -304,6 +304,74 @@ class V8TrackString : public CefTrackNode {
|
||||
std::string string_;
|
||||
};
|
||||
|
||||
class V8TrackArrayBuffer : public CefTrackNode {
|
||||
public:
|
||||
explicit V8TrackArrayBuffer(
|
||||
v8::Isolate* isolate,
|
||||
void* buffer,
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback)
|
||||
: isolate_(isolate),
|
||||
buffer_(buffer),
|
||||
release_callback_(release_callback) {
|
||||
DCHECK(isolate_);
|
||||
}
|
||||
|
||||
~V8TrackArrayBuffer() {
|
||||
if (buffer_ != nullptr) {
|
||||
release_callback_->ReleaseBuffer(buffer_);
|
||||
}
|
||||
isolate_->AdjustAmountOfExternalAllocatedMemory(
|
||||
-static_cast<int>(sizeof(V8TrackArrayBuffer)));
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> GetReleaseCallback() {
|
||||
return release_callback_;
|
||||
}
|
||||
|
||||
void Neuter() { buffer_ = nullptr; }
|
||||
|
||||
// Retrieve the track object for the specified V8 object.
|
||||
static V8TrackArrayBuffer* Unwrap(v8::Local<v8::Context> context,
|
||||
v8::Local<v8::Object> object) {
|
||||
v8::Local<v8::Value> value;
|
||||
if (GetPrivate(context, object, kCefTrackObject, &value))
|
||||
return static_cast<V8TrackArrayBuffer*>(
|
||||
v8::External::Cast(*value)->Value());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Attach this track object to the specified V8 object.
|
||||
void AttachTo(v8::Local<v8::Context> context,
|
||||
v8::Local<v8::ArrayBuffer> arrayBuffer) {
|
||||
isolate_->AdjustAmountOfExternalAllocatedMemory(
|
||||
static_cast<int>(sizeof(V8TrackArrayBuffer)));
|
||||
|
||||
SetPrivate(context, arrayBuffer, kCefTrackObject,
|
||||
v8::External::New(isolate_, this));
|
||||
|
||||
handle_.Reset(isolate_, arrayBuffer);
|
||||
handle_.SetWeak(this, FirstWeakCallback, v8::WeakCallbackType::kParameter);
|
||||
handle_.MarkIndependent();
|
||||
}
|
||||
|
||||
private:
|
||||
static void FirstWeakCallback(
|
||||
const v8::WeakCallbackInfo<V8TrackArrayBuffer>& data) {
|
||||
V8TrackArrayBuffer* wrapper = data.GetParameter();
|
||||
if (wrapper->buffer_ != nullptr) {
|
||||
wrapper->release_callback_->ReleaseBuffer(wrapper->buffer_);
|
||||
wrapper->buffer_ = nullptr;
|
||||
}
|
||||
wrapper->handle_.Reset();
|
||||
}
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
void* buffer_;
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback_;
|
||||
v8::Persistent<v8::ArrayBuffer> handle_;
|
||||
};
|
||||
|
||||
// Object wrapped in a v8::External and passed as the Data argument to
|
||||
// v8::FunctionTemplate::New.
|
||||
class V8FunctionData {
|
||||
@@ -1311,6 +1379,35 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
|
||||
return impl.get();
|
||||
}
|
||||
|
||||
// static
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateArrayBuffer(
|
||||
void* buffer,
|
||||
size_t length,
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback) {
|
||||
CEF_V8_REQUIRE_ISOLATE_RETURN(NULL);
|
||||
|
||||
v8::Isolate* isolate = GetIsolateManager()->isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||
if (context.IsEmpty()) {
|
||||
NOTREACHED() << "not currently in a V8 context";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Create a tracker object that will cause the user data reference to be
|
||||
// released when the V8 object is destroyed.
|
||||
V8TrackArrayBuffer* tracker =
|
||||
new V8TrackArrayBuffer(isolate, buffer, release_callback);
|
||||
v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, buffer, length);
|
||||
|
||||
// Attach the tracker object.
|
||||
tracker->AttachTo(context, ab);
|
||||
|
||||
CefRefPtr<CefV8ValueImpl> impl = new CefV8ValueImpl(isolate);
|
||||
impl->InitObject(ab, tracker);
|
||||
return impl.get();
|
||||
}
|
||||
|
||||
// static
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
|
||||
const CefString& name,
|
||||
@@ -1571,6 +1668,16 @@ bool CefV8ValueImpl::IsArray() {
|
||||
}
|
||||
}
|
||||
|
||||
bool CefV8ValueImpl::IsArrayBuffer() {
|
||||
CEF_V8_REQUIRE_MLT_RETURN(false);
|
||||
if (type_ == TYPE_OBJECT) {
|
||||
v8::HandleScope handle_scope(handle_->isolate());
|
||||
return handle_->GetNewV8Handle(false)->IsArrayBuffer();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CefV8ValueImpl::IsFunction() {
|
||||
CEF_V8_REQUIRE_MLT_RETURN(false);
|
||||
if (type_ == TYPE_OBJECT) {
|
||||
@@ -2091,6 +2198,60 @@ int CefV8ValueImpl::GetArrayLength() {
|
||||
return arr->Length();
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback>
|
||||
CefV8ValueImpl::GetArrayBufferReleaseCallback() {
|
||||
CEF_V8_REQUIRE_OBJECT_RETURN(0);
|
||||
|
||||
v8::Isolate* isolate = handle_->isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||
if (context.IsEmpty()) {
|
||||
NOTREACHED() << "not currently in a V8 context";
|
||||
return NULL;
|
||||
}
|
||||
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
|
||||
if (!value->IsArrayBuffer()) {
|
||||
NOTREACHED() << "V8 value is not an array buffer";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v8::Local<v8::Object> obj = value->ToObject();
|
||||
|
||||
V8TrackArrayBuffer* tracker = V8TrackArrayBuffer::Unwrap(context, obj);
|
||||
if (tracker)
|
||||
return tracker->GetReleaseCallback();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CefV8ValueImpl::NeuterArrayBuffer() {
|
||||
CEF_V8_REQUIRE_OBJECT_RETURN(0);
|
||||
|
||||
v8::Isolate* isolate = handle_->isolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||
if (context.IsEmpty()) {
|
||||
NOTREACHED() << "not currently in a V8 context";
|
||||
return false;
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> value = handle_->GetNewV8Handle(false);
|
||||
if (!value->IsArrayBuffer()) {
|
||||
NOTREACHED() << "V8 value is not an array buffer";
|
||||
return false;
|
||||
}
|
||||
v8::Local<v8::Object> obj = value->ToObject();
|
||||
v8::Local<v8::ArrayBuffer> arr = v8::Local<v8::ArrayBuffer>::Cast(obj);
|
||||
if (!arr->IsNeuterable()) {
|
||||
return false;
|
||||
}
|
||||
arr->Neuter();
|
||||
V8TrackArrayBuffer* tracker = V8TrackArrayBuffer::Unwrap(context, obj);
|
||||
tracker->Neuter();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CefString CefV8ValueImpl::GetFunctionName() {
|
||||
CefString rv;
|
||||
CEF_V8_REQUIRE_OBJECT_RETURN(rv);
|
||||
|
@@ -227,6 +227,7 @@ class CefV8ValueImpl : public CefV8Value {
|
||||
bool IsString() override;
|
||||
bool IsObject() override;
|
||||
bool IsArray() override;
|
||||
bool IsArrayBuffer() override;
|
||||
bool IsFunction() override;
|
||||
bool IsSame(CefRefPtr<CefV8Value> value) override;
|
||||
bool GetBoolValue() override;
|
||||
@@ -260,6 +261,9 @@ class CefV8ValueImpl : public CefV8Value {
|
||||
int GetExternallyAllocatedMemory() override;
|
||||
int AdjustExternallyAllocatedMemory(int change_in_bytes) override;
|
||||
int GetArrayLength() override;
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> GetArrayBufferReleaseCallback()
|
||||
override;
|
||||
bool NeuterArrayBuffer() override;
|
||||
CefString GetFunctionName() override;
|
||||
CefRefPtr<CefV8Handler> GetFunctionHandler() override;
|
||||
CefRefPtr<CefV8Value> ExecuteFunction(
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=1adf0d1a89ad232ddb0daa468082980906dc5931$
|
||||
// $hash=3980a914cf9a6be45acabff6e35c2849b51b27dd$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
@@ -26,11 +26,7 @@ void CEF_CALLBACK auth_callback_cont(struct _cef_auth_callback_t* self,
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: username; type: string_byref_const
|
||||
DCHECK(username);
|
||||
if (!username)
|
||||
return;
|
||||
// Unverified params: password
|
||||
// Unverified params: username, password
|
||||
|
||||
// Execute
|
||||
CefAuthCallbackCppToC::Get(self)->Continue(CefString(username),
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f0405e9e04f7eaa587fefd5f00abeed44704773b$
|
||||
// $hash=0ba45406ca1fcca29b4d8085d6f7b3280477e13f$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
|
||||
@@ -214,6 +214,25 @@ display_handler_on_auto_resize(struct _cef_display_handler_t* self,
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
display_handler_on_loading_progress_change(struct _cef_display_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
double progress) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefDisplayHandlerCppToC::Get(self)->OnLoadingProgressChange(
|
||||
CefBrowserCToCpp::Wrap(browser), progress);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -228,6 +247,8 @@ CefDisplayHandlerCppToC::CefDisplayHandlerCppToC() {
|
||||
GetStruct()->on_status_message = display_handler_on_status_message;
|
||||
GetStruct()->on_console_message = display_handler_on_console_message;
|
||||
GetStruct()->on_auto_resize = display_handler_on_auto_resize;
|
||||
GetStruct()->on_loading_progress_change =
|
||||
display_handler_on_loading_progress_change;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=7dba22b79d2e50ab27ccf93a393f5220965a08ce$
|
||||
// $hash=98625368df8daaeca9df1791f1867828a6271a89$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
|
||||
@@ -408,6 +408,31 @@ void CEF_CALLBACK render_handler_on_ime_composition_range_changed(
|
||||
CefBrowserCToCpp::Wrap(browser), selected_rangeVal, character_boundsList);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
render_handler_on_text_selection_changed(struct _cef_render_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
const cef_string_t* selected_text,
|
||||
const cef_range_t* selected_range) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Unverified params: selected_text, selected_range
|
||||
|
||||
// Translate param: selected_range; type: simple_byref_const
|
||||
CefRange selected_rangeVal = selected_range ? *selected_range : CefRange();
|
||||
|
||||
// Execute
|
||||
CefRenderHandlerCppToC::Get(self)->OnTextSelectionChanged(
|
||||
CefBrowserCToCpp::Wrap(browser), CefString(selected_text),
|
||||
selected_rangeVal);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -429,6 +454,8 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC() {
|
||||
render_handler_on_scroll_offset_changed;
|
||||
GetStruct()->on_ime_composition_range_changed =
|
||||
render_handler_on_ime_composition_range_changed;
|
||||
GetStruct()->on_text_selection_changed =
|
||||
render_handler_on_text_selection_changed;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=b4c3eec00b1889871f4e13ea05d7c00a12da1fa0$
|
||||
// $hash=02ebd75f0920edad6a23db997a57f28fc921b045$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
|
||||
@@ -34,6 +34,7 @@ request_handler_on_before_browse(struct _cef_request_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
cef_frame_t* frame,
|
||||
cef_request_t* request,
|
||||
int user_gesture,
|
||||
int is_redirect) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
@@ -56,7 +57,8 @@ request_handler_on_before_browse(struct _cef_request_handler_t* self,
|
||||
// Execute
|
||||
bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
||||
CefRequestCToCpp::Wrap(request), is_redirect ? true : false);
|
||||
CefRequestCToCpp::Wrap(request), user_gesture ? true : false,
|
||||
is_redirect ? true : false);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f2872ff67c69f164f899040c77340e116bd214c0$
|
||||
// $hash=9cf199db470205062b0c4d39f7daa739db2a95a2$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
||||
@@ -222,6 +222,37 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self,
|
||||
CefResponseCppToC::Get(self)->SetHeaderMap(headerMapMultimap);
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
response_get_url(struct _cef_response_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefResponseCppToC::Get(self)->GetURL();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK response_set_url(struct _cef_response_t* self,
|
||||
const cef_string_t* url) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: url; type: string_byref_const
|
||||
DCHECK(url);
|
||||
if (!url)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefResponseCppToC::Get(self)->SetURL(CefString(url));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@@ -239,6 +270,8 @@ CefResponseCppToC::CefResponseCppToC() {
|
||||
GetStruct()->get_header = response_get_header;
|
||||
GetStruct()->get_header_map = response_get_header_map;
|
||||
GetStruct()->set_header_map = response_set_header_map;
|
||||
GetStruct()->get_url = response_get_url;
|
||||
GetStruct()->set_url = response_set_url;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
70
libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc
Normal file
70
libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.cc
Normal file
@@ -0,0 +1,70 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a0e352ab964b29c7b1aa22791ee38a81cd418a99$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK v8array_buffer_release_callback_release_buffer(
|
||||
struct _cef_v8array_buffer_release_callback_t* self,
|
||||
void* buffer) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: buffer; type: simple_byaddr
|
||||
DCHECK(buffer);
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefV8ArrayBufferReleaseCallbackCppToC::Get(self)->ReleaseBuffer(buffer);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefV8ArrayBufferReleaseCallbackCppToC::CefV8ArrayBufferReleaseCallbackCppToC() {
|
||||
GetStruct()->release_buffer = v8array_buffer_release_callback_release_buffer;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback>
|
||||
CefCppToCRefCounted<CefV8ArrayBufferReleaseCallbackCppToC,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::
|
||||
UnwrapDerived(CefWrapperType type,
|
||||
cef_v8array_buffer_release_callback_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCppToCRefCounted<
|
||||
CefV8ArrayBufferReleaseCallbackCppToC,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
CefWrapperType
|
||||
CefCppToCRefCounted<CefV8ArrayBufferReleaseCallbackCppToC,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::kWrapperType =
|
||||
WT_V8ARRAY_BUFFER_RELEASE_CALLBACK;
|
37
libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h
Normal file
37
libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=61fe643dbdefcacb37612d6611d5b3cd0d0f731a$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_V8ARRAY_BUFFER_RELEASE_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_V8ARRAY_BUFFER_RELEASE_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_v8_capi.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefV8ArrayBufferReleaseCallbackCppToC
|
||||
: public CefCppToCRefCounted<CefV8ArrayBufferReleaseCallbackCppToC,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t> {
|
||||
public:
|
||||
CefV8ArrayBufferReleaseCallbackCppToC();
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_V8ARRAY_BUFFER_RELEASE_CALLBACK_CPPTOC_H_
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=d4baeb8853a8d33bde68e82a87e73e63fefb6e59$
|
||||
// $hash=b8c41c5cff5d308ad0ecbeafb38f12fae4ce06eb$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/base_ref_counted_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8interceptor_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
@@ -139,6 +140,30 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length) {
|
||||
return CefV8ValueCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_array_buffer(
|
||||
void* buffer,
|
||||
size_t length,
|
||||
cef_v8array_buffer_release_callback_t* release_callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: buffer; type: simple_byaddr
|
||||
DCHECK(buffer);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
// Verify param: release_callback; type: refptr_diff
|
||||
DCHECK(release_callback);
|
||||
if (!release_callback)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefV8Value> _retval = CefV8Value::CreateArrayBuffer(
|
||||
buffer, length,
|
||||
CefV8ArrayBufferReleaseCallbackCToCpp::Wrap(release_callback));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefV8ValueCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
CEF_EXPORT cef_v8value_t* cef_v8value_create_function(
|
||||
const cef_string_t* name,
|
||||
cef_v8handler_t* handler) {
|
||||
@@ -319,6 +344,20 @@ int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK v8value_is_array_buffer(struct _cef_v8value_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefV8ValueCppToC::Get(self)->IsArrayBuffer();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
@@ -806,6 +845,36 @@ int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_v8array_buffer_release_callback_t* CEF_CALLBACK
|
||||
v8value_get_array_buffer_release_callback(struct _cef_v8value_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> _retval =
|
||||
CefV8ValueCppToC::Get(self)->GetArrayBufferReleaseCallback();
|
||||
|
||||
// Return type: refptr_diff
|
||||
return CefV8ArrayBufferReleaseCallbackCToCpp::Unwrap(_retval);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK v8value_neuter_array_buffer(struct _cef_v8value_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefV8ValueCppToC::Get(self)->NeuterArrayBuffer();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK
|
||||
v8value_get_function_name(struct _cef_v8value_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -928,6 +997,7 @@ CefV8ValueCppToC::CefV8ValueCppToC() {
|
||||
GetStruct()->is_string = v8value_is_string;
|
||||
GetStruct()->is_object = v8value_is_object;
|
||||
GetStruct()->is_array = v8value_is_array;
|
||||
GetStruct()->is_array_buffer = v8value_is_array_buffer;
|
||||
GetStruct()->is_function = v8value_is_function;
|
||||
GetStruct()->is_same = v8value_is_same;
|
||||
GetStruct()->get_bool_value = v8value_get_bool_value;
|
||||
@@ -959,6 +1029,9 @@ CefV8ValueCppToC::CefV8ValueCppToC() {
|
||||
GetStruct()->adjust_externally_allocated_memory =
|
||||
v8value_adjust_externally_allocated_memory;
|
||||
GetStruct()->get_array_length = v8value_get_array_length;
|
||||
GetStruct()->get_array_buffer_release_callback =
|
||||
v8value_get_array_buffer_release_callback;
|
||||
GetStruct()->neuter_array_buffer = v8value_neuter_array_buffer;
|
||||
GetStruct()->get_function_name = v8value_get_function_name;
|
||||
GetStruct()->get_function_handler = v8value_get_function_handler;
|
||||
GetStruct()->execute_function = v8value_execute_function;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=de11e537658b94c48a2d2be344399186bd679f5b$
|
||||
// $hash=0464376fa24627e57280c81408ff70c3c2768021$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/auth_callback_ctocpp.h"
|
||||
@@ -24,11 +24,7 @@ void CefAuthCallbackCToCpp::Continue(const CefString& username,
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: username; type: string_byref_const
|
||||
DCHECK(!username.empty());
|
||||
if (username.empty())
|
||||
return;
|
||||
// Unverified params: password
|
||||
// Unverified params: username, password
|
||||
|
||||
// Execute
|
||||
_struct->cont(_struct, username.GetStruct(), password.GetStruct());
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=ca92b50b1b21d6de1a591edce5025267abdd2342$
|
||||
// $hash=9506e4c51606a428b82d70eb5a2366fed4c1c61e$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
|
||||
@@ -202,6 +202,25 @@ bool CefDisplayHandlerCToCpp::OnAutoResize(CefRefPtr<CefBrowser> browser,
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
void CefDisplayHandlerCToCpp::OnLoadingProgressChange(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
double progress) {
|
||||
cef_display_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_loading_progress_change))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->on_loading_progress_change(_struct, CefBrowserCppToC::Wrap(browser),
|
||||
progress);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f0d07bdd6b1de086c06a2e5ad7960d7cd7409894$
|
||||
// $hash=6fc6aa5750ef1aa3353c78daa018f761a7ba22a3$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_
|
||||
@@ -54,6 +54,8 @@ class CefDisplayHandlerCToCpp
|
||||
int line) override;
|
||||
bool OnAutoResize(CefRefPtr<CefBrowser> browser,
|
||||
const CefSize& new_size) override;
|
||||
void OnLoadingProgressChange(CefRefPtr<CefBrowser> browser,
|
||||
double progress) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f76ba6a84dade0b75d2018c4aee6b681a2a1505b$
|
||||
// $hash=98ed2d6d147cc82b00f766b45e1b0e15e0f84393$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/render_handler_ctocpp.h"
|
||||
@@ -326,6 +326,28 @@ void CefRenderHandlerCToCpp::OnImeCompositionRangeChanged(
|
||||
delete[] character_boundsList;
|
||||
}
|
||||
|
||||
void CefRenderHandlerCToCpp::OnTextSelectionChanged(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) {
|
||||
cef_render_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_text_selection_changed))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
// Unverified params: selected_text, selected_range
|
||||
|
||||
// Execute
|
||||
_struct->on_text_selection_changed(_struct, CefBrowserCppToC::Wrap(browser),
|
||||
selected_text.GetStruct(),
|
||||
&selected_range);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=980eeb6c12f70a23b985c8f3bb897b69ee9b73ef$
|
||||
// $hash=9e2bcb61512095fba2fca928f4696fbb39d9d3b1$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
|
||||
@@ -69,6 +69,9 @@ class CefRenderHandlerCToCpp
|
||||
void OnImeCompositionRangeChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefRange& selected_range,
|
||||
const RectList& character_bounds) override;
|
||||
void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=fbd234d6060aadc1bf5ee0efce5d8cb2c4a0e022$
|
||||
// $hash=83e35477036fe71704286b8089535e8787edf2c3$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
|
||||
@@ -30,6 +30,7 @@
|
||||
bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) {
|
||||
cef_request_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_before_browse))
|
||||
@@ -53,7 +54,7 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
// Execute
|
||||
int _retval = _struct->on_before_browse(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
||||
CefRequestCppToC::Wrap(request), is_redirect);
|
||||
CefRequestCppToC::Wrap(request), user_gesture, is_redirect);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=cde69cb97f29cb75da85bb709470f73d9e57f5bc$
|
||||
// $hash=f8849fecaa6e2a36280b9c71b37bdfbe1600fb06$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_
|
||||
@@ -37,6 +37,7 @@ class CefRequestHandlerCToCpp
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override;
|
||||
bool OnOpenURLFromTab(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=00cc7ae2c2822a50218bb1e3b9cab95ab67236a6$
|
||||
// $hash=fbfca8a1320ab81bda709202462543a658ed886d$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/response_ctocpp.h"
|
||||
@@ -224,6 +224,38 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) {
|
||||
cef_string_multimap_free(headerMapMultimap);
|
||||
}
|
||||
|
||||
CefString CefResponseCToCpp::GetURL() {
|
||||
cef_response_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_url))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_url(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
void CefResponseCToCpp::SetURL(const CefString& url) {
|
||||
cef_response_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, set_url))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: url; type: string_byref_const
|
||||
DCHECK(!url.empty());
|
||||
if (url.empty())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->set_url(_struct, url.GetStruct());
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefResponseCToCpp::CefResponseCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=0c155aa07dd80b78f92950d0fc8ff4fec7df9a21$
|
||||
// $hash=1b7de3f18de3231ea172447565684df6f0fcf265$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_
|
||||
@@ -45,6 +45,8 @@ class CefResponseCToCpp : public CefCToCppRefCounted<CefResponseCToCpp,
|
||||
CefString GetHeader(const CefString& name) OVERRIDE;
|
||||
void GetHeaderMap(HeaderMap& headerMap) OVERRIDE;
|
||||
void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE;
|
||||
CefString GetURL() OVERRIDE;
|
||||
void SetURL(const CefString& url) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_
|
||||
|
63
libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc
Normal file
63
libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.cc
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=4518c58051d90673ecc1fc2b9e29b70467b36c97$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefV8ArrayBufferReleaseCallbackCToCpp::ReleaseBuffer(void* buffer) {
|
||||
cef_v8array_buffer_release_callback_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, release_buffer))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: buffer; type: simple_byaddr
|
||||
DCHECK(buffer);
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
_struct->release_buffer(_struct, buffer);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefV8ArrayBufferReleaseCallbackCToCpp::CefV8ArrayBufferReleaseCallbackCToCpp() {
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_v8array_buffer_release_callback_t*
|
||||
CefCToCppRefCounted<CefV8ArrayBufferReleaseCallbackCToCpp,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::
|
||||
UnwrapDerived(CefWrapperType type, CefV8ArrayBufferReleaseCallback* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
template <>
|
||||
base::AtomicRefCount CefCToCppRefCounted<
|
||||
CefV8ArrayBufferReleaseCallbackCToCpp,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::DebugObjCt ATOMIC_DECLARATION;
|
||||
#endif
|
||||
|
||||
template <>
|
||||
CefWrapperType
|
||||
CefCToCppRefCounted<CefV8ArrayBufferReleaseCallbackCToCpp,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t>::kWrapperType =
|
||||
WT_V8ARRAY_BUFFER_RELEASE_CALLBACK;
|
40
libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h
Normal file
40
libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=6c5b7fe181699426e51ca11b6216a1ec56e36032$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(BUILDING_CEF_SHARED)
|
||||
#error This file can be included DLL-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_v8_capi.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefV8ArrayBufferReleaseCallbackCToCpp
|
||||
: public CefCToCppRefCounted<CefV8ArrayBufferReleaseCallbackCToCpp,
|
||||
CefV8ArrayBufferReleaseCallback,
|
||||
cef_v8array_buffer_release_callback_t> {
|
||||
public:
|
||||
CefV8ArrayBufferReleaseCallbackCToCpp();
|
||||
|
||||
// CefV8ArrayBufferReleaseCallback methods.
|
||||
void ReleaseBuffer(void* buffer) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
|
@@ -9,12 +9,13 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=54a9512b67fa17d33626e83e249fa27037bd92bc$
|
||||
// $hash=c08a6af7e4295bc574af45eb798e84e546f2e1a0$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
|
||||
@@ -131,6 +132,30 @@ CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
|
||||
return CefV8ValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateArrayBuffer(
|
||||
void* buffer,
|
||||
size_t length,
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: buffer; type: simple_byaddr
|
||||
DCHECK(buffer);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
// Verify param: release_callback; type: refptr_diff
|
||||
DCHECK(release_callback.get());
|
||||
if (!release_callback.get())
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
cef_v8value_t* _retval = cef_v8value_create_array_buffer(
|
||||
buffer, length,
|
||||
CefV8ArrayBufferReleaseCallbackCppToC::Wrap(release_callback));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefV8ValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
|
||||
const CefString& name,
|
||||
CefRefPtr<CefV8Handler> handler) {
|
||||
@@ -309,6 +334,20 @@ bool CefV8ValueCToCpp::IsArray() {
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
bool CefV8ValueCToCpp::IsArrayBuffer() {
|
||||
cef_v8value_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_array_buffer))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_array_buffer(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
bool CefV8ValueCToCpp::IsFunction() {
|
||||
cef_v8value_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_function))
|
||||
@@ -784,6 +823,36 @@ int CefV8ValueCToCpp::GetArrayLength() {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback>
|
||||
CefV8ValueCToCpp::GetArrayBufferReleaseCallback() {
|
||||
cef_v8value_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_array_buffer_release_callback))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_v8array_buffer_release_callback_t* _retval =
|
||||
_struct->get_array_buffer_release_callback(_struct);
|
||||
|
||||
// Return type: refptr_diff
|
||||
return CefV8ArrayBufferReleaseCallbackCppToC::Unwrap(_retval);
|
||||
}
|
||||
|
||||
bool CefV8ValueCToCpp::NeuterArrayBuffer() {
|
||||
cef_v8value_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, neuter_array_buffer))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->neuter_array_buffer(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
CefString CefV8ValueCToCpp::GetFunctionName() {
|
||||
cef_v8value_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_function_name))
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=8a913ff3ac0743621e969fed20ce713804ac4f16$
|
||||
// $hash=72b98313f1c00f864fd01694eb741f066ae2c5f4$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_
|
||||
@@ -44,6 +44,7 @@ class CefV8ValueCToCpp
|
||||
bool IsString() OVERRIDE;
|
||||
bool IsObject() OVERRIDE;
|
||||
bool IsArray() OVERRIDE;
|
||||
bool IsArrayBuffer() OVERRIDE;
|
||||
bool IsFunction() OVERRIDE;
|
||||
bool IsSame(CefRefPtr<CefV8Value> that) OVERRIDE;
|
||||
bool GetBoolValue() OVERRIDE;
|
||||
@@ -77,6 +78,9 @@ class CefV8ValueCToCpp
|
||||
int GetExternallyAllocatedMemory() OVERRIDE;
|
||||
int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE;
|
||||
int GetArrayLength() OVERRIDE;
|
||||
CefRefPtr<CefV8ArrayBufferReleaseCallback> GetArrayBufferReleaseCallback()
|
||||
OVERRIDE;
|
||||
bool NeuterArrayBuffer() OVERRIDE;
|
||||
CefString GetFunctionName() OVERRIDE;
|
||||
CefRefPtr<CefV8Handler> GetFunctionHandler() OVERRIDE;
|
||||
CefRefPtr<CefV8Value> ExecuteFunction(
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=8fb3e1af64274b34482ee34c75a6196654104360$
|
||||
// $hash=34ae05a5b71f5f9ede44fb859074e9ffcd7b65ad$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@@ -158,6 +158,7 @@
|
||||
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8interceptor_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h"
|
||||
@@ -372,6 +373,8 @@ CEF_EXPORT void cef_shutdown() {
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefURLRequestClientCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefURLRequestCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8AccessorCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(
|
||||
&CefV8ArrayBufferReleaseCallbackCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8ContextCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8ExceptionCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8HandlerCToCpp::DebugObjCt));
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=07d31c969dc527db8df550827d750aefa0abf1b8$
|
||||
// $hash=0549060b3d0b129aa1d4b0824eeacf3af9d3d5ab$
|
||||
//
|
||||
|
||||
#include "include/capi/cef_app_capi.h"
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h"
|
||||
@@ -363,6 +364,8 @@ CEF_GLOBAL void CefShutdown() {
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefURLRequestCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefURLRequestClientCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8AccessorCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(
|
||||
&CefV8ArrayBufferReleaseCallbackCppToC::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8ContextCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8ExceptionCToCpp::DebugObjCt));
|
||||
DCHECK(base::AtomicRefCountIsZero(&CefV8HandlerCppToC::DebugObjCt));
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=3fe3af71072987e46db28d1a94b8b6a9ad7d9e2a$
|
||||
// $hash=47f1724d1f28c8295717e5df6ce8f5f8602ce1d5$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_
|
||||
@@ -137,6 +137,7 @@ enum CefWrapperType {
|
||||
WT_URLREQUEST,
|
||||
WT_URLREQUEST_CLIENT,
|
||||
WT_V8ACCESSOR,
|
||||
WT_V8ARRAY_BUFFER_RELEASE_CALLBACK,
|
||||
WT_V8CONTEXT,
|
||||
WT_V8EXCEPTION,
|
||||
WT_V8HANDLER,
|
||||
|
@@ -363,4 +363,14 @@ patches = [
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=817738
|
||||
'name': 'win_strcat_817738',
|
||||
},
|
||||
{
|
||||
# Fix jumbo build compile error in service_worker_version.cc
|
||||
# https://crrev.com/35dabc0d
|
||||
'name': 'service_worker_jumbo',
|
||||
},
|
||||
{
|
||||
# Fix Remote Debugging is missing 'Select Element Button'
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=837145
|
||||
'name': 'devtools_837145',
|
||||
},
|
||||
]
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
index dad7599ed999..c8daf2ba58c8 100644
|
||||
index 7426062f7381..1ed9dedff31b 100644
|
||||
--- content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
+++ content/browser/renderer_host/browser_compositor_view_mac.h
|
||||
@@ -52,11 +52,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
|
||||
@@ -53,11 +53,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
|
||||
|
||||
// These will not return nullptr until Destroy is called.
|
||||
DelegatedFrameHost* GetDelegatedFrameHost();
|
||||
@@ -17,10 +17,10 @@ index dad7599ed999..c8daf2ba58c8 100644
|
||||
void DidCreateNewRendererCompositorFrameSink(
|
||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
|
||||
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
index 07d42e680951..46699b959d2d 100644
|
||||
index 7fcc24c15c37..d5949c6baddb 100644
|
||||
--- content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
|
||||
@@ -215,6 +215,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
|
||||
@@ -208,6 +208,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
|
||||
g_spare_recyclable_compositors.Get().clear();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 07d42e680951..46699b959d2d 100644
|
||||
gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() {
|
||||
if (recyclable_compositor_) {
|
||||
return recyclable_compositor_->accelerated_widget_mac()
|
||||
@@ -268,7 +274,9 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
|
||||
@@ -261,7 +267,9 @@ bool BrowserCompositorMac::UpdateNSViewAndDisplay() {
|
||||
accelerated_widget_mac_ns_view_->AcceleratedWidgetGetNSView();
|
||||
display::Display new_display =
|
||||
display::Screen::GetScreen()->GetDisplayNearestView(ns_view);
|
||||
@@ -48,7 +48,7 @@ diff --git ui/accelerated_widget_mac/accelerated_widget_mac.mm ui/accelerated_wi
|
||||
index 8306398431d9..5ab4fef9ac0f 100644
|
||||
--- ui/accelerated_widget_mac/accelerated_widget_mac.mm
|
||||
+++ ui/accelerated_widget_mac/accelerated_widget_mac.mm
|
||||
@@ -71,6 +71,10 @@ - (void)setContentsChanged;
|
||||
@@ -71,6 +71,10 @@ void AcceleratedWidgetMac::SetNSView(AcceleratedWidgetMacNSView* view) {
|
||||
DCHECK(view && !view_);
|
||||
view_ = view;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
index 593f46130e32..5f7d2fe7355d 100644
|
||||
index 3e1786aa6901..2a94e9ec8856 100644
|
||||
--- content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
+++ content/browser/browser_plugin/browser_plugin_guest.cc
|
||||
@@ -322,8 +322,11 @@ void BrowserPluginGuest::InitInternal(
|
||||
@@ -79,10 +79,10 @@ index cf8c74f4c744..b8cefb4b154b 100644
|
||||
// Creates a new View that holds a popup and receives messages for it.
|
||||
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
|
||||
index 13d687ea411e..f16415faa23f 100644
|
||||
index 5d28247a3161..b4f77825bbfb 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -781,7 +781,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
|
||||
@@ -784,7 +784,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
|
||||
@@ -92,7 +92,7 @@ index 13d687ea411e..f16415faa23f 100644
|
||||
if (render_widget_host->GetView()) {
|
||||
// During testing, the view will already be set up in most cases to the
|
||||
// test view, so we don't want to clobber it with a real one. To verify that
|
||||
@@ -793,6 +794,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
|
||||
@@ -796,6 +797,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
@@ -101,10 +101,10 @@ index 13d687ea411e..f16415faa23f 100644
|
||||
g_create_render_widget_host_view
|
||||
? g_create_render_widget_host_view(render_widget_host,
|
||||
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
|
||||
index 2371c819e665..40fa46097de1 100644
|
||||
index 50c22b1dfb53..d83f2dfab6d5 100644
|
||||
--- content/browser/web_contents/web_contents_view_aura.h
|
||||
+++ content/browser/web_contents/web_contents_view_aura.h
|
||||
@@ -114,7 +114,7 @@ class CONTENT_EXPORT WebContentsViewAura
|
||||
@@ -119,7 +119,7 @@ class CONTENT_EXPORT WebContentsViewAura
|
||||
gfx::NativeView context) override;
|
||||
RenderWidgetHostViewBase* CreateViewForWidget(
|
||||
RenderWidgetHost* render_widget_host,
|
||||
@@ -221,10 +221,10 @@ index 968c5157ab41..22aad9fbafa4 100644
|
||||
RenderWidgetHost* render_widget_host) override;
|
||||
void SetPageTitle(const base::string16& title) override;
|
||||
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
|
||||
index 6a9ee15776b6..e4872d47e3d2 100644
|
||||
index d3533591027d..8b9bbbc2f0de 100644
|
||||
--- content/browser/web_contents/web_contents_view_mac.mm
|
||||
+++ content/browser/web_contents/web_contents_view_mac.mm
|
||||
@@ -346,7 +346,8 @@ void WebContentsViewMac::CreateView(
|
||||
@@ -348,7 +348,8 @@ void WebContentsViewMac::CreateView(
|
||||
}
|
||||
|
||||
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -234,7 +234,7 @@ index 6a9ee15776b6..e4872d47e3d2 100644
|
||||
if (render_widget_host->GetView()) {
|
||||
// During testing, the view will already be set up in most cases to the
|
||||
// test view, so we don't want to clobber it with a real one. To verify that
|
||||
@@ -358,6 +359,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
@@ -360,6 +361,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
|
||||
render_widget_host->GetView());
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index ac49d3b83913..69696c72d0f3 100644
|
||||
index 957ba49abb8d..a4daa1d76df0 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
|
||||
@@ -10,7 +10,7 @@ index ac49d3b83913..69696c72d0f3 100644
|
||||
import("//chrome/common/features.gni")
|
||||
import("//components/feature_engagement/features.gni")
|
||||
import("//components/nacl/features.gni")
|
||||
@@ -1591,6 +1592,7 @@ jumbo_split_static_library("browser") {
|
||||
@@ -1579,6 +1580,7 @@ jumbo_split_static_library("browser") {
|
||||
"//base:i18n",
|
||||
"//base/allocator:buildflags",
|
||||
"//cc",
|
||||
@@ -18,7 +18,7 @@ index ac49d3b83913..69696c72d0f3 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -1845,6 +1847,10 @@ jumbo_split_static_library("browser") {
|
||||
@@ -1833,6 +1835,10 @@ jumbo_split_static_library("browser") {
|
||||
"//ui/web_dialogs",
|
||||
]
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
index 2e8e68563c3c..54a1834c6055 100644
|
||||
index deb6c5322b9b..09803293be6c 100644
|
||||
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
|
@@ -71,10 +71,10 @@ index e8e76ce5b954..1dd338dd0142 100644
|
||||
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
|
||||
content::BrowserContext* context);
|
||||
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
|
||||
index 06cc4ca5c59c..a610360829d8 100644
|
||||
index 5ba0e61824b0..db12c9e551ed 100644
|
||||
--- chrome/browser/profiles/profile_manager.cc
|
||||
+++ chrome/browser/profiles/profile_manager.cc
|
||||
@@ -377,7 +377,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
@@ -378,7 +378,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
|
||||
chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED,
|
||||
content::NotificationService::AllSources());
|
||||
|
||||
|
@@ -157,10 +157,10 @@ index ab3fd0de9e07..298db88e685f 100644
|
||||
// If we broke out of the loop, we have found an enabled plugin.
|
||||
bool enabled = i < matching_plugins.size();
|
||||
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 700886c6ce89..8a47ec9f91a3 100644
|
||||
index 910bf38b9c46..88ec7d4076b8 100644
|
||||
--- chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -774,6 +774,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -773,6 +773,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
|
||||
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
|
||||
status == chrome::mojom::PluginStatus::kBlocked) &&
|
||||
@@ -168,7 +168,7 @@ index 700886c6ce89..8a47ec9f91a3 100644
|
||||
observer->IsPluginTemporarilyAllowed(identifier)) {
|
||||
status = chrome::mojom::PluginStatus::kAllowed;
|
||||
}
|
||||
@@ -961,7 +962,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -960,7 +961,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
&plugin_auth_host);
|
||||
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
|
||||
@@ -178,7 +178,7 @@ index 700886c6ce89..8a47ec9f91a3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlocked: {
|
||||
@@ -970,7 +972,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -969,7 +971,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
|
||||
placeholder->AllowLoading();
|
||||
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
|
||||
@@ -188,7 +188,7 @@ index 700886c6ce89..8a47ec9f91a3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
|
||||
@@ -980,7 +983,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -979,7 +982,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
group_name));
|
||||
RenderThread::Get()->RecordAction(
|
||||
UserMetricsAction("Plugin_BlockedByPolicy"));
|
||||
@@ -198,7 +198,7 @@ index 700886c6ce89..8a47ec9f91a3 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
|
||||
@@ -988,7 +992,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -987,7 +991,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
IDR_BLOCKED_PLUGIN_HTML,
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
|
||||
group_name));
|
||||
|
@@ -93,10 +93,10 @@ index 2986bf0e340e..6ef8486960ce 100644
|
||||
}
|
||||
|
||||
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 1f566ef1f437..cffef1c8a2f2 100644
|
||||
index 6416a4690766..e961b32a0306 100644
|
||||
--- content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -1527,6 +1527,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
@@ -1534,6 +1534,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
|
||||
if (GetNavigationHandle()) {
|
||||
GetNavigationHandle()->set_net_error_code(
|
||||
static_cast<net::Error>(params.error_code));
|
||||
@@ -104,7 +104,7 @@ index 1f566ef1f437..cffef1c8a2f2 100644
|
||||
}
|
||||
|
||||
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
|
||||
@@ -3269,9 +3270,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
|
||||
@@ -3285,9 +3286,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
|
||||
&QuotaDispatcherHost::CreateForFrame, GetProcess(), routing_id_));
|
||||
|
||||
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
|
||||
@@ -117,7 +117,7 @@ index 1f566ef1f437..cffef1c8a2f2 100644
|
||||
// TODO(https://crbug.com/813479): Investigate why we need to explicitly
|
||||
// specify task runner for BrowserThread::IO here.
|
||||
// Bind calls to the BindRegistry should come on to the IO thread by
|
||||
@@ -3545,9 +3546,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
||||
@@ -3561,9 +3562,9 @@ void RenderFrameHostImpl::CommitNavigation(
|
||||
// however only do this for cross-document navigations, because the
|
||||
// alternative would be redundant effort.
|
||||
network::mojom::URLLoaderFactoryPtrInfo default_factory_info;
|
||||
@@ -130,7 +130,7 @@ index 1f566ef1f437..cffef1c8a2f2 100644
|
||||
if (subresource_loader_params &&
|
||||
subresource_loader_params->loader_factory_info.is_valid()) {
|
||||
// If the caller has supplied a default URLLoaderFactory override (for
|
||||
@@ -4162,8 +4163,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve(
|
||||
@@ -4178,8 +4179,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve(
|
||||
auto* context = GetSiteInstance()->GetBrowserContext();
|
||||
GetContentClient()->browser()->WillCreateURLLoaderFactory(
|
||||
this, false /* is_navigation */, &default_factory_request);
|
||||
@@ -274,10 +274,10 @@ index e6de4ca6c8b3..18eea4948e43 100644
|
||||
const std::string& mime_type,
|
||||
bool allow_wildcard,
|
||||
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
||||
index 8e482fa78e3a..99b8e486e88f 100644
|
||||
index c06c9d132a3a..f58a2ca60eb2 100644
|
||||
--- content/common/frame_messages.h
|
||||
+++ content/common/frame_messages.h
|
||||
@@ -1362,8 +1362,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
@@ -1368,8 +1368,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
||||
|
||||
// Used to get the list of plugins. |main_frame_origin| is used to handle
|
||||
// exceptions for plugin content settings.
|
||||
@@ -288,7 +288,7 @@ index 8e482fa78e3a..99b8e486e88f 100644
|
||||
url::Origin /* main_frame_origin */,
|
||||
std::vector<content::WebPluginInfo> /* plugins */)
|
||||
|
||||
@@ -1371,9 +1372,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
|
||||
@@ -1377,9 +1378,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
|
||||
// type. If there is no matching plugin, |found| is false.
|
||||
// |actual_mime_type| is the actual mime type supported by the
|
||||
// found plugin.
|
||||
@@ -388,10 +388,10 @@ index aa77b86eee98..097d26a80aa9 100644
|
||||
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
|
||||
|
||||
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
||||
index 259d31191208..890ec89bbaee 100644
|
||||
index 7fc7063d9f45..d0cf90c9fadc 100644
|
||||
--- content/renderer/render_frame_impl.cc
|
||||
+++ content/renderer/render_frame_impl.cc
|
||||
@@ -3447,7 +3447,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
@@ -3484,7 +3484,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
||||
std::string mime_type;
|
||||
bool found = false;
|
||||
Send(new FrameHostMsg_GetPluginInfo(
|
||||
@@ -401,7 +401,7 @@ index 259d31191208..890ec89bbaee 100644
|
||||
params.mime_type.Utf8(), &found, &info, &mime_type));
|
||||
if (!found)
|
||||
return nullptr;
|
||||
@@ -3808,6 +3809,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
|
||||
@@ -3845,6 +3846,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
|
||||
|
||||
void RenderFrameImpl::FrameFocused() {
|
||||
Send(new FrameHostMsg_FrameFocused(routing_id_));
|
||||
|
@@ -498,7 +498,7 @@ index 6508c2a06760..f51ce5a17e63 100644
|
||||
handler_path, database_path, metrics_path, url, process_annotations,
|
||||
arguments, true, false);
|
||||
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
|
||||
index a5d1afc409f4..91815d949f2e 100644
|
||||
index a5d1afc409f4..dc9917f7eca9 100644
|
||||
--- components/crash/content/app/crashpad_win.cc
|
||||
+++ components/crash/content/app/crashpad_win.cc
|
||||
@@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations(
|
||||
@@ -524,16 +524,34 @@ index a5d1afc409f4..91815d949f2e 100644
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
@@ -62,7 +62,9 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
base::FilePath metrics_path; // Only valid in the browser process.
|
||||
|
||||
const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME";
|
||||
+#if defined(GOOGLE_CHROME_BUILD)
|
||||
const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL";
|
||||
+#endif
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (initial_client) {
|
||||
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
@@ -82,13 +84,13 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
#if defined(GOOGLE_CHROME_BUILD)
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
#else
|
||||
-#else
|
||||
- std::string url;
|
||||
+ std::string url = crash_reporter_client->GetCrashServerURL();
|
||||
#endif
|
||||
-#endif
|
||||
|
||||
// Allow the crash server to be overridden for testing. If the variable
|
||||
@@ -103,13 +103,14 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
// isn't present in the environment then the default URL will remain.
|
||||
env->GetVar(kServerUrlVar, &url);
|
||||
+#else
|
||||
+ std::string url = crash_reporter_client->GetCrashServerURL();
|
||||
+#endif
|
||||
|
||||
wchar_t exe_file_path[MAX_PATH] = {};
|
||||
CHECK(
|
||||
@@ -103,13 +105,14 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
crashpad::TriState::kEnabled, kIndirectMemoryLimit);
|
||||
}
|
||||
|
||||
@@ -553,7 +571,7 @@ index a5d1afc409f4..91815d949f2e 100644
|
||||
if (!user_data_dir.empty()) {
|
||||
start_arguments.push_back(std::string("--user-data-dir=") +
|
||||
user_data_dir);
|
||||
@@ -120,9 +121,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
@@ -120,9 +123,12 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
start_arguments.push_back("/prefetch:7");
|
||||
} else {
|
||||
base::FilePath exe_dir = exe_file.DirName();
|
||||
|
64
patch/patches/devtools_837145.patch
Normal file
64
patch/patches/devtools_837145.patch
Normal file
@@ -0,0 +1,64 @@
|
||||
diff --git content/shell/browser/shell_devtools_frontend.cc content/shell/browser/shell_devtools_frontend.cc
|
||||
index 3b3221a..6447347 100644
|
||||
--- content/shell/browser/shell_devtools_frontend.cc
|
||||
+++ content/shell/browser/shell_devtools_frontend.cc
|
||||
@@ -19,8 +19,8 @@
|
||||
namespace {
|
||||
static GURL GetFrontendURL() {
|
||||
int port = ShellDevToolsManagerDelegate::GetHttpHandlerPort();
|
||||
- return GURL(
|
||||
- base::StringPrintf("http://127.0.0.1:%d/devtools/inspector.html", port));
|
||||
+ return GURL(base::StringPrintf(
|
||||
+ "http://127.0.0.1:%d/devtools/devtools_app.html", port));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
diff --git third_party/WebKit/Source/devtools/BUILD.gn third_party/WebKit/Source/devtools/BUILD.gn
|
||||
index 952b922..9e7b4bf 100644
|
||||
--- third_party/WebKit/Source/devtools/BUILD.gn
|
||||
+++ third_party/WebKit/Source/devtools/BUILD.gn
|
||||
@@ -1048,7 +1048,6 @@
|
||||
"$resources_out_dir/cm_modes/cm_modes_module.js",
|
||||
"$resources_out_dir/emulated_devices/emulated_devices_module.js",
|
||||
"$resources_out_dir/product_registry_impl/product_registry_impl_module.js",
|
||||
- "$resources_out_dir/screencast/screencast_module.js",
|
||||
]
|
||||
|
||||
devtools_applications = [
|
||||
diff --git third_party/WebKit/Source/devtools/front_end/inspector.json third_party/WebKit/Source/devtools/front_end/inspector.json
|
||||
index 36c222f..dc2149a 100644
|
||||
--- third_party/WebKit/Source/devtools/front_end/inspector.json
|
||||
+++ third_party/WebKit/Source/devtools/front_end/inspector.json
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"modules" : [
|
||||
- { "name": "screencast", "type": "remote" }
|
||||
+ { "name": "screencast", "type": "autostart" }
|
||||
],
|
||||
"extends": "devtools_app",
|
||||
"has_html": true
|
||||
diff --git third_party/WebKit/Source/devtools/front_end/main/Main.js third_party/WebKit/Source/devtools/front_end/main/Main.js
|
||||
index 4c9d9aa..e6d73b1 100644
|
||||
--- third_party/WebKit/Source/devtools/front_end/main/Main.js
|
||||
+++ third_party/WebKit/Source/devtools/front_end/main/Main.js
|
||||
@@ -212,19 +212,8 @@
|
||||
this._registerForwardedShortcuts();
|
||||
this._registerMessageSinkListener();
|
||||
|
||||
- // Pick first app we could instantiate (for test harness).
|
||||
- for (const extension of self.runtime.extensions(Common.AppProvider)) {
|
||||
- try {
|
||||
- const instance = await extension.instance();
|
||||
- if (instance) {
|
||||
- this._showAppUI(instance);
|
||||
- break;
|
||||
- }
|
||||
- } catch (e) {
|
||||
- console.error(e);
|
||||
- }
|
||||
- }
|
||||
Main.Main.timeEnd('Main._createAppUI');
|
||||
+ this._showAppUI(await self.runtime.extension(Common.AppProvider).instance());
|
||||
}
|
||||
|
||||
/**
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
|
||||
index 1a93ba92a9e0..2c4b116d25ea 100644
|
||||
index 26c4f50fad5b..1f95f9a18ad7 100644
|
||||
--- content/browser/devtools/devtools_http_handler.cc
|
||||
+++ content/browser/devtools/devtools_http_handler.cc
|
||||
@@ -543,7 +543,7 @@ void DevToolsHttpHandler::OnJsonRequest(
|
||||
@@ -560,7 +560,7 @@ void DevToolsHttpHandler::OnJsonRequest(
|
||||
version.SetString("Protocol-Version",
|
||||
DevToolsAgentHost::GetProtocolVersion());
|
||||
version.SetString("WebKit-Version", GetWebKitVersion());
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc
|
||||
index d7342d69dd8e..33d538952375 100644
|
||||
index 6f16deeb5f4f..f943cfdd053f 100644
|
||||
--- content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -891,10 +891,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
|
||||
@@ -892,10 +892,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
|
||||
// TODO(alexmos): This check should've been enforced earlier in the
|
||||
// navigation, in chrome::Navigate(). Verify this, and then convert this to
|
||||
// a CHECK and remove the fallback.
|
||||
@@ -18,7 +18,7 @@ index d7342d69dd8e..33d538952375 100644
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1034,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
|
||||
@@ -1034,7 +1035,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
|
||||
|
||||
// Double-check that the new SiteInstance is associated with the right
|
||||
// BrowserContext.
|
||||
|
@@ -132,7 +132,7 @@ index 94c5f759a0dd..a166b6302eeb 100644
|
||||
if (is_mac) {
|
||||
output_locales = locales_as_mac_outputs
|
||||
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
|
||||
index 3ed598db3989..b23170bc4591 100644
|
||||
index c44f8a110599..0597d10a54c1 100644
|
||||
--- chrome/installer/mini_installer/BUILD.gn
|
||||
+++ chrome/installer/mini_installer/BUILD.gn
|
||||
@@ -143,7 +143,7 @@ template("generate_mini_installer") {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc
|
||||
index 828ce9bb0138..1301e6cc1d14 100644
|
||||
index 3ca3b88be3f9..8786c68fc140 100644
|
||||
--- ui/gl/init/gl_initializer_mac.cc
|
||||
+++ ui/gl/init/gl_initializer_mac.cc
|
||||
@@ -40,11 +40,8 @@ bool InitializeOneOffForSandbox() {
|
||||
@@ -46,11 +46,8 @@ bool InitializeOneOffForSandbox() {
|
||||
// GPU-related stuff is very slow without this, probably because
|
||||
// the sandbox prevents loading graphics drivers or some such.
|
||||
std::vector<CGLPixelFormatAttribute> attribs;
|
||||
|
@@ -35,10 +35,10 @@ index 43606a755fa2..967190fc8f83 100644
|
||||
bool record_whole_document;
|
||||
SavePreviousDocumentResources save_previous_document_resources;
|
||||
diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc
|
||||
index 6e57733e6657..18cb21550b0b 100644
|
||||
index a9b91cdcc86d..2417a19d56e1 100644
|
||||
--- content/renderer/render_view_impl.cc
|
||||
+++ content/renderer/render_view_impl.cc
|
||||
@@ -1235,6 +1235,7 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
|
||||
@@ -1236,6 +1236,7 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
|
||||
blink::WebView* web_view,
|
||||
CompositorDependencies* compositor_deps) {
|
||||
ApplyWebPreferences(prefs, web_view);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
|
||||
index c50380806706..011b63531a33 100644
|
||||
index e89ff1f97be2..2573d7a8b94e 100644
|
||||
--- chrome/browser/ui/BUILD.gn
|
||||
+++ chrome/browser/ui/BUILD.gn
|
||||
@@ -919,6 +919,7 @@ split_static_library("ui") {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc
|
||||
index ba99093fc98e..5e1da4621361 100644
|
||||
index 5bee7d3a553b..4397ae979ada 100644
|
||||
--- chrome/browser/printing/print_job_worker.cc
|
||||
+++ chrome/browser/printing/print_job_worker.cc
|
||||
@@ -142,6 +142,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 087bc630062a..bd6ae8b47a1b 100644
|
||||
index 00bcfa035870..1212e1735c50 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -433,13 +433,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(
|
||||
@@ -29,7 +29,7 @@ index 087bc630062a..bd6ae8b47a1b 100644
|
||||
}
|
||||
|
||||
bool RenderWidgetHostViewAura::IsMouseLocked() {
|
||||
@@ -1922,6 +1917,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
@@ -1923,6 +1918,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
||||
if (frame_sink_id_.is_valid())
|
||||
window_->SetEmbedFrameSinkId(frame_sink_id_);
|
||||
|
||||
|
22
patch/patches/service_worker_jumbo.patch
Normal file
22
patch/patches/service_worker_jumbo.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git content/browser/service_worker/service_worker_version.cc content/browser/service_worker/service_worker_version.cc
|
||||
index 2417abcfdae2..c66986773923 100644
|
||||
--- content/browser/service_worker/service_worker_version.cc
|
||||
+++ content/browser/service_worker/service_worker_version.cc
|
||||
@@ -54,8 +54,6 @@
|
||||
|
||||
namespace content {
|
||||
|
||||
-using StatusCallback = ServiceWorkerVersion::StatusCallback;
|
||||
-
|
||||
namespace {
|
||||
|
||||
// Timeout for an installed worker to start.
|
||||
@@ -103,7 +101,7 @@ void RunCallbacks(ServiceWorkerVersion* version,
|
||||
|
||||
// An adapter to run a |callback| after StartWorker.
|
||||
void RunCallbackAfterStartWorker(base::WeakPtr<ServiceWorkerVersion> version,
|
||||
- StatusCallback callback,
|
||||
+ ServiceWorkerVersion::StatusCallback callback,
|
||||
ServiceWorkerStatusCode status) {
|
||||
if (status == SERVICE_WORKER_OK &&
|
||||
version->running_status() != EmbeddedWorkerStatus::RUNNING) {
|
@@ -207,10 +207,10 @@ index de25ae93f74d..73f490f783c9 100644
|
||||
workers_[offset] = std::move(worker);
|
||||
}
|
||||
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
|
||||
index 8e4c4a42b0a0..f78f3d3817ae 100644
|
||||
index 6e0b9d68ccbc..ba39c57a749a 100644
|
||||
--- content/browser/loader/navigation_url_loader_network_service.cc
|
||||
+++ content/browser/loader/navigation_url_loader_network_service.cc
|
||||
@@ -1020,11 +1020,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
|
||||
@@ -1030,11 +1030,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index 151c87cd72e3..593a79904382 100644
|
||||
index 09a37c1a2c70..b3fd2d561569 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -312,6 +312,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() const {
|
||||
@@ -18,7 +18,7 @@ index 151c87cd72e3..593a79904382 100644
|
||||
return renderer_frame_number_;
|
||||
}
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 06f2793aa2d7..06244d674026 100644
|
||||
index 17c07af5e63b..6a408d061790 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -79,6 +79,7 @@ class BrowserAccessibilityManager;
|
||||
@@ -73,7 +73,7 @@ index 06f2793aa2d7..06244d674026 100644
|
||||
#if defined(USE_AURA)
|
||||
void OnDidScheduleEmbed(int routing_id,
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc
|
||||
index 8318ed172a75..0d6023427bf4 100644
|
||||
index d7bb2f78dd6d..dc82d0a4b127 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_event_handler.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_event_handler.cc
|
||||
@@ -28,6 +28,10 @@
|
||||
@@ -87,7 +87,7 @@ index 8318ed172a75..0d6023427bf4 100644
|
||||
#if defined(OS_WIN)
|
||||
#include "content/browser/frame_host/render_frame_host_impl.h"
|
||||
#include "content/public/common/context_menu_params.h"
|
||||
@@ -880,6 +884,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
|
||||
@@ -886,6 +890,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
|
||||
::SetFocus(hwnd);
|
||||
}
|
||||
}
|
||||
@@ -103,10 +103,10 @@ index 8318ed172a75..0d6023427bf4 100644
|
||||
// TODO(wjmaclean): can host_ ever be null?
|
||||
if (host_ && set_focus_on_mouse_down_or_key_event_) {
|
||||
diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h
|
||||
index e967efe6ad9b..3c49ea9ac980 100644
|
||||
index 71f3b3cc9e8a..3aa2ead0894d 100644
|
||||
--- content/public/browser/render_widget_host_view.h
|
||||
+++ content/public/browser/render_widget_host_view.h
|
||||
@@ -213,6 +213,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
|
||||
@@ -215,6 +215,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
|
||||
// This must always return the same device scale factor as GetScreenInfo.
|
||||
virtual float GetDeviceScaleFactor() const = 0;
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
|
||||
index ca66c499f1e8..9208b43f669a 100644
|
||||
index c5f0ba58549c..bba41a8a5b61 100644
|
||||
--- content/browser/web_contents/web_contents_impl.cc
|
||||
+++ content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -1733,21 +1733,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -1762,21 +1762,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
std::string unique_name;
|
||||
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
||||
|
||||
@@ -45,7 +45,7 @@ index ca66c499f1e8..9208b43f669a 100644
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
|
||||
@@ -2298,6 +2307,15 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -2327,6 +2336,15 @@ void WebContentsImpl::CreateNewWindow(
|
||||
create_params.renderer_initiated_creation =
|
||||
main_frame_route_id != MSG_ROUTING_NONE;
|
||||
|
||||
@@ -61,7 +61,7 @@ index ca66c499f1e8..9208b43f669a 100644
|
||||
WebContentsImpl* new_contents = nullptr;
|
||||
if (!is_guest) {
|
||||
create_params.context = view_->GetNativeView();
|
||||
@@ -2327,7 +2345,7 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -2356,7 +2374,7 @@ void WebContentsImpl::CreateNewWindow(
|
||||
// TODO(brettw): It seems bogus that we have to call this function on the
|
||||
// newly created object and give it one of its own member variables.
|
||||
new_view->CreateViewForWidget(
|
||||
@@ -70,7 +70,7 @@ index ca66c499f1e8..9208b43f669a 100644
|
||||
}
|
||||
// Save the created window associated with the route so we can show it
|
||||
// later.
|
||||
@@ -5573,7 +5591,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
|
||||
@@ -5610,7 +5628,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
|
||||
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
|
||||
RenderViewHost* render_view_host) {
|
||||
RenderWidgetHostViewBase* rwh_view =
|
||||
@@ -95,7 +95,7 @@ index 53d56abb35a3..d7b955f42ca5 100644
|
||||
WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
|
||||
|
||||
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
|
||||
index 2dfd24904480..c254945f1621 100644
|
||||
index 6e2186917eaa..d26aa4ea94c4 100644
|
||||
--- content/public/browser/web_contents.h
|
||||
+++ content/public/browser/web_contents.h
|
||||
@@ -69,9 +69,11 @@ class BrowserPluginGuestDelegate;
|
||||
|
@@ -38,10 +38,10 @@ index 647da1f97f5c..4ef9014aecd9 100644
|
||||
|
||||
void WebDevToolsAgentImpl::Session::SendProtocolResponse(int session_id,
|
||||
diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
index d300bba78132..48ca90b83fd6 100644
|
||||
index 9ec4b2d94d13..4e894873a619 100644
|
||||
--- third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
+++ third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
@@ -1132,7 +1132,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
@@ -1136,7 +1136,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
PluginData* LocalFrame::GetPluginData() const {
|
||||
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
|
||||
return nullptr;
|
||||
|
@@ -1,8 +1,16 @@
|
||||
diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
||||
index e3a222a90f33..24298a7423f1 100644
|
||||
index e3a222a90f33..8b909deef05d 100644
|
||||
--- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
||||
+++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
||||
@@ -164,6 +164,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/sync/profile_sync_service_factory.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
+#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/browser_sync/profile_sync_service.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -164,6 +165,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
|
||||
}
|
||||
|
||||
void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) {
|
||||
@@ -13,6 +21,44 @@ index e3a222a90f33..24298a7423f1 100644
|
||||
// We are only interested in sync logs for the primary user profile.
|
||||
Profile* profile = ProfileManager::GetPrimaryUserProfile();
|
||||
if (!profile ||
|
||||
@@ -208,6 +213,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
|
||||
if (!profile)
|
||||
return;
|
||||
|
||||
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
+ switches::kDisableExtensions)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
extensions::ExtensionRegistry* extension_registry =
|
||||
extensions::ExtensionRegistry::Get(profile);
|
||||
std::string extensions_list;
|
||||
diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc
|
||||
index 5ef6e7292f5f..2884102c28e8 100644
|
||||
--- chrome/browser/memory_details.cc
|
||||
+++ chrome/browser/memory_details.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "base/task_scheduler/post_task.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/common/chrome_switches.h"
|
||||
#include "components/nacl/common/nacl_process_type.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
#include "content/public/browser/browser_child_process_host_iterator.h"
|
||||
@@ -253,8 +254,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
// Determine if this is an extension process.
|
||||
+ // CEF should avoid accessing ExtensionRegistry when extensions are disabled.
|
||||
bool process_is_for_extensions = false;
|
||||
- if (render_process_host) {
|
||||
+ if (render_process_host &&
|
||||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
+ switches::kDisableExtensions)) {
|
||||
content::BrowserContext* context =
|
||||
render_process_host->GetBrowserContext();
|
||||
extensions::ExtensionRegistry* extension_registry =
|
||||
diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc
|
||||
index 302df0f9a2cf..f6714b63a9f2 100644
|
||||
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
|
||||
index 6cd05c6fcd2a..eedc0295d8b8 100644
|
||||
index ff7dc5ac85b2..7e3d5c8a5548 100644
|
||||
--- chrome/app/generated_resources.grd
|
||||
+++ chrome/app/generated_resources.grd
|
||||
@@ -4830,7 +4830,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git base/strings/strcat.h base/strings/strcat.h
|
||||
index b249d49..44c6211 100644
|
||||
index b249d4919e82..44c6211d6b54 100644
|
||||
--- base/strings/strcat.h
|
||||
+++ base/strings/strcat.h
|
||||
@@ -11,6 +11,12 @@
|
||||
@@ -16,10 +16,10 @@ index b249d49..44c6211 100644
|
||||
namespace base {
|
||||
|
||||
diff --git base/win/windows_types.h base/win/windows_types.h
|
||||
index 8060f03..2a86195 100644
|
||||
index 8060f0391117..2a86195fa731 100644
|
||||
--- base/win/windows_types.h
|
||||
+++ base/win/windows_types.h
|
||||
@@ -248,5 +248,6 @@
|
||||
@@ -248,5 +248,6 @@ WINBASEAPI VOID WINAPI SetLastError(_In_ DWORD dwErrCode);
|
||||
#define SendMessageCallback SendMessageCallbackW
|
||||
#define SetCurrentDirectory SetCurrentDirectoryW
|
||||
#define StartService StartServiceW
|
||||
|
@@ -635,6 +635,7 @@ void ClientHandler::OnLoadError(CefRefPtr<CefBrowser> browser,
|
||||
bool ClientHandler::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
|
@@ -208,6 +208,7 @@ class ClientHandler : public CefClient,
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) OVERRIDE;
|
||||
bool OnOpenURLFromTab(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
|
@@ -513,7 +513,11 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
||||
}
|
||||
|
||||
void OnJobCompleted(GtkPrintJob* print_job, GError* error) {
|
||||
job_callback_->Continue();
|
||||
// Continue() will result in a call to ClientPrintHandlerGtk::OnPrintReset
|
||||
// which deletes |this|. Execute it asnychronously so the call stack has a
|
||||
// chance to unwind.
|
||||
CefPostTask(TID_UI, base::Bind(&CefPrintJobCallback::Continue,
|
||||
job_callback_.get()));
|
||||
job_callback_ = NULL;
|
||||
}
|
||||
|
||||
|
@@ -456,3 +456,71 @@ TEST(DisplayTest, OnConsoleMessageAssert) {
|
||||
handler->ExecuteTest();
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
const char kLoadinProgressUrl[] = "http://tests-display/loading-progress.html";
|
||||
|
||||
// Browser side.
|
||||
class LoadingProgressTestHandler : public TestHandler {
|
||||
public:
|
||||
LoadingProgressTestHandler() {}
|
||||
|
||||
void RunTest() override {
|
||||
// Add the resources that we will navigate to/from.
|
||||
AddResource(kLoadinProgressUrl,
|
||||
"<html><head><style>"
|
||||
"body {overflow:hidden;margin:0px;padding:0px;}"
|
||||
"</style></head><body><div id=a>Content</div></body></html>",
|
||||
"text/html");
|
||||
|
||||
// Create the browser.
|
||||
CreateBrowser(kLoadinProgressUrl);
|
||||
|
||||
// Time out the test after a reasonable period of time.
|
||||
SetTestTimeout();
|
||||
}
|
||||
|
||||
void OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
|
||||
bool isLoading,
|
||||
bool canGoBack,
|
||||
bool canGoForward) override {
|
||||
if (isLoading)
|
||||
return;
|
||||
|
||||
DestroyTest();
|
||||
}
|
||||
|
||||
void OnLoadingProgressChange(CefRefPtr<CefBrowser> browser,
|
||||
double progress) override {
|
||||
if (!got_loading_progress_change0_) {
|
||||
got_loading_progress_change0_.yes();
|
||||
EXPECT_GE(progress, 0.0);
|
||||
} else if (!got_loading_progress_change1_) {
|
||||
got_loading_progress_change1_.yes();
|
||||
EXPECT_LE(progress, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyTest() override {
|
||||
EXPECT_TRUE(got_loading_progress_change0_);
|
||||
EXPECT_TRUE(got_loading_progress_change1_);
|
||||
TestHandler::DestroyTest();
|
||||
}
|
||||
|
||||
private:
|
||||
TrackCallback got_loading_progress_change0_;
|
||||
TrackCallback got_loading_progress_change1_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(LoadingProgressTestHandler);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
// Test OnLoadingProgressChange notification.
|
||||
TEST(DisplayTest, LoadingProgress) {
|
||||
CefRefPtr<LoadingProgressTestHandler> handler =
|
||||
new LoadingProgressTestHandler();
|
||||
handler->ExecuteTest();
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
@@ -95,11 +95,12 @@ const char kFrameNavMsg[] = "FrameTest.Navigation";
|
||||
const char kFrameNavOrigin0[] = "http://tests-framenav0.com/";
|
||||
const char kFrameNavOrigin1[] = "http://tests-framenav1.com/";
|
||||
const char kFrameNavOrigin2[] = "http://tests-framenav2.com/";
|
||||
const char kFrameNavOrigin3[] = "http://tests-framenav3.com/";
|
||||
|
||||
// Maximum number of navigations. Should be kept synchronized with the number
|
||||
// of kFrameNavOrigin* values. Don't modify this value without checking the
|
||||
// below use cases.
|
||||
const int kMaxMultiNavNavigations = 3;
|
||||
const int kMaxMultiNavNavigations = 4;
|
||||
|
||||
// Global variables identifying the currently running test.
|
||||
bool g_frame_nav_test = false;
|
||||
@@ -163,7 +164,7 @@ class FrameNavExpectations {
|
||||
CompletionCallback completion_callback_;
|
||||
};
|
||||
|
||||
// Browser process expectations abstact base class.
|
||||
// Browser process expectations abstract base class.
|
||||
class FrameNavExpectationsBrowser : public FrameNavExpectations {
|
||||
public:
|
||||
explicit FrameNavExpectationsBrowser(int nav)
|
||||
@@ -427,7 +428,7 @@ class FrameNavTestHandler : public TestHandler {
|
||||
CreateBrowser(expectations_->GetMainURL());
|
||||
|
||||
// Time out the test after a reasonable period of time.
|
||||
SetTestTimeout();
|
||||
SetTestTimeout(15000);
|
||||
}
|
||||
|
||||
// Transition to the next navigation.
|
||||
@@ -479,6 +480,7 @@ class FrameNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_TRUE(
|
||||
expectations_->OnBeforeBrowse(browser, frame, request->GetURL()))
|
||||
@@ -1665,6 +1667,7 @@ namespace {
|
||||
const char kFrame0Name[] = "";
|
||||
const char kFrame1Name[] = "nav2";
|
||||
const char kFrame2Name[] = "<!--framePath //nav2/<!--frame0-->-->";
|
||||
const char kFrame3Name[] = "nav3";
|
||||
|
||||
bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
@@ -1672,11 +1675,11 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
int frame_number) {
|
||||
V_DECLARE();
|
||||
|
||||
// frame0 contains frame1 contains frame2.
|
||||
CefRefPtr<CefFrame> frame0, frame1, frame2;
|
||||
CefRefPtr<CefFrame> frame0b, frame1b, frame2b;
|
||||
int64 frame0id, frame1id, frame2id;
|
||||
std::string frame0url, frame1url, frame2url;
|
||||
// frame0 contains frame1 contains frame2, contains frame3.
|
||||
CefRefPtr<CefFrame> frame0, frame1, frame2, frame3;
|
||||
CefRefPtr<CefFrame> frame0b, frame1b, frame2b, frame3b;
|
||||
int64 frame0id, frame1id, frame2id, frame3id;
|
||||
std::string frame0url, frame1url, frame2url, frame3url;
|
||||
|
||||
// Find frames by name.
|
||||
frame0 = browser->GetFrame(kFrame0Name);
|
||||
@@ -1685,6 +1688,8 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame1.get());
|
||||
frame2 = browser->GetFrame(kFrame2Name);
|
||||
V_EXPECT_TRUE(frame2.get());
|
||||
frame3 = browser->GetFrame(kFrame3Name);
|
||||
V_EXPECT_TRUE(frame3.get());
|
||||
|
||||
// Verify that the name matches.
|
||||
V_EXPECT_TRUE(frame0->GetName().ToString() == kFrame0Name)
|
||||
@@ -1696,6 +1701,9 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame2->GetName().ToString() == kFrame2Name)
|
||||
<< "expected: " << kFrame2Name
|
||||
<< " actual: " << frame2->GetName().ToString();
|
||||
V_EXPECT_TRUE(frame3->GetName().ToString() == kFrame3Name)
|
||||
<< "expected: " << kFrame3Name
|
||||
<< " actual: " << frame3->GetName().ToString();
|
||||
|
||||
// Verify that the URL matches.
|
||||
frame0url = GetMultiNavURL(origin, 0);
|
||||
@@ -1710,6 +1718,10 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame2->GetURL() == frame2url)
|
||||
<< "expected: " << frame2url
|
||||
<< " actual: " << frame2->GetURL().ToString();
|
||||
frame3url = GetMultiNavURL(origin, 3);
|
||||
V_EXPECT_TRUE(frame3->GetURL() == frame3url)
|
||||
<< "expected: " << frame3url
|
||||
<< " actual: " << frame3->GetURL().ToString();
|
||||
|
||||
// Verify that the frame id is valid.
|
||||
frame0id = frame0->GetIdentifier();
|
||||
@@ -1718,6 +1730,8 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame1id > 0) << "actual: " << frame1id;
|
||||
frame2id = frame2->GetIdentifier();
|
||||
V_EXPECT_TRUE(frame2id > 0) << "actual: " << frame2id;
|
||||
frame3id = frame3->GetIdentifier();
|
||||
V_EXPECT_TRUE(frame3id > 0) << "actual: " << frame3id;
|
||||
|
||||
// Verify that the current frame has the correct id.
|
||||
if (frame_number == 0) {
|
||||
@@ -1729,6 +1743,9 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
} else if (frame_number == 2) {
|
||||
V_EXPECT_TRUE(frame->GetIdentifier() == frame2id)
|
||||
<< "expected: " << frame2id << " actual: " << frame->GetIdentifier();
|
||||
} else if (frame_number == 3) {
|
||||
V_EXPECT_TRUE(frame->GetIdentifier() == frame3id)
|
||||
<< "expected: " << frame3id << " actual: " << frame->GetIdentifier();
|
||||
}
|
||||
|
||||
// Find frames by id.
|
||||
@@ -1738,6 +1755,8 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame1b.get());
|
||||
frame2b = browser->GetFrame(frame2->GetIdentifier());
|
||||
V_EXPECT_TRUE(frame2b.get());
|
||||
frame3b = browser->GetFrame(frame3->GetIdentifier());
|
||||
V_EXPECT_TRUE(frame3b.get());
|
||||
|
||||
// Verify that the id matches.
|
||||
V_EXPECT_TRUE(frame0b->GetIdentifier() == frame0id)
|
||||
@@ -1746,31 +1765,37 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
<< "expected: " << frame1id << " actual: " << frame1b->GetIdentifier();
|
||||
V_EXPECT_TRUE(frame2b->GetIdentifier() == frame2id)
|
||||
<< "expected: " << frame2id << " actual: " << frame2b->GetIdentifier();
|
||||
V_EXPECT_TRUE(frame3b->GetIdentifier() == frame3id)
|
||||
<< "expected: " << frame3id << " actual: " << frame3b->GetIdentifier();
|
||||
|
||||
size_t frame_count = browser->GetFrameCount();
|
||||
V_EXPECT_TRUE(frame_count == 3U) << "actual: " << frame_count;
|
||||
V_EXPECT_TRUE(frame_count == 4U) << "actual: " << frame_count;
|
||||
|
||||
// Verify the GetFrameNames result.
|
||||
std::vector<CefString> names;
|
||||
browser->GetFrameNames(names);
|
||||
V_EXPECT_TRUE(names.size() == 3U) << "actual: " << names.size();
|
||||
V_EXPECT_TRUE(names.size() == 4U) << "actual: " << names.size();
|
||||
V_EXPECT_TRUE(names[0].ToString() == kFrame0Name)
|
||||
<< "expected: " << kFrame0Name << " actual: " << names[0].ToString();
|
||||
V_EXPECT_TRUE(names[1].ToString() == kFrame1Name)
|
||||
<< "expected: " << kFrame1Name << " actual: " << names[1].ToString();
|
||||
V_EXPECT_TRUE(names[2].ToString() == kFrame2Name)
|
||||
<< "expected: " << kFrame2Name << " actual: " << names[2].ToString();
|
||||
V_EXPECT_TRUE(names[3].ToString() == kFrame3Name)
|
||||
<< "expected: " << kFrame3Name << " actual: " << names[3].ToString();
|
||||
|
||||
// Verify the GetFrameIdentifiers result.
|
||||
std::vector<int64> idents;
|
||||
browser->GetFrameIdentifiers(idents);
|
||||
V_EXPECT_TRUE(idents.size() == 3U) << "actual: " << idents.size();
|
||||
V_EXPECT_TRUE(idents.size() == 4U) << "actual: " << idents.size();
|
||||
V_EXPECT_TRUE(idents[0] == frame0id)
|
||||
<< "expected: " << frame0id << " actual: " << idents[0];
|
||||
V_EXPECT_TRUE(idents[1] == frame1id)
|
||||
<< "expected: " << frame1id << " actual: " << idents[1];
|
||||
V_EXPECT_TRUE(idents[2] == frame2id)
|
||||
<< "expected: " << frame2id << " actual: " << idents[2];
|
||||
V_EXPECT_TRUE(idents[3] == frame3id)
|
||||
<< "expected: " << frame3id << " actual: " << idents[3];
|
||||
|
||||
// Verify parent hierarchy.
|
||||
V_EXPECT_FALSE(frame0->GetParent().get());
|
||||
@@ -1780,6 +1805,9 @@ bool VerifyBrowserIframe(CefRefPtr<CefBrowser> browser,
|
||||
V_EXPECT_TRUE(frame2->GetParent()->GetIdentifier() == frame1id)
|
||||
<< "expected: " << frame1id
|
||||
<< " actual: " << frame2->GetParent()->GetIdentifier();
|
||||
V_EXPECT_TRUE(frame3->GetParent()->GetIdentifier() == frame2id)
|
||||
<< "expected: " << frame2id
|
||||
<< " actual: " << frame3->GetParent()->GetIdentifier();
|
||||
|
||||
V_RETURN();
|
||||
}
|
||||
@@ -1807,6 +1835,9 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
case 2:
|
||||
origin_ = kFrameNavOrigin2;
|
||||
break;
|
||||
case 3:
|
||||
origin_ = kFrameNavOrigin3;
|
||||
break;
|
||||
default:
|
||||
EXPECT_TRUE(false); // Not reached.
|
||||
break;
|
||||
@@ -1830,9 +1861,21 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
// Frame 1. Contains an unnamed iframe.
|
||||
return "<html><body>Nav2<iframe src=\"" + GetMultiNavURL(origin_, 2) +
|
||||
"\"></body></html>";
|
||||
case 2:
|
||||
// Frame 2.
|
||||
return "<html><body>Nav3</body></html>";
|
||||
case 2: {
|
||||
// Frame 2. Contains an named iframe created via javascript.
|
||||
std::stringstream ss;
|
||||
ss << "<html><script>"
|
||||
<< " function createFrame() {"
|
||||
<< " var f = document.createElement('iframe');"
|
||||
<< " f.name = 'nav3';"
|
||||
<< " f.src = '" << GetMultiNavURL(origin_, 3) << "';"
|
||||
<< " document.body.appendChild(f);"
|
||||
<< " }</script><body onload=\"createFrame()\">Nav3</body></html>";
|
||||
return ss.str();
|
||||
}
|
||||
case 3:
|
||||
// Frame 3.
|
||||
return "<html><body>Nav4</body></html>";
|
||||
default:
|
||||
EXPECT_TRUE(false); // Not reached.
|
||||
return "";
|
||||
@@ -1841,7 +1884,8 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
|
||||
bool IsNavigationDone() const override {
|
||||
return got_load_state_change_done_ && got_renderer_complete_ &&
|
||||
got_load_end_[0] && got_load_end_[1] && got_load_end_[2];
|
||||
got_load_end_[0] && got_load_end_[1] && got_load_end_[2] &&
|
||||
got_load_end_[3];
|
||||
}
|
||||
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
@@ -1886,12 +1930,19 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
if (frame_number == 0) {
|
||||
V_EXPECT_FALSE(got_load_start_[1]);
|
||||
V_EXPECT_FALSE(got_load_start_[2]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 1) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_FALSE(got_load_start_[2]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 2) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 3) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_TRUE(got_load_start_[2]);
|
||||
} else {
|
||||
V_EXPECT_TRUE(false); // Not reached.
|
||||
}
|
||||
@@ -1914,12 +1965,19 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
if (frame_number == 0) {
|
||||
V_EXPECT_TRUE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 1) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 2) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_FALSE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 3) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_FALSE(got_load_end_[1]);
|
||||
V_EXPECT_FALSE(got_load_end_[2]);
|
||||
} else {
|
||||
V_EXPECT_TRUE(false); // Not reached.
|
||||
}
|
||||
@@ -1958,9 +2016,11 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_TRUE(got_load_start_[2]);
|
||||
V_EXPECT_TRUE(got_load_start_[3]);
|
||||
V_EXPECT_TRUE(got_load_end_[0]);
|
||||
V_EXPECT_TRUE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
V_EXPECT_TRUE(got_renderer_complete_);
|
||||
V_EXPECT_TRUE(parent::Finalize());
|
||||
V_RETURN();
|
||||
@@ -1971,8 +2031,8 @@ class FrameNavExpectationsBrowserTestNestedIframes
|
||||
std::string origin_;
|
||||
|
||||
TrackCallback got_load_state_change_done_;
|
||||
TrackCallback got_load_start_[3];
|
||||
TrackCallback got_load_end_[3];
|
||||
TrackCallback got_load_start_[4];
|
||||
TrackCallback got_load_end_[4];
|
||||
TrackCallback got_renderer_complete_;
|
||||
};
|
||||
|
||||
@@ -1989,7 +2049,7 @@ class FrameNavExpectationsRendererTestNestedIframes
|
||||
|
||||
bool IsNavigationDone() const override {
|
||||
return got_load_state_change_done_ && got_load_end_[0] &&
|
||||
got_load_end_[1] && got_load_end_[2];
|
||||
got_load_end_[1] && got_load_end_[2] && got_load_end_[3];
|
||||
}
|
||||
|
||||
bool OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
|
||||
@@ -2024,12 +2084,19 @@ class FrameNavExpectationsRendererTestNestedIframes
|
||||
if (frame_number == 0) {
|
||||
V_EXPECT_FALSE(got_load_start_[1]);
|
||||
V_EXPECT_FALSE(got_load_start_[2]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 1) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_FALSE(got_load_start_[2]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 2) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_FALSE(got_load_start_[3]);
|
||||
} else if (frame_number == 3) {
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_TRUE(got_load_start_[2]);
|
||||
}
|
||||
|
||||
got_load_start_[frame_number].yes();
|
||||
@@ -2050,12 +2117,19 @@ class FrameNavExpectationsRendererTestNestedIframes
|
||||
if (frame_number == 0) {
|
||||
V_EXPECT_TRUE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 1) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 2) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_FALSE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
} else if (frame_number == 3) {
|
||||
V_EXPECT_FALSE(got_load_end_[0]);
|
||||
V_EXPECT_FALSE(got_load_end_[1]);
|
||||
V_EXPECT_FALSE(got_load_end_[2]);
|
||||
}
|
||||
|
||||
V_EXPECT_TRUE(VerifyBrowserIframe(browser, frame, origin_, frame_number))
|
||||
@@ -2073,9 +2147,11 @@ class FrameNavExpectationsRendererTestNestedIframes
|
||||
V_EXPECT_TRUE(got_load_start_[0]);
|
||||
V_EXPECT_TRUE(got_load_start_[1]);
|
||||
V_EXPECT_TRUE(got_load_start_[2]);
|
||||
V_EXPECT_TRUE(got_load_start_[3]);
|
||||
V_EXPECT_TRUE(got_load_end_[0]);
|
||||
V_EXPECT_TRUE(got_load_end_[1]);
|
||||
V_EXPECT_TRUE(got_load_end_[2]);
|
||||
V_EXPECT_TRUE(got_load_end_[3]);
|
||||
V_EXPECT_TRUE(parent::Finalize());
|
||||
V_RETURN();
|
||||
}
|
||||
@@ -2084,8 +2160,8 @@ class FrameNavExpectationsRendererTestNestedIframes
|
||||
std::string origin_;
|
||||
|
||||
TrackCallback got_load_state_change_done_;
|
||||
TrackCallback got_load_start_[3];
|
||||
TrackCallback got_load_end_[3];
|
||||
TrackCallback got_load_start_[4];
|
||||
TrackCallback got_load_end_[4];
|
||||
};
|
||||
|
||||
class FrameNavExpectationsFactoryBrowserTestNestedIframesSameOrigin
|
||||
|
@@ -229,6 +229,7 @@ class MRTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
message_router_->OnBeforeBrowse(browser, frame);
|
||||
return false;
|
||||
|
@@ -368,6 +368,7 @@ class HistoryNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
const NavListItem& item = kHNavList[nav_];
|
||||
|
||||
@@ -1455,6 +1456,7 @@ class OrderNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_EQ(RT_MAIN_FRAME, request->GetResourceType());
|
||||
|
||||
@@ -1896,13 +1898,22 @@ class LoadNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_EQ(RT_MAIN_FRAME, request->GetResourceType());
|
||||
if (mode_ == LOAD || request->GetURL() == kLoadNav1)
|
||||
if (mode_ == LOAD || request->GetURL() == kLoadNav1) {
|
||||
EXPECT_EQ(TT_EXPLICIT, request->GetTransitionType());
|
||||
else
|
||||
EXPECT_FALSE(user_gesture);
|
||||
} else {
|
||||
EXPECT_EQ(TT_LINK, request->GetTransitionType());
|
||||
|
||||
if (mode_ == LEFT_CLICK) {
|
||||
EXPECT_TRUE(user_gesture);
|
||||
} else {
|
||||
EXPECT_FALSE(user_gesture);
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_GT(browser_id_current_, 0);
|
||||
EXPECT_EQ(browser_id_current_, browser->GetIdentifier());
|
||||
|
||||
@@ -2602,6 +2613,7 @@ class BrowseNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
const std::string& url = request->GetURL();
|
||||
EXPECT_STREQ(kBrowseNavPageUrl, url.c_str());
|
||||
@@ -2764,6 +2776,7 @@ class SameNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
const std::string& url = request->GetURL();
|
||||
EXPECT_STREQ(expected_url_.c_str(), url.c_str());
|
||||
@@ -2956,6 +2969,7 @@ class CancelBeforeNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_TRUE(got_loading_state_changed_start_);
|
||||
EXPECT_FALSE(got_before_browse_);
|
||||
@@ -3199,6 +3213,7 @@ class CancelAfterNavTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_TRUE(got_loading_state_changed_start_);
|
||||
EXPECT_FALSE(got_before_browse_);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "include/base/cef_bind.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/cef_parser.h"
|
||||
#include "include/cef_v8.h"
|
||||
#include "include/wrapper/cef_closure_task.h"
|
||||
#include "include/wrapper/cef_stream_resource_handler.h"
|
||||
@@ -33,65 +34,13 @@ const char kTestUrl[] = "http://tests/osrtest";
|
||||
const int kOsrWidth = 600;
|
||||
const int kOsrHeight = 400;
|
||||
|
||||
// precomputed bounding client rects for html elements (h1 and li).
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
const CefRect kExpectedRectLI[] = {
|
||||
CefRect(8, 8, 567, 74), // LI00
|
||||
CefRect(27, 103, 548, 20), // LI01
|
||||
CefRect(27, 123, 548, 20), // LI02
|
||||
CefRect(27, 143, 548, 20), // LI03
|
||||
CefRect(27, 163, 548, 20), // LI04
|
||||
CefRect(27, 183, 548, 20), // LI05
|
||||
CefRect(27, 203, 548, 20), // LI06
|
||||
CefRect(27, 223, 548, 20), // LI07
|
||||
CefRect(27, 243, 548, 26), // LI08
|
||||
CefRect(27, 269, 548, 26), // LI09
|
||||
CefRect(27, 295, 548, 20), // LI10
|
||||
};
|
||||
#elif defined(OS_MACOSX)
|
||||
const CefRect kExpectedRectLI[] = {
|
||||
CefRect(8, 8, 584, 74), // LI00
|
||||
CefRect(28, 103, 564, 18), // LI01
|
||||
CefRect(28, 121, 564, 18), // LI02
|
||||
CefRect(28, 139, 564, 18), // LI03
|
||||
CefRect(28, 157, 564, 18), // LI04
|
||||
CefRect(28, 175, 564, 18), // LI05
|
||||
CefRect(28, 193, 564, 18), // LI06
|
||||
CefRect(28, 211, 564, 18), // LI07
|
||||
CefRect(28, 229, 564, 23), // LI08
|
||||
CefRect(28, 252, 564, 26), // LI09
|
||||
CefRect(18, 291, 360, 21), // LI10
|
||||
};
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
// bounding client rects for edit box and navigate button
|
||||
#if defined(OS_WIN)
|
||||
const CefRect kEditBoxRect(412, 245, 60, 22);
|
||||
const CefRect kNavigateButtonRect(360, 271, 140, 22);
|
||||
const CefRect kSelectRect(467, 22, 75, 20);
|
||||
const CefRect kExpandedSelectRect(463, 42, 81, 334);
|
||||
const CefRect kDropDivRect(8, 332, 52, 52);
|
||||
const CefRect kDragDivRect(71, 342, 30, 30);
|
||||
const int kDefaultVerticalScrollbarWidth = 17;
|
||||
const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
|
||||
#elif defined(OS_MACOSX)
|
||||
const CefRect kEditBoxRect(442, 251, 46, 16);
|
||||
const CefRect kNavigateButtonRect(375, 275, 130, 20);
|
||||
const CefRect kSelectRect(461, 21, 87, 26);
|
||||
const CefRect kExpandedSelectRect(463, 42, 75, 286);
|
||||
const CefRect kDropDivRect(9, 330, 52, 52);
|
||||
const CefRect kDragDivRect(60, 330, 30, 30);
|
||||
#elif defined(OS_LINUX)
|
||||
const CefRect kEditBoxRect(434, 246, 60, 20);
|
||||
const CefRect kNavigateButtonRect(380, 271, 140, 22);
|
||||
const CefRect kSelectRect(467, 22, 75, 20);
|
||||
const CefRect kExpandedSelectRect(463, 42, 79, 334);
|
||||
const CefRect kDropDivRect(8, 332, 52, 52);
|
||||
const CefRect kDragDivRect(71, 342, 30, 30);
|
||||
const int kDefaultVerticalScrollbarWidth = 14;
|
||||
const int kVerticalScrollbarWidth = 14;
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif // defined(OS_WIN)
|
||||
@@ -207,6 +156,8 @@ enum OSRTestType {
|
||||
OSR_TEST_IME_FINISH_COMPOSITION,
|
||||
// IMECancelComposition will update the composition range
|
||||
OSR_TEST_IME_CANCEL_COMPOSITION,
|
||||
// text selection range changed
|
||||
OSR_TEST_TEXT_SELECTION_CHANGE,
|
||||
|
||||
// Define the range for popup tests.
|
||||
OSR_TEST_POPUP_FIRST = OSR_TEST_POPUP_PAINT,
|
||||
@@ -286,8 +237,10 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
CefRefPtr<Callback> callback) override {
|
||||
EXPECT_TRUE(browser.get());
|
||||
|
||||
if (!started())
|
||||
return false;
|
||||
if (!started()) {
|
||||
return handleBoundsQuery(browser, frame, query_id, request, persistent,
|
||||
callback);
|
||||
}
|
||||
|
||||
const std::string& messageStr = request;
|
||||
switch (test_type_) {
|
||||
@@ -316,6 +269,33 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool handleBoundsQuery(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int64 query_id,
|
||||
const CefString& request,
|
||||
bool persistent,
|
||||
CefRefPtr<Callback> callback) {
|
||||
CefRefPtr<CefValue> jsonObj = CefParseJSON(request, JSON_PARSER_RFC);
|
||||
if (jsonObj.get()) {
|
||||
CefRefPtr<CefDictionaryValue> dict = jsonObj->GetDictionary();
|
||||
const std::string& type = dict->GetString("type");
|
||||
if (type == "ElementBounds") {
|
||||
CefRefPtr<CefListValue> elems = dict->GetList("elems");
|
||||
|
||||
for (size_t i = 0; i < elems->GetSize(); i++) {
|
||||
CefRefPtr<CefDictionaryValue> elem = elems->GetDictionary(i);
|
||||
std::string elementId = elem->GetString("id");
|
||||
CefRect bounds(elem->GetInt("x"), elem->GetInt("y"),
|
||||
elem->GetInt("width"), elem->GetInt("height"));
|
||||
element_bounds_.insert(std::make_pair(elementId, bounds));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// CefClient methods, providing handlers
|
||||
CefRefPtr<CefFocusHandler> GetFocusHandler() override { return this; }
|
||||
|
||||
@@ -359,7 +339,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
int& screenX,
|
||||
int& screenY) override {
|
||||
if (test_type_ == OSR_TEST_SCREEN_POINT && started()) {
|
||||
const CefRect& expected_rect = GetExpectedRect(4);
|
||||
const CefRect& expected_rect = GetElementBounds("LI04");
|
||||
EXPECT_EQ(viewX, MiddleX(expected_rect));
|
||||
EXPECT_EQ(viewY, MiddleY(expected_rect));
|
||||
DestroySucceededTestSoon();
|
||||
@@ -527,7 +507,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseMoveEvent(mouse_event, true);
|
||||
// enter mouse in the LI2 element having hand cursor
|
||||
const CefRect& expected_rect = GetExpectedRect(2);
|
||||
const CefRect& expected_rect = GetElementBounds("LI02");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
browser->GetHost()->SendMouseMoveEvent(mouse_event, false);
|
||||
@@ -536,7 +516,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
case OSR_TEST_MOUSE_MOVE:
|
||||
if (StartTest()) {
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(3);
|
||||
const CefRect& expected_rect = GetElementBounds("LI03");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
@@ -548,7 +528,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
case OSR_TEST_CONTEXT_MENU:
|
||||
if (StartTest()) {
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(4);
|
||||
const CefRect& expected_rect = GetElementBounds("LI04");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
@@ -561,7 +541,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
case OSR_TEST_CLICK_LEFT:
|
||||
if (StartTest()) {
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(0);
|
||||
const CefRect& expected_rect = GetElementBounds("LI00");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
|
||||
@@ -598,8 +578,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// click inside edit box
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kEditBoxRect);
|
||||
mouse_event.y = MiddleY(kEditBoxRect);
|
||||
const CefRect& editbox = GetElementBounds("editbox");
|
||||
mouse_event.x = MiddleX(editbox);
|
||||
mouse_event.y = MiddleY(editbox);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -621,9 +602,11 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
}
|
||||
|
||||
// click button to navigate
|
||||
mouse_event.x = MiddleX(kNavigateButtonRect);
|
||||
mouse_event.y = MiddleY(kNavigateButtonRect);
|
||||
const CefRect& btnnavigate = GetElementBounds("btnnavigate");
|
||||
mouse_event.x = MiddleX(btnnavigate);
|
||||
mouse_event.y = MiddleY(btnnavigate);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, true,
|
||||
@@ -633,7 +616,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
case OSR_TEST_TOOLTIP:
|
||||
if (StartTest()) {
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(10);
|
||||
const CefRect& expected_rect = GetElementBounds("LI10");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
@@ -645,7 +628,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// scroll down once
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetExpectedRect(0);
|
||||
const CefRect& expected_rect = GetElementBounds("LI00");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
@@ -787,8 +770,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// move the mouse over the element to drag
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kDragDivRect);
|
||||
mouse_event.y = MiddleY(kDragDivRect);
|
||||
const CefRect& dragdiv = GetElementBounds("dragdiv");
|
||||
mouse_event.x = MiddleX(dragdiv);
|
||||
mouse_event.y = MiddleY(dragdiv);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseMoveEvent(mouse_event, false);
|
||||
// click on the element to drag
|
||||
@@ -806,8 +790,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// click inside edit box so that text could be entered
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kEditBoxRect);
|
||||
mouse_event.y = MiddleY(kEditBoxRect);
|
||||
const CefRect& editbox = GetElementBounds("editbox");
|
||||
mouse_event.x = MiddleX(editbox);
|
||||
mouse_event.y = MiddleY(editbox);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -832,8 +817,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
browser->GetHost()->ImeCommitText(markedText, range, 0);
|
||||
|
||||
// click button to navigate
|
||||
mouse_event.x = MiddleX(kNavigateButtonRect);
|
||||
mouse_event.y = MiddleY(kNavigateButtonRect);
|
||||
const CefRect& btnnavigate = GetElementBounds("btnnavigate");
|
||||
mouse_event.x = MiddleX(btnnavigate);
|
||||
mouse_event.y = MiddleY(btnnavigate);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, true,
|
||||
@@ -845,8 +831,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// click inside edit box so that text could be entered
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kEditBoxRect);
|
||||
mouse_event.y = MiddleY(kEditBoxRect);
|
||||
const CefRect& editbox = GetElementBounds("editbox");
|
||||
mouse_event.x = MiddleX(editbox);
|
||||
mouse_event.y = MiddleY(editbox);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -869,8 +856,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
browser->GetHost()->ImeFinishComposingText(true);
|
||||
|
||||
// click button to navigate
|
||||
mouse_event.x = MiddleX(kNavigateButtonRect);
|
||||
mouse_event.y = MiddleY(kNavigateButtonRect);
|
||||
const CefRect& btnnavigate = GetElementBounds("btnnavigate");
|
||||
mouse_event.x = MiddleX(btnnavigate);
|
||||
mouse_event.y = MiddleY(btnnavigate);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, true,
|
||||
@@ -882,8 +870,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// click inside edit box so that text could be entered
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kEditBoxRect);
|
||||
mouse_event.y = MiddleY(kEditBoxRect);
|
||||
const CefRect& editbox = GetElementBounds("editbox");
|
||||
mouse_event.x = MiddleX(editbox);
|
||||
mouse_event.y = MiddleY(editbox);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -909,8 +898,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
browser->GetHost()->ImeCancelComposition();
|
||||
|
||||
// click button to navigate and verify
|
||||
mouse_event.x = MiddleX(kNavigateButtonRect);
|
||||
mouse_event.y = MiddleY(kNavigateButtonRect);
|
||||
const CefRect& btnnavigate = GetElementBounds("btnnavigate");
|
||||
mouse_event.x = MiddleX(btnnavigate);
|
||||
mouse_event.y = MiddleY(btnnavigate);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, true,
|
||||
@@ -922,8 +912,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (StartTest()) {
|
||||
// click inside edit box so that text could be entered
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kEditBoxRect);
|
||||
mouse_event.y = MiddleY(kEditBoxRect);
|
||||
const CefRect& editbox = GetElementBounds("editbox");
|
||||
mouse_event.x = MiddleX(editbox);
|
||||
mouse_event.y = MiddleY(editbox);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -948,6 +939,21 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
markedText, underlines, replacement_range, selection_range);
|
||||
}
|
||||
} break;
|
||||
case OSR_TEST_TEXT_SELECTION_CHANGE: {
|
||||
// trigger the text selection changed event
|
||||
if (StartTest()) {
|
||||
// click inside list element so text range will be selected.
|
||||
CefMouseEvent mouse_event;
|
||||
const CefRect& expected_rect = GetElementBounds("LI11");
|
||||
mouse_event.x = MiddleX(expected_rect);
|
||||
mouse_event.y = MiddleY(expected_rect);
|
||||
mouse_event.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, true,
|
||||
1);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1013,24 +1019,24 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
int y) override {
|
||||
if (test_type_ == OSR_TEST_DRAG_DROP_START_DRAGGING && started()) {
|
||||
// Verify the drag image representation.
|
||||
const CefRect& dragdiv = GetElementBounds("dragdiv");
|
||||
EXPECT_TRUE(drag_data->HasImage());
|
||||
CefRefPtr<CefImage> image = drag_data->GetImage();
|
||||
EXPECT_TRUE(image.get() != NULL);
|
||||
if (image.get()) {
|
||||
// Drag image height seems to always be + 1px greater than the drag rect
|
||||
// on Linux. Therefore allow it to be +/- 1px.
|
||||
EXPECT_NEAR(static_cast<int>(image->GetWidth()), kDragDivRect.width, 1);
|
||||
EXPECT_NEAR(static_cast<int>(image->GetHeight()), kDragDivRect.height,
|
||||
1);
|
||||
EXPECT_NEAR(static_cast<int>(image->GetWidth()), dragdiv.width, 1);
|
||||
EXPECT_NEAR(static_cast<int>(image->GetHeight()), dragdiv.height, 1);
|
||||
}
|
||||
// During testing hotspot (x, y) was (15, 23) at 1x scale and (15, 18) at
|
||||
// 2x scale. Since the mechanism for determining this position is unclear
|
||||
// test only that it falls within the rect boundaries.
|
||||
CefPoint hotspot = drag_data->GetImageHotspot();
|
||||
EXPECT_GT(hotspot.x, 0);
|
||||
EXPECT_LT(hotspot.x, GetScaledInt(kDragDivRect.width));
|
||||
EXPECT_LT(hotspot.x, GetScaledInt(dragdiv.width));
|
||||
EXPECT_GT(hotspot.y, 0);
|
||||
EXPECT_LT(hotspot.y, GetScaledInt(kDragDivRect.height));
|
||||
EXPECT_LT(hotspot.y, GetScaledInt(dragdiv.height));
|
||||
|
||||
DestroySucceededTestSoon();
|
||||
return false;
|
||||
@@ -1041,13 +1047,15 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
CefRefPtr<CefDragData> data = drag_data->Clone();
|
||||
data->ResetFileContents();
|
||||
CefMouseEvent ev;
|
||||
ev.x = MiddleX(kDragDivRect) - 5;
|
||||
ev.y = MiddleY(kDragDivRect) - 5;
|
||||
const CefRect& dragdiv = GetElementBounds("dragdiv");
|
||||
ev.x = MiddleX(dragdiv) - 5;
|
||||
ev.y = MiddleY(dragdiv) - 5;
|
||||
ev.modifiers = EVENTFLAG_LEFT_MOUSE_BUTTON;
|
||||
browser->GetHost()->DragTargetDragEnter(data, ev, allowed_ops);
|
||||
|
||||
ev.x = MiddleX(kDropDivRect);
|
||||
ev.y = MiddleY(kDropDivRect);
|
||||
const CefRect& dropdiv = GetElementBounds("dropdiv");
|
||||
ev.x = MiddleX(dropdiv);
|
||||
ev.y = MiddleY(dropdiv);
|
||||
browser->GetHost()->SendMouseMoveEvent(ev, false);
|
||||
browser->GetHost()->DragTargetDragOver(ev, allowed_ops);
|
||||
|
||||
@@ -1064,8 +1072,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
DragOperation operation) override {
|
||||
if (test_type_ == OSR_TEST_DRAG_DROP_UPDATE_CURSOR && started()) {
|
||||
if (operation != DRAG_OPERATION_NONE) {
|
||||
const CefRect& dropdiv = GetElementBounds("dropdiv");
|
||||
browser->GetHost()->DragSourceEndedAt(
|
||||
MiddleX(kDropDivRect), MiddleY(kDropDivRect), DRAG_OPERATION_NONE);
|
||||
MiddleX(dropdiv), MiddleY(dropdiv), DRAG_OPERATION_NONE);
|
||||
browser->GetHost()->DragSourceSystemDragEnded();
|
||||
DestroySucceededTestSoon();
|
||||
}
|
||||
@@ -1076,8 +1085,9 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
got_update_cursor_.yes();
|
||||
|
||||
CefMouseEvent ev;
|
||||
ev.x = MiddleX(kDropDivRect);
|
||||
ev.y = MiddleY(kDropDivRect);
|
||||
const CefRect& dropdiv = GetElementBounds("dropdiv");
|
||||
ev.x = MiddleX(dropdiv);
|
||||
ev.y = MiddleY(dropdiv);
|
||||
ev.modifiers = 0;
|
||||
browser->GetHost()->SendMouseClickEvent(ev, MBT_LEFT, true, 1);
|
||||
browser->GetHost()->DragTargetDrop(ev);
|
||||
@@ -1086,6 +1096,19 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
}
|
||||
}
|
||||
|
||||
void OnTextSelectionChanged(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& selected_text,
|
||||
const CefRange& selected_range) override {
|
||||
if (test_type_ == OSR_TEST_TEXT_SELECTION_CHANGE && started()) {
|
||||
if (!got_initial_text_selection_event_) {
|
||||
got_initial_text_selection_event_.yes();
|
||||
} else {
|
||||
EXPECT_STREQ("SELECTED_TEXT_RANGE", selected_text.ToString().c_str());
|
||||
DestroySucceededTestSoon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OnTooltip(CefRefPtr<CefBrowser> browser, CefString& text) override {
|
||||
if (test_type_ == OSR_TEST_TOOLTIP && started()) {
|
||||
EXPECT_STREQ("EXPECTED_TOOLTIP", text.ToString().c_str());
|
||||
@@ -1101,7 +1124,7 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
if (!started())
|
||||
return;
|
||||
if (test_type_ == OSR_TEST_CLICK_RIGHT) {
|
||||
const CefRect& expected_rect = GetExpectedRect(4);
|
||||
const CefRect& expected_rect = GetElementBounds("LI04");
|
||||
EXPECT_EQ(params->GetXCoord(), MiddleX(expected_rect));
|
||||
EXPECT_EQ(params->GetYCoord(), MiddleY(expected_rect));
|
||||
DestroySucceededTestSoon();
|
||||
@@ -1146,16 +1169,12 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
return client::LogicalToDevice(value, scale_factor_);
|
||||
}
|
||||
|
||||
CefRect GetExpectedRect(int index) {
|
||||
CefRect rect = kExpectedRectLI[index];
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
// Adjust the rect to include system vertical scrollbar width.
|
||||
rect.width += kDefaultVerticalScrollbarWidth - kVerticalScrollbarWidth;
|
||||
#elif !defined(OS_MACOSX)
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
|
||||
return rect;
|
||||
CefRect GetElementBounds(const std::string& id) {
|
||||
ElementBoundsMap::const_iterator it = element_bounds_.find(id);
|
||||
if (it != element_bounds_.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return CefRect();
|
||||
}
|
||||
|
||||
static bool IsFullRepaint(const CefRect& rc, int width, int height) {
|
||||
@@ -1212,6 +1231,8 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
// SetFocus is called by the system when we explicitly set the focus and
|
||||
// when popups are dismissed.
|
||||
EXPECT_TRUE(got_system_focus_event_);
|
||||
} else if (test_type_ == OSR_TEST_TEXT_SELECTION_CHANGE) {
|
||||
EXPECT_TRUE(got_initial_text_selection_event_);
|
||||
} else {
|
||||
EXPECT_FALSE(got_system_focus_event_);
|
||||
}
|
||||
@@ -1222,8 +1243,10 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
void ExpandDropDown() {
|
||||
GetBrowser()->GetHost()->SendFocusEvent(true);
|
||||
CefMouseEvent mouse_event;
|
||||
mouse_event.x = MiddleX(kSelectRect);
|
||||
mouse_event.y = MiddleY(kSelectRect);
|
||||
|
||||
const CefRect& LI11select = GetElementBounds("LI11select");
|
||||
mouse_event.x = MiddleX(LI11select);
|
||||
mouse_event.y = MiddleY(LI11select);
|
||||
mouse_event.modifiers = 0;
|
||||
GetBrowser()->GetHost()->SendMouseClickEvent(mouse_event, MBT_LEFT, false,
|
||||
1);
|
||||
@@ -1301,6 +1324,10 @@ class OSRTestHandler : public RoutingTestHandler,
|
||||
TrackCallback got_update_cursor_;
|
||||
TrackCallback got_navigation_focus_event_;
|
||||
TrackCallback got_system_focus_event_;
|
||||
TrackCallback got_initial_text_selection_event_;
|
||||
|
||||
typedef std::map<std::string, CefRect> ElementBoundsMap;
|
||||
ElementBoundsMap element_bounds_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(OSRTestHandler);
|
||||
};
|
||||
@@ -1382,3 +1409,5 @@ OSR_TEST(IMEFinishComposition, OSR_TEST_IME_FINISH_COMPOSITION, 1.0f);
|
||||
OSR_TEST(IMEFinishComposition2x, OSR_TEST_IME_FINISH_COMPOSITION, 2.0f);
|
||||
OSR_TEST(IMECancelComposition, OSR_TEST_IME_CANCEL_COMPOSITION, 1.0f);
|
||||
OSR_TEST(IMECancelComposition2x, OSR_TEST_IME_CANCEL_COMPOSITION, 2.0f);
|
||||
OSR_TEST(TextSelectionChanged, OSR_TEST_TEXT_SELECTION_CHANGE, 1.0f);
|
||||
OSR_TEST(TextSelectionChanged2x, OSR_TEST_TEXT_SELECTION_CHANGE, 2.0f);
|
||||
|
@@ -204,6 +204,7 @@ class NetNotifyTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
std::string url = request->GetURL();
|
||||
|
||||
@@ -576,6 +577,7 @@ class ResourceResponseTest : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
EXPECT_UI_THREAD();
|
||||
EXPECT_EQ(0, browser_id_);
|
||||
|
@@ -487,6 +487,7 @@ class TypeTestHandler : public TestHandler {
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override {
|
||||
browse_expectations_.GotRequest(request);
|
||||
|
||||
|
@@ -83,6 +83,7 @@ void RoutingTestHandler::OnRenderProcessTerminated(
|
||||
bool RoutingTestHandler::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) {
|
||||
message_router_->OnBeforeBrowse(browser, frame);
|
||||
return false;
|
||||
|
@@ -26,6 +26,7 @@ class RoutingTestHandler : public TestHandler,
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool user_gesture,
|
||||
bool is_redirect) override;
|
||||
|
||||
// Returns true if the router handled the navigation.
|
||||
|
@@ -57,6 +57,7 @@ enum RequestTestMode {
|
||||
REQTEST_GET_NODATA,
|
||||
REQTEST_GET_ALLOWCOOKIES,
|
||||
REQTEST_GET_REDIRECT,
|
||||
REQTEST_GET_REDIRECT_STOP,
|
||||
REQTEST_GET_REFERRER,
|
||||
REQTEST_POST,
|
||||
REQTEST_POST_FILE,
|
||||
@@ -1058,6 +1059,8 @@ class RequestTestRunner : public base::RefCountedThreadSafe<RequestTestRunner> {
|
||||
REGISTER_TEST(REQTEST_GET_ALLOWCOOKIES, SetupGetAllowCookiesTest,
|
||||
SingleRunTest);
|
||||
REGISTER_TEST(REQTEST_GET_REDIRECT, SetupGetRedirectTest, SingleRunTest);
|
||||
REGISTER_TEST(REQTEST_GET_REDIRECT_STOP, SetupGetRedirectStopTest,
|
||||
SingleRunTest);
|
||||
REGISTER_TEST(REQTEST_GET_REFERRER, SetupGetReferrerTest, SingleRunTest);
|
||||
REGISTER_TEST(REQTEST_POST, SetupPostTest, SingleRunTest);
|
||||
REGISTER_TEST(REQTEST_POST_FILE, SetupPostFileTest, SingleRunTest);
|
||||
@@ -1240,6 +1243,41 @@ class RequestTestRunner : public base::RefCountedThreadSafe<RequestTestRunner> {
|
||||
complete_callback.Run();
|
||||
}
|
||||
|
||||
void SetupGetRedirectStopTest(const base::Closure& complete_callback) {
|
||||
settings_.request = CefRequest::Create();
|
||||
settings_.request->SetURL(GetTestURL("GetTest.html"));
|
||||
settings_.request->SetMethod("GET");
|
||||
|
||||
// With the test server only the status is expected
|
||||
// on stop redirects.
|
||||
settings_.response = CefResponse::Create();
|
||||
settings_.response->SetStatus(302);
|
||||
|
||||
// Add a redirect request.
|
||||
settings_.redirect_request = CefRequest::Create();
|
||||
settings_.redirect_request->SetURL(GetTestURL("redirect.html"));
|
||||
settings_.redirect_request->SetMethod("GET");
|
||||
settings_.redirect_request->SetFlags(UR_FLAG_STOP_ON_REDIRECT);
|
||||
|
||||
settings_.redirect_response = CefResponse::Create();
|
||||
settings_.redirect_response->SetMimeType("text/html");
|
||||
settings_.redirect_response->SetStatus(302);
|
||||
settings_.redirect_response->SetStatusText("Found");
|
||||
|
||||
CefResponse::HeaderMap headerMap;
|
||||
headerMap.insert(std::make_pair("Location", settings_.request->GetURL()));
|
||||
settings_.redirect_response->SetHeaderMap(headerMap);
|
||||
|
||||
settings_.expected_status = UR_CANCELED;
|
||||
settings_.expected_error_code = ERR_ABORTED;
|
||||
settings_.expect_download_data = false;
|
||||
settings_.expect_download_progress = false;
|
||||
settings_.expected_send_count = 1;
|
||||
settings_.expected_receive_count = 1;
|
||||
|
||||
complete_callback.Run();
|
||||
}
|
||||
|
||||
void SetupGetReferrerTest(const base::Closure& complete_callback) {
|
||||
settings_.request = CefRequest::Create();
|
||||
settings_.request->SetURL(GetTestURL("GetTest.html"));
|
||||
@@ -2210,6 +2248,8 @@ void RegisterURLRequestCustomSchemes(
|
||||
context_mode, true, test_server_backend); \
|
||||
REQ_TEST(BrowserGETRedirect##suffix, REQTEST_GET_REDIRECT, context_mode, \
|
||||
true, test_server_backend); \
|
||||
REQ_TEST(BrowserGETRedirectStop##suffix, REQTEST_GET_REDIRECT_STOP, \
|
||||
context_mode, true, test_server_backend); \
|
||||
REQ_TEST(BrowserGETReferrer##suffix, REQTEST_GET_REFERRER, context_mode, \
|
||||
true, test_server_backend); \
|
||||
REQ_TEST(BrowserPOST##suffix, REQTEST_POST, context_mode, true, \
|
||||
@@ -2228,6 +2268,8 @@ void RegisterURLRequestCustomSchemes(
|
||||
context_mode, false, test_server_backend); \
|
||||
REQ_TEST(RendererGETRedirect##suffix, REQTEST_GET_REDIRECT, context_mode, \
|
||||
false, test_server_backend); \
|
||||
REQ_TEST(RendererGETRedirectStop##suffix, REQTEST_GET_REDIRECT_STOP, \
|
||||
context_mode, false, test_server_backend); \
|
||||
REQ_TEST(RendererGETReferrer##suffix, REQTEST_GET_REFERRER, context_mode, \
|
||||
false, test_server_backend); \
|
||||
REQ_TEST(RendererPOST##suffix, REQTEST_POST, context_mode, false, \
|
||||
|
@@ -57,6 +57,8 @@ enum V8TestMode {
|
||||
V8TEST_EMPTY_STRING_CREATE,
|
||||
V8TEST_ARRAY_CREATE,
|
||||
V8TEST_ARRAY_VALUE,
|
||||
V8TEST_ARRAY_BUFFER,
|
||||
V8TEST_ARRAY_BUFFER_VALUE,
|
||||
V8TEST_OBJECT_CREATE,
|
||||
V8TEST_OBJECT_USERDATA,
|
||||
V8TEST_OBJECT_ACCESSOR,
|
||||
@@ -159,6 +161,12 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
|
||||
case V8TEST_ARRAY_VALUE:
|
||||
RunArrayValueTest();
|
||||
break;
|
||||
case V8TEST_ARRAY_BUFFER:
|
||||
RunArrayBufferTest();
|
||||
break;
|
||||
case V8TEST_ARRAY_BUFFER_VALUE:
|
||||
RunArrayBufferValueTest();
|
||||
break;
|
||||
case V8TEST_OBJECT_CREATE:
|
||||
RunObjectCreateTest();
|
||||
break;
|
||||
@@ -543,6 +551,117 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
|
||||
DestroyTest();
|
||||
}
|
||||
|
||||
void RunArrayBufferTest() {
|
||||
class TestArrayBufferReleaseCallback
|
||||
: public CefV8ArrayBufferReleaseCallback {
|
||||
public:
|
||||
TestArrayBufferReleaseCallback(bool* destructorCalled,
|
||||
bool* releaseBufferCalled)
|
||||
: destructorCalled_(destructorCalled),
|
||||
releaseBufferCalled_(releaseBufferCalled) {}
|
||||
|
||||
~TestArrayBufferReleaseCallback() { *destructorCalled_ = true; }
|
||||
|
||||
void ReleaseBuffer(void* buffer) { *releaseBufferCalled_ = true; }
|
||||
|
||||
IMPLEMENT_REFCOUNTING(TestArrayBufferReleaseCallback);
|
||||
|
||||
private:
|
||||
bool* destructorCalled_;
|
||||
bool* releaseBufferCalled_;
|
||||
};
|
||||
|
||||
CefRefPtr<CefV8Context> context = GetContext();
|
||||
|
||||
bool destructorCalled = false;
|
||||
bool releaseBufferCalled = false;
|
||||
|
||||
bool neuteredDestructorCalled = false;
|
||||
bool neuteredReleaseBufferCalled = false;
|
||||
// Enter the V8 context.
|
||||
EXPECT_TRUE(context->Enter());
|
||||
{
|
||||
int static_data[16];
|
||||
CefRefPtr<CefV8Value> value;
|
||||
CefRefPtr<TestArrayBufferReleaseCallback> release_callback =
|
||||
new TestArrayBufferReleaseCallback(&destructorCalled,
|
||||
&releaseBufferCalled);
|
||||
|
||||
CefRefPtr<CefV8Value> neuteredValue;
|
||||
CefRefPtr<TestArrayBufferReleaseCallback> neuteredReleaseCallback =
|
||||
new TestArrayBufferReleaseCallback(&neuteredDestructorCalled,
|
||||
&neuteredReleaseBufferCalled);
|
||||
value = CefV8Value::CreateArrayBuffer(static_data, sizeof(static_data),
|
||||
release_callback);
|
||||
neuteredValue = CefV8Value::CreateArrayBuffer(
|
||||
static_data, sizeof(static_data), neuteredReleaseCallback);
|
||||
EXPECT_TRUE(value.get());
|
||||
EXPECT_TRUE(value->IsArrayBuffer());
|
||||
EXPECT_TRUE(value->IsObject());
|
||||
EXPECT_FALSE(value->HasValue(0));
|
||||
EXPECT_FALSE(destructorCalled);
|
||||
EXPECT_TRUE(value->GetArrayBufferReleaseCallback().get() != nullptr);
|
||||
EXPECT_TRUE(((TestArrayBufferReleaseCallback*)value
|
||||
->GetArrayBufferReleaseCallback()
|
||||
.get()) == release_callback);
|
||||
|
||||
EXPECT_TRUE(neuteredValue->NeuterArrayBuffer());
|
||||
}
|
||||
// Exit the V8 context.
|
||||
EXPECT_TRUE(destructorCalled);
|
||||
EXPECT_TRUE(releaseBufferCalled);
|
||||
EXPECT_TRUE(neuteredDestructorCalled);
|
||||
EXPECT_FALSE(neuteredReleaseBufferCalled);
|
||||
EXPECT_TRUE(context->Exit());
|
||||
DestroyTest();
|
||||
}
|
||||
|
||||
void RunArrayBufferValueTest() {
|
||||
class TestArrayBufferReleaseCallback
|
||||
: public CefV8ArrayBufferReleaseCallback {
|
||||
public:
|
||||
TestArrayBufferReleaseCallback() {}
|
||||
|
||||
~TestArrayBufferReleaseCallback() {}
|
||||
|
||||
void ReleaseBuffer(void* buffer) {}
|
||||
|
||||
IMPLEMENT_REFCOUNTING(TestArrayBufferReleaseCallback);
|
||||
};
|
||||
|
||||
CefRefPtr<CefV8Context> context = GetContext();
|
||||
|
||||
// Enter the V8 context.
|
||||
CefRefPtr<CefV8Value> value;
|
||||
|
||||
CefRefPtr<TestArrayBufferReleaseCallback> owner =
|
||||
new TestArrayBufferReleaseCallback();
|
||||
EXPECT_TRUE(context->Enter());
|
||||
int static_data[16];
|
||||
static_data[0] = 3;
|
||||
value =
|
||||
CefV8Value::CreateArrayBuffer(static_data, sizeof(static_data), owner);
|
||||
|
||||
CefRefPtr<CefV8Value> object = context->GetGlobal();
|
||||
EXPECT_TRUE(object.get());
|
||||
object->SetValue("arr", value, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
std::string test =
|
||||
"let data = new Int32Array(window.arr); data[0] += data.length";
|
||||
CefRefPtr<CefV8Value> retval;
|
||||
CefRefPtr<CefV8Exception> exception;
|
||||
EXPECT_TRUE(context->Eval(test, CefString(), 0, retval, exception));
|
||||
if (exception.get())
|
||||
ADD_FAILURE() << exception->GetMessage().c_str();
|
||||
|
||||
EXPECT_TRUE(static_data[0] == 19);
|
||||
EXPECT_TRUE(value->GetArrayBufferReleaseCallback().get() != nullptr);
|
||||
EXPECT_TRUE(value->NeuterArrayBuffer());
|
||||
|
||||
// Exit the V8 context.
|
||||
EXPECT_TRUE(context->Exit());
|
||||
DestroyTest();
|
||||
}
|
||||
|
||||
void RunObjectCreateTest() {
|
||||
CefRefPtr<CefV8Context> context = GetContext();
|
||||
|
||||
@@ -2972,6 +3091,8 @@ V8_TEST(StringCreate, V8TEST_STRING_CREATE);
|
||||
V8_TEST(EmptyStringCreate, V8TEST_EMPTY_STRING_CREATE);
|
||||
V8_TEST(ArrayCreate, V8TEST_ARRAY_CREATE);
|
||||
V8_TEST(ArrayValue, V8TEST_ARRAY_VALUE);
|
||||
V8_TEST(ArrayBuffer, V8TEST_ARRAY_BUFFER);
|
||||
V8_TEST(ArrayBufferValue, V8TEST_ARRAY_BUFFER_VALUE);
|
||||
V8_TEST(ObjectCreate, V8TEST_OBJECT_CREATE);
|
||||
V8_TEST(ObjectUserData, V8TEST_OBJECT_USERDATA);
|
||||
V8_TEST(ObjectAccessor, V8TEST_OBJECT_ACCESSOR);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user