feat: Upgrade to Chromium 71.0.3578.98 (#15966)
This commit is contained in:
parent
92ddfd0d4c
commit
52fe92d02e
204 changed files with 2291 additions and 1760 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "native_mate/dictionary.h"
|
||||
#include "native_mate/object_template_builder.h"
|
||||
#include "third_party/blink/public/platform/web_cache.h"
|
||||
#include "third_party/blink/public/web/web_custom_element.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
#include "third_party/blink/public/web/web_element.h"
|
||||
#include "third_party/blink/public/web/web_frame_widget.h"
|
||||
|
@ -188,13 +189,15 @@ void WebFrame::SetLayoutZoomLevelLimits(double min_level, double max_level) {
|
|||
web_frame_->View()->ZoomLimitsChanged(min_level, max_level);
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> WebFrame::RegisterEmbedderCustomElement(
|
||||
void WebFrame::AllowGuestViewElementDefinition(
|
||||
v8::Local<v8::Object> context,
|
||||
const base::string16& name,
|
||||
v8::Local<v8::Object> options) {
|
||||
v8::Local<v8::Function> register_cb) {
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
v8::Context::Scope context_scope(context->CreationContext());
|
||||
return web_frame_->GetDocument().RegisterEmbedderCustomElement(
|
||||
blink::WebString::FromUTF16(name), options);
|
||||
blink::WebCustomElement::EmbedderNamesAllowedScope embedder_names_scope;
|
||||
web_frame_->RequestExecuteV8Function(context->CreationContext(), register_cb,
|
||||
v8::Null(isolate()), 0, nullptr,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
int WebFrame::GetWebFrameId(v8::Local<v8::Value> content_window) {
|
||||
|
@ -491,8 +494,8 @@ void WebFrame::BuildPrototype(v8::Isolate* isolate,
|
|||
&WebFrame::SetVisualZoomLevelLimits)
|
||||
.SetMethod("setLayoutZoomLevelLimits",
|
||||
&WebFrame::SetLayoutZoomLevelLimits)
|
||||
.SetMethod("registerEmbedderCustomElement",
|
||||
&WebFrame::RegisterEmbedderCustomElement)
|
||||
.SetMethod("allowGuestViewElementDefinition",
|
||||
&WebFrame::AllowGuestViewElementDefinition)
|
||||
.SetMethod("getWebFrameId", &WebFrame::GetWebFrameId)
|
||||
.SetMethod("setSpellCheckProvider", &WebFrame::SetSpellCheckProvider)
|
||||
.SetMethod("registerURLSchemeAsBypassingCSP",
|
||||
|
|
|
@ -50,10 +50,8 @@ class WebFrame : public mate::Wrappable<WebFrame> {
|
|||
void SetVisualZoomLevelLimits(double min_level, double max_level);
|
||||
void SetLayoutZoomLevelLimits(double min_level, double max_level);
|
||||
|
||||
v8::Local<v8::Value> RegisterEmbedderCustomElement(
|
||||
v8::Local<v8::Object> context,
|
||||
const base::string16& name,
|
||||
v8::Local<v8::Object> options);
|
||||
void AllowGuestViewElementDefinition(v8::Local<v8::Object> context,
|
||||
v8::Local<v8::Function> register_cb);
|
||||
int GetWebFrameId(v8::Local<v8::Value> content_window);
|
||||
|
||||
// Set the provider that will be used by SpellCheckClient for spell check.
|
||||
|
|
|
@ -177,7 +177,8 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
|
|||
}
|
||||
|
||||
bool AutofillAgent::IsUserGesture() const {
|
||||
return blink::WebUserGestureIndicator::IsProcessingUserGesture();
|
||||
return blink::WebUserGestureIndicator::IsProcessingUserGesture(
|
||||
render_frame()->GetWebFrame());
|
||||
}
|
||||
|
||||
void AutofillAgent::HidePopup() {
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
||||
#include "tracing/trace_event.h"
|
||||
#include "third_party/electron_node/src/node_native_module.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -189,28 +188,20 @@ void AtomRendererClient::SetupMainWorldOverrides(
|
|||
v8::Handle<v8::Context> context,
|
||||
content::RenderFrame* render_frame) {
|
||||
// Setup window overrides in the main world context
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
||||
// Wrap the bundle into a function that receives the isolatedWorld as
|
||||
// an argument.
|
||||
std::string left = "(function (nodeProcess, isolatedWorld) {\n";
|
||||
std::string right = "\n})";
|
||||
auto source = v8::String::Concat(
|
||||
isolate, mate::ConvertToV8(isolate, left)->ToString(isolate),
|
||||
v8::String::Concat(isolate,
|
||||
node::isolated_bundle_value.ToStringChecked(isolate),
|
||||
mate::ConvertToV8(isolate, right)->ToString(isolate)));
|
||||
auto result = RunScript(context, source);
|
||||
DCHECK(result->IsFunction());
|
||||
auto* isolate = context->GetIsolate();
|
||||
std::vector<v8::Local<v8::String>> isolated_bundle_params = {
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "nodeProcess"),
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "isolatedWorld")};
|
||||
|
||||
v8::Local<v8::Value> args[] = {
|
||||
std::vector<v8::Local<v8::Value>> isolated_bundle_args = {
|
||||
GetEnvironment(render_frame)->process_object(),
|
||||
GetContext(render_frame->GetWebFrame(), isolate)->Global(),
|
||||
};
|
||||
ignore_result(result.As<v8::Function>()->Call(context, v8::Null(isolate),
|
||||
node::arraysize(args), args));
|
||||
GetContext(render_frame->GetWebFrame(), isolate)->Global()};
|
||||
|
||||
node::per_process::native_module_loader.CompileAndCall(
|
||||
context, "electron/js2c/isolated_bundle", &isolated_bundle_params,
|
||||
&isolated_bundle_args, nullptr);
|
||||
}
|
||||
|
||||
node::Environment* AtomRendererClient::GetEnvironment(
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace node {
|
||||
class Environment;
|
||||
}
|
||||
} // namespace node
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
#include "third_party/blink/public/web/web_document.h"
|
||||
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
||||
#include "third_party/electron_node/src/node_binding.h"
|
||||
#include "third_party/electron_node/src/node_native_module.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -68,7 +69,7 @@ v8::Local<v8::Value> GetBinding(v8::Isolate* isolate,
|
|||
return exports;
|
||||
}
|
||||
|
||||
auto* mod = node::get_builtin_module(module_key.c_str());
|
||||
auto* mod = node::binding::get_builtin_module(module_key.c_str());
|
||||
|
||||
if (!mod) {
|
||||
char errmsg[1024];
|
||||
|
@ -182,30 +183,21 @@ void AtomSandboxedRendererClient::DidCreateScriptContext(
|
|||
!IsDevToolsExtension(render_frame))
|
||||
return;
|
||||
|
||||
// Wrap the bundle into a function that receives the binding object as
|
||||
// argument.
|
||||
auto* isolate = context->GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Context::Scope context_scope(context);
|
||||
// Wrap the bundle into a function that receives the binding object and the
|
||||
// preload script path as arguments.
|
||||
std::string left = "(function(binding, require) {\n";
|
||||
std::string right = "\n})";
|
||||
// Compile the wrapper and run it to get the function object
|
||||
auto source = v8::String::Concat(
|
||||
isolate, mate::ConvertToV8(isolate, left)->ToString(isolate),
|
||||
v8::String::Concat(isolate,
|
||||
node::preload_bundle_value.ToStringChecked(isolate),
|
||||
mate::ConvertToV8(isolate, right)->ToString(isolate)));
|
||||
auto result = RunScript(context, source);
|
||||
|
||||
DCHECK(result->IsFunction());
|
||||
// Create and initialize the binding object
|
||||
auto binding = v8::Object::New(isolate);
|
||||
InitializeBindings(binding, context);
|
||||
AddRenderBindings(isolate, binding);
|
||||
v8::Local<v8::Value> args[] = {binding};
|
||||
// Execute the function with proper arguments
|
||||
ignore_result(result.As<v8::Function>()->Call(context, v8::Null(isolate),
|
||||
node::arraysize(args), args));
|
||||
|
||||
std::vector<v8::Local<v8::String>> preload_bundle_params = {
|
||||
node::FIXED_ONE_BYTE_STRING(isolate, "binding")};
|
||||
|
||||
std::vector<v8::Local<v8::Value>> preload_bundle_args = {binding};
|
||||
|
||||
node::per_process::native_module_loader.CompileAndCall(
|
||||
isolate->GetCurrentContext(), "electron/js2c/preload_bundle",
|
||||
&preload_bundle_params, &preload_bundle_args, nullptr);
|
||||
}
|
||||
|
||||
void AtomSandboxedRendererClient::WillReleaseScriptContext(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue