refactor: rename the atom namespace to electron
This commit is contained in:
parent
8c4496a9c9
commit
34c4c8d508
531 changed files with 1456 additions and 1428 deletions
|
@ -44,10 +44,11 @@ class IPCRenderer : public mate::Wrappable<IPCRenderer> {
|
|||
// Bind the interface on the background runner. All accesses will be via
|
||||
// the thread-safe pointer. This is to support our "fake-sync"
|
||||
// MessageSync() hack; see the comment in IPCRenderer::SendSync.
|
||||
atom::mojom::ElectronBrowserPtrInfo info;
|
||||
electron::mojom::ElectronBrowserPtrInfo info;
|
||||
render_frame->GetRemoteInterfaces()->GetInterface(mojo::MakeRequest(&info));
|
||||
electron_browser_ptr_ = atom::mojom::ThreadSafeElectronBrowserPtr::Create(
|
||||
std::move(info), task_runner_);
|
||||
electron_browser_ptr_ =
|
||||
electron::mojom::ThreadSafeElectronBrowserPtr::Create(std::move(info),
|
||||
task_runner_);
|
||||
}
|
||||
|
||||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
|
@ -74,12 +75,12 @@ class IPCRenderer : public mate::Wrappable<IPCRenderer> {
|
|||
v8::Local<v8::Promise> Invoke(mate::Arguments* args,
|
||||
const std::string& channel,
|
||||
const base::Value& arguments) {
|
||||
atom::util::Promise p(args->isolate());
|
||||
electron::util::Promise p(args->isolate());
|
||||
auto handle = p.GetHandle();
|
||||
|
||||
electron_browser_ptr_->get()->Invoke(
|
||||
channel, arguments.Clone(),
|
||||
base::BindOnce([](atom::util::Promise p,
|
||||
base::BindOnce([](electron::util::Promise p,
|
||||
base::Value result) { p.Resolve(result); },
|
||||
std::move(p)));
|
||||
|
||||
|
@ -186,7 +187,7 @@ class IPCRenderer : public mate::Wrappable<IPCRenderer> {
|
|||
}
|
||||
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner_;
|
||||
scoped_refptr<atom::mojom::ThreadSafeElectronBrowserPtr>
|
||||
scoped_refptr<electron::mojom::ThreadSafeElectronBrowserPtr>
|
||||
electron_browser_ptr_;
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "third_party/blink/public/web/web_text_checking_result.h"
|
||||
#include "third_party/icu/source/common/unicode/uscript.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace api {
|
||||
|
||||
|
@ -272,4 +272,4 @@ SpellCheckClient::SpellCheckScope::~SpellCheckScope() = default;
|
|||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -23,7 +23,7 @@ struct WebTextCheckingResult;
|
|||
class WebTextCheckingCompletion;
|
||||
} // namespace blink
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace api {
|
||||
|
||||
|
@ -109,6 +109,6 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
|
|||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_API_ATOM_API_SPELL_CHECK_CLIENT_H_
|
||||
|
|
|
@ -63,7 +63,7 @@ struct Converter<blink::WebLocalFrame::ScriptExecutionType> {
|
|||
|
||||
} // namespace mate
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace api {
|
||||
|
||||
|
@ -94,7 +94,7 @@ class RenderFrameStatus : public content::RenderFrameObserver {
|
|||
|
||||
class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
|
||||
public:
|
||||
explicit ScriptExecutionCallback(atom::util::Promise promise)
|
||||
explicit ScriptExecutionCallback(electron::util::Promise promise)
|
||||
: promise_(std::move(promise)) {}
|
||||
~ScriptExecutionCallback() override {}
|
||||
|
||||
|
@ -118,7 +118,7 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
|
|||
}
|
||||
|
||||
private:
|
||||
atom::util::Promise promise_;
|
||||
electron::util::Promise promise_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ScriptExecutionCallback);
|
||||
};
|
||||
|
@ -532,7 +532,7 @@ int GetRoutingId(v8::Local<v8::Value> window) {
|
|||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -540,7 +540,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
using namespace atom::api; // NOLINT(build/namespaces)
|
||||
using namespace electron::api; // NOLINT(build/namespaces)
|
||||
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
#include "ui/gfx/geometry/rect_f.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
const size_t kMaxDataLength = 1024;
|
||||
|
@ -227,4 +227,4 @@ const mojom::ElectronBrowserPtr& AutofillAgent::GetElectronBrowser() {
|
|||
return browser_ptr_;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "third_party/blink/public/web/web_form_control_element.h"
|
||||
#include "third_party/blink/public/web/web_input_element.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AutofillAgent : public content::RenderFrameObserver,
|
||||
public blink::WebAutofillClient,
|
||||
|
@ -85,6 +85,6 @@ class AutofillAgent : public content::RenderFrameObserver,
|
|||
DISALLOW_COPY_AND_ASSIGN(AutofillAgent);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_ATOM_AUTOFILL_AGENT_H_
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "third_party/blink/public/web/web_script_source.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -156,4 +156,4 @@ bool AtomRenderFrameObserver::ShouldNotifyClient(int world_id) {
|
|||
return IsMainWorld(world_id);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace base {
|
|||
class ListValue;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
enum World {
|
||||
MAIN_WORLD = 0,
|
||||
|
@ -66,6 +66,6 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
|
|||
DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_ATOM_RENDER_FRAME_OBSERVER_H_
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/electron_node/src/node_native_module.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -245,4 +245,4 @@ node::Environment* AtomRendererClient::GetEnvironment(
|
|||
return env;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace node {
|
|||
class Environment;
|
||||
} // namespace node
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class ElectronBindings;
|
||||
class NodeBindings;
|
||||
|
@ -26,7 +26,7 @@ class AtomRendererClient : public RendererClientBase {
|
|||
AtomRendererClient();
|
||||
~AtomRendererClient() override;
|
||||
|
||||
// atom::RendererClientBase:
|
||||
// electron::RendererClientBase:
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
content::RenderFrame* render_frame) override;
|
||||
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
||||
|
@ -73,6 +73,6 @@ class AtomRendererClient : public RendererClientBase {
|
|||
DISALLOW_COPY_AND_ASSIGN(AtomRendererClient);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_ATOM_RENDERER_CLIENT_H_
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "third_party/electron_node/src/node_binding.h"
|
||||
#include "third_party/electron_node/src/node_native_module.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -296,4 +296,4 @@ void AtomSandboxedRendererClient::WillReleaseScriptContext(
|
|||
InvokeHiddenCallback(context, kLifecycleKey, "onExit");
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "base/process/process_metrics.h"
|
||||
#include "shell/renderer/renderer_client_base.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomSandboxedRendererClient : public RendererClientBase {
|
||||
public:
|
||||
|
@ -22,7 +22,7 @@ class AtomSandboxedRendererClient : public RendererClientBase {
|
|||
void InitializeBindings(v8::Local<v8::Object> binding,
|
||||
v8::Local<v8::Context> context,
|
||||
bool is_main_frame);
|
||||
// atom::RendererClientBase:
|
||||
// electron::RendererClientBase:
|
||||
void DidCreateScriptContext(v8::Handle<v8::Context> context,
|
||||
content::RenderFrame* render_frame) override;
|
||||
void WillReleaseScriptContext(v8::Handle<v8::Context> context,
|
||||
|
@ -49,6 +49,6 @@ class AtomSandboxedRendererClient : public RendererClientBase {
|
|||
DISALLOW_COPY_AND_ASSIGN(AtomSandboxedRendererClient);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_ATOM_SANDBOXED_RENDERER_CLIENT_H_
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "third_party/blink/public/platform/web_security_origin.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
ContentSettingsObserver::ContentSettingsObserver(
|
||||
content::RenderFrame* render_frame)
|
||||
|
@ -57,4 +57,4 @@ void ContentSettingsObserver::OnDestruct() {
|
|||
delete this;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "content/public/renderer/render_frame_observer.h"
|
||||
#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class ContentSettingsObserver : public content::RenderFrameObserver,
|
||||
public blink::WebContentSettingsClient {
|
||||
|
@ -29,6 +29,6 @@ class ContentSettingsObserver : public content::RenderFrameObserver,
|
|||
DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "third_party/blink/public/web/blink.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -171,9 +171,10 @@ void ElectronApiServiceImpl::TakeHeapSnapshot(
|
|||
}
|
||||
base::File base_file(platform_file);
|
||||
|
||||
bool success = atom::TakeHeapSnapshot(blink::MainThreadIsolate(), &base_file);
|
||||
bool success =
|
||||
electron::TakeHeapSnapshot(blink::MainThreadIsolate(), &base_file);
|
||||
|
||||
std::move(callback).Run(success);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/associated_binding.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class RendererClientBase;
|
||||
|
||||
|
@ -50,6 +50,6 @@ class ElectronApiServiceImpl : public mojom::ElectronRenderer,
|
|||
DISALLOW_COPY_AND_ASSIGN(ElectronApiServiceImpl);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_ELECTRON_API_SERVICE_IMPL_H_
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -61,4 +61,4 @@ base::WeakPtr<content::BrowserPluginDelegate> GuestViewContainer::GetWeakPtr() {
|
|||
return weak_ptr_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace gfx {
|
|||
class Size;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class GuestViewContainer : public content::BrowserPluginDelegate {
|
||||
public:
|
||||
|
@ -41,6 +41,6 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
|
|||
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_GUEST_VIEW_CONTAINER_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "third_party/blink/public/web/web_element.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
PrintRenderFrameHelperDelegate::PrintRenderFrameHelperDelegate() = default;
|
||||
|
||||
|
@ -34,4 +34,4 @@ bool PrintRenderFrameHelperDelegate::OverridePrint(
|
|||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "base/macros.h"
|
||||
#include "components/printing/renderer/print_render_frame_helper.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class PrintRenderFrameHelperDelegate
|
||||
: public printing::PrintRenderFrameHelper::Delegate {
|
||||
|
@ -26,6 +26,6 @@ class PrintRenderFrameHelperDelegate
|
|||
DISALLOW_COPY_AND_ASSIGN(PrintRenderFrameHelperDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_PRINTING_PRINT_RENDER_FRAME_HELPER_DELEGATE_H_
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#include "shell/renderer/printing/print_render_frame_helper_delegate.h"
|
||||
#endif // BUILDFLAG(ENABLE_PRINTING)
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -209,7 +209,8 @@ void RendererClientBase::RenderFrameCreated(
|
|||
new ContentSettingsObserver(render_frame);
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
new printing::PrintRenderFrameHelper(
|
||||
render_frame, std::make_unique<atom::PrintRenderFrameHelperDelegate>());
|
||||
render_frame,
|
||||
std::make_unique<electron::PrintRenderFrameHelperDelegate>());
|
||||
#endif
|
||||
|
||||
// TODO(nornagon): it might be possible for an IPC message sent to this
|
||||
|
@ -319,4 +320,4 @@ v8::Local<v8::Value> RendererClientBase::RunScript(
|
|||
return script->Run(context).ToLocalChecked();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "chrome/renderer/media/chrome_key_systems_provider.h" // nogncheck
|
||||
#endif
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class RendererClientBase : public content::ContentRendererClient {
|
||||
public:
|
||||
|
@ -73,6 +73,6 @@ class RendererClientBase : public content::ContentRendererClient {
|
|||
int64_t next_context_id_ = 0;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_RENDERER_CLIENT_BASE_H_
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -71,4 +71,4 @@ void WebWorkerObserver::ContextWillDestroy(v8::Local<v8::Context> context) {
|
|||
delete this;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "base/macros.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class ElectronBindings;
|
||||
class NodeBindings;
|
||||
|
@ -34,6 +34,6 @@ class WebWorkerObserver {
|
|||
DISALLOW_COPY_AND_ASSIGN(WebWorkerObserver);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_RENDERER_WEB_WORKER_OBSERVER_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue