From 1b07208a2c4055e21eff79995124c26b694e3a91 Mon Sep 17 00:00:00 2001 From: Uzair Date: Mon, 19 Nov 2018 22:38:55 -0800 Subject: [PATCH] [M69 Dev] Implements IPC::Sender in WebContentsDelegateEfl IPC::Sender of WebContentsObserver was removed in the upstream [1]. Implemented IPC::Sender to send a reply message through current RenderViewHost by the received message as before. [1] https://chromium-review.googlesource.com/630416 Reference: https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/175401 Change-Id: I9dcf9625544ae410831f26b726425360e40303e1 Signed-off-by: Uzair --- .../ewk/efl_integration/web_contents_delegate_efl.cc | 20 ++++++++------------ .../ewk/efl_integration/web_contents_delegate_efl.h | 6 +++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc index e92a42c..142ed24 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc @@ -518,19 +518,13 @@ void WebContentsDelegateEfl::OnUpdateSettings(const Ewk_Settings* settings) { bool WebContentsDelegateEfl::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(WebContentsDelegateEfl, message) -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // FIXME: WebContentsObserver is IPC:: listener only cannot send IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_GetContentSecurityPolicy, OnGetContentSecurityPolicy) -#endif IPC_MESSAGE_HANDLER(EwkHostMsg_DidPrintPagesToPdf, OnPrintedMetafileReceived) IPC_MESSAGE_HANDLER(EwkHostMsg_WrtMessage, OnWrtPluginMessage) -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // FIXME: WebContentsObserver is IPC:: listener only cannot send IPC_MESSAGE_HANDLER_DELAY_REPLY(EwkHostMsg_WrtSyncMessage, OnWrtPluginSyncMessage) -#endif IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -557,6 +551,14 @@ void WebContentsDelegateEfl::DidFailLoad( is_main_frame); } +bool WebContentsDelegateEfl::Send(IPC::Message* message) { + if (!web_contents_.GetRenderViewHost()) { + delete message; + return false; + } + return web_contents_.GetRenderViewHost()->Send(message); +} + void WebContentsDelegateEfl::OnWrtPluginMessage( const Ewk_Wrt_Message_Data& data) { std::unique_ptr p(new Ewk_Wrt_Message_Data); @@ -575,10 +577,7 @@ void WebContentsDelegateEfl::OnWrtPluginSyncMessage( Ewk_Wrt_Message_Data tmp = data; web_view_->SmartCallback().call(&tmp); EwkHostMsg_WrtSyncMessage::WriteReplyParams(reply, tmp.value); -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // WebContentsObserver is IPC:: listener only cannot send Send(reply); -#endif } void WebContentsDelegateEfl::DidFirstVisuallyNonEmptyPaint() { @@ -603,10 +602,7 @@ void WebContentsDelegateEfl::OnGetContentSecurityPolicy( pending_content_security_policy_->header_type); pending_content_security_policy_.reset(); } -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // WebContentsObserver is IPC:: listener only cannot send Send(reply_msg); -#endif } void WebContentsDelegateEfl::OnPrintedMetafileReceived( diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h index 1414777..91d237a 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h @@ -30,7 +30,8 @@ namespace content { struct DateTimeSuggestion; class WebContentsDelegateEfl : public WebContentsDelegate, - public WebContentsObserver { + public WebContentsObserver, + public IPC::Sender { public: WebContentsDelegateEfl(EWebView*); ~WebContentsDelegateEfl(); @@ -151,6 +152,9 @@ class WebContentsDelegateEfl : public WebContentsDelegate, int error_code, const base::string16& error_description) override; + // IPC::Sender----------------------------------------------------------- + bool Send(IPC::Message* message) override; + // EWK_BRINGUP: These APIs are removed in upstream. void TitleWasSet(content::NavigationEntry* entry, bool explicit_set); -- 2.7.4