kaanb@chromium.org | 73ae0f3e | 2013-04-08 20:38:15 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors. All rights reserved. |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "android_webview/renderer/aw_content_renderer_client.h" |
| 6 | |
Gyuyoung Kim | dae5f10 | 2017-12-04 15:55:38 | [diff] [blame] | 7 | #include <memory> |
mnaganov | f082f6c | 2015-08-05 20:09:53 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
boliu | 7b59e50 | 2015-08-14 15:57:48 | [diff] [blame] | 10 | #include "android_webview/common/aw_switches.h" |
Gyuyoung Kim | 3f41f88 | 2021-01-15 00:12:49 | [diff] [blame] | 11 | #include "android_webview/common/mojom/frame.mojom.h" |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 12 | #include "android_webview/common/url_constants.h" |
mlamouri | 007f9d7 | 2015-02-27 16:27:25 | [diff] [blame] | 13 | #include "android_webview/renderer/aw_content_settings_client.h" |
ycheo@chromium.org | 6853d16a | 2013-11-27 14:35:05 | [diff] [blame] | 14 | #include "android_webview/renderer/aw_key_systems.h" |
Wei Li | 1324644 | 2017-07-29 03:13:40 | [diff] [blame] | 15 | #include "android_webview/renderer/aw_print_render_frame_helper_delegate.h" |
hjd@chromium.org | b165655 | 2014-06-09 19:59:38 | [diff] [blame] | 16 | #include "android_webview/renderer/aw_render_frame_ext.h" |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 17 | #include "android_webview/renderer/aw_render_view_ext.h" |
Carlos IL | 08747ea8 | 2019-11-06 17:44:59 | [diff] [blame] | 18 | #include "android_webview/renderer/aw_safe_browsing_error_page_controller_delegate_impl.h" |
Yuzhu Shen | fe5f3a5 | 2018-01-11 21:24:13 | [diff] [blame] | 19 | #include "android_webview/renderer/aw_url_loader_throttle_provider.h" |
Hiroki Nakagawa | ea68b64 | 2018-04-13 06:24:42 | [diff] [blame] | 20 | #include "android_webview/renderer/aw_websocket_handshake_throttle_provider.h" |
Ken Rockot | 13051c93 | 2019-11-14 20:11:51 | [diff] [blame] | 21 | #include "android_webview/renderer/browser_exposed_renderer_interfaces.h" |
boliu | 7b59e50 | 2015-08-14 15:57:48 | [diff] [blame] | 22 | #include "base/command_line.h" |
mnaganov | f082f6c | 2015-08-05 20:09:53 | [diff] [blame] | 23 | #include "base/i18n/rtl.h" |
Dale Curtis | 2fe03e9 | 2017-07-07 20:40:19 | [diff] [blame] | 24 | #include "base/metrics/histogram_macros.h" |
mnaganov | f082f6c | 2015-08-05 20:09:53 | [diff] [blame] | 25 | #include "base/strings/string_util.h" |
Colin Blundell | 49f165d | 2020-01-14 14:08:53 | [diff] [blame] | 26 | #include "components/android_system_error_page/error_page_populator.h" |
Scott Violet | 9343e64 | 2020-06-12 18:47:21 | [diff] [blame] | 27 | #include "components/js_injection/renderer/js_communication.h" |
Tao Bai | 42e52f3 | 2019-09-28 00:07:51 | [diff] [blame] | 28 | #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" |
Wei Li | 1324644 | 2017-07-29 03:13:40 | [diff] [blame] | 29 | #include "components/printing/renderer/print_render_frame_helper.h" |
Robert Sesek | ffeae8e | 2019-11-26 17:10:15 | [diff] [blame] | 30 | #include "components/visitedlink/renderer/visitedlink_reader.h" |
ben | bd9dc80 | 2017-04-19 01:37:43 | [diff] [blame] | 31 | #include "content/public/child/child_thread.h" |
sgurun@chromium.org | 0b85508d | 2013-12-10 04:33:53 | [diff] [blame] | 32 | #include "content/public/common/url_constants.h" |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 33 | #include "content/public/renderer/document_state.h" |
jam@chromium.org | 1a4e975 | 2013-12-31 20:10:58 | [diff] [blame] | 34 | #include "content/public/renderer/render_frame.h" |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 35 | #include "content/public/renderer/render_thread.h" |
jam@chromium.org | 0474172 | 2014-01-13 17:03:52 | [diff] [blame] | 36 | #include "content/public/renderer/render_view.h" |
Gyuyoung Kim | 3f41f88 | 2021-01-15 00:12:49 | [diff] [blame] | 37 | #include "ipc/ipc_sync_channel.h" |
Ken Rockot | 13051c93 | 2019-11-14 20:11:51 | [diff] [blame] | 38 | #include "mojo/public/cpp/bindings/binder_map.h" |
Gyuyoung Kim | bd70b6ab | 2020-12-18 08:19:12 | [diff] [blame] | 39 | #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 40 | #include "third_party/blink/public/platform/platform.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 41 | #include "third_party/blink/public/platform/web_string.h" |
| 42 | #include "third_party/blink/public/platform/web_url.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 43 | #include "third_party/blink/public/platform/web_url_request.h" |
| 44 | #include "third_party/blink/public/web/web_frame.h" |
| 45 | #include "third_party/blink/public/web/web_navigation_type.h" |
| 46 | #include "third_party/blink/public/web/web_security_policy.h" |
tfarina@chromium.org | 79fe227 | 2013-07-13 20:01:40 | [diff] [blame] | 47 | #include "url/gurl.h" |
mnaganov | 2cee4bd | 2015-08-05 16:07:41 | [diff] [blame] | 48 | #include "url/url_constants.h" |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 49 | |
brettw | 41446f6 | 2016-11-14 23:23:23 | [diff] [blame] | 50 | #if BUILDFLAG(ENABLE_SPELLCHECK) |
timvolodine | 469d6f7 | 2016-08-25 05:46:10 | [diff] [blame] | 51 | #include "components/spellcheck/renderer/spellcheck.h" |
| 52 | #include "components/spellcheck/renderer/spellcheck_provider.h" |
| 53 | #endif |
| 54 | |
sgurun@chromium.org | 0b85508d | 2013-12-10 04:33:53 | [diff] [blame] | 55 | using content::RenderThread; |
| 56 | |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 57 | namespace android_webview { |
| 58 | |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 59 | AwContentRendererClient::AwContentRendererClient() = default; |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 60 | |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 61 | AwContentRendererClient::~AwContentRendererClient() = default; |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 62 | |
| 63 | void AwContentRendererClient::RenderThreadStarted() { |
bashi | a820a50 | 2015-10-02 03:51:11 | [diff] [blame] | 64 | RenderThread* thread = RenderThread::Get(); |
tyoshino | 832a58a | 2016-04-18 08:14:08 | [diff] [blame] | 65 | aw_render_thread_observer_.reset(new AwRenderThreadObserver); |
| 66 | thread->AddObserver(aw_render_thread_observer_.get()); |
bashi | a820a50 | 2015-10-02 03:51:11 | [diff] [blame] | 67 | |
Robert Sesek | ffeae8e | 2019-11-26 17:10:15 | [diff] [blame] | 68 | visited_link_reader_.reset(new visitedlink::VisitedLinkReader); |
ben | bd9dc80 | 2017-04-19 01:37:43 | [diff] [blame] | 69 | |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 70 | browser_interface_broker_ = |
Oksana Zhuravlova | d4f1f5c | 2019-11-14 05:57:11 | [diff] [blame] | 71 | blink::Platform::Current()->GetBrowserInterfaceBroker(); |
Kenichi Ishibashi | 92734c6 | 2019-08-20 14:12:34 | [diff] [blame] | 72 | |
brettw | 41446f6 | 2016-11-14 23:23:23 | [diff] [blame] | 73 | #if BUILDFLAG(ENABLE_SPELLCHECK) |
Ben Goodger | 1633130 | 2018-01-23 00:43:21 | [diff] [blame] | 74 | if (!spellcheck_) |
Ken Rockot | 13051c93 | 2019-11-14 20:11:51 | [diff] [blame] | 75 | spellcheck_ = std::make_unique<SpellCheck>(this); |
timvolodine | 469d6f7 | 2016-08-25 05:46:10 | [diff] [blame] | 76 | #endif |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 77 | } |
| 78 | |
Ken Rockot | 13051c93 | 2019-11-14 20:11:51 | [diff] [blame] | 79 | void AwContentRendererClient::ExposeInterfacesToBrowser( |
| 80 | mojo::BinderMap* binders) { |
| 81 | // NOTE: Do not add binders directly within this method. Instead, modify the |
| 82 | // definition of |ExposeRendererInterfacesToBrowser()| to ensure security |
| 83 | // review coverage. |
| 84 | ExposeRendererInterfacesToBrowser(this, binders); |
| 85 | } |
| 86 | |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 87 | bool AwContentRendererClient::HandleNavigation( |
| 88 | content::RenderFrame* render_frame, |
| 89 | bool is_content_initiated, |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 90 | bool render_view_was_created_by_renderer, |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 91 | blink::WebFrame* frame, |
| 92 | const blink::WebURLRequest& request, |
| 93 | blink::WebNavigationType type, |
| 94 | blink::WebNavigationPolicy default_policy, |
| 95 | bool is_redirect) { |
| 96 | // Only GETs can be overridden. |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 97 | if (!request.HttpMethod().Equals("GET")) |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 98 | return false; |
| 99 | |
| 100 | // Any navigation from loadUrl, and goBack/Forward are considered application- |
| 101 | // initiated and hence will not yield a shouldOverrideUrlLoading() callback. |
| 102 | // Webview classic does not consider reload application-initiated so we |
| 103 | // continue the same behavior. |
| 104 | // TODO(sgurun) is_content_initiated is normally false for cross-origin |
| 105 | // navigations but since android_webview does not swap out renderers, this |
| 106 | // works fine. This will stop working if android_webview starts swapping out |
| 107 | // renderers on navigation. |
| 108 | bool application_initiated = |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 109 | !is_content_initiated || type == blink::kWebNavigationTypeBackForward; |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 110 | |
| 111 | // Don't offer application-initiated navigations unless it's a redirect. |
| 112 | if (application_initiated && !is_redirect) |
| 113 | return false; |
| 114 | |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 115 | bool is_main_frame = !frame->Parent(); |
| 116 | const GURL& gurl = request.Url(); |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 117 | // For HTTP schemes, only top-level navigations can be overridden. Similarly, |
| 118 | // WebView Classic lets app override only top level about:blank navigations. |
| 119 | // So we filter out non-top about:blank navigations here. |
| 120 | if (!is_main_frame && |
| 121 | (gurl.SchemeIs(url::kHttpScheme) || gurl.SchemeIs(url::kHttpsScheme) || |
| 122 | gurl.SchemeIs(url::kAboutScheme))) |
| 123 | return false; |
| 124 | |
| 125 | // use NavigationInterception throttle to handle the call as that can |
| 126 | // be deferred until after the java side has been constructed. |
nick | f7b3822 | 2016-11-22 21:59:35 | [diff] [blame] | 127 | // |
| 128 | // TODO(nick): |render_view_was_created_by_renderer| was plumbed in to |
| 129 | // preserve the existing code behavior, but it doesn't appear to be correct. |
| 130 | // In particular, this value will be true for the initial navigation of a |
| 131 | // RenderView created via window.open(), but it will also be true for all |
| 132 | // subsequent navigations in that RenderView, no matter how they are |
| 133 | // initiated. |
| 134 | if (render_view_was_created_by_renderer) { |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 135 | return false; |
| 136 | } |
| 137 | |
| 138 | bool ignore_navigation = false; |
Jan Wilken Dörrie | 85285b0 | 2021-03-11 23:38:47 | [diff] [blame^] | 139 | std::u16string url = request.Url().GetString().Utf16(); |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 140 | bool has_user_gesture = request.HasUserGesture(); |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 141 | |
Gyuyoung Kim | bd70b6ab | 2020-12-18 08:19:12 | [diff] [blame] | 142 | mojo::AssociatedRemote<mojom::FrameHost> frame_host_remote; |
| 143 | render_frame->GetRemoteAssociatedInterfaces()->GetInterface( |
| 144 | &frame_host_remote); |
| 145 | frame_host_remote->ShouldOverrideUrlLoading( |
| 146 | url, has_user_gesture, is_redirect, is_main_frame, &ignore_navigation); |
| 147 | |
gsennton | 68afca7 | 2016-01-12 11:07:32 | [diff] [blame] | 148 | return ignore_navigation; |
| 149 | } |
| 150 | |
jam@chromium.org | a86c0e96 | 2013-12-17 17:10:39 | [diff] [blame] | 151 | void AwContentRendererClient::RenderFrameCreated( |
| 152 | content::RenderFrame* render_frame) { |
mlamouri | 007f9d7 | 2015-02-27 16:27:25 | [diff] [blame] | 153 | new AwContentSettingsClient(render_frame); |
Wei Li | ffbf9e1 | 2017-07-29 20:55:21 | [diff] [blame] | 154 | new printing::PrintRenderFrameHelper( |
Gyuyoung Kim | dae5f10 | 2017-12-04 15:55:38 | [diff] [blame] | 155 | render_frame, std::make_unique<AwPrintRenderFrameHelperDelegate>()); |
hjd@chromium.org | b165655 | 2014-06-09 19:59:38 | [diff] [blame] | 156 | new AwRenderFrameExt(render_frame); |
Scott Violet | 9343e64 | 2020-06-12 18:47:21 | [diff] [blame] | 157 | new js_injection::JsCommunication(render_frame); |
Carlos IL | 08747ea8 | 2019-11-06 17:44:59 | [diff] [blame] | 158 | new AwSafeBrowsingErrorPageControllerDelegateImpl(render_frame); |
jam@chromium.org | 0474172 | 2014-01-13 17:03:52 | [diff] [blame] | 159 | |
jam@chromium.org | e634564 | 2014-01-25 00:25:28 | [diff] [blame] | 160 | // TODO(jam): when the frame tree moves into content and parent() works at |
| 161 | // RenderFrame construction, simplify this by just checking parent(). |
| 162 | content::RenderFrame* parent_frame = |
| 163 | render_frame->GetRenderView()->GetMainRenderFrame(); |
| 164 | if (parent_frame && parent_frame != render_frame) { |
jam@chromium.org | 0474172 | 2014-01-13 17:03:52 | [diff] [blame] | 165 | // Avoid any race conditions from having the browser's UI thread tell the IO |
| 166 | // thread that a subframe was created. |
Gyuyoung Kim | 3f41f88 | 2021-01-15 00:12:49 | [diff] [blame] | 167 | GetRenderMessageFilter()->SubFrameCreated(parent_frame->GetRoutingID(), |
| 168 | render_frame->GetRoutingID()); |
jam@chromium.org | 0474172 | 2014-01-13 17:03:52 | [diff] [blame] | 169 | } |
estade | b1bc9bd | 2014-12-02 22:44:11 | [diff] [blame] | 170 | |
xiaochengh | 0c92b1c | 2017-04-12 03:06:49 | [diff] [blame] | 171 | #if BUILDFLAG(ENABLE_SPELLCHECK) |
Ben Goodger | 03c39c2 | 2017-10-26 23:45:37 | [diff] [blame] | 172 | new SpellCheckProvider(render_frame, spellcheck_.get(), this); |
xiaochengh | 0c92b1c | 2017-04-12 03:06:49 | [diff] [blame] | 173 | #endif |
Tao Bai | 42e52f3 | 2019-09-28 00:07:51 | [diff] [blame] | 174 | |
| 175 | // Owned by |render_frame|. |
| 176 | new page_load_metrics::MetricsRenderFrameObserver(render_frame); |
jam@chromium.org | a86c0e96 | 2013-12-17 17:10:39 | [diff] [blame] | 177 | } |
| 178 | |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 179 | void AwContentRendererClient::RenderViewCreated( |
| 180 | content::RenderView* render_view) { |
Dave Tapuska | dd4996e | 2021-02-08 20:36:25 | [diff] [blame] | 181 | AwRenderViewExt::WebViewCreated(render_view->GetWebView()); |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 182 | } |
| 183 | |
Carlos IL | 94293f9 | 2018-01-11 18:57:22 | [diff] [blame] | 184 | void AwContentRendererClient::PrepareErrorPage( |
aberent | a7f273b | 2016-08-18 10:46:11 | [diff] [blame] | 185 | content::RenderFrame* render_frame, |
abarth@chromium.org | c32e2708 | 2013-11-07 06:58:20 | [diff] [blame] | 186 | const blink::WebURLError& error, |
Dmitry Gozman | 96c429a | 2018-12-20 01:29:14 | [diff] [blame] | 187 | const std::string& http_method, |
Dmitry Gozman | e63db7e | 2018-11-14 23:42:23 | [diff] [blame] | 188 | std::string* error_html) { |
Carlos IL | 08747ea8 | 2019-11-06 17:44:59 | [diff] [blame] | 189 | AwSafeBrowsingErrorPageControllerDelegateImpl::Get(render_frame) |
| 190 | ->PrepareForErrorPage(); |
| 191 | |
Colin Blundell | 49f165d | 2020-01-14 14:08:53 | [diff] [blame] | 192 | android_system_error_page::PopulateErrorPageHtml(error, error_html); |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 193 | } |
| 194 | |
Miyoung Shin | d2dd8bc | 2019-03-11 02:45:40 | [diff] [blame] | 195 | uint64_t AwContentRendererClient::VisitedLinkHash(const char* canonical_url, |
| 196 | size_t length) { |
Robert Sesek | ffeae8e | 2019-11-26 17:10:15 | [diff] [blame] | 197 | return visited_link_reader_->ComputeURLFingerprint(canonical_url, length); |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 198 | } |
| 199 | |
Miyoung Shin | d2dd8bc | 2019-03-11 02:45:40 | [diff] [blame] | 200 | bool AwContentRendererClient::IsLinkVisited(uint64_t link_hash) { |
Robert Sesek | ffeae8e | 2019-11-26 17:10:15 | [diff] [blame] | 201 | return visited_link_reader_->IsVisited(link_hash); |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 202 | } |
| 203 | |
Shimi Zhang | 4defe64 | 2020-04-27 21:31:40 | [diff] [blame] | 204 | void AwContentRendererClient::RunScriptsAtDocumentStart( |
| 205 | content::RenderFrame* render_frame) { |
Scott Violet | 9343e64 | 2020-06-12 18:47:21 | [diff] [blame] | 206 | js_injection::JsCommunication* communication = |
| 207 | js_injection::JsCommunication::Get(render_frame); |
danakj | a79ab9f | 2021-01-15 20:08:34 | [diff] [blame] | 208 | communication->RunScriptsAtDocumentStart(); |
Shimi Zhang | 4defe64 | 2020-04-27 21:31:40 | [diff] [blame] | 209 | } |
| 210 | |
halliwell | 8f42dd5 | 2016-04-29 16:06:33 | [diff] [blame] | 211 | void AwContentRendererClient::AddSupportedKeySystems( |
| 212 | std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) { |
ycheo@chromium.org | 6853d16a | 2013-11-27 14:35:05 | [diff] [blame] | 213 | AwAddKeySystems(key_systems); |
| 214 | } |
| 215 | |
Minggang Wang | b747d8ef | 2021-03-03 07:48:09 | [diff] [blame] | 216 | std::unique_ptr<blink::WebSocketHandshakeThrottleProvider> |
Hiroki Nakagawa | ea68b64 | 2018-04-13 06:24:42 | [diff] [blame] | 217 | AwContentRendererClient::CreateWebSocketHandshakeThrottleProvider() { |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 218 | return std::make_unique<AwWebSocketHandshakeThrottleProvider>( |
| 219 | browser_interface_broker_.get()); |
ricea | 4ce57e6 | 2017-06-28 05:53:27 | [diff] [blame] | 220 | } |
| 221 | |
Minggang Wang | 1df377df | 2021-03-08 04:45:40 | [diff] [blame] | 222 | std::unique_ptr<blink::URLLoaderThrottleProvider> |
Yuzhu Shen | fe5f3a5 | 2018-01-11 21:24:13 | [diff] [blame] | 223 | AwContentRendererClient::CreateURLLoaderThrottleProvider( |
Minggang Wang | 1df377df | 2021-03-08 04:45:40 | [diff] [blame] | 224 | blink::URLLoaderThrottleProviderType provider_type) { |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 225 | return std::make_unique<AwURLLoaderThrottleProvider>( |
| 226 | browser_interface_broker_.get(), provider_type); |
Yuzhu Shen | fe5f3a5 | 2018-01-11 21:24:13 | [diff] [blame] | 227 | } |
| 228 | |
Ben Goodger | 03c39c2 | 2017-10-26 23:45:37 | [diff] [blame] | 229 | void AwContentRendererClient::GetInterface( |
| 230 | const std::string& interface_name, |
Xiaocheng Hu | d9085ee | 2018-02-16 22:32:30 | [diff] [blame] | 231 | mojo::ScopedMessagePipeHandle interface_pipe) { |
| 232 | // A dirty hack to make SpellCheckHost requests work on WebView. |
| 233 | // TODO(crbug.com/806394): Use a WebView-specific service for SpellCheckHost |
| 234 | // and SafeBrowsing, instead of |content_browser|. |
Ken Rockot | 15253a48 | 2019-08-23 17:44:59 | [diff] [blame] | 235 | RenderThread::Get()->BindHostReceiver( |
| 236 | mojo::GenericPendingReceiver(interface_name, std::move(interface_pipe))); |
Xiaocheng Hu | d9085ee | 2018-02-16 22:32:30 | [diff] [blame] | 237 | } |
Ben Goodger | 03c39c2 | 2017-10-26 23:45:37 | [diff] [blame] | 238 | |
Gyuyoung Kim | 3f41f88 | 2021-01-15 00:12:49 | [diff] [blame] | 239 | mojom::RenderMessageFilter* AwContentRendererClient::GetRenderMessageFilter() { |
| 240 | if (!render_message_filter_) { |
| 241 | RenderThread::Get()->GetChannel()->GetRemoteAssociatedInterface( |
| 242 | &render_message_filter_); |
| 243 | } |
| 244 | return render_message_filter_.get(); |
| 245 | } |
| 246 | |
boliu@chromium.org | 710b260 | 2012-10-11 21:41:09 | [diff] [blame] | 247 | } // namespace android_webview |