2020-09-25 03:40:47 +02:00
|
|
|
// Copyright 2015 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
#include "libcef/renderer/render_manager.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
|
2022-01-25 20:40:24 +01:00
|
|
|
#include <tuple>
|
|
|
|
|
2022-02-21 23:23:40 +01:00
|
|
|
#include "build/build_config.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
|
2022-01-24 18:58:02 +01:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2020-09-25 03:40:47 +02:00
|
|
|
#if defined(__clang__)
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic error "-Wdeprecated-declarations"
|
|
|
|
#else
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(default : 4996)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "libcef/common/app_manager.h"
|
|
|
|
#include "libcef/common/cef_switches.h"
|
|
|
|
#include "libcef/common/net/scheme_info.h"
|
|
|
|
#include "libcef/common/values_impl.h"
|
|
|
|
#include "libcef/renderer/blink_glue.h"
|
|
|
|
#include "libcef/renderer/browser_impl.h"
|
|
|
|
#include "libcef/renderer/render_frame_observer.h"
|
|
|
|
#include "libcef/renderer/thread_util.h"
|
|
|
|
#include "libcef/renderer/v8_impl.h"
|
|
|
|
|
|
|
|
#include "base/command_line.h"
|
|
|
|
#include "base/strings/string_number_conversions.h"
|
2021-05-14 18:58:55 +02:00
|
|
|
#include "cef/libcef/common/mojom/cef.mojom.h"
|
2021-11-29 20:58:09 +01:00
|
|
|
#include "content/public/common/content_switches.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
#include "content/public/renderer/render_frame.h"
|
|
|
|
#include "content/public/renderer/render_thread.h"
|
2021-11-29 20:58:09 +01:00
|
|
|
#include "extensions/common/switches.h"
|
2021-05-14 18:58:55 +02:00
|
|
|
#include "mojo/public/cpp/bindings/binder_map.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
|
2021-05-14 18:58:55 +02:00
|
|
|
#include "third_party/blink/public/platform/web_string.h"
|
|
|
|
#include "third_party/blink/public/platform/web_url.h"
|
2022-03-26 02:12:30 +01:00
|
|
|
#include "third_party/blink/public/web/web_frame.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
#include "third_party/blink/public/web/web_security_policy.h"
|
|
|
|
#include "third_party/blink/public/web/web_view.h"
|
2021-03-04 23:36:57 +01:00
|
|
|
#include "third_party/blink/public/web/web_view_observer.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRenderManager* g_manager = nullptr;
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// Placeholder object for guest views.
|
2021-03-04 23:36:57 +01:00
|
|
|
class CefGuestView : public blink::WebViewObserver {
|
2020-09-25 03:40:47 +02:00
|
|
|
public:
|
2021-05-14 18:58:55 +02:00
|
|
|
CefGuestView(CefRenderManager* manager,
|
2022-07-21 19:26:10 +02:00
|
|
|
blink::WebView* web_view,
|
2020-09-25 03:40:47 +02:00
|
|
|
bool is_windowless)
|
2022-07-21 19:26:10 +02:00
|
|
|
: blink::WebViewObserver(web_view),
|
2020-09-25 03:40:47 +02:00
|
|
|
manager_(manager),
|
|
|
|
is_windowless_(is_windowless) {}
|
|
|
|
|
|
|
|
bool is_windowless() const { return is_windowless_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
// RenderViewObserver methods.
|
|
|
|
void OnDestruct() override { manager_->OnGuestViewDestroyed(this); }
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRenderManager* const manager_;
|
2020-09-25 03:40:47 +02:00
|
|
|
const bool is_windowless_;
|
|
|
|
};
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRenderManager::CefRenderManager() {
|
2020-09-25 03:40:47 +02:00
|
|
|
DCHECK(!g_manager);
|
|
|
|
g_manager = this;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRenderManager::~CefRenderManager() {
|
2020-09-25 03:40:47 +02:00
|
|
|
g_manager = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRenderManager* CefRenderManager::Get() {
|
2020-09-25 03:40:47 +02:00
|
|
|
CEF_REQUIRE_RT_RETURN(nullptr);
|
|
|
|
return g_manager;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::RenderThreadConnected() {
|
2020-09-25 03:40:47 +02:00
|
|
|
// Retrieve the new render thread information synchronously.
|
2021-05-14 18:58:55 +02:00
|
|
|
auto params = cef::mojom::NewRenderThreadInfo::New();
|
|
|
|
GetBrowserManager()->GetNewRenderThreadInfo(¶ms);
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
// Cross-origin entries need to be added after WebKit is initialized.
|
2021-05-14 18:58:55 +02:00
|
|
|
if (params->cross_origin_whitelist_entries) {
|
|
|
|
cross_origin_whitelist_entries_.swap(
|
|
|
|
*params->cross_origin_whitelist_entries);
|
|
|
|
}
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
WebKitInitialized();
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::RenderFrameCreated(
|
2020-09-25 03:40:47 +02:00
|
|
|
content::RenderFrame* render_frame,
|
|
|
|
CefRenderFrameObserver* render_frame_observer,
|
|
|
|
bool& browser_created,
|
2021-06-04 03:34:56 +02:00
|
|
|
absl::optional<bool>& is_windowless) {
|
2022-07-21 19:26:10 +02:00
|
|
|
auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame,
|
2020-09-25 03:40:47 +02:00
|
|
|
&browser_created, &is_windowless);
|
|
|
|
if (browser) {
|
|
|
|
// Attach the frame to the observer for message routing purposes.
|
|
|
|
render_frame_observer->AttachFrame(
|
|
|
|
browser->GetWebFrameImpl(render_frame->GetWebFrame()).get());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-23 18:40:13 +02:00
|
|
|
void CefRenderManager::WebViewCreated(blink::WebView* web_view,
|
|
|
|
bool& browser_created,
|
|
|
|
absl::optional<bool>& is_windowless) {
|
|
|
|
content::RenderFrame* render_frame = nullptr;
|
|
|
|
if (web_view->MainFrame()->IsWebLocalFrame()) {
|
|
|
|
render_frame = content::RenderFrame::FromWebFrame(
|
|
|
|
web_view->MainFrame()->ToWebLocalFrame());
|
|
|
|
}
|
|
|
|
|
2022-07-21 19:26:10 +02:00
|
|
|
MaybeCreateBrowser(web_view, render_frame, &browser_created, &is_windowless);
|
2020-09-25 03:40:47 +02:00
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::DevToolsAgentAttached() {
|
2020-09-25 03:40:47 +02:00
|
|
|
++devtools_agent_count_;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::DevToolsAgentDetached() {
|
2020-09-25 03:40:47 +02:00
|
|
|
--devtools_agent_count_;
|
|
|
|
if (devtools_agent_count_ == 0 && uncaught_exception_stack_size_ > 0) {
|
|
|
|
// When the last DevToolsAgent is detached the stack size is set to 0.
|
|
|
|
// Restore the user-specified stack size here.
|
|
|
|
CefV8SetUncaughtExceptionStackSize(uncaught_exception_stack_size_);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::ExposeInterfacesToBrowser(mojo::BinderMap* binders) {
|
|
|
|
auto task_runner = base::SequencedTaskRunnerHandle::Get();
|
|
|
|
|
2022-07-25 19:49:32 +02:00
|
|
|
binders->Add<cef::mojom::RenderManager>(
|
2021-05-14 18:58:55 +02:00
|
|
|
base::BindRepeating(
|
|
|
|
[](CefRenderManager* render_manager,
|
|
|
|
mojo::PendingReceiver<cef::mojom::RenderManager> receiver) {
|
|
|
|
render_manager->BindReceiver(std::move(receiver));
|
|
|
|
},
|
|
|
|
base::Unretained(this)),
|
|
|
|
task_runner);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowserImpl> CefRenderManager::GetBrowserForView(
|
2022-07-21 19:26:10 +02:00
|
|
|
blink::WebView* view) {
|
2020-09-25 03:40:47 +02:00
|
|
|
BrowserMap::const_iterator it = browsers_.find(view);
|
|
|
|
if (it != browsers_.end())
|
|
|
|
return it->second;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRefPtr<CefBrowserImpl> CefRenderManager::GetBrowserForMainFrame(
|
2020-09-25 03:40:47 +02:00
|
|
|
blink::WebFrame* frame) {
|
|
|
|
BrowserMap::const_iterator it = browsers_.begin();
|
|
|
|
for (; it != browsers_.end(); ++it) {
|
2021-03-04 23:36:57 +01:00
|
|
|
auto web_view = it->second->GetWebView();
|
|
|
|
if (web_view && web_view->MainFrame() == frame) {
|
2020-09-25 03:40:47 +02:00
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
mojo::Remote<cef::mojom::BrowserManager>&
|
|
|
|
CefRenderManager::GetBrowserManager() {
|
|
|
|
if (!browser_manager_) {
|
|
|
|
content::RenderThread::Get()->BindHostReceiver(
|
|
|
|
browser_manager_.BindNewPipeAndPassReceiver());
|
|
|
|
}
|
|
|
|
return browser_manager_;
|
|
|
|
}
|
|
|
|
|
2021-11-29 20:58:09 +01:00
|
|
|
// static
|
|
|
|
bool CefRenderManager::IsExtensionProcess() {
|
|
|
|
return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
|
extensions::switches::kExtensionProcess);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
bool CefRenderManager::IsPdfProcess() {
|
|
|
|
return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
|
switches::kPdfRenderer);
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::BindReceiver(
|
|
|
|
mojo::PendingReceiver<cef::mojom::RenderManager> receiver) {
|
|
|
|
receivers_.Add(this, std::move(receiver));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRenderManager::ModifyCrossOriginWhitelistEntry(
|
|
|
|
bool add,
|
|
|
|
cef::mojom::CrossOriginWhiteListEntryPtr entry) {
|
|
|
|
GURL gurl = GURL(entry->source_origin);
|
|
|
|
if (add) {
|
|
|
|
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(
|
|
|
|
gurl, blink::WebString::FromUTF8(entry->target_protocol),
|
|
|
|
blink::WebString::FromUTF8(entry->target_domain),
|
|
|
|
/*destination_port=*/0,
|
|
|
|
entry->allow_target_subdomains
|
|
|
|
? network::mojom::CorsDomainMatchMode::kAllowSubdomains
|
|
|
|
: network::mojom::CorsDomainMatchMode::kDisallowSubdomains,
|
|
|
|
network::mojom::CorsPortMatchMode::kAllowAnyPort,
|
|
|
|
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
|
|
|
|
} else {
|
|
|
|
blink::WebSecurityPolicy::ClearOriginAccessListForOrigin(gurl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRenderManager::ClearCrossOriginWhitelist() {
|
|
|
|
blink::WebSecurityPolicy::ClearOriginAccessList();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefRenderManager::WebKitInitialized() {
|
2020-09-25 03:40:47 +02:00
|
|
|
const base::CommandLine* command_line =
|
|
|
|
base::CommandLine::ForCurrentProcess();
|
|
|
|
|
|
|
|
// Create global objects associated with the default Isolate.
|
|
|
|
CefV8IsolateCreated();
|
|
|
|
|
|
|
|
const CefAppManager::SchemeInfoList* schemes =
|
|
|
|
CefAppManager::Get()->GetCustomSchemes();
|
|
|
|
if (!schemes->empty()) {
|
2021-01-28 00:13:12 +01:00
|
|
|
// Register the custom schemes. Some attributes are excluded here because
|
|
|
|
// they use url/url_util.h APIs instead.
|
2020-09-25 03:40:47 +02:00
|
|
|
CefAppManager::SchemeInfoList::const_iterator it = schemes->begin();
|
|
|
|
for (; it != schemes->end(); ++it) {
|
|
|
|
const CefSchemeInfo& info = *it;
|
|
|
|
const blink::WebString& scheme =
|
|
|
|
blink::WebString::FromUTF8(info.scheme_name);
|
|
|
|
if (info.is_display_isolated)
|
|
|
|
blink::WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(scheme);
|
|
|
|
if (info.is_fetch_enabled)
|
|
|
|
blink_glue::RegisterURLSchemeAsSupportingFetchAPI(scheme);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!cross_origin_whitelist_entries_.empty()) {
|
|
|
|
// Add the cross-origin white list entries.
|
2021-05-14 18:58:55 +02:00
|
|
|
for (auto& entry : cross_origin_whitelist_entries_) {
|
|
|
|
ModifyCrossOriginWhitelistEntry(/*add=*/true, std::move(entry));
|
2020-09-25 03:40:47 +02:00
|
|
|
}
|
|
|
|
cross_origin_whitelist_entries_.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// The number of stack trace frames to capture for uncaught exceptions.
|
|
|
|
if (command_line->HasSwitch(switches::kUncaughtExceptionStackSize)) {
|
|
|
|
int uncaught_exception_stack_size = 0;
|
|
|
|
base::StringToInt(command_line->GetSwitchValueASCII(
|
|
|
|
switches::kUncaughtExceptionStackSize),
|
|
|
|
&uncaught_exception_stack_size);
|
|
|
|
|
|
|
|
if (uncaught_exception_stack_size > 0) {
|
|
|
|
uncaught_exception_stack_size_ = uncaught_exception_stack_size;
|
|
|
|
CefV8SetUncaughtExceptionStackSize(uncaught_exception_stack_size_);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Notify the render process handler.
|
|
|
|
CefRefPtr<CefApp> application = CefAppManager::Get()->GetApplication();
|
|
|
|
if (application.get()) {
|
|
|
|
CefRefPtr<CefRenderProcessHandler> handler =
|
|
|
|
application->GetRenderProcessHandler();
|
|
|
|
if (handler.get())
|
|
|
|
handler->OnWebKitInitialized();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
|
2022-07-21 19:26:10 +02:00
|
|
|
blink::WebView* web_view,
|
2020-09-25 03:40:47 +02:00
|
|
|
content::RenderFrame* render_frame,
|
|
|
|
bool* browser_created,
|
2021-06-04 03:34:56 +02:00
|
|
|
absl::optional<bool>* is_windowless) {
|
2020-09-25 03:40:47 +02:00
|
|
|
if (browser_created)
|
|
|
|
*browser_created = false;
|
|
|
|
|
2022-07-21 19:26:10 +02:00
|
|
|
if (!web_view || !render_frame)
|
2020-09-25 03:40:47 +02:00
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
// Don't create another browser or guest view object if one already exists for
|
|
|
|
// the view.
|
2022-07-21 19:26:10 +02:00
|
|
|
auto browser = GetBrowserForView(web_view);
|
2020-09-25 03:40:47 +02:00
|
|
|
if (browser) {
|
|
|
|
if (is_windowless) {
|
|
|
|
*is_windowless = browser->is_windowless();
|
|
|
|
}
|
|
|
|
return browser;
|
|
|
|
}
|
|
|
|
|
2022-07-21 19:26:10 +02:00
|
|
|
auto guest_view = GetGuestViewForView(web_view);
|
2020-09-25 03:40:47 +02:00
|
|
|
if (guest_view) {
|
|
|
|
if (is_windowless) {
|
|
|
|
*is_windowless = guest_view->is_windowless();
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-11-29 20:58:09 +01:00
|
|
|
const bool is_pdf = IsPdfProcess();
|
2020-09-25 03:40:47 +02:00
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
auto params = cef::mojom::NewBrowserInfo::New();
|
2021-11-29 20:58:09 +01:00
|
|
|
if (!is_pdf) {
|
|
|
|
// Retrieve browser information synchronously.
|
|
|
|
GetBrowserManager()->GetNewBrowserInfo(render_frame->GetRoutingID(),
|
|
|
|
¶ms);
|
|
|
|
if (params->browser_id == 0) {
|
|
|
|
// The popup may have been canceled during creation.
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
if (is_windowless) {
|
2021-05-14 18:58:55 +02:00
|
|
|
*is_windowless = params->is_windowless;
|
2020-09-25 03:40:47 +02:00
|
|
|
}
|
|
|
|
|
2021-11-29 20:58:09 +01:00
|
|
|
if (is_pdf || params->is_guest_view || params->browser_id < 0) {
|
|
|
|
// Don't create a CefBrowser for a PDF renderer, guest view, or if the new
|
|
|
|
// browser info response has timed out.
|
2020-09-25 03:40:47 +02:00
|
|
|
guest_views_.insert(std::make_pair(
|
2022-07-21 19:26:10 +02:00
|
|
|
web_view,
|
|
|
|
std::make_unique<CefGuestView>(this, web_view, params->is_windowless)));
|
2020-09-25 03:40:47 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2022-07-21 19:26:10 +02:00
|
|
|
browser = new CefBrowserImpl(web_view, params->browser_id, params->is_popup,
|
|
|
|
params->is_windowless);
|
|
|
|
browsers_.insert(std::make_pair(web_view, browser));
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
// Notify the render process handler.
|
|
|
|
CefRefPtr<CefApp> application = CefAppManager::Get()->GetApplication();
|
|
|
|
if (application.get()) {
|
|
|
|
CefRefPtr<CefRenderProcessHandler> handler =
|
|
|
|
application->GetRenderProcessHandler();
|
|
|
|
if (handler.get()) {
|
2021-05-14 18:58:55 +02:00
|
|
|
CefRefPtr<CefDictionaryValueImpl> dictValuePtr;
|
|
|
|
if (params->extra_info) {
|
|
|
|
auto& dict_value = base::Value::AsDictionaryValue(*params->extra_info);
|
|
|
|
dictValuePtr = new CefDictionaryValueImpl(
|
|
|
|
const_cast<base::DictionaryValue*>(&dict_value),
|
|
|
|
/*will_delete=*/false, /*read_only=*/true);
|
|
|
|
}
|
2020-09-25 03:40:47 +02:00
|
|
|
handler->OnBrowserCreated(browser.get(), dictValuePtr.get());
|
2021-05-14 18:58:55 +02:00
|
|
|
if (dictValuePtr)
|
2022-01-25 20:40:24 +01:00
|
|
|
std::ignore = dictValuePtr->Detach(nullptr);
|
2020-09-25 03:40:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (browser_created)
|
|
|
|
*browser_created = true;
|
|
|
|
|
|
|
|
return browser;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::OnBrowserDestroyed(CefBrowserImpl* browser) {
|
2020-09-25 03:40:47 +02:00
|
|
|
BrowserMap::iterator it = browsers_.begin();
|
|
|
|
for (; it != browsers_.end(); ++it) {
|
|
|
|
if (it->second.get() == browser) {
|
|
|
|
browsers_.erase(it);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// No browser was found in the map.
|
|
|
|
NOTREACHED();
|
|
|
|
}
|
|
|
|
|
2022-07-21 19:26:10 +02:00
|
|
|
CefGuestView* CefRenderManager::GetGuestViewForView(blink::WebView* view) {
|
2020-09-25 03:40:47 +02:00
|
|
|
CEF_REQUIRE_RT_RETURN(nullptr);
|
|
|
|
|
|
|
|
GuestViewMap::const_iterator it = guest_views_.find(view);
|
|
|
|
if (it != guest_views_.end())
|
|
|
|
return it->second.get();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
void CefRenderManager::OnGuestViewDestroyed(CefGuestView* guest_view) {
|
2020-09-25 03:40:47 +02:00
|
|
|
GuestViewMap::iterator it = guest_views_.begin();
|
|
|
|
for (; it != guest_views_.end(); ++it) {
|
|
|
|
if (it->second.get() == guest_view) {
|
|
|
|
guest_views_.erase(it);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// No guest view was found in the map.
|
|
|
|
NOTREACHED();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
|
2022-01-24 18:58:02 +01:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2020-09-25 03:40:47 +02:00
|
|
|
#if defined(__clang__)
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
#else
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
|
|
|
#endif
|