@@ -1023,15 +1023,15 @@ void WebContents::OnElectronBrowserConnectionError() {
10231023
10241024void WebContents::Message (bool internal,
10251025 const std::string& channel,
1026- base::Value arguments) {
1026+ base::ListValue arguments) {
10271027 // webContents.emit('-ipc-message', new Event(), internal, channel,
10281028 // arguments);
10291029 EmitWithSender (" -ipc-message" , bindings_.dispatch_context (), base::nullopt ,
10301030 internal, channel, std::move (arguments));
10311031}
10321032
10331033void WebContents::Invoke (const std::string& channel,
1034- base::Value arguments,
1034+ base::ListValue arguments,
10351035 InvokeCallback callback) {
10361036 // webContents.emit('-ipc-invoke', new Event(), channel, arguments);
10371037 EmitWithSender (" -ipc-invoke" , bindings_.dispatch_context (),
@@ -1040,7 +1040,7 @@ void WebContents::Invoke(const std::string& channel,
10401040
10411041void WebContents::MessageSync (bool internal,
10421042 const std::string& channel,
1043- base::Value arguments,
1043+ base::ListValue arguments,
10441044 MessageSyncCallback callback) {
10451045 // webContents.emit('-ipc-message-sync', new Event(sender, message), internal,
10461046 // channel, arguments);
@@ -1052,19 +1052,18 @@ void WebContents::MessageTo(bool internal,
10521052 bool send_to_all,
10531053 int32_t web_contents_id,
10541054 const std::string& channel,
1055- base::Value arguments) {
1055+ base::ListValue arguments) {
10561056 auto * web_contents = mate::TrackableObject<WebContents>::FromWeakMapID (
10571057 isolate (), web_contents_id);
10581058
10591059 if (web_contents) {
10601060 web_contents->SendIPCMessageWithSender (internal, send_to_all, channel,
1061- base::ListValue (arguments.GetList ()),
1062- ID ());
1061+ std::move (arguments), ID ());
10631062 }
10641063}
10651064
10661065void WebContents::MessageHost (const std::string& channel,
1067- base::Value arguments) {
1066+ base::ListValue arguments) {
10681067 // webContents.emit('ipc-message-host', new Event(), channel, args);
10691068 EmitWithSender (" ipc-message-host" , bindings_.dispatch_context (),
10701069 base::nullopt , channel, std::move (arguments));
@@ -1943,14 +1942,15 @@ void WebContents::TabTraverse(bool reverse) {
19431942bool WebContents::SendIPCMessage (bool internal,
19441943 bool send_to_all,
19451944 const std::string& channel,
1946- const base::ListValue& args) {
1947- return SendIPCMessageWithSender (internal, send_to_all, channel, args);
1945+ base::ListValue args) {
1946+ return SendIPCMessageWithSender (internal, send_to_all, channel,
1947+ std::move (args));
19481948}
19491949
19501950bool WebContents::SendIPCMessageWithSender (bool internal,
19511951 bool send_to_all,
19521952 const std::string& channel,
1953- const base::ListValue& args,
1953+ base::ListValue args,
19541954 int32_t sender_id) {
19551955 std::vector<content::RenderFrameHost*> target_hosts;
19561956 if (!send_to_all) {
@@ -1966,7 +1966,8 @@ bool WebContents::SendIPCMessageWithSender(bool internal,
19661966 mojom::ElectronRendererAssociatedPtr electron_ptr;
19671967 frame_host->GetRemoteAssociatedInterfaces ()->GetInterface (
19681968 mojo::MakeRequest (&electron_ptr));
1969- electron_ptr->Message (internal, false , channel, args.Clone (), sender_id);
1969+ electron_ptr->Message (internal, false , channel,
1970+ base::ListValue (args.Clone ().GetList ()), sender_id);
19701971 }
19711972 return true ;
19721973}
@@ -1975,7 +1976,7 @@ bool WebContents::SendIPCMessageToFrame(bool internal,
19751976 bool send_to_all,
19761977 int32_t frame_id,
19771978 const std::string& channel,
1978- const base::ListValue& args) {
1979+ base::ListValue args) {
19791980 auto frames = web_contents ()->GetAllFrames ();
19801981 auto iter = std::find_if (frames.begin (), frames.end (), [frame_id](auto * f) {
19811982 return f->GetRoutingID () == frame_id;
@@ -1988,7 +1989,7 @@ bool WebContents::SendIPCMessageToFrame(bool internal,
19881989 mojom::ElectronRendererAssociatedPtr electron_ptr;
19891990 (*iter)->GetRemoteAssociatedInterfaces ()->GetInterface (
19901991 mojo::MakeRequest (&electron_ptr));
1991- electron_ptr->Message (internal, send_to_all, channel, args. Clone ( ),
1992+ electron_ptr->Message (internal, send_to_all, channel, std::move (args ),
19921993 0 /* sender_id */ );
19931994 return true ;
19941995}
0 commit comments