aw_main_delegate.cc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "android_webview/lib/aw_main_delegate.h"
  5. #include <memory>
  6. #include "android_webview/browser/aw_content_browser_client.h"
  7. #include "android_webview/browser/aw_media_url_interceptor.h"
  8. #include "android_webview/browser/gfx/aw_draw_fn_impl.h"
  9. #include "android_webview/browser/gfx/browser_view_renderer.h"
  10. #include "android_webview/browser/gfx/gpu_service_webview.h"
  11. #include "android_webview/browser/gfx/viz_compositor_thread_runner_webview.h"
  12. #include "android_webview/browser/tracing/aw_trace_event_args_allowlist.h"
  13. #include "android_webview/common/aw_descriptors.h"
  14. #include "android_webview/common/aw_features.h"
  15. #include "android_webview/common/aw_paths.h"
  16. #include "android_webview/common/aw_resource_bundle.h"
  17. #include "android_webview/common/aw_switches.h"
  18. #include "android_webview/common/crash_reporter/aw_crash_reporter_client.h"
  19. #include "android_webview/common/crash_reporter/crash_keys.h"
  20. #include "android_webview/gpu/aw_content_gpu_client.h"
  21. #include "android_webview/renderer/aw_content_renderer_client.h"
  22. #include "base/android/apk_assets.h"
  23. #include "base/android/build_info.h"
  24. #include "base/bind.h"
  25. #include "base/check_op.h"
  26. #include "base/command_line.h"
  27. #include "base/cpu.h"
  28. #include "base/i18n/icu_util.h"
  29. #include "base/i18n/rtl.h"
  30. #include "base/posix/global_descriptors.h"
  31. #include "base/scoped_add_feature_flags.h"
  32. #include "base/strings/string_number_conversions.h"
  33. #include "base/strings/string_split.h"
  34. #include "base/strings/string_util.h"
  35. #include "base/threading/thread_restrictions.h"
  36. #include "build/build_config.h"
  37. #include "cc/base/switches.h"
  38. #include "components/autofill/core/common/autofill_features.h"
  39. #include "components/crash/core/common/crash_key.h"
  40. #include "components/embedder_support/switches.h"
  41. #include "components/gwp_asan/buildflags/buildflags.h"
  42. #include "components/metrics/unsent_log_store_metrics.h"
  43. #include "components/safe_browsing/android/safe_browsing_api_handler_bridge.h"
  44. #include "components/services/heap_profiling/public/cpp/profiling_client.h"
  45. #include "components/spellcheck/spellcheck_buildflags.h"
  46. #include "components/translate/core/common/translate_util.h"
  47. #include "components/variations/variations_ids_provider.h"
  48. #include "components/version_info/android/channel_getter.h"
  49. #include "components/viz/common/features.h"
  50. #include "content/public/browser/android/media_url_interceptor_register.h"
  51. #include "content/public/browser/browser_main_runner.h"
  52. #include "content/public/browser/browser_thread.h"
  53. #include "content/public/common/content_descriptor_keys.h"
  54. #include "content/public/common/content_features.h"
  55. #include "content/public/common/content_switches.h"
  56. #include "content/public/common/main_function_params.h"
  57. #include "device/base/features.h"
  58. #include "gin/public/isolate_holder.h"
  59. #include "gin/v8_initializer.h"
  60. #include "gpu/command_buffer/service/gpu_switches.h"
  61. #include "gpu/config/gpu_finch_features.h"
  62. #include "media/base/media_switches.h"
  63. #include "media/media_buildflags.h"
  64. #include "net/base/features.h"
  65. #include "services/network/public/cpp/features.h"
  66. #include "third_party/abseil-cpp/absl/types/variant.h"
  67. #include "third_party/blink/public/common/features.h"
  68. #include "ui/base/ui_base_paths.h"
  69. #include "ui/base/ui_base_switches.h"
  70. #include "ui/events/gesture_detection/gesture_configuration.h"
  71. #include "ui/gl/gl_switches.h"
  72. #if BUILDFLAG(ENABLE_SPELLCHECK)
  73. #include "components/spellcheck/common/spellcheck_features.h"
  74. #endif // ENABLE_SPELLCHECK
  75. #if BUILDFLAG(ENABLE_GWP_ASAN)
  76. #include "components/gwp_asan/client/gwp_asan.h" // nogncheck
  77. #endif
  78. namespace android_webview {
  79. AwMainDelegate::AwMainDelegate() = default;
  80. AwMainDelegate::~AwMainDelegate() = default;
  81. absl::optional<int> AwMainDelegate::BasicStartupComplete() {
  82. TRACE_EVENT0("startup", "AwMainDelegate::BasicStartupComplete");
  83. base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
  84. // WebView uses the Android system's scrollbars and overscroll glow.
  85. cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect);
  86. // Pull-to-refresh should never be a default WebView action.
  87. cl->AppendSwitch(switches::kDisablePullToRefreshEffect);
  88. // Not yet supported in single-process mode.
  89. cl->AppendSwitch(switches::kDisableSharedWorkers);
  90. // File system API not supported (requires some new API; internal bug 6930981)
  91. cl->AppendSwitch(switches::kDisableFileSystem);
  92. // Web Notification API and the Push API are not supported (crbug.com/434712)
  93. cl->AppendSwitch(switches::kDisableNotifications);
  94. // Check damage in OnBeginFrame to prevent unnecessary draws.
  95. cl->AppendSwitch(cc::switches::kCheckDamageEarly);
  96. // This is needed for sharing textures across the different GL threads.
  97. cl->AppendSwitch(switches::kEnableThreadedTextureMailboxes);
  98. // WebView does not yet support screen orientation locking.
  99. cl->AppendSwitch(switches::kDisableScreenOrientationLock);
  100. // WebView does not currently support Web Speech Synthesis API,
  101. // but it does support Web Speech Recognition API (crbug.com/487255).
  102. cl->AppendSwitch(switches::kDisableSpeechSynthesisAPI);
  103. // WebView does not currently support the Permissions API (crbug.com/490120)
  104. cl->AppendSwitch(switches::kDisablePermissionsAPI);
  105. // WebView does not (yet) save Chromium data during shutdown, so add setting
  106. // for Chrome to aggressively persist DOM Storage to minimize data loss.
  107. // http://crbug.com/479767
  108. cl->AppendSwitch(switches::kEnableAggressiveDOMStorageFlushing);
  109. // Webview does not currently support the Presentation API, see
  110. // https://crbug.com/521319
  111. cl->AppendSwitch(switches::kDisablePresentationAPI);
  112. // WebView doesn't support Remote Playback API for the same reason as the
  113. // Presentation API, see https://crbug.com/521319.
  114. cl->AppendSwitch(switches::kDisableRemotePlaybackAPI);
  115. // WebView does not support MediaSession API since there's no UI for media
  116. // metadata and controls.
  117. cl->AppendSwitch(switches::kDisableMediaSessionAPI);
  118. // We have crash dumps to diagnose regressions in remote font analysis or cc
  119. // serialization errors but most of their utility is in identifying URLs where
  120. // the regression occurs. This info is not available for webview so there
  121. // isn't much point in having the crash dumps there.
  122. cl->AppendSwitch(switches::kDisableOoprDebugCrashDump);
  123. // Disable BackForwardCache for Android WebView as it is not supported.
  124. // WebView-specific code hasn't been audited and fixed to ensure compliance
  125. // with the changed API contracts around new navigation types and changes to
  126. // the document lifecycle.
  127. cl->AppendSwitch(switches::kDisableBackForwardCache);
  128. // Deemed that performance benefit is not worth the stability cost.
  129. // See crbug.com/1309151.
  130. cl->AppendSwitch(switches::kDisableGpuShaderDiskCache);
  131. if (cl->GetSwitchValueASCII(switches::kProcessType).empty()) {
  132. // Browser process (no type specified).
  133. content::RegisterMediaUrlInterceptor(new AwMediaUrlInterceptor());
  134. BrowserViewRenderer::CalculateTileMemoryPolicy();
  135. // WebView apps can override WebView#computeScroll to achieve custom
  136. // scroll/fling. As a result, fling animations may not be ticked,
  137. // potentially
  138. // confusing the tap suppression controller. Simply disable it for WebView
  139. ui::GestureConfiguration::GetInstance()
  140. ->set_fling_touchscreen_tap_suppression_enabled(false);
  141. if (AwDrawFnImpl::IsUsingVulkan())
  142. cl->AppendSwitch(switches::kWebViewDrawFunctorUsesVulkan);
  143. #if defined(USE_V8_CONTEXT_SNAPSHOT)
  144. const gin::V8SnapshotFileType file_type =
  145. gin::V8SnapshotFileType::kWithAdditionalContext;
  146. #else
  147. const gin::V8SnapshotFileType file_type = gin::V8SnapshotFileType::kDefault;
  148. #endif
  149. base::android::RegisterApkAssetWithFileDescriptorStore(
  150. content::kV8Snapshot32DataDescriptor,
  151. gin::V8Initializer::GetSnapshotFilePath(true, file_type));
  152. base::android::RegisterApkAssetWithFileDescriptorStore(
  153. content::kV8Snapshot64DataDescriptor,
  154. gin::V8Initializer::GetSnapshotFilePath(false, file_type));
  155. {
  156. // Disable origin trial features on WebView unless the flag was explicitly
  157. // specified via command-line.
  158. std::string disabled_origin_trials_switch_value = cl->GetSwitchValueASCII(
  159. embedder_support::kOriginTrialDisabledFeatures);
  160. base::flat_set<std::string> disabled_origin_trials(
  161. base::SplitString(disabled_origin_trials_switch_value, "|",
  162. base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY));
  163. // Disable origin trials for the FedCM API on WebView because the FedCM
  164. // API is not implemented on WebView. The inserted feature string should
  165. // match a name in
  166. // third_party/blink/renderer/platform/runtime_enabled_features.json5.
  167. // Currently, there is no method to obtain these strings directly so it is
  168. // hard coded.
  169. disabled_origin_trials.insert("FedCM");
  170. cl->AppendSwitchASCII(
  171. embedder_support::kOriginTrialDisabledFeatures,
  172. base::JoinString(std::move(disabled_origin_trials).extract(), "|"));
  173. }
  174. }
  175. if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) {
  176. cl->AppendSwitch(switches::kInProcessGPU);
  177. }
  178. {
  179. base::ScopedAddFeatureFlags features(cl);
  180. if (base::android::BuildInfo::GetInstance()->sdk_int() >=
  181. base::android::SDK_VERSION_OREO) {
  182. features.EnableIfNotSet(autofill::features::kAutofillExtractAllDatalists);
  183. features.EnableIfNotSet(
  184. autofill::features::kAutofillSkipComparingInferredLabels);
  185. }
  186. if (cl->HasSwitch(switches::kWebViewLogJsConsoleMessages)) {
  187. features.EnableIfNotSet(::features::kLogJsConsoleMessages);
  188. }
  189. if (!cl->HasSwitch(switches::kWebViewDrawFunctorUsesVulkan)) {
  190. // Not use ANGLE's Vulkan backend, if the draw functor is not using
  191. // Vulkan.
  192. features.DisableIfNotSet(::features::kDefaultANGLEVulkan);
  193. }
  194. if (cl->HasSwitch(switches::kWebViewMPArchFencedFrames)) {
  195. features.EnableIfNotSetWithParameter(blink::features::kFencedFrames,
  196. "implementation_type", "mparch");
  197. features.EnableIfNotSet(blink::features::kSharedStorageAPI);
  198. features.EnableIfNotSet(::features::kPrivacySandboxAdsAPIsOverride);
  199. }
  200. if (cl->HasSwitch(switches::kWebViewShadowDOMFencedFrames)) {
  201. features.EnableIfNotSetWithParameter(blink::features::kFencedFrames,
  202. "implementation_type", "shadow_dom");
  203. features.EnableIfNotSet(blink::features::kSharedStorageAPI);
  204. features.EnableIfNotSet(::features::kPrivacySandboxAdsAPIsOverride);
  205. }
  206. // WebView uses kWebViewVulkan to control vulkan. Pre-emptively disable
  207. // kVulkan in case it becomes enabled by default.
  208. features.DisableIfNotSet(::features::kVulkan);
  209. features.DisableIfNotSet(::features::kWebPayments);
  210. features.DisableIfNotSet(::features::kServiceWorkerPaymentApps);
  211. // WebView does not support overlay fullscreen yet for video overlays.
  212. features.DisableIfNotSet(media::kOverlayFullscreenVideo);
  213. // WebView does not support EME persistent license yet, because it's not
  214. // clear on how user can remove persistent media licenses from UI.
  215. features.DisableIfNotSet(media::kMediaDrmPersistentLicense);
  216. // WebView does not support Picture-in-Picture yet.
  217. features.DisableIfNotSet(media::kPictureInPictureAPI);
  218. features.DisableIfNotSet(::features::kBackgroundFetch);
  219. // SurfaceControl is controlled by kWebViewSurfaceControl flag.
  220. features.DisableIfNotSet(::features::kAndroidSurfaceControl);
  221. // TODO(https://crbug.com/963653): WebOTP is not yet supported on
  222. // WebView.
  223. features.DisableIfNotSet(::features::kWebOTP);
  224. // TODO(https://crbug.com/1012899): WebXR is not yet supported on WebView.
  225. features.DisableIfNotSet(::features::kWebXr);
  226. features.DisableIfNotSet(::features::kWebXrArModule);
  227. features.DisableIfNotSet(device::features::kWebXrHitTest);
  228. // TODO(https://crbug.com/1312827): Digital Goods API is not yet supported
  229. // on WebView.
  230. features.DisableIfNotSet(::features::kDigitalGoodsApi);
  231. features.DisableIfNotSet(::features::kDynamicColorGamut);
  232. // De-jelly is never supported on WebView.
  233. features.EnableIfNotSet(::features::kDisableDeJelly);
  234. // COOP is not supported on WebView yet. See:
  235. // https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/XBKAGb2_7uAi.
  236. features.DisableIfNotSet(network::features::kCrossOriginOpenerPolicy);
  237. features.DisableIfNotSet(::features::kInstalledApp);
  238. features.EnableIfNotSet(
  239. metrics::UnsentLogStoreMetrics::kRecordLastUnsentLogMetadataMetrics);
  240. features.DisableIfNotSet(::features::kPeriodicBackgroundSync);
  241. // TODO(crbug.com/921655): Add support for User Agent Client hints on
  242. // WebView.
  243. features.DisableIfNotSet(blink::features::kUserAgentClientHint);
  244. // Disable Reducing User Agent minor version on WebView.
  245. features.DisableIfNotSet(blink::features::kReduceUserAgentMinorVersion);
  246. // Disabled until viz scheduling can be improved.
  247. features.DisableIfNotSet(::features::kUseSurfaceLayerForVideoDefault);
  248. // Enabled by default for webview.
  249. features.EnableIfNotSet(::features::kWebViewThreadSafeMediaDefault);
  250. // Disable dr-dc on webview.
  251. features.DisableIfNotSet(::features::kEnableDrDc);
  252. // TODO(crbug.com/1100993): Web Bluetooth is not yet supported on WebView.
  253. features.DisableIfNotSet(::features::kWebBluetooth);
  254. // TODO(crbug.com/933055): WebUSB is not yet supported on WebView.
  255. features.DisableIfNotSet(::features::kWebUsb);
  256. // Disable TFLite based language detection on webview until webview supports
  257. // ML model delivery via Optimization Guide component.
  258. // TODO(crbug.com/1292622): Enable the feature on Webview.
  259. features.DisableIfNotSet(::translate::kTFLiteLanguageDetectionEnabled);
  260. // Disable key pinning enforcement on webview.
  261. features.DisableIfNotSet(net::features::kStaticKeyPinningEnforcement);
  262. // Have the network service in the browser process even if we have separate
  263. // renderer processes. See also: switches::kInProcessGPU above.
  264. features.EnableIfNotSet(::features::kNetworkServiceInProcess);
  265. // Disable Event.path on Canary and Dev to help the deprecation and removal.
  266. // See crbug.com/1277431 for more details.
  267. if (version_info::android::GetChannel() < version_info::Channel::BETA)
  268. features.DisableIfNotSet(blink::features::kEventPath);
  269. // FedCM is not yet supported on WebView.
  270. features.DisableIfNotSet(::features::kFedCm);
  271. }
  272. android_webview::RegisterPathProvider();
  273. // Used only if the argument filter is enabled in tracing config,
  274. // as is the case by default in aw_tracing_controller.cc
  275. base::trace_event::TraceLog::GetInstance()->SetArgumentFilterPredicate(
  276. base::BindRepeating(&IsTraceEventArgsAllowlisted));
  277. base::trace_event::TraceLog::GetInstance()->SetMetadataFilterPredicate(
  278. base::BindRepeating(&IsTraceMetadataAllowlisted));
  279. base::trace_event::TraceLog::GetInstance()->SetRecordHostAppPackageName(true);
  280. // The TLS slot used by the memlog allocator shim needs to be initialized
  281. // early to ensure that it gets assigned a low slot number. If it gets
  282. // initialized too late, the glibc TLS system will require a malloc call in
  283. // order to allocate storage for a higher slot number. Since malloc is hooked,
  284. // this causes re-entrancy into the allocator shim, while the TLS object is
  285. // partially-initialized, which the TLS object is supposed to protect again.
  286. heap_profiling::InitTLSSlot();
  287. return absl::nullopt;
  288. }
  289. void AwMainDelegate::PreSandboxStartup() {
  290. TRACE_EVENT0("startup", "AwMainDelegate::PreSandboxStartup");
  291. #if defined(ARCH_CPU_ARM_FAMILY)
  292. // Create an instance of the CPU class to parse /proc/cpuinfo and cache
  293. // cpu_brand info.
  294. base::CPU cpu_info;
  295. #endif
  296. const base::CommandLine& command_line =
  297. *base::CommandLine::ForCurrentProcess();
  298. std::string process_type =
  299. command_line.GetSwitchValueASCII(switches::kProcessType);
  300. const bool is_browser_process = process_type.empty();
  301. if (!is_browser_process) {
  302. base::i18n::SetICUDefaultLocale(
  303. command_line.GetSwitchValueASCII(switches::kLang));
  304. }
  305. if (process_type == switches::kRendererProcess) {
  306. InitResourceBundleRendererSide();
  307. }
  308. EnableCrashReporter(process_type);
  309. base::android::BuildInfo* android_build_info =
  310. base::android::BuildInfo::GetInstance();
  311. static ::crash_reporter::CrashKeyString<64> app_name_key(
  312. crash_keys::kAppPackageName);
  313. app_name_key.Set(android_build_info->host_package_name());
  314. static ::crash_reporter::CrashKeyString<64> app_version_key(
  315. crash_keys::kAppPackageVersionCode);
  316. app_version_key.Set(android_build_info->host_version_code());
  317. static ::crash_reporter::CrashKeyString<8> sdk_int_key(
  318. crash_keys::kAndroidSdkInt);
  319. sdk_int_key.Set(base::NumberToString(android_build_info->sdk_int()));
  320. }
  321. absl::variant<int, content::MainFunctionParams> AwMainDelegate::RunProcess(
  322. const std::string& process_type,
  323. content::MainFunctionParams main_function_params) {
  324. // Defer to the default main method outside the browser process.
  325. if (!process_type.empty())
  326. return std::move(main_function_params);
  327. browser_runner_ = content::BrowserMainRunner::Create();
  328. int exit_code = browser_runner_->Initialize(std::move(main_function_params));
  329. // We do not expect Initialize() to ever fail in AndroidWebView. On success
  330. // it returns a negative value but we do not want to use that on Android.
  331. DCHECK_LT(exit_code, 0);
  332. return 0;
  333. }
  334. void AwMainDelegate::ProcessExiting(const std::string& process_type) {
  335. // TODO(torne): Clean up resources when we handle them.
  336. logging::CloseLogFile();
  337. }
  338. bool AwMainDelegate::ShouldCreateFeatureList(InvokedIn invoked_in) {
  339. // In the browser process the FeatureList is created in
  340. // AwMainDelegate::PostEarlyInitialization().
  341. return absl::holds_alternative<InvokedInChildProcess>(invoked_in);
  342. }
  343. variations::VariationsIdsProvider*
  344. AwMainDelegate::CreateVariationsIdsProvider() {
  345. return variations::VariationsIdsProvider::Create(
  346. variations::VariationsIdsProvider::Mode::kDontSendSignedInVariations);
  347. }
  348. absl::optional<int> AwMainDelegate::PostEarlyInitialization(
  349. InvokedIn invoked_in) {
  350. const bool is_browser_process =
  351. absl::holds_alternative<InvokedInBrowserProcess>(invoked_in);
  352. if (is_browser_process) {
  353. InitIcuAndResourceBundleBrowserSide();
  354. aw_feature_list_creator_->CreateFeatureListAndFieldTrials();
  355. }
  356. version_info::Channel channel = version_info::android::GetChannel();
  357. [[maybe_unused]] const bool is_canary_dev =
  358. (channel == version_info::Channel::CANARY ||
  359. channel == version_info::Channel::DEV);
  360. [[maybe_unused]] const std::string process_type =
  361. base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
  362. switches::kProcessType);
  363. #if BUILDFLAG(ENABLE_GWP_ASAN_MALLOC)
  364. gwp_asan::EnableForMalloc(is_canary_dev || is_browser_process,
  365. process_type.c_str());
  366. #endif
  367. #if BUILDFLAG(ENABLE_GWP_ASAN_PARTITIONALLOC)
  368. gwp_asan::EnableForPartitionAlloc(is_canary_dev || is_browser_process,
  369. process_type.c_str());
  370. #endif
  371. return absl::nullopt;
  372. }
  373. content::ContentClient* AwMainDelegate::CreateContentClient() {
  374. return &content_client_;
  375. }
  376. content::ContentBrowserClient* AwMainDelegate::CreateContentBrowserClient() {
  377. DCHECK(!aw_feature_list_creator_);
  378. aw_feature_list_creator_ = std::make_unique<AwFeatureListCreator>();
  379. content_browser_client_ =
  380. std::make_unique<AwContentBrowserClient>(aw_feature_list_creator_.get());
  381. return content_browser_client_.get();
  382. }
  383. namespace {
  384. gpu::SyncPointManager* GetSyncPointManager() {
  385. DCHECK(GpuServiceWebView::GetInstance());
  386. return GpuServiceWebView::GetInstance()->sync_point_manager();
  387. }
  388. gpu::SharedImageManager* GetSharedImageManager() {
  389. DCHECK(GpuServiceWebView::GetInstance());
  390. return GpuServiceWebView::GetInstance()->shared_image_manager();
  391. }
  392. viz::VizCompositorThreadRunner* GetVizCompositorThreadRunner() {
  393. return VizCompositorThreadRunnerWebView::GetInstance();
  394. }
  395. } // namespace
  396. content::ContentGpuClient* AwMainDelegate::CreateContentGpuClient() {
  397. content_gpu_client_ = std::make_unique<AwContentGpuClient>(
  398. base::BindRepeating(&GetSyncPointManager),
  399. base::BindRepeating(&GetSharedImageManager),
  400. base::BindRepeating(&GetVizCompositorThreadRunner));
  401. return content_gpu_client_.get();
  402. }
  403. content::ContentRendererClient* AwMainDelegate::CreateContentRendererClient() {
  404. content_renderer_client_ = std::make_unique<AwContentRendererClient>();
  405. return content_renderer_client_.get();
  406. }
  407. } // namespace android_webview