refactor: move CompileAndCall to a helper (#20675)
This commit is contained in:
parent
5abce7ec08
commit
db4d01c517
8 changed files with 86 additions and 76 deletions
|
@ -16,12 +16,12 @@
|
|||
#include "shell/common/gin_helper/event_emitter_caller.h"
|
||||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/node_util.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/renderer/atom_render_frame_observer.h"
|
||||
#include "shell/renderer/web_worker_observer.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/electron_node/src/node_native_module_env.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -227,9 +227,8 @@ void AtomRendererClient::SetupMainWorldOverrides(
|
|||
env->process_object(),
|
||||
GetContext(render_frame->GetWebFrame(), isolate)->Global()};
|
||||
|
||||
node::native_module::NativeModuleEnv::CompileAndCall(
|
||||
context, "electron/js2c/isolated_bundle", &isolated_bundle_params,
|
||||
&isolated_bundle_args, nullptr);
|
||||
util::CompileAndCall(context, "electron/js2c/isolated_bundle",
|
||||
&isolated_bundle_params, &isolated_bundle_args, nullptr);
|
||||
}
|
||||
|
||||
void AtomRendererClient::SetupExtensionWorldOverrides(
|
||||
|
@ -255,9 +254,8 @@ void AtomRendererClient::SetupExtensionWorldOverrides(
|
|||
GetContext(render_frame->GetWebFrame(), isolate)->Global(),
|
||||
v8::Integer::New(isolate, world_id)};
|
||||
|
||||
node::native_module::NativeModuleEnv::CompileAndCall(
|
||||
context, "electron/js2c/content_script_bundle", &isolated_bundle_params,
|
||||
&isolated_bundle_args, nullptr);
|
||||
util::CompileAndCall(context, "electron/js2c/content_script_bundle",
|
||||
&isolated_bundle_params, &isolated_bundle_args, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue