Commit 5c79944b authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision d483fb77 (#474934)

- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread.
- Remove CefBrowserSettings.javascript_open_windows which is no
  longer supported.
parent 12150b43
......@@ -405,6 +405,8 @@ static_library("libcef_static") {
"libcef/browser/plugins/plugin_service_filter.h",
"libcef/browser/prefs/browser_prefs.cc",
"libcef/browser/prefs/browser_prefs.h",
"libcef/browser/prefs/pref_store.cc",
"libcef/browser/prefs/pref_store.h",
"libcef/browser/prefs/renderer_prefs.cc",
"libcef/browser/prefs/renderer_prefs.h",
"libcef/browser/print_settings_impl.cc",
......@@ -568,10 +570,6 @@ static_library("libcef_static") {
# with enable_print_preview=0.
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
# Part of //components/prefs:test_support which is testingonly.
"//components/prefs/testing_pref_store.cc",
"//components/prefs/testing_pref_store.h",
]
configs += [
......@@ -641,6 +639,9 @@ static_library("libcef_static") {
"//components/printing/browser",
"//components/printing/common",
"//components/printing/renderer",
"//components/printing/service:pdf_compositor_manifest",
"//components/printing/service/public/cpp:factory",
"//components/printing/service/public/interfaces",
"//components/proxy_config",
"//components/ssl_config",
"//components/update_client",
......@@ -653,6 +654,7 @@ static_library("libcef_static") {
"//components/web_cache/renderer",
"//content/public/app:both",
"//content/public/browser",
"//content/public/child",
"//content/public/common",
"//content/public/gpu",
"//content/public/renderer",
......@@ -1713,7 +1715,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
]
if (is_win) {
......@@ -1789,7 +1791,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
]
if (is_win) {
......@@ -1858,7 +1860,7 @@ if (is_mac) {
deps = [
":libcef",
":libcef_dll_wrapper",
"//build/config/sanitizers:deps",
"//build/config:exe_and_shlib_deps",
"//testing/gtest",
]
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'a106f0abbf69dad349d4aaf4bcc4f5d376dd2377',
'chromium_checkout': 'd483fb7716e28b377c70c26c1bf1e3695aa1d8c9',
}
......@@ -8,7 +8,7 @@
# by hand. See the translator.README.txt file in the tools directory for
# more information.
#
# $hash=9b613878ab9c9f72136f890b1df4a145d6341790$
# $hash=20588ad142633d169a929c7631888e287ab66b9a$
#
{
......@@ -80,6 +80,7 @@
'include/cef_x509_certificate.h',
'include/cef_xml_reader.h',
'include/cef_zip_reader.h',
'include/test/cef_test_helpers.h',
'include/test/cef_translator_test.h',
'include/views/cef_box_layout.h',
'include/views/cef_browser_view.h',
......@@ -169,6 +170,7 @@
'include/capi/cef_x509_certificate_capi.h',
'include/capi/cef_xml_reader_capi.h',
'include/capi/cef_zip_reader_capi.h',
'include/capi/test/cef_test_helpers_capi.h',
'include/capi/test/cef_translator_test_capi.h',
'include/capi/views/cef_box_layout_capi.h',
'include/capi/views/cef_browser_view_capi.h',
......
......@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7894d507f337ebe5f9296770e10773a4e6458f00$
// $hash=fe38af40efe76e5d6babf0644d7d4af679a4ca6f$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
......@@ -61,7 +61,7 @@ typedef struct _cef_life_span_handler_t {
cef_base_ref_counted_t base;
///
// Called on the IO thread before a new popup browser is created. The
// Called on the UI thread before a new popup browser is created. The
// |browser| and |frame| values represent the source of the popup request. The
// |target_url| and |target_frame_name| values indicate where the popup
// browser should navigate and may be NULL if not specified with the request.
......
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a43c32d6951dd8f125f87d21948798f4d596768e$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
#define CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
#pragma once
#if !defined(BUILDING_CEF_SHARED) && !defined(WRAPPING_CEF_SHARED) && \
!defined(UNIT_TEST)
#error This file can be included for unit tests only
#endif
#include "include/capi/cef_base_capi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
// Execute JavaScript with a user gesture to trigger functionality like
// onbeforeunload handlers that will otherwise be blocked.
///
CEF_EXPORT void cef_execute_java_script_with_user_gesture_for_tests(
struct _cef_frame_t* frame,
const cef_string_t* javascript);
#ifdef __cplusplus
}
#endif
#endif // CEF_INCLUDE_CAPI_TEST_CEF_TEST_HELPERS_CAPI_H_
......@@ -54,7 +54,7 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
typedef cef_window_open_disposition_t WindowOpenDisposition;
///
// Called on the IO thread before a new popup browser is created. The
// Called on the UI thread before a new popup browser is created. The
// |browser| and |frame| values represent the source of the popup request. The
// |target_url| and |target_frame_name| values indicate where the popup
// browser should navigate and may be empty if not specified with the request.
......
......@@ -523,13 +523,6 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t javascript;
///
// Controls whether JavaScript can be used for opening windows. Also
// configurable using the "disable-javascript-open-windows" command-line
// switch.
///
cef_state_t javascript_open_windows;
///
// Controls whether JavaScript can be used to close windows that were not
// opened via JavaScript. JavaScript can still be used to close windows that
......
......@@ -679,7 +679,6 @@ struct CefBrowserSettingsTraits {
target->remote_fonts = src->remote_fonts;
target->javascript = src->javascript;
target->javascript_open_windows = src->javascript_open_windows;
target->javascript_close_windows = src->javascript_close_windows;
target->javascript_access_clipboard = src->javascript_access_clipboard;
target->javascript_dom_paste = src->javascript_dom_paste;
......
// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---------------------------------------------------------------------------
//
// The contents of this file must follow a specific format in order to
// support the CEF translator tool. See the translator.README.txt file in the
// tools directory for more information.
//
// THIS FILE IS FOR TESTING PURPOSES ONLY.
//
// The APIs defined in this file are for testing purposes only. They should only
// be included from unit test targets.
//
#ifndef CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
#define CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
#pragma once
#if !defined(BUILDING_CEF_SHARED) && !defined(WRAPPING_CEF_SHARED) && \
!defined(UNIT_TEST)
#error This file can be included for unit tests only
#endif
#include "include/cef_frame.h"
///
// Execute JavaScript with a user gesture to trigger functionality like
// onbeforeunload handlers that will otherwise be blocked.
///
/*--cef(optional_param=javascript)--*/
void CefExecuteJavaScriptWithUserGestureForTests(CefRefPtr<CefFrame> frame,
const CefString& javascript);
#endif // CEF_INCLUDE_TEST_CEF_TEST_HELPERS_H_
......@@ -505,7 +505,7 @@ HostContentSettingsMap* CefBrowserContextImpl::GetHostContentSettingsMap() {
// that can be stored in the settings map (for example, default values set
// via DefaultProvider::SetWebsiteSetting).
host_content_settings_map_ =
new HostContentSettingsMap(GetPrefs(), false, false);
new HostContentSettingsMap(GetPrefs(), false, false, false);
// Change the default plugin policy.
const base::CommandLine* command_line =
......
......@@ -95,13 +95,6 @@ base::SupportsUserData::Data* CefBrowserContextProxy::GetUserData(
return BrowserContext::GetUserData(key);
}
void CefBrowserContextProxy::SetUserData(const void* key, Data* data) {
if (ShouldProxyUserData(key))
parent_->SetUserData(key, data);
else
BrowserContext::SetUserData(key, data);
}
void CefBrowserContextProxy::SetUserData(const void* key,
std::unique_ptr<Data> data) {
if (ShouldProxyUserData(key))
......
......@@ -29,7 +29,6 @@ class CefBrowserContextProxy : public CefBrowserContext {
// SupportsUserData methods.
Data* GetUserData(const void* key) const override;
void SetUserData(const void* key, Data* data) override;
void SetUserData(const void* key, std::unique_ptr<Data> data) override;
void RemoveUserData(const void* key) override;
......
......@@ -96,7 +96,7 @@ class WebContentsUserDataAdapter : public base::SupportsUserData::Data {
private:
WebContentsUserDataAdapter(CefBrowserHostImpl* browser) : browser_(browser) {
browser->web_contents()->SetUserData(UserDataKey(), this);
browser->web_contents()->SetUserData(UserDataKey(), base::WrapUnique(this));
}
static void* UserDataKey() {
......@@ -1692,6 +1692,35 @@ void CefBrowserHostImpl::SendCode(
}
}
void CefBrowserHostImpl::ExecuteJavaScriptWithUserGestureForTests(
int64 frame_id,
const CefString& javascript) {
DCHECK(frame_id >= CefFrameHostImpl::kMainFrameId);
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(
CEF_UIT,
base::Bind(
&CefBrowserHostImpl::ExecuteJavaScriptWithUserGestureForTests, this,
frame_id, javascript));
return;
}
if (!web_contents())
return;
content::RenderFrameHost* rfh;
if (frame_id == CefFrameHostImpl::kMainFrameId) {
rfh = web_contents()->GetMainFrame();
} else {
rfh = content::RenderFrameHost::FromID(
web_contents()->GetRenderProcessHost()->GetID(), frame_id);
}
if (rfh)
rfh->ExecuteJavaScriptWithUserGestureForTests(javascript);
}
bool CefBrowserHostImpl::SendProcessMessage(CefProcessId target_process,
const std::string& name,
base::ListValue* arguments,
......@@ -2276,7 +2305,8 @@ void CefBrowserHostImpl::WebContentsCreated(
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params) {
CefBrowserSettings settings;
CefRefPtr<CefClient> client;
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate;
......@@ -2672,6 +2702,18 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
return handled;
}
bool CefBrowserHostImpl::OnMessageReceived(
const IPC::Message& message,
content::RenderFrameHost* render_frame_host) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefBrowserHostImpl, message,
render_frame_host)
IPC_MESSAGE_HANDLER(CefHostMsg_FrameFocused, OnFrameFocused)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
void CefBrowserHostImpl::AccessibilityEventReceived(
const std::vector<content::AXEventNotificationDetails>& eventData) {
// Only needed in windowless mode.
......@@ -2743,6 +2785,38 @@ void CefBrowserHostImpl::OnFrameIdentified(int64 frame_id,
GetOrCreateFrame(frame_id, parent_frame_id, is_main_frame, name, GURL());
}
void CefBrowserHostImpl::OnFrameFocused(
content::RenderFrameHost* render_frame_host) {
const int64 frame_id = render_frame_host->GetRoutingID();
CefRefPtr<CefFrameHostImpl> unfocused_frame;
CefRefPtr<CefFrameHostImpl> focused_frame;
{
base::AutoLock lock_scope(state_lock_);
if (focused_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
// Unfocus the previously focused frame.
FrameMap::const_iterator it = frames_.find(frame_id);
if (it != frames_.end())
unfocused_frame = it->second;
}
// Focus the newly focused frame.
FrameMap::iterator it = frames_.find(frame_id);
if (it != frames_.end())
focused_frame = it->second;
focused_frame_id_ =
focused_frame.get() ? frame_id : CefFrameHostImpl::kInvalidFrameId;
}
if (unfocused_frame.get())
unfocused_frame->SetFocused(false);
if (focused_frame.get())
focused_frame->SetFocused(true);
}
void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
const GURL& validated_url,
bool is_main_frame,
......@@ -3016,37 +3090,6 @@ void CefBrowserHostImpl::DetachAllFrames() {
it->second->Detach();
}
void CefBrowserHostImpl::SetFocusedFrame(int64 frame_id) {
CefRefPtr<CefFrameHostImpl> unfocused_frame;
CefRefPtr<CefFrameHostImpl> focused_frame;
{
base::AutoLock lock_scope(state_lock_);
if (focused_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
// Unfocus the previously focused frame.
FrameMap::const_iterator it = frames_.find(frame_id);
if (it != frames_.end())
unfocused_frame = it->second;
}
if (frame_id != CefFrameHostImpl::kInvalidFrameId) {
// Focus the newly focused frame.
FrameMap::iterator it = frames_.find(frame_id);
if (it != frames_.end())
focused_frame = it->second;
}
focused_frame_id_ =
focused_frame.get() ? frame_id : CefFrameHostImpl::kInvalidFrameId;
}
if (unfocused_frame.get())
unfocused_frame->SetFocused(false);
if (focused_frame.get())
focused_frame->SetFocused(true);
}
gfx::Point CefBrowserHostImpl::GetScreenPoint(const gfx::Point& view) const {
CEF_REQUIRE_UIT();
if (platform_delegate_)
......
......@@ -319,6 +319,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
int script_start_line,
CefRefPtr<CefResponseManager::Handler> responseHandler);
void ExecuteJavaScriptWithUserGestureForTests(int64 frame_id,
const CefString& javascript);
bool SendProcessMessage(CefProcessId target_process,
const std::string& name,
base::ListValue* arguments,
......@@ -330,9 +333,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Handler for URLs involving external protocols.
void HandleExternalProtocol(const GURL& url);
// Set the frame that currently has focus.
void SetFocusedFrame(int64 frame_id);
// Convert from view coordinates to screen coordinates. Potential display
// scaling will be applied to the result.
gfx::Point GetScreenPoint(const gfx::Point& view) const;
......@@ -412,12 +412,15 @@ class CefBrowserHostImpl : public CefBrowserHost,
int opener_render_frame_id,
content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) override;
void WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents,
const base::Optional<content::WebContents::CreateParams>& create_params)
override;
void DidNavigateMainFramePostCommit(
content::WebContents* web_contents) override;
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
......@@ -472,6 +475,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
void DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& candidates) override;
bool OnMessageReceived(const IPC::Message& message) override;
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
void AccessibilityEventReceived(
const std::vector<content::AXEventNotificationDetails>& eventData)
override;
......@@ -507,6 +512,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void OnFrameIdentified(int64 frame_id,
int64 parent_frame_id,
base::string16 name);
void OnFrameFocused(content::RenderFrameHost* render_frame_host);
void OnDidFinishLoad(int64 frame_id,
const GURL& validated_url,
bool is_main_frame,
......
......@@ -128,6 +128,7 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
}
bool CefBrowserInfoManager::CanCreateWindow(
content::RenderFrameHost* opener,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
......@@ -135,16 +136,12 @@ bool CefBrowserInfoManager::CanCreateWindow(
const blink::mojom::WindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
int opener_render_process_id,
int opener_render_frame_id,
bool* no_javascript_access) {
DCHECK_NE(opener_render_process_id,
content::ChildProcessHost::kInvalidUniqueID);
DCHECK_GT(opener_render_frame_id, 0);
CEF_REQUIRE_UIT();
bool is_guest_view = false;
CefRefPtr<CefBrowserHostImpl> browser = extensions::GetOwnerBrowserForFrame(
opener_render_process_id, opener_render_frame_id, &is_guest_view);
CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForHost(opener, &is_guest_view);
DCHECK(browser.get());
if (!browser.get()) {
// Cancel the popup.
......@@ -177,8 +174,8 @@ bool CefBrowserInfoManager::CanCreateWindow(
auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>();
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
pending_popup->opener_process_id = opener_render_process_id;
pending_popup->opener_frame_id = opener_render_frame_id;
pending_popup->opener_process_id = opener->GetProcess()->GetID();
pending_popup->opener_frame_id = opener->GetRoutingID();
pending_popup->target_url = target_url;
pending_popup->target_frame_name = frame_name;
......@@ -229,10 +226,14 @@ bool CefBrowserInfoManager::CanCreateWindow(
CefBrowserPlatformDelegate::Create(create_params);
CHECK(pending_popup->platform_delegate.get());
// Filtering needs to be done on the UI thread.
CEF_POST_TASK(CEF_UIT,
base::Bind(FilterPendingPopupURL, opener_render_process_id,
base::Passed(&pending_popup)));
// Between the calls to CanCreateWindow and GetCustomWebContentsView
// RenderViewHostImpl::CreateNewWindow() will call
// RenderProcessHostImpl::FilterURL() which, in the case of "javascript:"
// URIs, rewrites the URL to "about:blank". We need to apply the same filter
// otherwise GetCustomWebContentsView will fail to retrieve the PopupInfo.
opener->GetProcess()->FilterURL(false, &pending_popup->target_url);
PushPendingPopup(std::move(pending_popup));
}
return allow;
......@@ -244,6 +245,8 @@ void CefBrowserInfoManager::GetCustomWebContentsView(
int opener_render_frame_id,
content::WebContentsView** view,
content::RenderViewHostDelegateView** delegate_view) {
CEF_REQUIRE_UIT();
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW,
opener_render_process_id, opener_render_frame_id,
......@@ -268,6 +271,8 @@ void CefBrowserInfoManager::WebContentsCreated(
CefBrowserSettings& settings,
CefRefPtr<CefClient>& client,
std::unique_ptr<CefBrowserPlatformDelegate>& platform_delegate) {
CEF_REQUIRE_UIT();
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(
CefBrowserInfoManager::PendingPopup::GET_CUSTOM_WEB_CONTENTS_VIEW,
......@@ -399,6 +404,8 @@ void CefBrowserInfoManager::GetBrowserInfoList(BrowserInfoList& list) {
void CefBrowserInfoManager::RenderProcessHostDestroyed(
content::RenderProcessHost* host) {
CEF_REQUIRE_UIT();
const int render_process_id = host->GetID();
DCHECK_GT(render_process_id, 0);
......@@ -419,8 +426,6 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
// Remove all pending popups that reference the destroyed host as the opener.
{
base::AutoLock lock_scope(pending_popup_lock_);
PendingPopupList::iterator it = pending_popup_list_.begin();
while (it != pending_popup_list_.end()) {
PendingPopup* popup = *it;
......@@ -433,22 +438,9 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
}
}
void CefBrowserInfoManager::FilterPendingPopupURL(
int opener_process_id,
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup) {
// |host| may be nullptr if the parent browser is destroyed while the popup is
// pending.
content::RenderProcessHost* host =
content::RenderProcessHost::FromID(opener_process_id);
if (host) {
host->FilterURL(false, &pending_popup->target_url);
GetInstance()->PushPendingPopup(std::move(pending_popup));
}
}
void CefBrowserInfoManager::PushPendingPopup(
std::unique_ptr<PendingPopup> popup) {
base::AutoLock lock_scope(pending_popup_lock_);
CEF_REQUIRE_UIT();
pending_popup_list_.push_back(std::move(popup));
}
......@@ -457,11 +449,10 @@ CefBrowserInfoManager::PopPendingPopup(PendingPopup::Step step,
int opener_process_id,
int opener_frame_id,
const GURL& target_url) {
CEF_REQUIRE_UIT();
DCHECK_GT(opener_process_id, 0);