chore: remove native_mate (Part 4) (#20146)

* avoid patching gin::Dictionary by using our wrapper

* remove SetHidden from mate::Dictionary
This commit is contained in:
Cheng Zhao 2019-09-09 00:10:18 +09:00 committed by GitHub
parent d395799917
commit 49bd74ff0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 190 additions and 162 deletions

View file

@ -19,9 +19,9 @@
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "electron/buildflags/buildflags.h"
#include "native_mate/dictionary.h"
#include "printing/buildflags/buildflags.h"
#include "shell/common/color_util.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/native_mate_converters/value_converter.h"
#include "shell/common/options_switches.h"
#include "shell/renderer/atom_autofill_agent.h"
@ -114,7 +114,7 @@ void RendererClientBase::DidCreateScriptContext(
// global.setHidden("contextId", `${processHostId}-${++next_context_id_}`)
auto context_id = base::StringPrintf(
"%s-%" PRId64, renderer_client_id_.c_str(), ++next_context_id_);
mate::Dictionary global(context->GetIsolate(), context->Global());
gin_helper::Dictionary global(context->GetIsolate(), context->Global());
global.SetHidden("contextId", context_id);
auto* command_line = base::CommandLine::ForCurrentProcess();
@ -125,9 +125,7 @@ void RendererClientBase::DidCreateScriptContext(
void RendererClientBase::AddRenderBindings(
v8::Isolate* isolate,
v8::Local<v8::Object> binding_object) {
mate::Dictionary dict(isolate, binding_object);
}
v8::Local<v8::Object> binding_object) {}
void RendererClientBase::RenderThreadStarted() {
auto* command_line = base::CommandLine::ForCurrentProcess();
@ -380,14 +378,14 @@ bool RendererClientBase::IsWebViewFrame(
if (render_frame->IsMainFrame())
return false;
mate::Dictionary window_dict(
gin::Dictionary window_dict(
isolate, GetContext(render_frame->GetWebFrame(), isolate)->Global());
v8::Local<v8::Object> frame_element;
if (!window_dict.Get("frameElement", &frame_element))
return false;
mate::Dictionary frame_element_dict(isolate, frame_element);
gin_helper::Dictionary frame_element_dict(isolate, frame_element);
v8::Local<v8::Object> internal;
if (!frame_element_dict.GetHidden("internal", &internal))