refactor: delete atom_api_renderer_ipc.h (#16481)

This commit is contained in:
Milan Burda 2019-01-22 07:31:37 +01:00 committed by Shelley Vohr
parent b965e54efc
commit 0e27f133d7
4 changed files with 8 additions and 51 deletions

View file

@ -2,22 +2,23 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/renderer/api/atom_api_renderer_ipc.h"
#include <string>
#include "atom/common/api/api_messages.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_bindings.h"
#include "atom/common/node_includes.h"
#include "base/values.h"
#include "content/public/renderer/render_frame.h"
#include "native_mate/arguments.h"
#include "native_mate/dictionary.h"
#include "third_party/blink/public/web/web_local_frame.h"
using blink::WebLocalFrame;
using content::RenderFrame;
namespace atom {
namespace api {
namespace {
RenderFrame* GetCurrentRenderFrame() {
WebLocalFrame* frame = WebLocalFrame::FrameForCurrentContext();
@ -78,20 +79,14 @@ void SendTo(mate::Arguments* args,
args->ThrowError("Unable to send AtomFrameHostMsg_Message_To");
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("send", &atom::api::Send);
dict.SetMethod("sendSync", &atom::api::SendSync);
dict.SetMethod("sendTo", &atom::api::SendTo);
dict.SetMethod("send", &Send);
dict.SetMethod("sendSync", &SendSync);
dict.SetMethod("sendTo", &SendTo);
}
} // namespace

View file

@ -1,36 +0,0 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_
#define ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_
#include <string>
#include "base/values.h"
#include "native_mate/arguments.h"
namespace atom {
namespace api {
void Send(mate::Arguments* args,
const std::string& channel,
const base::ListValue& arguments);
base::ListValue SendSync(mate::Arguments* args,
const std::string& channel,
const base::ListValue& arguments);
void SendTo(mate::Arguments* args,
bool internal,
bool send_to_all,
int32_t web_contents_id,
const std::string& channel,
const base::ListValue& arguments);
} // namespace api
} // namespace atom
#endif // ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_

View file

@ -11,7 +11,6 @@
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_bindings.h"
#include "atom/common/options_switches.h"
#include "atom/renderer/api/atom_api_renderer_ipc.h"
#include "atom/renderer/atom_render_frame_observer.h"
#include "base/base_paths.h"
#include "base/command_line.h"

View file

@ -630,7 +630,6 @@ filenames = {
"atom/common/platform_util_win.cc",
"atom/common/promise_util.h",
"atom/common/promise_util.cc",
"atom/renderer/api/atom_api_renderer_ipc.h",
"atom/renderer/api/atom_api_renderer_ipc.cc",
"atom/renderer/api/atom_api_spell_check_client.cc",
"atom/renderer/api/atom_api_spell_check_client.h",