WebContents are no longer IPC Sender's
This commit is contained in:
parent
6f695b93d5
commit
41b9825f00
2 changed files with 10 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
#include "content/public/browser/render_frame_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "native_mate/object_template_builder.h"
|
#include "native_mate/object_template_builder.h"
|
||||||
|
|
||||||
|
@ -60,8 +60,10 @@ bool Event::SendReply(const base::string16& json) {
|
||||||
if (message_ == nullptr || sender_ == nullptr)
|
if (message_ == nullptr || sender_ == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AtomFrameHostMsg_Message_Sync::WriteReplyParams(message_, json);
|
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
|
||||||
bool success = sender_->Send(message_);
|
auto host = sender_->GetRenderViewHost();
|
||||||
|
if (!host) return false;
|
||||||
|
bool success = host->Send(message_);
|
||||||
message_ = nullptr;
|
message_ = nullptr;
|
||||||
sender_ = nullptr;
|
sender_ = nullptr;
|
||||||
return success;
|
return success;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "content/public/browser/render_frame_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -37,10 +37,10 @@ void RemoteCallbackFreer::RunDestructor() {
|
||||||
base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK");
|
base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK");
|
||||||
base::ListValue args;
|
base::ListValue args;
|
||||||
args.AppendInteger(object_id_);
|
args.AppendInteger(object_id_);
|
||||||
auto frame_host = web_contents()->GetMainFrame();
|
auto host = web_contents()->GetRenderViewHost();
|
||||||
if (frame_host) {
|
if (host) {
|
||||||
frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false,
|
host->Send(new AtomViewMsg_Message(
|
||||||
channel, args));
|
host->GetRoutingID(), false, channel, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
Observe(nullptr);
|
Observe(nullptr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue