diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 574b1023f1439e9b3940ae35e5cd18615b0fa0a9..89b2468dccc1699b9a4baa1e1099327279375b50 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -805,33 +805,20 @@ void AlloyBrowserHostImpl::NotifyForNextTouchEvent() { void AlloyBrowserHostImpl::SetVisible(int32_t nweb_id, bool visible) { - content::WebContents* contents = web_contents(); - if (!contents) { - LOG(ERROR) << "AlloyBrowserHostImpl::ReportRenderProcessStatus web_contents is null"; - return; - } - - if (auto render_view_host = contents->GetRenderViewHost()) { - auto render_process_host = render_view_host->GetProcess(); - if (!render_process_host) { - LOG(ERROR) << "AlloyBrowserHostImpl::ReportRenderProcessStatus render_process_host is null"; - return; - } - auto strategy = -1; - if (visible && ltpo_strategy_ < 0) { - strategy = OHOS::NWeb::OhosAdapterHelper::GetInstance(). - GetSystemPropertiesInstance().GetLTPOStrategy(); - ltpo_strategy_ = strategy; - } - if (auto* host = content::GpuProcessHost::Get()) { - if (auto* host_impl = host->gpu_host()) { - if (strategy >= 0) { - host_impl->SetLTPOStrategy(ltpo_strategy_); - } - TRACE_EVENT2("base", "AlloyBrowserHostImpl::SetVisible", "nweb_id", nweb_id, "visible", visible); - LOG(INFO) << "AlloyBrowserHostImpl::SetVisible nweb_id: " << nweb_id << ", visible " << visible; - host_impl->SetVisible(nweb_id, visible); + auto strategy = -1; + if (visible && ltpo_strategy_ < 0) { + strategy = OHOS::NWeb::OhosAdapterHelper::GetInstance(). + GetSystemPropertiesInstance().GetLTPOStrategy(); + ltpo_strategy_ = strategy; + } + if (auto* host = content::GpuProcessHost::Get()) { + if (auto* host_impl = host->gpu_host()) { + if (strategy >= 0) { + host_impl->SetLTPOStrategy(ltpo_strategy_); } + TRACE_EVENT2("base", "AlloyBrowserHostImpl::SetVisible", "nweb_id", nweb_id, "visible", visible); + LOG(INFO) << "AlloyBrowserHostImpl::SetVisible nweb_id: " << nweb_id << ", visible " << visible; + host_impl->SetVisible(nweb_id, visible); } } }