REVIEW: move ipc use from rvh to rfh

This commit is contained in:
deepak1556 2017-12-30 02:06:11 +05:30 committed by Aleksei Kuzmin
parent b552ad7065
commit 5684f8886f
7 changed files with 62 additions and 39 deletions

View file

@ -7,7 +7,7 @@
#include "atom/common/api/api_messages.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
namespace atom {
@ -37,10 +37,10 @@ void RemoteCallbackFreer::RunDestructor() {
base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK");
base::ListValue args;
args.AppendInteger(object_id_);
auto host = web_contents()->GetRenderViewHost();
if (host) {
host->Send(new AtomViewMsg_Message(
host->GetRoutingID(), false, channel, args));
auto frame_host = web_contents()->GetMainFrame();
if (frame_host) {
frame_host->Send(new AtomFrameMsg_Message(frame_host->GetRoutingID(), false,
channel, args));
}
Observe(nullptr);