Skip to content
Permalink
Browse files

chore: remove native_mate (Part 12) (#20869)

* refactor: move mate::Event to gin

* refactor: move mate::Locker to gin

* refactor: convert contextBridge to gin

* refactor: convert contentTracing to gin

* refactor: remove callback converter of native_mate

* refactor: remove file_dialog_converter and native_window_converter from native_mate

* refactor: convert webFrame to gin

* refactor: move blink_converter to gin

* refactor: remove net_converter from native_mate

* refactor: remove event_emitter_caller_deprecated

* refactor: remove gurl_converter from native_mate

* refactor: remove file_path and string16_converter from native_mate

* refactor: remove image_converter from native_mate

* refactor: move value_converter to gin
  • Loading branch information...
zcbenz committed Oct 31, 2019
1 parent 6781d5e commit 3ae3233e65aa71b4815e156cd426834c30eb993b
Showing with 622 additions and 1,711 deletions.
  1. +10 −22 filenames.gni
  2. +0 −3 native_mate/BUILD.gn
  3. +0 −17 native_mate/native_mate/dictionary.h
  4. +0 −35 native_mate/native_mate/persistent_dictionary.cc
  5. +0 −51 native_mate/native_mate/persistent_dictionary.h
  6. +0 −102 native_mate/native_mate/scoped_persistent.h
  7. +1 −1 shell/browser/api/atom_api_app.cc
  8. +1 −1 shell/browser/api/atom_api_browser_window.cc
  9. +13 −14 shell/browser/api/atom_api_content_tracing.cc
  10. +1 −1 shell/browser/api/atom_api_cookies.cc
  11. +2 −2 shell/browser/api/atom_api_debugger.cc
  12. +1 −1 shell/browser/api/atom_api_event.cc
  13. +1 −1 shell/browser/api/atom_api_menu.h
  14. +1 −1 shell/browser/api/atom_api_menu_mac.mm
  15. +1 −1 shell/browser/api/atom_api_menu_views.cc
  16. +1 −1 shell/browser/api/atom_api_session.cc
  17. +1 −1 shell/browser/api/atom_api_system_preferences.cc
  18. +1 −1 shell/browser/api/atom_api_system_preferences_mac.mm
  19. +7 −6 shell/browser/api/atom_api_top_level_window.cc
  20. +2 −2 shell/browser/api/atom_api_top_level_window.h
  21. +8 −8 shell/browser/api/atom_api_web_contents.cc
  22. +1 −1 shell/browser/api/atom_api_web_request.cc
  23. +1 −1 shell/browser/api/atom_api_web_view_manager.cc
  24. +24 −23 shell/browser/api/event.cc
  25. +16 −12 shell/browser/api/event.h
  26. +3 −2 shell/browser/api/gpuinfo_manager.cc
  27. +0 −1 shell/browser/api/gpuinfo_manager.h
  28. +1 −1 shell/browser/auto_updater_mac.mm
  29. +62 −1 shell/browser/login_handler.cc
  30. +3 −2 shell/browser/native_window.cc
  31. +3 −7 shell/browser/native_window.h
  32. +2 −2 shell/browser/native_window_mac.h
  33. +5 −4 shell/browser/native_window_mac.mm
  34. +1 −1 shell/browser/net/atom_url_loader_factory.cc
  35. +0 −1 shell/browser/net/cert_verifier_client.cc
  36. +2 −2 shell/browser/printing/print_preview_message_handler.cc
  37. +1 −1 shell/browser/renderer_host/electron_render_message_filter.cc
  38. +12 −13 shell/browser/ui/cocoa/atom_touch_bar.h
  39. +41 −42 shell/browser/ui/cocoa/atom_touch_bar.mm
  40. +0 −1 shell/browser/web_contents_permission_helper.cc
  41. +1 −1 shell/browser/web_contents_preferences.cc
  42. +0 −1 shell/browser/web_view_guest_delegate.cc
  43. +8 −10 shell/common/api/atom_api_asar.cc
  44. +28 −21 shell/common/api/atom_api_clipboard.cc
  45. +28 −19 shell/common/api/atom_api_clipboard.h
  46. +5 −6 shell/common/api/atom_api_command_line.cc
  47. +1 −1 shell/common/api/atom_api_native_image.cc
  48. +1 −2 shell/common/api/atom_api_shell.cc
  49. +13 −15 shell/common/api/electron_bindings.cc
  50. +6 −7 shell/common/api/electron_bindings.h
  51. +0 −38 shell/common/api/event_emitter_caller_deprecated.cc
  52. +0 −73 shell/common/api/event_emitter_caller_deprecated.h
  53. +1 −3 shell/common/api/remote/remote_object_freer.cc
  54. +41 −41 shell/common/{native_mate_converters → gin_converters}/blink_converter.cc
  55. +6 −6 shell/common/{native_mate_converters → gin_converters}/blink_converter.h
  56. +0 −79 shell/common/gin_converters/blink_converter_gin_adapter.h
  57. +3 −3 shell/common/gin_converters/content_converter.cc
  58. +1 −0 shell/common/gin_converters/file_path_converter.h
  59. +1 −59 shell/common/gin_converters/net_converter.cc
  60. +0 −11 shell/common/gin_converters/net_converter.h
  61. +4 −4 shell/common/{native_mate_converters → gin_converters}/value_converter.cc
  62. +6 −31 shell/common/{native_mate_converters → gin_converters}/value_converter.h
  63. +0 −56 shell/common/gin_converters/value_converter_gin_adapter.h
  64. +1 −1 shell/common/gin_helper/callback.cc
  65. +4 −4 shell/common/gin_helper/callback.h
  66. +20 −0 shell/common/gin_helper/dictionary.h
  67. +2 −3 shell/common/gin_helper/event_emitter.cc
  68. +5 −8 shell/common/gin_helper/event_emitter.h
  69. +1 −1 shell/common/gin_helper/event_emitter_caller.cc
  70. +3 −5 shell/common/{api → gin_helper}/locker.cc
  71. +5 −5 shell/common/{api → gin_helper}/locker.h
  72. +32 −0 shell/common/gin_helper/persistent_dictionary.cc
  73. +64 −0 shell/common/gin_helper/persistent_dictionary.h
  74. +2 −2 shell/common/gin_helper/trackable_object.cc
  75. +0 −162 shell/common/native_mate_converters/callback_converter_deprecated.cc
  76. +0 −185 shell/common/native_mate_converters/callback_converter_deprecated.h
  77. +0 −41 shell/common/native_mate_converters/file_dialog_converter.h
  78. +0 −28 shell/common/native_mate_converters/file_path_converter.h
  79. +0 −27 shell/common/native_mate_converters/gurl_converter.h
  80. +0 −37 shell/common/native_mate_converters/image_converter.h
  81. +0 −24 shell/common/native_mate_converters/native_window_converter.h
  82. +0 −75 shell/common/native_mate_converters/net_converter.h
  83. +0 −87 shell/common/native_mate_converters/once_callback.h
  84. +0 −33 shell/common/native_mate_converters/string16_converter.h
  85. +2 −2 shell/common/node_bindings.cc
  86. +1 −1 shell/common/{native_mate_converters → }/v8_value_converter.cc
  87. +3 −3 shell/common/{native_mate_converters → }/v8_value_converter.h
  88. +37 −34 shell/renderer/api/atom_api_context_bridge.cc
  89. +10 −13 shell/renderer/api/atom_api_context_bridge.h
  90. +7 −7 shell/renderer/api/atom_api_renderer_ipc.cc
  91. +10 −10 shell/renderer/api/atom_api_spell_check_client.cc
  92. +4 −4 shell/renderer/api/atom_api_spell_check_client.h
  93. +14 −15 shell/renderer/api/atom_api_web_frame.cc
  94. +9 −14 shell/renderer/atom_sandboxed_renderer_client.cc
  95. +2 −2 shell/renderer/electron_api_service_impl.cc
  96. +0 −1 shell/renderer/renderer_client_base.cc
@@ -430,11 +430,7 @@ filenames = {
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",
"shell/common/api/constructor.h",
"shell/common/api/event_emitter_caller_deprecated.cc",
"shell/common/api/event_emitter_caller_deprecated.h",
"shell/common/api/features.cc",
"shell/common/api/locker.cc",
"shell/common/api/locker.h",
"shell/common/asar/archive.cc",
"shell/common/asar/archive.h",
"shell/common/asar/asar_util.cc",
@@ -466,6 +462,8 @@ filenames = {
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/gin_converters/accelerator_converter.cc",
"shell/common/gin_converters/accelerator_converter.h",
"shell/common/gin_converters/blink_converter.cc",
"shell/common/gin_converters/blink_converter.h",
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/content_converter.cc",
"shell/common/gin_converters/content_converter.h",
@@ -483,8 +481,8 @@ filenames = {
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/blink_converter_gin_adapter.h",
"shell/common/gin_converters/value_converter_gin_adapter.h",
"shell/common/gin_converters/value_converter.cc",
"shell/common/gin_converters/value_converter.h",
"shell/common/gin_helper/arguments.cc",
"shell/common/gin_helper/arguments.h",
"shell/common/gin_helper/callback.cc",
@@ -500,8 +498,12 @@ filenames = {
"shell/common/gin_helper/event_emitter.h",
"shell/common/gin_helper/function_template.cc",
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/locker.cc",
"shell/common/gin_helper/locker.h",
"shell/common/gin_helper/object_template_builder.cc",
"shell/common/gin_helper/object_template_builder.h",
"shell/common/gin_helper/persistent_dictionary.cc",
"shell/common/gin_helper/persistent_dictionary.h",
"shell/common/gin_helper/trackable_object.cc",
"shell/common/gin_helper/trackable_object.h",
"shell/common/heap_snapshot.cc",
@@ -515,22 +517,6 @@ filenames = {
"shell/common/mouse_util.h",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/native_mate_converters/blink_converter.cc",
"shell/common/native_mate_converters/blink_converter.h",
"shell/common/native_mate_converters/callback_converter_deprecated.cc",
"shell/common/native_mate_converters/callback_converter_deprecated.h",
"shell/common/native_mate_converters/file_dialog_converter.h",
"shell/common/native_mate_converters/file_path_converter.h",
"shell/common/native_mate_converters/gurl_converter.h",
"shell/common/native_mate_converters/image_converter.h",
"shell/common/native_mate_converters/native_window_converter.h",
"shell/common/native_mate_converters/net_converter.h",
"shell/common/native_mate_converters/once_callback.h",
"shell/common/native_mate_converters/string16_converter.h",
"shell/common/native_mate_converters/v8_value_converter.cc",
"shell/common/native_mate_converters/v8_value_converter.h",
"shell/common/native_mate_converters/value_converter.cc",
"shell/common/native_mate_converters/value_converter.h",
"shell/common/node_bindings.cc",
"shell/common/node_bindings.h",
"shell/common/node_bindings_linux.cc",
@@ -552,6 +538,8 @@ filenames = {
"shell/common/promise_util.cc",
"shell/common/skia_util.h",
"shell/common/skia_util.cc",
"shell/common/v8_value_converter.cc",
"shell/common/v8_value_converter.h",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/renderer/api/atom_api_context_bridge.cc",
@@ -25,9 +25,6 @@ source_set("native_mate") {
"native_mate/handle.h",
"native_mate/object_template_builder.cc",
"native_mate/object_template_builder_deprecated.h",
"native_mate/persistent_dictionary.cc",
"native_mate/persistent_dictionary.h",
"native_mate/scoped_persistent.h",
"native_mate/wrappable.cc",
"native_mate/wrappable.h",
"native_mate/wrappable_base.h",
@@ -40,12 +40,6 @@ class Dictionary {

static Dictionary CreateEmpty(v8::Isolate* isolate);

bool Has(base::StringPiece key) const {
v8::Local<v8::Context> context = isolate_->GetCurrentContext();
v8::Local<v8::String> v8_key = StringToV8(isolate_, key);
return internal::IsTrue(GetHandle()->Has(context, v8_key));
}

template <typename T>
bool Get(base::StringPiece key, T* out) const {
// Check for existence before getting, otherwise this method will always
@@ -82,17 +76,6 @@ class Dictionary {
return !result.IsNothing() && result.FromJust();
}

template <typename T>
bool SetReadOnlyNonConfigurable(base::StringPiece key, T val) {
v8::Local<v8::Value> v8_value;
if (!TryConvertToV8(isolate_, val, &v8_value))
return false;
v8::Maybe<bool> result = GetHandle()->DefineOwnProperty(
isolate_->GetCurrentContext(), StringToV8(isolate_, key), v8_value,
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
return !result.IsNothing() && result.FromJust();
}

template <typename T>
bool SetMethod(base::StringPiece key, const T& callback) {
return GetHandle()

This file was deleted.

This file was deleted.

This file was deleted.

@@ -48,7 +48,7 @@
#include "shell/common/gin_converters/gurl_converter.h"
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/gin_converters/net_converter.h"
#include "shell/common/gin_converters/value_converter_gin_adapter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h"
@@ -18,7 +18,7 @@
#include "shell/browser/window_list.h"
#include "shell/common/api/constructor.h"
#include "shell/common/color_util.h"
#include "shell/common/gin_converters/value_converter_gin_adapter.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h"

0 comments on commit 3ae3233

Please sign in to comment.
You can’t perform that action at this time.