mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 86.0.4240.0 (#800218)
- CefURLRequest::Create is no longer supported in the renderer process (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead. - Mac platform definitions have been changed from `MACOSX` to `MAC` (see https://crbug.com/1105907) and related CMake macro names have been updated. The old `OS_MACOSX` define is still set in code and CMake for backwards compatibility. - Linux ARM build is currently broken (see https://crbug.com/1123214).
This commit is contained in:
@ -109,7 +109,7 @@
|
||||
#include "third_party/blink/public/web/web_view.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#endif
|
||||
@ -359,7 +359,7 @@ void AlloyContentRendererClient::RunSingleProcessCleanup() {
|
||||
}
|
||||
|
||||
void AlloyContentRendererClient::PostIOThreadCreated(
|
||||
base::SingleThreadTaskRunner*) {
|
||||
base::SingleThreadTaskRunner*) {
|
||||
// TODO(cef): Enable these once the implementation supports it.
|
||||
blink::WebRuntimeFeatures::EnableNotifications(false);
|
||||
blink::WebRuntimeFeatures::EnablePushMessaging(false);
|
||||
@ -390,10 +390,10 @@ void AlloyContentRendererClient::RenderThreadStarted() {
|
||||
if (content::RenderProcessHost::run_renderer_in_process()) {
|
||||
// When running in single-process mode register as a destruction observer
|
||||
// on the render thread's MessageLoop.
|
||||
base::MessageLoopCurrent::Get()->AddDestructionObserver(this);
|
||||
base::CurrentThread::Get()->AddDestructionObserver(this);
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
{
|
||||
base::ScopedCFTypeRef<CFStringRef> key(
|
||||
base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
|
||||
@ -408,7 +408,7 @@ void AlloyContentRendererClient::RenderThreadStarted() {
|
||||
CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
}
|
||||
#endif // defined(OS_MACOSX)
|
||||
#endif // defined(OS_MAC)
|
||||
|
||||
if (extensions::PdfExtensionEnabled()) {
|
||||
pdf_print_client_.reset(new ChromePDFPrintClient());
|
||||
@ -749,7 +749,7 @@ CefRefPtr<CefBrowserImpl> AlloyContentRendererClient::MaybeCreateBrowser(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#if defined(OS_MAC)
|
||||
// FIXME: It would be better if this API would be a callback from the
|
||||
// WebKit layer, or if it would be exposed as an WebView instance method; the
|
||||
// current implementation uses a static variable, and WebKit needs to be
|
||||
|
@ -16,9 +16,9 @@
|
||||
#include "libcef/renderer/browser_impl.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/task/current_thread.h"
|
||||
#include "chrome/common/plugin.mojom.h"
|
||||
#include "content/public/renderer/content_renderer_client.h"
|
||||
#include "content/public/renderer/render_thread.h"
|
||||
@ -52,7 +52,7 @@ class SpellCheck;
|
||||
class AlloyContentRendererClient
|
||||
: public content::ContentRendererClient,
|
||||
public service_manager::LocalInterfaceProvider,
|
||||
public base::MessageLoopCurrent::DestructionObserver {
|
||||
public base::CurrentThread::DestructionObserver {
|
||||
public:
|
||||
AlloyContentRendererClient();
|
||||
~AlloyContentRendererClient() override;
|
||||
|
@ -13,11 +13,8 @@
|
||||
#include "third_party/blink/public/web/web_node.h"
|
||||
#include "third_party/blink/public/web/web_view_client.h"
|
||||
|
||||
#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/v8_code_cache.h"
|
||||
#include "third_party/blink/renderer/core/dom/document.h"
|
||||
#include "third_party/blink/renderer/core/dom/element.h"
|
||||
#include "third_party/blink/renderer/core/dom/node.h"
|
||||
@ -31,6 +28,7 @@
|
||||
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
|
||||
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
|
||||
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
|
||||
#include "third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
|
||||
#undef LOG
|
||||
|
||||
@ -179,13 +177,6 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
if (start_line < 1)
|
||||
start_line = 1;
|
||||
|
||||
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
|
||||
source, blink::ScriptSourceLocationType::kInternal,
|
||||
nullptr, /* cache_handler */
|
||||
blink::KURL(source_url),
|
||||
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
|
||||
WTF::OrdinalNumber::FromZeroBasedInt(0)));
|
||||
|
||||
v8::MaybeLocal<v8::Value> result;
|
||||
|
||||
blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context);
|
||||
@ -193,35 +184,25 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
|
||||
return result;
|
||||
|
||||
blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault);
|
||||
if (frame && frame->GetSettings())
|
||||
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
|
||||
if (const blink::Settings* settings = frame->GetSettings())
|
||||
v8CacheOptions = settings->GetV8CacheOptions();
|
||||
|
||||
// Based on V8ScriptRunner::CompileAndRunInternalScript:
|
||||
v8::ScriptCompiler::CompileOptions compile_options;
|
||||
blink::V8CodeCache::ProduceCacheOptions produce_cache_options;
|
||||
v8::ScriptCompiler::NoCacheReason no_cache_reason;
|
||||
std::tie(compile_options, produce_cache_options, no_cache_reason) =
|
||||
blink::V8CodeCache::GetCompileOptions(v8CacheOptions, ssc);
|
||||
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
|
||||
source, blink::ScriptSourceLocationType::kInternal,
|
||||
nullptr, /* cache_handler */
|
||||
blink::KURL(source_url),
|
||||
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
|
||||
WTF::OrdinalNumber::FromZeroBasedInt(0)));
|
||||
|
||||
// Currently internal scripts don't have cache handlers, so we should not
|
||||
// produce cache for them.
|
||||
DCHECK_EQ(produce_cache_options,
|
||||
blink::V8CodeCache::ProduceCacheOptions::kNoProduceCache);
|
||||
|
||||
v8::Local<v8::Script> script;
|
||||
// Use default ReferrerScriptInfo here:
|
||||
// - nonce: empty for internal script, and
|
||||
// - parser_state: always "not parser inserted" for internal scripts.
|
||||
if (!blink::V8ScriptRunner::CompileScript(
|
||||
blink::ScriptState::From(context), ssc, sanitizeScriptErrors,
|
||||
compile_options, no_cache_reason, blink::ReferrerScriptInfo())
|
||||
.ToLocal(&script)) {
|
||||
result = blink::V8ScriptRunner::CompileAndRunScript(
|
||||
isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc,
|
||||
ssc.Url(), sanitizeScriptErrors, blink::ScriptFetchOptions(),
|
||||
v8CacheOptions);
|
||||
if (result.IsEmpty()) {
|
||||
DCHECK(tryCatch.HasCaught());
|
||||
return result;
|
||||
}
|
||||
|
||||
return blink::V8ScriptRunner::RunCompiledScript(
|
||||
isolate, script, blink::ToExecutionContext(context));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool IsScriptForbidden() {
|
||||
|
@ -76,7 +76,7 @@ void CefRenderFrameObserver::DidFinishLoad() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefRenderFrameObserver::FrameDetached() {
|
||||
void CefRenderFrameObserver::WillDetach() {
|
||||
if (frame_) {
|
||||
frame_->OnDetached();
|
||||
frame_ = nullptr;
|
||||
|
@ -31,7 +31,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
|
||||
void DidCommitProvisionalLoad(ui::PageTransition transition) override;
|
||||
void DidFailProvisionalLoad() override;
|
||||
void DidFinishLoad() override;
|
||||
void FrameDetached() override;
|
||||
void WillDetach() override;
|
||||
void FocusedElementChanged(const blink::WebElement& element) override;
|
||||
void DraggableRegionsChanged() override;
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libcef/common/app_manager.h"
|
||||
#include "libcef/common/request_impl.h"
|
||||
#include "libcef/common/response_impl.h"
|
||||
#include "libcef/common/task_runner_impl.h"
|
||||
@ -155,8 +154,8 @@ class CefRenderURLRequest::Context
|
||||
factory = static_cast<CefFrameImpl*>(frame_.get())->GetURLLoaderFactory();
|
||||
}
|
||||
if (!factory) {
|
||||
// This factory only supports unintercepted http(s) and blob requests.
|
||||
factory = CefAppManager::Get()->GetDefaultURLLoaderFactory();
|
||||
// Global requests are not supported.
|
||||
return false;
|
||||
}
|
||||
|
||||
loader_ = factory->CreateURLLoader(
|
||||
@ -446,6 +445,9 @@ CefRenderURLRequest::CefRenderURLRequest(
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefURLRequestClient> client) {
|
||||
DCHECK(frame);
|
||||
DCHECK(request);
|
||||
DCHECK(client);
|
||||
context_ = new Context(this, frame, request, client);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user