mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: bump chromium to 7dff37844cb3 (master) (#18059)
This commit is contained in:
committed by
Jeremy Apthorp
parent
00358545a9
commit
2616911f7a
@@ -530,9 +530,9 @@ int ImportIntoCertStore(CertificateManagerModel* model,
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnIconDataAvailable(util::Promise promise, gfx::Image* icon) {
|
||||
if (icon && !icon->IsEmpty()) {
|
||||
promise.Resolve(*icon);
|
||||
void OnIconDataAvailable(util::Promise promise, gfx::Image icon) {
|
||||
if (!icon.IsEmpty()) {
|
||||
promise.Resolve(icon);
|
||||
} else {
|
||||
promise.RejectWithErrorMessage("Failed to get file icon.");
|
||||
}
|
||||
|
||||
@@ -64,11 +64,17 @@ void AutoUpdater::OnError(const std::string& message,
|
||||
auto errorObject =
|
||||
error->ToObject(isolate()->GetCurrentContext()).ToLocalChecked();
|
||||
|
||||
auto context = isolate()->GetCurrentContext();
|
||||
|
||||
// add two new params for better error handling
|
||||
errorObject->Set(mate::StringToV8(isolate(), "code"),
|
||||
v8::Integer::New(isolate(), code));
|
||||
errorObject->Set(mate::StringToV8(isolate(), "domain"),
|
||||
mate::StringToV8(isolate(), domain));
|
||||
errorObject
|
||||
->Set(context, mate::StringToV8(isolate(), "code"),
|
||||
v8::Integer::New(isolate(), code))
|
||||
.Check();
|
||||
errorObject
|
||||
->Set(context, mate::StringToV8(isolate(), "domain"),
|
||||
mate::StringToV8(isolate(), domain))
|
||||
.Check();
|
||||
|
||||
mate::EmitEvent(isolate(), GetWrapper(), "error", errorObject, message);
|
||||
}
|
||||
|
||||
@@ -491,12 +491,14 @@ void WebContents::DestroyWebContents(bool async) {
|
||||
ResetManagedWebContents(async);
|
||||
}
|
||||
|
||||
bool WebContents::DidAddMessageToConsole(content::WebContents* source,
|
||||
int32_t level,
|
||||
const base::string16& message,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) {
|
||||
return Emit("console-message", level, message, line_no, source_id);
|
||||
bool WebContents::DidAddMessageToConsole(
|
||||
content::WebContents* source,
|
||||
blink::mojom::ConsoleMessageLevel level,
|
||||
const base::string16& message,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) {
|
||||
return Emit("console-message", static_cast<int32_t>(level), message, line_no,
|
||||
source_id);
|
||||
}
|
||||
|
||||
void WebContents::OnCreateWindow(
|
||||
|
||||
@@ -336,7 +336,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||
|
||||
// content::WebContentsDelegate:
|
||||
bool DidAddMessageToConsole(content::WebContents* source,
|
||||
int32_t level,
|
||||
blink::mojom::ConsoleMessageLevel level,
|
||||
const base::string16& message,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) override;
|
||||
|
||||
@@ -52,7 +52,10 @@ void Event::FrameDeleted(content::RenderFrameHost* rfh) {
|
||||
}
|
||||
|
||||
void Event::PreventDefault(v8::Isolate* isolate) {
|
||||
GetWrapper()->Set(StringToV8(isolate, "defaultPrevented"), v8::True(isolate));
|
||||
GetWrapper()
|
||||
->Set(isolate->GetCurrentContext(),
|
||||
StringToV8(isolate, "defaultPrevented"), v8::True(isolate))
|
||||
.Check();
|
||||
}
|
||||
|
||||
bool Event::SendReply(const base::ListValue& result) {
|
||||
|
||||
@@ -108,8 +108,13 @@ class EventEmitter : public Wrappable<T> {
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
EmitEvent(isolate(), GetWrapper(), name, event,
|
||||
std::forward<Args>(args)...);
|
||||
return event->Get(StringToV8(isolate(), "defaultPrevented"))
|
||||
->BooleanValue(isolate());
|
||||
auto context = isolate()->GetCurrentContext();
|
||||
v8::Local<v8::Value> defaultPrevented;
|
||||
if (event->Get(context, StringToV8(isolate(), "defaultPrevented"))
|
||||
.ToLocal(&defaultPrevented)) {
|
||||
return defaultPrevented->BooleanValue(isolate());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(EventEmitter);
|
||||
|
||||
@@ -96,7 +96,7 @@ void Browser::Focus() {
|
||||
}
|
||||
|
||||
void Browser::AddRecentDocument(const base::FilePath& path) {
|
||||
if (base::win::GetVersion() < base::win::VERSION_WIN7)
|
||||
if (base::win::GetVersion() < base::win::Version::WIN7)
|
||||
return;
|
||||
|
||||
CComPtr<IShellItem> item;
|
||||
@@ -346,7 +346,7 @@ std::string Browser::GetExecutableFileProductName() const {
|
||||
|
||||
bool Browser::IsEmojiPanelSupported() {
|
||||
// emoji picker is supported on Windows 10's Spring 2018 update & above.
|
||||
return base::win::GetVersion() >= base::win::Version::VERSION_WIN10_RS4;
|
||||
return base::win::GetVersion() >= base::win::Version::WIN10_RS4;
|
||||
}
|
||||
|
||||
void Browser::ShowEmojiPanel() {
|
||||
|
||||
@@ -45,7 +45,7 @@ void IOThread::Init() {
|
||||
|
||||
auto cert_verifier = std::make_unique<net::CachingCertVerifier>(
|
||||
std::make_unique<net::MultiThreadedCertVerifier>(
|
||||
net::CertVerifyProc::CreateDefault()));
|
||||
net::CertVerifyProc::CreateDefault(nullptr)));
|
||||
builder->SetCertVerifier(std::move(cert_verifier));
|
||||
|
||||
// Create the network service, so that shared host resolver
|
||||
|
||||
@@ -152,7 +152,7 @@ class CertVerifierRequest : public AtomCertVerifier::Request {
|
||||
};
|
||||
|
||||
AtomCertVerifier::AtomCertVerifier(RequireCTDelegate* ct_delegate)
|
||||
: default_cert_verifier_(net::CertVerifier::CreateDefault()),
|
||||
: default_cert_verifier_(net::CertVerifier::CreateDefault(nullptr)),
|
||||
ct_delegate_(ct_delegate) {}
|
||||
|
||||
AtomCertVerifier::~AtomCertVerifier() {}
|
||||
|
||||
@@ -47,7 +47,7 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) {
|
||||
// static
|
||||
NotificationPresenter* NotificationPresenter::Create() {
|
||||
auto version = base::win::GetVersion();
|
||||
if (version < base::win::VERSION_WIN8)
|
||||
if (version < base::win::Version::WIN8)
|
||||
return new NotificationPresenterWin7;
|
||||
if (!WindowsToastNotification::Initialize())
|
||||
return nullptr;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/shared_memory.h"
|
||||
#include "components/viz/common/resources/resource_format.h"
|
||||
#include "components/viz/common/resources/resource_sizes.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/shared_memory.h"
|
||||
#include "base/memory/shared_memory_mapping.h"
|
||||
#include "components/viz/host/host_display_client.h"
|
||||
#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
|
||||
@@ -531,8 +531,7 @@ void OffScreenRenderWidgetHostView::TextInputStateChanged(
|
||||
|
||||
void OffScreenRenderWidgetHostView::ImeCancelComposition() {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::RenderProcessGone(base::TerminationStatus,
|
||||
int) {
|
||||
void OffScreenRenderWidgetHostView::RenderProcessGone() {
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
||||
void SetIsLoading(bool is_loading) override;
|
||||
void TextInputStateChanged(const content::TextInputState& params) override;
|
||||
void ImeCancelComposition(void) override;
|
||||
void RenderProcessGone(base::TerminationStatus, int) override;
|
||||
void RenderProcessGone() override;
|
||||
void Destroy(void) override;
|
||||
void SetTooltipText(const base::string16&) override;
|
||||
content::CursorManager* GetCursorManager() override;
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "services/network/public/cpp/simple_url_loader.h"
|
||||
#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
|
||||
#include "third_party/blink/public/common/logging/logging_utils.h"
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/display/screen.h"
|
||||
|
||||
@@ -779,11 +780,13 @@ void InspectableWebContentsImpl::WebContentsDestroyed() {
|
||||
|
||||
bool InspectableWebContentsImpl::DidAddMessageToConsole(
|
||||
content::WebContents* source,
|
||||
int32_t level,
|
||||
blink::mojom::ConsoleMessageLevel level,
|
||||
const base::string16& message,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) {
|
||||
logging::LogMessage("CONSOLE", line_no, level).stream()
|
||||
logging::LogMessage("CONSOLE", line_no,
|
||||
blink::ConsoleMessageLevelToLogSeverity(level))
|
||||
.stream()
|
||||
<< "\"" << message << "\", source: " << source_id << " (" << line_no
|
||||
<< ")";
|
||||
return true;
|
||||
|
||||
@@ -145,6 +145,7 @@ class InspectableWebContentsImpl
|
||||
void SetOpenNewWindowForPopups(bool value) override {}
|
||||
void RecordPerformanceHistogram(const std::string& name,
|
||||
double duration) override {}
|
||||
void RecordUserMetricsAction(const std::string& name) override {}
|
||||
|
||||
// content::DevToolsFrontendHostDelegate:
|
||||
void HandleMessageFromDevToolsFrontend(const std::string& message);
|
||||
@@ -167,7 +168,7 @@ class InspectableWebContentsImpl
|
||||
|
||||
// content::WebContentsDelegate:
|
||||
bool DidAddMessageToConsole(content::WebContents* source,
|
||||
int32_t level,
|
||||
blink::mojom::ConsoleMessageLevel level,
|
||||
const base::string16& message,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) override;
|
||||
|
||||
@@ -150,10 +150,10 @@ void AutofillPopupView::OnSelectedRowChanged(
|
||||
|
||||
if (current_row_selection) {
|
||||
int selected = current_row_selection.value_or(-1);
|
||||
if (selected == -1 || selected >= child_count())
|
||||
if (selected == -1 || static_cast<size_t>(selected) >= children().size())
|
||||
return;
|
||||
child_at(selected)->NotifyAccessibilityEvent(ax::mojom::Event::kSelection,
|
||||
true);
|
||||
children().at(selected)->NotifyAccessibilityEvent(
|
||||
ax::mojom::Event::kSelection, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,8 @@ void AutofillPopupView::DoUpdateBoundsAndRedrawPopup() {
|
||||
}
|
||||
|
||||
void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||
if (!popup_ || popup_->GetLineCount() != child_count())
|
||||
if (!popup_ ||
|
||||
static_cast<size_t>(popup_->GetLineCount()) != children().size())
|
||||
return;
|
||||
gfx::Canvas* draw_canvas = canvas;
|
||||
SkBitmap bitmap;
|
||||
|
||||
@@ -43,9 +43,10 @@ void MenuDelegate::RunMenu(AtomMenuModel* model,
|
||||
menu_runner_.reset(new views::MenuRunner(
|
||||
item,
|
||||
views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS));
|
||||
menu_runner_->RunMenuAt(button->GetWidget()->GetTopLevelWidget(),
|
||||
static_cast<views::MenuButton*>(button), bounds,
|
||||
views::MenuAnchorPosition::kTopRight, source_type);
|
||||
menu_runner_->RunMenuAt(
|
||||
button->GetWidget()->GetTopLevelWidget(),
|
||||
static_cast<views::MenuButton*>(button)->button_controller(), bounds,
|
||||
views::MenuAnchorPosition::kTopRight, source_type);
|
||||
}
|
||||
|
||||
void MenuDelegate::ExecuteCommand(int id) {
|
||||
|
||||
@@ -92,10 +92,10 @@ void RootView::SetMenuBarVisibility(bool visible) {
|
||||
|
||||
menu_bar_visible_ = visible;
|
||||
if (visible) {
|
||||
DCHECK_EQ(child_count(), 1);
|
||||
DCHECK_EQ(children().size(), 1ul);
|
||||
AddChildView(menu_bar_.get());
|
||||
} else {
|
||||
DCHECK_EQ(child_count(), 2);
|
||||
DCHECK_EQ(children().size(), 2ul);
|
||||
RemoveChildView(menu_bar_.get());
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,12 @@ struct Converter<std::pair<Type1, Type2>> {
|
||||
v8::Local<v8::Array> array(v8::Local<v8::Array>::Cast(val));
|
||||
if (array->Length() != 2)
|
||||
return false;
|
||||
return Converter<Type1>::FromV8(isolate, array->Get(0), &out->first) &&
|
||||
Converter<Type2>::FromV8(isolate, array->Get(1), &out->second);
|
||||
|
||||
auto context = isolate->GetCurrentContext();
|
||||
return Converter<Type1>::FromV8(
|
||||
isolate, array->Get(context, 0).ToLocalChecked(), &out->first) &&
|
||||
Converter<Type2>::FromV8(
|
||||
isolate, array->Get(context, 1).ToLocalChecked(), &out->second);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -147,7 +147,8 @@ v8::Local<v8::Value> BindFunctionWith(v8::Isolate* isolate,
|
||||
v8::Local<v8::Function> func,
|
||||
v8::Local<v8::Value> arg1,
|
||||
v8::Local<v8::Value> arg2) {
|
||||
v8::MaybeLocal<v8::Value> bind = func->Get(mate::StringToV8(isolate, "bind"));
|
||||
v8::MaybeLocal<v8::Value> bind =
|
||||
func->Get(context, mate::StringToV8(isolate, "bind"));
|
||||
CHECK(!bind.IsEmpty());
|
||||
v8::Local<v8::Function> bind_func =
|
||||
v8::Local<v8::Function>::Cast(bind.ToLocalChecked());
|
||||
|
||||
@@ -211,7 +211,8 @@ bool Converter<net::HttpResponseHeaders*>::FromV8(
|
||||
if (localVal->IsArray()) {
|
||||
auto values = v8::Local<v8::Array>::Cast(localVal);
|
||||
for (uint32_t j = 0; j < values->Length(); j++) {
|
||||
if (!addHeaderFromValue(key, values->Get(j))) {
|
||||
if (!addHeaderFromValue(key,
|
||||
values->Get(context, j).ToLocalChecked())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Array(
|
||||
v8::Isolate* isolate,
|
||||
const base::ListValue* val) const {
|
||||
v8::Local<v8::Array> result(v8::Array::New(isolate, val->GetSize()));
|
||||
auto context = isolate->GetCurrentContext();
|
||||
|
||||
for (size_t i = 0; i < val->GetSize(); ++i) {
|
||||
const base::Value* child = nullptr;
|
||||
@@ -212,7 +213,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Array(
|
||||
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child);
|
||||
|
||||
v8::TryCatch try_catch(isolate);
|
||||
result->Set(static_cast<uint32_t>(i), child_v8);
|
||||
result->Set(context, static_cast<uint32_t>(i), child_v8).Check();
|
||||
if (try_catch.HasCaught())
|
||||
LOG(ERROR) << "Setter for index " << i << " threw an exception.";
|
||||
}
|
||||
@@ -330,9 +331,10 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8ValueImpl(
|
||||
if (val->IsDate()) {
|
||||
v8::Date* date = v8::Date::Cast(*val);
|
||||
v8::Local<v8::Value> toISOString =
|
||||
date->Get(v8::String::NewFromUtf8(isolate, "toISOString",
|
||||
v8::NewStringType::kNormal)
|
||||
.ToLocalChecked());
|
||||
date->Get(context, v8::String::NewFromUtf8(isolate, "toISOString",
|
||||
v8::NewStringType::kNormal)
|
||||
.ToLocalChecked())
|
||||
.ToLocalChecked();
|
||||
if (toISOString->IsFunction()) {
|
||||
v8::MaybeLocal<v8::Value> result =
|
||||
toISOString.As<v8::Function>()->Call(context, val, 0, nullptr);
|
||||
|
||||
@@ -341,7 +341,7 @@ bool MoveItemToTrash(const base::FilePath& path) {
|
||||
// Elevation prompt enabled for UAC protected files. This overrides the
|
||||
// SILENT, NO_UI and NOERRORUI flags.
|
||||
|
||||
if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
|
||||
if (base::win::GetVersion() >= base::win::Version::WIN8) {
|
||||
// Windows 8 introduces the flag RECYCLEONDELETE and deprecates the
|
||||
// ALLOWUNDO in favor of ADDUNDORECORD.
|
||||
if (FAILED(pfo->SetOperationFlags(
|
||||
|
||||
@@ -110,7 +110,7 @@ void InvokeHiddenCallback(v8::Handle<v8::Context> context,
|
||||
auto callback_key = mate::ConvertToV8(isolate, callback_name)
|
||||
->ToString(context)
|
||||
.ToLocalChecked();
|
||||
auto callback_value = binding->Get(callback_key);
|
||||
auto callback_value = binding->Get(context, callback_key).ToLocalChecked();
|
||||
DCHECK(callback_value->IsFunction()); // set by sandboxed_renderer/init.js
|
||||
auto callback = v8::Handle<v8::Function>::Cast(callback_value);
|
||||
ignore_result(callback->Call(context, binding, 0, nullptr));
|
||||
|
||||
@@ -60,7 +60,7 @@ void InvokeIpcCallback(v8::Local<v8::Context> context,
|
||||
auto callback_key = mate::ConvertToV8(isolate, callback_name)
|
||||
->ToString(context)
|
||||
.ToLocalChecked();
|
||||
auto callback_value = ipcNative->Get(callback_key);
|
||||
auto callback_value = ipcNative->Get(context, callback_key).ToLocalChecked();
|
||||
DCHECK(callback_value->IsFunction()); // set by init.ts
|
||||
auto callback = v8::Local<v8::Function>::Cast(callback_value);
|
||||
ignore_result(callback->Call(context, ipcNative, args.size(), args.data()));
|
||||
|
||||
Reference in New Issue
Block a user