Revert "feat: upgrade to Chromium 72.0.3626.52 (#16334)"
This reverts commit 1918e76913
.
This commit is contained in:
parent
58a6fe13d6
commit
0b85fb7ea2
178 changed files with 1734 additions and 2102 deletions
|
@ -52,7 +52,7 @@ mate::Handle<NativeImage> NativeImage::CreateFromNamedImage(
|
|||
png_data = bufferFromNSImage(
|
||||
gfx::Image(gfx::ImageSkiaOperations::CreateHSLShiftedImage(
|
||||
gfx_image.AsImageSkia(), shift))
|
||||
.AsNSImage());
|
||||
.CopyNSImage());
|
||||
}
|
||||
|
||||
return CreateFromPNG(args->isolate(), (char*)[png_data bytes],
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "atom/common/promise_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/process/process.h"
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/process/process_info.h"
|
||||
#include "base/process/process_metrics_iocounters.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/sys_info.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "chrome/common/chrome_version.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
|
@ -189,7 +189,7 @@ v8::Local<v8::Value> AtomBindings::GetHeapStatistics(v8::Isolate* isolate) {
|
|||
|
||||
// static
|
||||
v8::Local<v8::Value> AtomBindings::GetCreationTime(v8::Isolate* isolate) {
|
||||
auto timeValue = base::Process::Current().CreationTime();
|
||||
auto timeValue = base::CurrentProcessInfo::CreationTime();
|
||||
if (timeValue.is_null()) {
|
||||
return v8::Null(isolate);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ v8::Local<v8::Function> CreateConstructor(v8::Isolate* isolate,
|
|||
isolate, base::Bind(&mate::internal::InvokeNew<Sig>, func));
|
||||
templ->InstanceTemplate()->SetInternalFieldCount(1);
|
||||
T::BuildPrototype(isolate, templ);
|
||||
return templ->GetFunction(isolate->GetCurrentContext()).ToLocalChecked();
|
||||
return templ->GetFunction();
|
||||
}
|
||||
|
||||
} // namespace mate
|
||||
|
|
|
@ -9,7 +9,13 @@
|
|||
// Generate constructors.
|
||||
#include "ipc/struct_constructor_macros.h"
|
||||
|
||||
// lint: must come after struct_constructor_macros.
|
||||
// must go after struct_contructor_macros
|
||||
#include "atom/common/common_message_generator.h"
|
||||
|
||||
// Generate destructors.
|
||||
#include "ipc/struct_destructor_macros.h"
|
||||
|
||||
// must go after struct_destructor_macros
|
||||
#include "atom/common/common_message_generator.h"
|
||||
|
||||
// Generate param traits write methods.
|
||||
|
@ -28,4 +34,4 @@ namespace IPC {
|
|||
#include "ipc/param_traits_log_macros.h"
|
||||
namespace IPC {
|
||||
#include "atom/common/common_message_generator.h"
|
||||
} // namespace IPC
|
||||
} // namespace IPC
|
|
@ -473,26 +473,25 @@ v8::Local<v8::Value> Converter<blink::WebCache::ResourceTypeStats>::ToV8(
|
|||
}
|
||||
|
||||
// static
|
||||
v8::Local<v8::Value> Converter<network::mojom::ReferrerPolicy>::ToV8(
|
||||
v8::Local<v8::Value> Converter<blink::WebReferrerPolicy>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const network::mojom::ReferrerPolicy& in) {
|
||||
const blink::WebReferrerPolicy& in) {
|
||||
switch (in) {
|
||||
case network::mojom::ReferrerPolicy::kDefault:
|
||||
case blink::kWebReferrerPolicyDefault:
|
||||
return mate::StringToV8(isolate, "default");
|
||||
case network::mojom::ReferrerPolicy::kAlways:
|
||||
case blink::kWebReferrerPolicyAlways:
|
||||
return mate::StringToV8(isolate, "unsafe-url");
|
||||
case network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade:
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngrade:
|
||||
return mate::StringToV8(isolate, "no-referrer-when-downgrade");
|
||||
case network::mojom::ReferrerPolicy::kNever:
|
||||
case blink::kWebReferrerPolicyNever:
|
||||
return mate::StringToV8(isolate, "no-referrer");
|
||||
case network::mojom::ReferrerPolicy::kOrigin:
|
||||
case blink::kWebReferrerPolicyOrigin:
|
||||
return mate::StringToV8(isolate, "origin");
|
||||
case network::mojom::ReferrerPolicy::
|
||||
kNoReferrerWhenDowngradeOriginWhenCrossOrigin:
|
||||
case blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin:
|
||||
return mate::StringToV8(isolate, "strict-origin-when-cross-origin");
|
||||
case network::mojom::ReferrerPolicy::kSameOrigin:
|
||||
case blink::kWebReferrerPolicySameOrigin:
|
||||
return mate::StringToV8(isolate, "same-origin");
|
||||
case network::mojom::ReferrerPolicy::kStrictOrigin:
|
||||
case blink::kWebReferrerPolicyStrictOrigin:
|
||||
return mate::StringToV8(isolate, "strict-origin");
|
||||
default:
|
||||
return mate::StringToV8(isolate, "no-referrer");
|
||||
|
@ -500,28 +499,28 @@ v8::Local<v8::Value> Converter<network::mojom::ReferrerPolicy>::ToV8(
|
|||
}
|
||||
|
||||
// static
|
||||
bool Converter<network::mojom::ReferrerPolicy>::FromV8(
|
||||
bool Converter<blink::WebReferrerPolicy>::FromV8(
|
||||
v8::Isolate* isolate,
|
||||
v8::Handle<v8::Value> val,
|
||||
network::mojom::ReferrerPolicy* out) {
|
||||
blink::WebReferrerPolicy* out) {
|
||||
std::string policy = base::ToLowerASCII(gin::V8ToString(isolate, val));
|
||||
if (policy == "default")
|
||||
*out = network::mojom::ReferrerPolicy::kDefault;
|
||||
*out = blink::kWebReferrerPolicyDefault;
|
||||
else if (policy == "unsafe-url")
|
||||
*out = network::mojom::ReferrerPolicy::kAlways;
|
||||
*out = blink::kWebReferrerPolicyAlways;
|
||||
else if (policy == "no-referrer-when-downgrade")
|
||||
*out = network::mojom::ReferrerPolicy::kNoReferrerWhenDowngrade;
|
||||
*out = blink::kWebReferrerPolicyNoReferrerWhenDowngrade;
|
||||
else if (policy == "no-referrer")
|
||||
*out = network::mojom::ReferrerPolicy::kNever;
|
||||
*out = blink::kWebReferrerPolicyNever;
|
||||
else if (policy == "origin")
|
||||
*out = network::mojom::ReferrerPolicy::kOrigin;
|
||||
*out = blink::kWebReferrerPolicyOrigin;
|
||||
else if (policy == "strict-origin-when-cross-origin")
|
||||
*out = network::mojom::ReferrerPolicy::
|
||||
kNoReferrerWhenDowngradeOriginWhenCrossOrigin;
|
||||
*out =
|
||||
blink::kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin;
|
||||
else if (policy == "same-origin")
|
||||
*out = network::mojom::ReferrerPolicy::kSameOrigin;
|
||||
*out = blink::kWebReferrerPolicySameOrigin;
|
||||
else if (policy == "strict-origin")
|
||||
*out = network::mojom::ReferrerPolicy::kStrictOrigin;
|
||||
*out = blink::kWebReferrerPolicyStrictOrigin;
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
@ -123,12 +123,12 @@ struct Converter<blink::WebCache::ResourceTypeStats> {
|
|||
};
|
||||
|
||||
template <>
|
||||
struct Converter<network::mojom::ReferrerPolicy> {
|
||||
struct Converter<blink::WebReferrerPolicy> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const network::mojom::ReferrerPolicy& in);
|
||||
const blink::WebReferrerPolicy& in);
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
network::mojom::ReferrerPolicy* out);
|
||||
blink::WebReferrerPolicy* out);
|
||||
};
|
||||
|
||||
v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags);
|
||||
|
|
|
@ -43,19 +43,16 @@ void CallTranslater(v8::Local<v8::External> external,
|
|||
mate::Arguments* args) {
|
||||
// Whether the callback should only be called for once.
|
||||
v8::Isolate* isolate = args->isolate();
|
||||
auto context = isolate->GetCurrentContext();
|
||||
bool one_time =
|
||||
state->Has(context, mate::StringToSymbol(isolate, "oneTime")).ToChecked();
|
||||
bool one_time = state->Has(mate::StringToSymbol(isolate, "oneTime"));
|
||||
|
||||
// Check if the callback has already been called.
|
||||
if (one_time) {
|
||||
auto called_symbol = mate::StringToSymbol(isolate, "called");
|
||||
if (state->Has(context, called_symbol).ToChecked()) {
|
||||
if (state->Has(called_symbol)) {
|
||||
args->ThrowError("callback can only be called for once");
|
||||
return;
|
||||
} else {
|
||||
state->Set(context, called_symbol, v8::Boolean::New(isolate, true))
|
||||
.ToChecked();
|
||||
state->Set(called_symbol, v8::Boolean::New(isolate, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,10 +130,9 @@ v8::Local<v8::Value> CreateFunctionFromTranslater(v8::Isolate* isolate,
|
|||
Dictionary state = mate::Dictionary::CreateEmpty(isolate);
|
||||
if (one_time)
|
||||
state.Set("oneTime", true);
|
||||
auto context = isolate->GetCurrentContext();
|
||||
return BindFunctionWith(
|
||||
isolate, context, call_translater->GetFunction(context).ToLocalChecked(),
|
||||
holder->handle.Get(isolate), state.GetHandle());
|
||||
return BindFunctionWith(isolate, isolate->GetCurrentContext(),
|
||||
call_translater->GetFunction(),
|
||||
holder->handle.Get(isolate), state.GetHandle());
|
||||
}
|
||||
|
||||
// func.bind(func, arg1).
|
||||
|
|
|
@ -55,10 +55,8 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
|||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
std::vector<v8::Local<v8::Value>> args{ConvertToV8(isolate, raw)...};
|
||||
v8::Local<v8::Value> ret(holder
|
||||
->Call(context, holder, args.size(),
|
||||
args.empty() ? nullptr : &args.front())
|
||||
.ToLocalChecked());
|
||||
v8::Local<v8::Value> ret(holder->Call(
|
||||
holder, args.size(), args.empty() ? nullptr : &args.front()));
|
||||
return handle_scope.Escape(ret);
|
||||
}
|
||||
};
|
||||
|
@ -78,10 +76,7 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
|||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
std::vector<v8::Local<v8::Value>> args{ConvertToV8(isolate, raw)...};
|
||||
holder
|
||||
->Call(context, holder, args.size(),
|
||||
args.empty() ? nullptr : &args.front())
|
||||
.ToLocalChecked();
|
||||
holder->Call(holder, args.size(), args.empty() ? nullptr : &args.front());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -331,9 +331,8 @@ base::Value* V8ValueConverter::FromV8ValueImpl(FromV8ValueState* state,
|
|||
v8::Local<v8::Value> toISOString =
|
||||
date->Get(v8::String::NewFromUtf8(isolate, "toISOString"));
|
||||
if (toISOString->IsFunction()) {
|
||||
v8::Local<v8::Value> result = toISOString.As<v8::Function>()
|
||||
->Call(context, val, 0, nullptr)
|
||||
.ToLocalChecked();
|
||||
v8::Local<v8::Value> result =
|
||||
toISOString.As<v8::Function>()->Call(val, 0, nullptr);
|
||||
if (!result.IsEmpty()) {
|
||||
v8::String::Utf8Value utf8(isolate,
|
||||
result->ToString(context).ToLocalChecked());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/sys_info.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue