chore: rename atomBinding to electronBinding (#17419)
This commit is contained in:
parent
5025c991ee
commit
38d75010c7
81 changed files with 167 additions and 164 deletions
|
@ -7,7 +7,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "atom/common/api/atom_bindings.h"
|
||||
#include "atom/common/api/electron_bindings.h"
|
||||
#include "atom/common/api/event_emitter_caller.h"
|
||||
#include "atom/common/asar/asar_util.h"
|
||||
#include "atom/common/node_bindings.h"
|
||||
|
@ -35,7 +35,7 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) {
|
|||
|
||||
AtomRendererClient::AtomRendererClient()
|
||||
: node_bindings_(NodeBindings::Create(NodeBindings::RENDERER)),
|
||||
atom_bindings_(new AtomBindings(uv_default_loop())) {}
|
||||
electron_bindings_(new ElectronBindings(uv_default_loop())) {}
|
||||
|
||||
AtomRendererClient::~AtomRendererClient() {
|
||||
asar::ClearArchives();
|
||||
|
@ -114,7 +114,7 @@ void AtomRendererClient::DidCreateScriptContext(
|
|||
environments_.insert(env);
|
||||
|
||||
// Add Electron extended APIs.
|
||||
atom_bindings_->BindTo(env->isolate(), env->process_object());
|
||||
electron_bindings_->BindTo(env->isolate(), env->process_object());
|
||||
AddRenderBindings(env->isolate(), env->process_object());
|
||||
mate::Dictionary process_dict(env->isolate(), env->process_object());
|
||||
process_dict.SetReadOnly("isMainFrame", render_frame->IsMainFrame());
|
||||
|
@ -157,8 +157,8 @@ void AtomRendererClient::WillReleaseScriptContext(
|
|||
switches::kNodeIntegrationInSubFrames))
|
||||
node::FreeEnvironment(env);
|
||||
|
||||
// AtomBindings is tracking node environments.
|
||||
atom_bindings_->EnvironmentDestroyed(env);
|
||||
// ElectronBindings is tracking node environments.
|
||||
electron_bindings_->EnvironmentDestroyed(env);
|
||||
}
|
||||
|
||||
bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
|
|
|
@ -18,7 +18,7 @@ class Environment;
|
|||
|
||||
namespace atom {
|
||||
|
||||
class AtomBindings;
|
||||
class ElectronBindings;
|
||||
class NodeBindings;
|
||||
|
||||
class AtomRendererClient : public RendererClientBase {
|
||||
|
@ -60,7 +60,7 @@ class AtomRendererClient : public RendererClientBase {
|
|||
bool node_integration_initialized_ = false;
|
||||
|
||||
std::unique_ptr<NodeBindings> node_bindings_;
|
||||
std::unique_ptr<AtomBindings> atom_bindings_;
|
||||
std::unique_ptr<ElectronBindings> electron_bindings_;
|
||||
|
||||
// The node::Environment::GetCurrent API does not return nullptr when it
|
||||
// is called for a context without node::Environment, so we have to keep
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "atom/renderer/atom_sandboxed_renderer_client.h"
|
||||
|
||||
#include "atom/common/api/api_messages.h"
|
||||
#include "atom/common/api/atom_bindings.h"
|
||||
#include "atom/common/api/electron_bindings.h"
|
||||
#include "atom/common/application_info.h"
|
||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "atom/common/native_mate_converters/value_converter.h"
|
||||
|
@ -149,7 +149,7 @@ void AtomSandboxedRendererClient::InitializeBindings(
|
|||
mate::Dictionary process = mate::Dictionary::CreateEmpty(isolate);
|
||||
b.Set("process", process);
|
||||
|
||||
AtomBindings::BindProcess(isolate, &process, metrics_.get());
|
||||
ElectronBindings::BindProcess(isolate, &process, metrics_.get());
|
||||
|
||||
process.Set("argv", base::CommandLine::ForCurrentProcess()->argv());
|
||||
process.SetReadOnly("pid", base::GetCurrentProcId());
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "atom/renderer/web_worker_observer.h"
|
||||
|
||||
#include "atom/common/api/atom_bindings.h"
|
||||
#include "atom/common/api/electron_bindings.h"
|
||||
#include "atom/common/api/event_emitter_caller.h"
|
||||
#include "atom/common/asar/asar_util.h"
|
||||
#include "atom/common/node_bindings.h"
|
||||
|
@ -30,7 +30,7 @@ WebWorkerObserver* WebWorkerObserver::GetCurrent() {
|
|||
|
||||
WebWorkerObserver::WebWorkerObserver()
|
||||
: node_bindings_(NodeBindings::Create(NodeBindings::WORKER)),
|
||||
atom_bindings_(new AtomBindings(node_bindings_->uv_loop())) {
|
||||
electron_bindings_(new ElectronBindings(node_bindings_->uv_loop())) {
|
||||
lazy_tls.Pointer()->Set(this);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ void WebWorkerObserver::ContextCreated(v8::Local<v8::Context> context) {
|
|||
node::Environment* env = node_bindings_->CreateEnvironment(context);
|
||||
|
||||
// Add Electron extended APIs.
|
||||
atom_bindings_->BindTo(env->isolate(), env->process_object());
|
||||
electron_bindings_->BindTo(env->isolate(), env->process_object());
|
||||
|
||||
// Load everything.
|
||||
node_bindings_->LoadEnvironment(env);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
class AtomBindings;
|
||||
class ElectronBindings;
|
||||
class NodeBindings;
|
||||
|
||||
// Watches for WebWorker and insert node integration to it.
|
||||
|
@ -29,7 +29,7 @@ class WebWorkerObserver {
|
|||
~WebWorkerObserver();
|
||||
|
||||
std::unique_ptr<NodeBindings> node_bindings_;
|
||||
std::unique_ptr<AtomBindings> atom_bindings_;
|
||||
std::unique_ptr<ElectronBindings> electron_bindings_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebWorkerObserver);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue