refactor: use std::string instead of base::string16 for IPC channel names (#14286)

This commit is contained in:
Milan Burda 2018-08-24 17:30:37 +02:00 committed by Charles Kerr
parent 605a4570c1
commit e6e3ccfc50
12 changed files with 45 additions and 24 deletions

View file

@ -303,7 +303,7 @@ struct WebContents::FrameDispatchHelper {
api_web_contents->OnGetZoomLevel(rfh, reply_msg);
}
void OnRendererMessageSync(const base::string16& channel,
void OnRendererMessageSync(const std::string& channel,
const base::ListValue& args,
IPC::Message* message) {
api_web_contents->OnRendererMessageSync(rfh, channel, args, message);
@ -1550,7 +1550,7 @@ void WebContents::TabTraverse(bool reverse) {
}
bool WebContents::SendIPCMessage(bool all_frames,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args) {
auto* frame_host = web_contents()->GetMainFrame();
if (frame_host) {
@ -2063,18 +2063,18 @@ AtomBrowserContext* WebContents::GetBrowserContext() const {
}
void WebContents::OnRendererMessage(content::RenderFrameHost* frame_host,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args) {
// webContents.emit(channel, new Event(), args...);
Emit(base::UTF16ToUTF8(channel), args);
Emit(channel, args);
}
void WebContents::OnRendererMessageSync(content::RenderFrameHost* frame_host,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args,
IPC::Message* message) {
// webContents.emit(channel, new Event(sender, message), args...);
EmitWithSender(base::UTF16ToUTF8(channel), frame_host, message, args);
EmitWithSender(channel, frame_host, message, args);
}
// static

View file

@ -178,7 +178,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Send messages to browser.
bool SendIPCMessage(bool all_frames,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args);
// Send WebInputEvent to the page.
@ -410,12 +410,12 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Called when received a message from renderer.
void OnRendererMessage(content::RenderFrameHost* frame_host,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args);
// Called when received a synchronous message from renderer.
void OnRendererMessageSync(content::RenderFrameHost* frame_host,
const base::string16& channel,
const std::string& channel,
const base::ListValue& args,
IPC::Message* message);