Update to Chromium revision 614d31da (#423768)

- Fix PDF extension loading after showing the plugin placeholder (issue #2020)
This commit is contained in:
Marshall Greenblatt 2016-10-21 15:52:29 -04:00
parent 07d12b78e1
commit c9e81c082f
75 changed files with 725 additions and 502 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '9cedf75377d817c6b32a01f1d30fbe10663b8bb8',
'chromium_checkout': '614d31daee2f61b0180df403a8ad43f20b9f6dd7',
}

View File

@ -138,20 +138,13 @@ base::LazyInstance<ImplManager> g_manager = LAZY_INSTANCE_INITIALIZER;
// CefBrowserContext sharing the same VisitedLinkMaster.
class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
public:
CefVisitedLinkListener()
: master_(nullptr) {
}
void set_master(visitedlink::VisitedLinkMaster* master) {
DCHECK(!master_);
master_ = master;
CefVisitedLinkListener() {
}
void CreateListenerForContext(const CefBrowserContext* context) {
CEF_REQUIRE_UIT();
std::unique_ptr<visitedlink::VisitedLinkEventListener> listener(
new visitedlink::VisitedLinkEventListener(
master_, const_cast<CefBrowserContext*>(context)));
auto listener = base::MakeUnique<visitedlink::VisitedLinkEventListener>(
const_cast<CefBrowserContext*>(context));
listener_map_.insert(std::make_pair(context, std::move(listener)));
}
@ -164,11 +157,11 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
// visitedlink::VisitedLinkMaster::Listener methods.
void NewTable(base::SharedMemory* shared_memory) override {
void NewTable(mojo::SharedBufferHandle table) override {
CEF_REQUIRE_UIT();
ListenerMap::iterator it = listener_map_.begin();
for (; it != listener_map_.end(); ++it)
it->second->NewTable(shared_memory);
it->second->NewTable(table);
}
void Add(visitedlink::VisitedLinkCommon::Fingerprint fingerprint) override {
@ -186,12 +179,10 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
}
private:
visitedlink::VisitedLinkMaster* master_;
// Map of CefBrowserContext to the associated VisitedLinkEventListener.
typedef std::map<const CefBrowserContext*,
std::unique_ptr<visitedlink::VisitedLinkEventListener> >
ListenerMap;
ListenerMap;
ListenerMap listener_map_;
DISALLOW_COPY_AND_ASSIGN(CefVisitedLinkListener);
@ -262,7 +253,6 @@ void CefBrowserContextImpl::Initialize() {
new visitedlink::VisitedLinkMaster(visitedlink_listener_, this,
!visited_link_path.empty(), false,
visited_link_path, 0));
visitedlink_listener_->set_master(visitedlink_master_.get());
visitedlink_listener_->CreateListenerForContext(this);
visitedlink_master_->Init();

View File

@ -2231,6 +2231,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
void CefBrowserHostImpl::WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,

View File

@ -396,6 +396,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
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,

View File

@ -137,27 +137,10 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
return browser_info;
}
void CefBrowserInfoManager::OnCreateWindow(
int render_process_id,
const ViewHostMsg_CreateWindow_Params& params) {
DCHECK_NE(render_process_id, content::ChildProcessHost::kInvalidUniqueID);
DCHECK_GT(params.opener_id, 0);
DCHECK_GT(params.opener_render_frame_id, 0);
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup(
new CefBrowserInfoManager::PendingPopup);
pending_popup->step = CefBrowserInfoManager::PendingPopup::ON_CREATE_WINDOW;
pending_popup->opener_process_id = render_process_id;
pending_popup->opener_view_id = params.opener_id;
pending_popup->opener_frame_id = params.opener_render_frame_id;
pending_popup->target_url = params.target_url;
pending_popup->target_frame_name = params.frame_name;
PushPendingPopup(std::move(pending_popup));
}
bool CefBrowserInfoManager::CanCreateWindow(
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
bool user_gesture,
@ -166,18 +149,13 @@ bool CefBrowserInfoManager::CanCreateWindow(
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) {
std::unique_ptr<CefBrowserInfoManager::PendingPopup> pending_popup =
PopPendingPopup(CefBrowserInfoManager::PendingPopup::ON_CREATE_WINDOW,
render_process_id, opener_render_view_id, target_url);
DCHECK(pending_popup.get());
DCHECK(!pending_popup->platform_delegate.get());
DCHECK_NE(render_process_id, content::ChildProcessHost::kInvalidUniqueID);
DCHECK_GT(opener_render_view_id, 0);
DCHECK_GT(opener_render_frame_id, 0);
bool is_guest_view = false;
CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForView(
pending_popup->opener_process_id,
pending_popup->opener_view_id,
&is_guest_view);
CefRefPtr<CefBrowserHostImpl> browser = extensions::GetOwnerBrowserForView(
render_process_id, opener_render_view_id, &is_guest_view);
DCHECK(browser.get());
if (!browser.get()) {
// Cancel the popup.
@ -210,6 +188,14 @@ bool CefBrowserInfoManager::CanCreateWindow(
window_info->SetAsPopup(NULL, CefString());
#endif
auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>();
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
pending_popup->opener_process_id = render_process_id;
pending_popup->opener_view_id = opener_render_view_id;
pending_popup->opener_frame_id = opener_render_frame_id;
pending_popup->target_url = target_url;
pending_popup->target_frame_name = frame_name;
// Start with the current browser's settings.
pending_popup->client = client;
pending_popup->settings = browser->settings();
@ -262,9 +248,6 @@ bool CefBrowserInfoManager::CanCreateWindow(
CefBrowserPlatformDelegate::Create(create_params);
CHECK(pending_popup->platform_delegate.get());
pending_popup->step =
CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
// Filtering needs to be done on the UI thread.
CEF_POST_TASK(CEF_UIT,
base::Bind(FilterPendingPopupURL, render_process_id,

View File

@ -34,7 +34,6 @@ class Message;
}
class CefBrowserPlatformDelegate;
struct ViewHostMsg_CreateWindow_Params;
// Singleton object for managing BrowserInfo instances.
class CefBrowserInfoManager : public content::RenderProcessHostObserver {
@ -58,16 +57,12 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
content::WebContents* new_contents,
bool is_windowless);
// Called from CefBrowserMessageFilter::OnCreateWindow. See comments on
// PendingPopup for more information.
void OnCreateWindow(int render_process_id,
const ViewHostMsg_CreateWindow_Params& params);
// Called from CefContentBrowserClient::CanCreateWindow. See comments on
// PendingPopup for more information.
bool CanCreateWindow(
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
bool user_gesture,
@ -137,9 +132,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
// Store state information about pending popups. Call order is:
// - CefBrowserMessageFilter::OnCreateWindow (IOT)
// Intercepts the ViewHostMsg_CreateWindow message to gather information
// about the opener (parent browser) and target URL/frame.
// - CefContentBrowserClient::CanCreateWindow (IOT)
// Provides an opportunity to cancel the popup (calls OnBeforePopup) and
// creates the new platform delegate for the popup. If the popup owner is
@ -157,7 +149,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// be multiple pending popups with the same identifiers and this allows us
// to differentiate between them at different processing steps.
enum Step {
ON_CREATE_WINDOW,
CAN_CREATE_WINDOW,
SHOULD_CREATE_WEB_CONTENTS
} step;

View File

@ -17,25 +17,18 @@
#include "base/compiler_specific.h"
#include "base/bind.h"
#include "content/common/frame_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/child_process_host.h"
CefBrowserMessageFilter::CefBrowserMessageFilter(int render_process_id)
: render_process_id_(render_process_id),
sender_(NULL) {
: render_process_id_(render_process_id) {
}
CefBrowserMessageFilter::~CefBrowserMessageFilter() {
}
void CefBrowserMessageFilter::OnFilterAdded(IPC::Sender* sender) {
sender_ = sender;
}
void CefBrowserMessageFilter::OnFilterRemoved() {
render_process_id_ = content::ChildProcessHost::kInvalidUniqueID;
sender_ = NULL;
}
bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
@ -46,17 +39,12 @@ bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
}
bool handled = true;
if (message.type() == ViewHostMsg_CreateWindow::ID) {
// Observe but don't handle this message.
handled = false;
}
IPC_BEGIN_MESSAGE_MAP(CefBrowserMessageFilter, message)
IPC_MESSAGE_HANDLER(CefProcessHostMsg_GetNewRenderThreadInfo,
OnGetNewRenderThreadInfo)
IPC_MESSAGE_HANDLER_DELAY_REPLY(CefProcessHostMsg_GetNewBrowserInfo,
OnGetNewBrowserInfo)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_CreateWindow, OnCreateWindow)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@ -112,18 +100,6 @@ void CefBrowserMessageFilter::OnGetNewBrowserInfo(
}
}
void CefBrowserMessageFilter::OnCreateWindow(
const ViewHostMsg_CreateWindow_Params& params,
IPC::Message* reply_msg) {
if (render_process_id_ != content::ChildProcessHost::kInvalidUniqueID) {
CefBrowserInfoManager::GetInstance()->OnCreateWindow(render_process_id_,
params);
}
// Reply message is not used.
delete reply_msg;
}
void CefBrowserMessageFilter::OnFrameFocused(int32_t render_frame_routing_id) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,

View File

@ -19,7 +19,6 @@ class RenderProcessHost;
struct CefProcessHostMsg_GetNewBrowserInfo_Params;
struct CefProcessHostMsg_GetNewRenderThreadInfo_Params;
struct ViewHostMsg_CreateWindow_Params;
// This class sends and receives control messages on the browser process.
class CefBrowserMessageFilter : public IPC::MessageFilter {
@ -28,7 +27,6 @@ class CefBrowserMessageFilter : public IPC::MessageFilter {
~CefBrowserMessageFilter() override;
// IPC::ChannelProxy::MessageFilter implementation.
void OnFilterAdded(IPC::Sender* sender) override;
void OnFilterRemoved() override;
bool OnMessageReceived(const IPC::Message& message) override;
@ -42,12 +40,9 @@ class CefBrowserMessageFilter : public IPC::MessageFilter {
int render_view_routing_id,
int render_frame_routing_id,
IPC::Message* reply_msg);
void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params,
IPC::Message* reply_msg);
void OnFrameFocused(int32_t render_frame_routing_id);
int render_process_id_;
IPC::Sender* sender_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserMessageFilter);
};

View File

@ -123,5 +123,6 @@ void CefBrowserMessageLoop::DoMessageLoopIteration() {
}
void CefBrowserMessageLoop::RunMessageLoop() {
Run();
base::RunLoop run_loop;
run_loop.Run();
}

View File

@ -41,7 +41,9 @@ class CefURLFetcherDelegate : public net::URLFetcherDelegate {
// net::URLFetcherDelegate methods.
void OnURLFetchComplete(const net::URLFetcher* source) override;
void OnURLFetchDownloadProgress(const net::URLFetcher* source,
int64 current, int64 total) override;
int64 current,
int64 total,
int64_t current_network_bytes) override;
void OnURLFetchUploadProgress(const net::URLFetcher* source,
int64 current, int64 total) override;
@ -402,7 +404,9 @@ void CefURLFetcherDelegate::OnURLFetchComplete(
void CefURLFetcherDelegate::OnURLFetchDownloadProgress(
const net::URLFetcher* source,
int64 current, int64 total) {
int64 current,
int64 total,
int64_t current_network_bytes) {
context_->OnDownloadProgress(current, total);
}

View File

@ -326,6 +326,11 @@ memory::TabManager* ChromeBrowserProcessStub::GetTabManager() {
return NULL;
}
PhysicalWebDataSource* ChromeBrowserProcessStub::GetPhysicalWebDataSource() {
NOTIMPLEMENTED();
return NULL;
}
content::BrowserContext*
ChromeBrowserProcessStub::GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context) {

View File

@ -107,6 +107,7 @@ class ChromeBrowserProcessStub : public BrowserProcess,
shell_integration::DefaultWebClientState
CachedDefaultWebClientState() override;
memory::TabManager* GetTabManager() override;
PhysicalWebDataSource* GetPhysicalWebDataSource() override;
// BrowserContextIncognitoHelper implementation.
content::BrowserContext* GetBrowserContextRedirectedInIncognito(

View File

@ -738,7 +738,7 @@ bool CefContentBrowserClient::CanCreateWindow(
*no_javascript_access = false;
return CefBrowserInfoManager::GetInstance()->CanCreateWindow(
target_url, referrer, disposition, features, user_gesture,
target_url, referrer, frame_name, disposition, features, user_gesture,
opener_suppressed, render_process_id, opener_render_view_id,
opener_render_frame_id, no_javascript_access);
}

View File

@ -34,6 +34,7 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "net/base/net_errors.h"
#include "net/log/net_log_source.h"
#include "net/socket/tcp_server_socket.h"
#include "ui/base/resource/resource_bundle.h"
@ -50,7 +51,7 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory {
// content::DevToolsSocketFactory.
std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
std::unique_ptr<net::ServerSocket> socket(
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
new net::TCPServerSocket(nullptr, net::NetLogSource()));
if (socket->ListenWithAddressAndPort(address_, port_, kBackLog) != net::OK)
return std::unique_ptr<net::ServerSocket>();
return socket;

View File

@ -22,9 +22,6 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
~CefDevToolsManagerDelegate() override;
// DevToolsManagerDelegate implementation.
void Inspect(content::DevToolsAgentHost* agent_host) override {}
void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host,
bool attached) override {}
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(const GURL& url)
override;
std::string GetDiscoveryPageHTML() override;

View File

@ -248,6 +248,11 @@ CefExtensionsBrowserClient::GetExtensionWebContentsObserver(
return CefExtensionWebContentsObserver::FromWebContents(web_contents);
}
KioskDelegate* CefExtensionsBrowserClient::GetKioskDelegate() {
NOTREACHED();
return NULL;
}
void CefExtensionsBrowserClient::SetAPIClientForTest(
ExtensionsAPIClient* api_client) {
api_client_.reset(api_client);

View File

@ -80,6 +80,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
bool IsMinBrowserVersionSupported(const std::string& min_version) override;
ExtensionWebContentsObserver* GetExtensionWebContentsObserver(
content::WebContents* web_contents) override;
KioskDelegate* GetKioskDelegate() override;
// Sets the API client.
void SetAPIClientForTest(ExtensionsAPIClient* api_client);

View File

@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/win/wrapped_window_proc.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/l10n/l10n_util.h"
@ -450,7 +451,7 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
// state. Instead post a task, then notify. This mirrors what WM_MENUCOMMAND
// does.
menu_to_select_factory_.InvalidateWeakPtrs();
base::MessageLoop::current()->PostTask(
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&CefNativeMenuWin::DelayedSelect,
menu_to_select_factory_.GetWeakPtr()));

View File

@ -455,7 +455,6 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
frame_rate_threshold_ms_(0),
#if !defined(OS_MACOSX)
compositor_widget_(gfx::kNullAcceleratedWidget),
delegated_frame_host_(new content::DelegatedFrameHost(this)),
#endif
software_output_device_(NULL),
hold_resize_(false),
@ -482,6 +481,11 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
}
#if !defined(OS_MACOSX)
content::ImageTransportFactory* factory =
content::ImageTransportFactory::GetInstance();
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
factory->GetContextFactory()->AllocateFrameSinkId(), this);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif

View File

@ -139,7 +139,7 @@ content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget(
embedder_host_view);
embedder_host_view->AddGuestHostView(platform_widget);
return new content::RenderWidgetHostViewGuest(
return content::RenderWidgetHostViewGuest::Create(
render_widget_host,
guest_,
platform_widget->GetWeakPtr());

View File

@ -5,6 +5,7 @@
#include "libcef/browser/pepper/browser_pepper_host_factory.h"
#include "build/build_config.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h"
#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h"
@ -35,24 +36,24 @@ std::unique_ptr<ResourceHost> CefBrowserPepperHostFactory::CreateResourceHost(
// Make sure the plugin is giving us a valid instance for this resource.
if (!host_->IsValidInstance(instance))
return std::unique_ptr<ResourceHost>();
return nullptr;
// Flash interfaces.
if (host_->GetPpapiHost()->permissions().HasPermission(
ppapi::PERMISSION_FLASH)) {
switch (message.type()) {
case PpapiHostMsg_Flash_Create::ID:
return std::unique_ptr<ResourceHost>(
new chrome::PepperFlashBrowserHost(host_, instance, resource));
return base::MakeUnique<chrome::PepperFlashBrowserHost>(host_, instance,
resource);
case PpapiHostMsg_FlashClipboard_Create::ID: {
scoped_refptr<ResourceMessageFilter> clipboard_filter(
new chrome::PepperFlashClipboardMessageFilter);
return std::unique_ptr<ResourceHost>(new MessageFilterHost(
host_->GetPpapiHost(), instance, resource, clipboard_filter));
return base::MakeUnique<MessageFilterHost>(
host_->GetPpapiHost(), instance, resource, clipboard_filter);
}
case PpapiHostMsg_FlashDRM_Create::ID:
return std::unique_ptr<ResourceHost>(
new chrome::PepperFlashDRMHost(host_, instance, resource));
return base::MakeUnique<chrome::PepperFlashDRMHost>(host_, instance,
resource);
}
}
@ -66,11 +67,11 @@ std::unique_ptr<ResourceHost> CefBrowserPepperHostFactory::CreateResourceHost(
chrome::PepperIsolatedFileSystemMessageFilter* isolated_fs_filter =
chrome::PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
if (!isolated_fs_filter)
return std::unique_ptr<ResourceHost>();
return std::unique_ptr<ResourceHost>(
new MessageFilterHost(host, instance, resource, isolated_fs_filter));
return nullptr;
return base::MakeUnique<MessageFilterHost>(host, instance, resource,
isolated_fs_filter);
}
NOTREACHED() << "Unhandled message type: " << message.type();
return std::unique_ptr<ResourceHost>();
return nullptr;
}

View File

@ -37,6 +37,8 @@ ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) {
return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
case PermissionType::BACKGROUND_SYNC:
return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;
case PermissionType::FLASH:
return CONTENT_SETTINGS_TYPE_PLUGINS;
case PermissionType::NUM:
// This will hit the NOTREACHED below.
break;

View File

@ -34,6 +34,7 @@
#include "extensions/common/extension.h"
#include "extensions/common/manifest_handlers/webview_info.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@ -95,7 +96,7 @@ static void SendPluginAvailabilityUMA(const std::string& mime_type,
void ReportMetrics(const std::string& mime_type,
const GURL& url,
const GURL& origin_url) {
const url::Origin& main_frame_origin) {
}
#if defined(ENABLE_EXTENSIONS)
@ -196,20 +197,20 @@ CefPluginInfoMessageFilter::~CefPluginInfoMessageFilter() {}
struct CefPluginInfoMessageFilter::GetPluginInfo_Params {
int render_frame_id;
GURL url;
GURL top_origin_url;
url::Origin main_frame_origin;
std::string mime_type;
};
void CefPluginInfoMessageFilter::OnGetPluginInfo(
int render_frame_id,
const GURL& url,
const GURL& top_origin_url,
const url::Origin& main_frame_origin,
const std::string& mime_type,
IPC::Message* reply_msg) {
GetPluginInfo_Params params = {
render_frame_id,
url,
top_origin_url,
main_frame_origin,
mime_type
};
PluginService::GetInstance()->GetPlugins(
@ -244,7 +245,7 @@ void CefPluginInfoMessageFilter::PluginsLoaded(
CefViewHostMsg_GetPluginInfo_Status::kNotFound) {
main_thread_task_runner_->PostTask(
FROM_HERE, base::Bind(&ReportMetrics, output.actual_mime_type,
params.url, params.top_origin_url));
params.url, params.main_frame_origin));
}
}
@ -304,7 +305,7 @@ void CefPluginInfoMessageFilter::Context::DecidePluginStatus(
bool is_managed = false;
// Check plugin content settings. The primary URL is the top origin URL and
// the secondary URL is the plugin URL.
GetPluginContentSetting(plugin, params.top_origin_url, params.url,
GetPluginContentSetting(plugin, params.main_frame_origin.GetURL(), params.url,
plugin_metadata->identifier(), &plugin_setting,
&uses_default_content_setting, &is_managed);
@ -413,7 +414,7 @@ bool CefPluginInfoMessageFilter::Context::FindEnabledPlugin(
DecidePluginStatus(params, *plugin, (*plugin_metadata).get(), status);
if (filter->IsPluginAvailable(handler,
params.url,
params.top_origin_url,
params.main_frame_origin,
plugin,
status)) {
break;

View File

@ -34,6 +34,10 @@ namespace extensions {
class ExtensionRegistry;
}
namespace url {
class Origin;
}
// This class filters out incoming IPC messages requesting plugin information.
class CefPluginInfoMessageFilter : public content::BrowserMessageFilter {
public:
@ -95,7 +99,7 @@ class CefPluginInfoMessageFilter : public content::BrowserMessageFilter {
void OnGetPluginInfo(int render_frame_id,
const GURL& url,
const GURL& top_origin_url,
const url::Origin& main_frame_origin,
const std::string& mime_type,
IPC::Message* reply_msg);

View File

@ -22,7 +22,7 @@ bool CefPluginServiceFilter::IsPluginAvailable(
int render_frame_id,
const void* context,
const GURL& url,
const GURL& policy_url,
const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) {
CefResourceContext* resource_context = const_cast<CefResourceContext*>(
reinterpret_cast<const CefResourceContext*>(context));
@ -36,7 +36,7 @@ bool CefPluginServiceFilter::IsPluginAvailable(
CefRefPtr<CefRequestContextHandler> handler = resource_context->GetHandler();
CefViewHostMsg_GetPluginInfo_Status status =
CefViewHostMsg_GetPluginInfo_Status::kAllowed;
allow_load = IsPluginAvailable(handler.get(), url, policy_url, plugin,
allow_load = IsPluginAvailable(handler.get(), url, main_frame_origin, plugin,
&status);
resource_context->AddPluginLoadDecision(render_process_id, plugin->path,
@ -53,7 +53,7 @@ bool CefPluginServiceFilter::CanLoadPlugin(int render_process_id,
bool CefPluginServiceFilter::IsPluginAvailable(
CefRequestContextHandler* handler,
const GURL& url,
const GURL& policy_url,
const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin,
CefViewHostMsg_GetPluginInfo_Status* status) {
if (*status == CefViewHostMsg_GetPluginInfo_Status::kNotFound ||
@ -68,6 +68,7 @@ bool CefPluginServiceFilter::IsPluginAvailable(
return true;
}
const GURL& policy_url = main_frame_origin.GetURL();
if (!policy_url.is_empty() &&
policy_url.scheme() == extensions::kExtensionScheme) {
// Always allow extension origins to load plugins.

View File

@ -25,7 +25,7 @@ class CefPluginServiceFilter : public content::PluginServiceFilter {
int render_frame_id,
const void* context,
const GURL& url,
const GURL& policy_url,
const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin) override;
bool CanLoadPlugin(int render_process_id,
@ -36,7 +36,7 @@ class CefPluginServiceFilter : public content::PluginServiceFilter {
// See related discussion in issue #2015.
bool IsPluginAvailable(CefRequestContextHandler* handler,
const GURL& url,
const GURL& policy_url,
const url::Origin& main_frame_origin,
content::WebPluginInfo* plugin,
CefViewHostMsg_GetPluginInfo_Status* status);

View File

@ -144,7 +144,8 @@ void CefPrintViewManagerBase::OnDidPrintPage(
web_contents()->Stop();
return;
}
shared_buf.reset(new base::SharedMemory(params.metafile_data_handle, true));
shared_buf =
base::MakeUnique<base::SharedMemory>(params.metafile_data_handle, true);
if (!shared_buf->Map(params.data_size)) {
NOTREACHED() << "couldn't map";
web_contents()->Stop();
@ -174,6 +175,7 @@ void CefPrintViewManagerBase::OnDidPrintPage(
if (metafile_must_be_valid) {
bool print_text_with_gdi =
document->settings().print_text_with_gdi() &&
!document->settings().printer_is_xps() &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGDITextPrinting);
scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes(

View File

@ -518,7 +518,7 @@ cef_errorcode_t CefRequestContextImpl::ResolveHostCached(
net::HostPortPair::FromURL(GURL(origin.ToString())));
net::AddressList address_list;
retval = host_resolver->ResolveFromCache(request_info, &address_list,
net::BoundNetLog());
net::NetLogWithSource());
if (retval == net::OK) {
net::AddressList::const_iterator iter = address_list.begin();
for (; iter != address_list.end(); ++iter)
@ -693,7 +693,7 @@ void CefRequestContextImpl::ResolveHostInternal(
&helper->address_list_,
base::Bind(&ResolveHostHelper::OnResolveCompleted,
base::Unretained(helper)),
&helper->request_, net::BoundNetLog());
&helper->request_, net::NetLogWithSource());
if (retval == net::ERR_IO_PENDING) {
// The result will be delivered asynchronously via the callback.
return;

View File

@ -21,6 +21,7 @@
#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/plugin_service_filter.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/stream_info.h"
#include "content/public/common/resource_response.h"
@ -36,21 +37,26 @@ namespace {
void SendExecuteMimeTypeHandlerEvent(
std::unique_ptr<content::StreamInfo> stream,
int64_t expected_content_size,
int render_process_id,
int render_frame_id,
const std::string& extension_id,
const std::string& view_id,
bool embedded) {
bool embedded,
int frame_tree_node_id,
int render_process_id,
int render_frame_id) {
CEF_REQUIRE_UIT();
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForFrame(render_process_id,
render_frame_id);
if (!browser.get())
return;
content::WebContents* web_contents = nullptr;
if (frame_tree_node_id != -1) {
web_contents =
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
} else {
web_contents = content::WebContents::FromRenderFrameHost(
content::RenderFrameHost::FromID(render_process_id, render_frame_id));
}
content::WebContents* web_contents = browser->web_contents();
if (!web_contents)
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (!browser.get())
return;
content::BrowserContext* browser_context = web_contents->GetBrowserContext();
@ -61,8 +67,8 @@ void SendExecuteMimeTypeHandlerEvent(
return;
streams_private->ExecuteMimeTypeHandler(
extension_id, web_contents, std::move(stream), view_id,
expected_content_size, embedded, render_process_id, render_frame_id);
extension_id, std::move(stream), view_id, expected_content_size, embedded,
frame_tree_node_id, render_process_id, render_frame_id);
}
} // namespace
@ -181,9 +187,9 @@ void CefResourceDispatcherHostDelegate::OnStreamCreated(
bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME;
CEF_POST_TASK(CEF_UIT,
base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
request->GetExpectedContentSize(), info->GetChildID(),
info->GetRenderFrameID(), ix->second.extension_id,
ix->second.view_id, embedded));
request->GetExpectedContentSize(), ix->second.extension_id,
ix->second.view_id, embedded, info->GetFrameTreeNodeId(),
info->GetChildID(), info->GetRenderFrameID()));
stream_target_info_.erase(request);
}

View File

@ -7,6 +7,7 @@
#include "libcef/browser/thread_util.h"
#include "base/files/file_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "content/public/browser/tracing_controller.h"
@ -106,7 +107,7 @@ bool CefTraceSubscriber::EndTracing(
// Create a new temporary file path on the FILE thread, then continue.
CEF_POST_TASK(CEF_FILET,
base::Bind(CreateTemporaryFileOnFileThread,
base::MessageLoop::current()->task_runner(),
base::ThreadTaskRunnerHandle::Get(),
base::Bind(&CefTraceSubscriber::ContinueEndTracing,
weak_factory_.GetWeakPtr(), callback)));
return true;

View File

@ -234,7 +234,7 @@ IPC_STRUCT_END()
IPC_SYNC_MESSAGE_CONTROL4_1(CefViewHostMsg_GetPluginInfo,
int /* render_frame_id */,
GURL /* url */,
GURL /* top origin url */,
url::Origin /* top origin url */,
std::string /* mime_type */,
CefViewHostMsg_GetPluginInfo_Output /* output */)

View File

@ -10,17 +10,11 @@
namespace {
void CopyList(const base::ListValue& source,
base::ListValue& target) {
base::ListValue::const_iterator it = source.begin();
for (; it != source.end(); ++it)
target.Append((*it)->DeepCopy());
}
void CopyValue(const Cef_Request_Params& source,
Cef_Request_Params& target) {
target.name = source.name;
CopyList(source.arguments, target.arguments);
auto copy = source.arguments.CreateDeepCopy();
target.arguments.Swap(copy.get());
}
} // namespace

View File

@ -192,10 +192,6 @@ CefContentRendererClient::CefContentRendererClient()
}
CefContentRendererClient::~CefContentRendererClient() {
if (!guest_views_.empty()) {
base::STLDeleteContainerPairSecondPointers(guest_views_.begin(),
guest_views_.end());
}
}
// static
@ -254,8 +250,7 @@ bool CefContentRendererClient::HasGuestViewForView(
void CefContentRendererClient::OnGuestViewDestroyed(CefGuestView* guest_view) {
GuestViewMap::iterator it = guest_views_.begin();
for (; it != guest_views_.end(); ++it) {
if (it->second == guest_view) {
delete it->second;
if (it->second.get() == guest_view) {
guest_views_.erase(it);
return;
}
@ -409,9 +404,6 @@ void CefContentRendererClient::RenderThreadStarted() {
thread->AddObserver(spellcheck_.get());
}
visited_link_slave_.reset(new visitedlink::VisitedLinkSlave());
thread->AddObserver(visited_link_slave_.get());
if (content::RenderProcessHost::run_renderer_in_process()) {
// When running in single-process mode register as a destruction observer
// on the render thread's MessageLoop.
@ -514,9 +506,8 @@ bool CefContentRendererClient::OverrideCreatePlugin(
GURL url(params.url);
CefViewHostMsg_GetPluginInfo_Output output;
blink::WebString top_origin = frame->top()->getSecurityOrigin().toString();
render_frame->Send(new CefViewHostMsg_GetPluginInfo(
render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin),
render_frame->GetRoutingID(), url, frame->top()->getSecurityOrigin(),
orig_mime_type, &output));
*plugin = CreatePlugin(render_frame, frame, params, output);
@ -620,11 +611,12 @@ bool CefContentRendererClient::WillSendRequest(
unsigned long long CefContentRendererClient::VisitedLinkHash(
const char* canonical_url, size_t length) {
return visited_link_slave_->ComputeURLFingerprint(canonical_url, length);
return observer_->visited_link_slave()->ComputeURLFingerprint(canonical_url,
length);
}
bool CefContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
return visited_link_slave_->IsVisited(link_hash);
return observer_->visited_link_slave()->IsVisited(link_hash);
}
content::BrowserPluginDelegate*
@ -846,7 +838,8 @@ void CefContentRendererClient::BrowserCreated(
if (params.is_guest_view) {
// Don't create a CefBrowser for guest views.
guest_views_.insert(
std::make_pair(render_view, new CefGuestView(render_view)));
std::make_pair(render_view,
base::MakeUnique<CefGuestView>(render_view)));
return;
}

View File

@ -9,6 +9,7 @@
#include <list>
#include <map>
#include <memory>
#include <string>
#include <vector>
@ -29,10 +30,6 @@ class ExtensionsRendererClient;
class ResourceRequestPolicy;
}
namespace visitedlink {
class VisitedLinkSlave;
}
namespace web_cache {
class WebCacheImpl;
}
@ -152,14 +149,14 @@ class CefContentRendererClient : public content::ContentRendererClient,
std::unique_ptr<CefRenderThreadObserver> observer_;
std::unique_ptr<web_cache::WebCacheImpl> web_cache_impl_;
std::unique_ptr<SpellCheck> spellcheck_;
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
// Map of RenderView pointers to CefBrowserImpl references.
typedef std::map<content::RenderView*, CefRefPtr<CefBrowserImpl> > BrowserMap;
BrowserMap browsers_;
// Map of RenderView poiners to CefGuestView implementations.
typedef std::map<content::RenderView*, CefGuestView* > GuestViewMap;
typedef std::map<content::RenderView*, std::unique_ptr<CefGuestView> >
GuestViewMap;
GuestViewMap guest_views_;
// Cross-origin white list entries that need to be registered with WebKit.

View File

@ -21,9 +21,9 @@ void CefPepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) {
// TODO(brettw) figure out how to hook up the host factory. It needs some
// kind of filter-like system to allow dynamic additions.
host->GetPpapiHost()->AddHostFactoryFilter(
base::WrapUnique(new CefRendererPepperHostFactory(host)));
base::MakeUnique<CefRendererPepperHostFactory>(host));
}
void CefPepperHelper::OnDestruct() {
delete this;
}
}

View File

@ -5,6 +5,7 @@
#include "libcef/renderer/pepper/renderer_pepper_host_factory.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h"
#include "chrome/renderer/pepper/pepper_flash_font_file_host.h"
#include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
@ -36,25 +37,25 @@ std::unique_ptr<ResourceHost> CefRendererPepperHostFactory::CreateResourceHost(
// Make sure the plugin is giving us a valid instance for this resource.
if (!host_->IsValidInstance(instance))
return std::unique_ptr<ResourceHost>();
return nullptr;
if (host_->GetPpapiHost()->permissions().HasPermission(
ppapi::PERMISSION_FLASH)) {
switch (message.type()) {
case PpapiHostMsg_Flash_Create::ID: {
return std::unique_ptr<ResourceHost>(
new PepperFlashRendererHost(host_, instance, resource));
return base::MakeUnique<PepperFlashRendererHost>(host_, instance,
resource);
}
case PpapiHostMsg_FlashFullscreen_Create::ID: {
return std::unique_ptr<ResourceHost>(
new PepperFlashFullscreenHost(host_, instance, resource));
return base::MakeUnique<PepperFlashFullscreenHost>(host_, instance,
resource);
}
case PpapiHostMsg_FlashMenu_Create::ID: {
ppapi::proxy::SerializedFlashMenu serialized_menu;
if (ppapi::UnpackMessage<PpapiHostMsg_FlashMenu_Create>(
message, &serialized_menu)) {
return std::unique_ptr<ResourceHost>(new PepperFlashMenuHost(
host_, instance, resource, serialized_menu));
return base::MakeUnique<PepperFlashMenuHost>(
host_, instance, resource, serialized_menu);
}
break;
}
@ -74,14 +75,14 @@ std::unique_ptr<ResourceHost> CefRendererPepperHostFactory::CreateResourceHost(
PP_PrivateFontCharset charset;
if (ppapi::UnpackMessage<PpapiHostMsg_FlashFontFile_Create>(
message, &description, &charset)) {
return std::unique_ptr<ResourceHost>(new PepperFlashFontFileHost(
host_, instance, resource, description, charset));
return base::MakeUnique<PepperFlashFontFileHost>(
host_, instance, resource, description, charset);
}
break;
}
case PpapiHostMsg_FlashDRM_Create::ID:
return std::unique_ptr<ResourceHost>(
new PepperFlashDRMRendererHost(host_, instance, resource));
return base::MakeUnique<PepperFlashDRMRendererHost>(host_, instance,
resource);
}
}
@ -89,8 +90,7 @@ std::unique_ptr<ResourceHost> CefRendererPepperHostFactory::CreateResourceHost(
ppapi::PERMISSION_PRIVATE)) {
switch (message.type()) {
case PpapiHostMsg_PDF_Create::ID: {
return std::unique_ptr<ResourceHost>(
new pdf::PepperPDFHost(host_, instance, resource));
return base::MakeUnique<pdf::PepperPDFHost>(host_, instance, resource);
}
}
}
@ -101,11 +101,10 @@ std::unique_ptr<ResourceHost> CefRendererPepperHostFactory::CreateResourceHost(
// access to the other private interfaces.
switch (message.type()) {
case PpapiHostMsg_UMA_Create::ID: {
return std::unique_ptr<ResourceHost>(
new PepperUMAHost(host_, instance, resource));
return base::MakeUnique<PepperUMAHost>(host_, instance, resource);
}
}
NOTREACHED() << "Unhandled message type: " << message.type();
return std::unique_ptr<ResourceHost>();
return nullptr;
}

View File

@ -17,7 +17,6 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/renderer_resources.h"
#include "chrome/renderer/custom_menu_commands.h"
#include "components/content_settings/content/common/content_settings_messages.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/context_menu_params.h"
@ -171,6 +170,12 @@ void CefPluginPlaceholder::OpenAboutPluginsCallback() {
NOTREACHED();
}
void CefPluginPlaceholder::ShowPermissionBubbleCallback() {
// CEF does not use IDR_PREFER_HTML_PLUGIN_HTML which would originate this
// callback.
NOTREACHED();
}
void CefPluginPlaceholder::PluginListChanged() {
if (!GetFrame() || !plugin())
return;
@ -180,14 +185,9 @@ void CefPluginPlaceholder::PluginListChanged() {
CefViewHostMsg_GetPluginInfo_Output output;
std::string mime_type(GetPluginParams().mimeType.utf8());
blink::WebString top_origin =
GetFrame()->top()->getSecurityOrigin().toString();
render_frame()->Send(
new CefViewHostMsg_GetPluginInfo(routing_id(),
GURL(GetPluginParams().url),
blink::WebStringToGURL(top_origin),
mime_type,
&output));
render_frame()->Send(new CefViewHostMsg_GetPluginInfo(
routing_id(), GURL(GetPluginParams().url),
GetFrame()->top()->getSecurityOrigin(), mime_type, &output));
if (output.status == status_)
return;
blink::WebPlugin* new_plugin = CefContentRendererClient::CreatePlugin(
@ -305,7 +305,9 @@ gin::ObjectTemplateBuilder CefPluginPlaceholder::GetObjectTemplateBuilder(
"didFinishLoading",
&CefPluginPlaceholder::DidFinishLoadingCallback)
.SetMethod("openAboutPlugins",
&CefPluginPlaceholder::OpenAboutPluginsCallback);
&CefPluginPlaceholder::OpenAboutPluginsCallback)
.SetMethod("showPermissionBubble",
&CefPluginPlaceholder::ShowPermissionBubbleCallback);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePluginPlaceholderTesting)) {

View File

@ -75,6 +75,8 @@ class CefPluginPlaceholder final
// Javascript callbacks:
// Open chrome://plugins in a new tab.
void OpenAboutPluginsCallback();
// Show the Plugins permission bubble.
void ShowPermissionBubbleCallback();
CefViewHostMsg_GetPluginInfo_Status status_;

View File

@ -21,17 +21,18 @@
using content::BrowserThread;
CefRenderMessageFilter::CefRenderMessageFilter()
: sender_(NULL) {
: channel_(NULL) {
}
CefRenderMessageFilter::~CefRenderMessageFilter() {
}
void CefRenderMessageFilter::OnFilterAdded(IPC::Sender* sender) {
sender_ = sender;
void CefRenderMessageFilter::OnFilterAdded(IPC::Channel* channel) {
channel_ = channel;
}
void CefRenderMessageFilter::OnFilterRemoved() {
channel_ = nullptr;
}
bool CefRenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
@ -74,8 +75,8 @@ bool CefRenderMessageFilter::Send(IPC::Message* message) {
return true;
}
if (sender_)
return sender_->Send(message);
if (channel_)
return channel_->Send(message);
delete message;
return false;

View File

@ -20,7 +20,7 @@ class CefRenderMessageFilter : public IPC::MessageFilter {
~CefRenderMessageFilter() override;
// IPC::ChannelProxy::MessageFilter implementation.
void OnFilterAdded(IPC::Sender* sender) override;
void OnFilterAdded(IPC::Channel* channel) override;
void OnFilterRemoved() override;
bool OnMessageReceived(const IPC::Message& message) override;
@ -35,7 +35,7 @@ class CefRenderMessageFilter : public IPC::MessageFilter {
void OnDevToolsAgentAttach_RT();
void OnDevToolsAgentDetach_RT(int32_t routing_id);
IPC::Sender* sender_;
IPC::Channel* channel_;
DISALLOW_COPY_AND_ASSIGN(CefRenderMessageFilter);
};

View File

@ -8,15 +8,23 @@
#include "libcef/common/net/net_resource_provider.h"
#include "libcef/renderer/content_renderer_client.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "content/public/renderer/render_thread.h"
#include "net/base/net_module.h"
#include "services/shell/public/cpp/interface_registry.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
bool CefRenderThreadObserver::is_incognito_process_ = false;
CefRenderThreadObserver::CefRenderThreadObserver() {
CefRenderThreadObserver::CefRenderThreadObserver()
: visited_link_slave_(new visitedlink::VisitedLinkSlave) {
net::NetModule::SetResourceProvider(NetResourceProvider);
content::RenderThread* thread = content::RenderThread::Get();
thread->GetInterfaceRegistry()->AddInterface(
visited_link_slave_->GetBindCallback());
}
CefRenderThreadObserver::~CefRenderThreadObserver() {
@ -39,6 +47,7 @@ bool CefRenderThreadObserver::OnControlMessageReceived(
void CefRenderThreadObserver::OnRenderProcessShutdown() {
CefContentRendererClient::Get()->OnRenderProcessShutdown();
visited_link_slave_.reset();
}
void CefRenderThreadObserver::OnSetIsIncognitoProcess(

View File

@ -6,9 +6,15 @@
#ifndef CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
#define CEF_LIBCEF_RENDERER_RENDER_THREAD_OBSERVER_H_
#include <memory>
#include "base/compiler_specific.h"
#include "content/public/renderer/render_thread_observer.h"
namespace visitedlink {
class VisitedLinkSlave;
}
struct Cef_CrossOriginWhiteListEntry_Params;
// This class sends and receives control messages on the renderer process.
@ -23,6 +29,10 @@ class CefRenderThreadObserver : public content::RenderThreadObserver {
bool OnControlMessageReceived(const IPC::Message& message) override;
void OnRenderProcessShutdown() override;
visitedlink::VisitedLinkSlave* visited_link_slave() {
return visited_link_slave_.get();
}
private:
// Message handlers called on the render thread.
void OnSetIsIncognitoProcess(bool is_incognito_process);
@ -33,6 +43,8 @@ class CefRenderThreadObserver : public content::RenderThreadObserver {
static bool is_incognito_process_;
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver);
};

View File

@ -37,11 +37,10 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
~CefWebURLLoaderClient() override;
// blink::WebURLLoaderClient methods.
void willFollowRedirect(
bool willFollowRedirect(
WebURLLoader* loader,
WebURLRequest& newRequest,
const WebURLResponse& redirectResponse,
int64_t encodedDataLength) override;
const WebURLResponse& redirectResponse) override;
void didSendData(
WebURLLoader* loader,
unsigned long long bytesSent,
@ -252,11 +251,11 @@ CefWebURLLoaderClient::CefWebURLLoaderClient(
CefWebURLLoaderClient::~CefWebURLLoaderClient() {
}
void CefWebURLLoaderClient::willFollowRedirect(
bool CefWebURLLoaderClient::willFollowRedirect(
WebURLLoader* loader,
WebURLRequest& newRequest,
const WebURLResponse& redirectResponse,
int64_t encodedDataLength) {
const WebURLResponse& redirectResponse) {
return true;
}
void CefWebURLLoaderClient::didSendData(

View File

@ -262,4 +262,12 @@ patches = [
'name': 'ui_views_test_640741',
'path': '../',
},
{
# Fix PDF extension loading after showing the plugin placeholder.
# https://bitbucket.org/chromiumembedded/cef/issues/2020/
# Reverts https://codereview.chromium.org/2352673003 and
# https://codereview.chromium.org/2344023002
'name': 'webview_plugin_2020',
'path': '../',
},
]

View File

@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index 8d92b06..618d23e 100644
index 4b8d5bc..6a1b374 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -56,9 +56,11 @@ class BrowserCompositorMac : public cc::BeginFrameObserver,
@ -13,12 +13,12 @@ index 8d92b06..618d23e 100644
+ ui::Compositor* GetCompositor();
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac();
void SwapCompositorFrame(uint32_t output_surface_id,
void SwapCompositorFrame(uint32_t compositor_frame_sink_id,
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index 219effe..5122a99 100644
index 3ec7423..14d5add 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -198,6 +198,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
@@ -200,6 +200,12 @@ BrowserCompositorMac::~BrowserCompositorMac() {
g_spare_recyclable_compositors.Get().clear();
}
@ -31,7 +31,7 @@ index 219effe..5122a99 100644
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() {
if (recyclable_compositor_)
return recyclable_compositor_->accelerated_widget_mac();
@@ -414,8 +420,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
@@ -417,8 +423,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor(
}
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index cdb2d17..fb53fa6 100644
index 7122187..19dec1a 100644
--- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc
@@ -242,6 +242,9 @@ void RenderWidgetHostViewGuest::Destroy() {
@@ -253,6 +253,9 @@ void RenderWidgetHostViewGuest::Destroy() {
}
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@ -1,5 +1,5 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
index 6d06122..bc964c7 100644
index 2dc039f..66e45e2 100644
--- browser/browser_plugin/browser_plugin_guest.cc
+++ browser/browser_plugin/browser_plugin_guest.cc
@@ -28,7 +28,7 @@
@ -11,13 +11,13 @@ index 6d06122..bc964c7 100644
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/content_constants_internal.h"
@@ -292,20 +292,19 @@ void BrowserPluginGuest::InitInternal(
@@ -293,20 +293,19 @@ void BrowserPluginGuest::InitInternal(
guest_window_rect_ = params.view_rect;
if (owner_web_contents_ != owner_web_contents) {
- WebContentsViewGuest* new_view = nullptr;
+ WebContentsView* new_view = nullptr;
if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
if (!GuestMode::IsCrossProcessFrameGuest(GetWebContents())) {
- new_view =
- static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
+ new_view = GetWebContents()->GetView();
@ -52,7 +52,7 @@ index 6d06122..bc964c7 100644
}
diff --git public/browser/browser_plugin_guest_delegate.cc public/browser/browser_plugin_guest_delegate.cc
index bfa19e4..d788495 100644
index 732df23..25dbc62 100644
--- public/browser/browser_plugin_guest_delegate.cc
+++ public/browser/browser_plugin_guest_delegate.cc
@@ -4,6 +4,8 @@
@ -64,8 +64,8 @@ index bfa19e4..d788495 100644
namespace content {
bool BrowserPluginGuestDelegate::CanRunInDetachedState() const {
@@ -32,4 +34,23 @@ bool BrowserPluginGuestDelegate::HandleStopFindingForEmbedder(
return false;
@@ -36,4 +38,23 @@ bool BrowserPluginGuestDelegate::CanUseCrossProcessFrames() {
return true;
}
+void BrowserPluginGuestDelegate::OnGuestAttached(
@ -89,7 +89,7 @@ index bfa19e4..d788495 100644
+
} // namespace content
diff --git public/browser/browser_plugin_guest_delegate.h public/browser/browser_plugin_guest_delegate.h
index 4dd1a4c..b299190 100644
index 0f805651..fe0385d 100644
--- public/browser/browser_plugin_guest_delegate.h
+++ public/browser/browser_plugin_guest_delegate.h
@@ -21,6 +21,8 @@ class Size;

View File

@ -63,7 +63,7 @@ index 4b43013..169ca47 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index e3e742c..fe8e855 100644
index ba156c5..b7f41d3 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -89,7 +89,7 @@ class ProfileManager : public base::NonThreadSafe,

View File

@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index eb4d107..0f5dfee 100644
index 616c9b1..cf1c881 100644
--- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc
@@ -76,7 +76,7 @@
@@ -77,7 +77,7 @@
#endif
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && \

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index 128cb43..fb72012 100644
index 73ee42f..b30dc83 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -198,6 +198,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
@@ -196,6 +196,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
@ -17,7 +17,7 @@ index 128cb43..fb72012 100644
if (shell::ShellIsRemote()) {
NOTREACHED();
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 1ab836b..1f7a82a 100644
index 6a6b423..4a0d9e4 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -18,6 +18,7 @@
@ -28,7 +28,7 @@ index 1ab836b..1f7a82a 100644
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
@@ -194,6 +195,17 @@ class COMPOSITOR_EXPORT CompositorLock
@@ -195,6 +196,17 @@ class COMPOSITOR_EXPORT CompositorLock
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
};
@ -46,7 +46,7 @@ index 1ab836b..1f7a82a 100644
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -217,6 +229,9 @@ class COMPOSITOR_EXPORT Compositor
@@ -218,6 +230,9 @@ class COMPOSITOR_EXPORT Compositor
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();

View File

@ -19,7 +19,7 @@ index bb040a6..c801841 100644
return false;
}
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index 752ae2d..de04432 100644
index 14d8550..92e5b21 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -208,7 +208,6 @@ class CONTENT_EXPORT ContentRendererClient {
@ -39,10 +39,10 @@ index 752ae2d..de04432 100644
// built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index e74b334..2fe1e1a 100644
index 8880b8d..cab954b 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -4972,7 +4972,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -5008,7 +5008,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty());
@ -50,7 +50,7 @@ index e74b334..2fe1e1a 100644
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation(
@@ -4981,7 +4980,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
@@ -5017,7 +5016,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
}

View File

@ -1,8 +1,8 @@
diff --git .gn .gn
index 2034420..1675275 100644
index 585f0d8..9f60467 100644
--- .gn
+++ .gn
@@ -238,6 +238,7 @@ exec_script_whitelist = [
@@ -237,6 +237,7 @@ exec_script_whitelist = [
"//build/toolchain/win/BUILD.gn",
"//build/util/branding.gni",
"//build/util/version.gni",
@ -11,10 +11,10 @@ index 2034420..1675275 100644
# TODO(dgn): Layer violation but breaks the build otherwise, see
diff --git BUILD.gn BUILD.gn
index 6aad399..9c42f8e 100644
index 93699f0..3346d3e 100644
--- BUILD.gn
+++ BUILD.gn
@@ -270,6 +270,7 @@ group("both_gn_and_gyp") {
@@ -280,6 +280,7 @@ group("both_gn_and_gyp") {
# and whether there should be other targets that are iOS-only and missing.
deps += [
"//cc:cc_unittests",
@ -102,37 +102,21 @@ index 9c55984..d44d116 100755
# When using an installed toolchain these files aren't needed in the output
# directory in order to run binaries locally, but they are needed in order
# to create isolates or the mini_installer. Copying them to the output
diff --git chrome/BUILD.gn chrome/BUILD.gn
index 87d4743..dc21a56 100644
--- chrome/BUILD.gn
+++ chrome/BUILD.gn
@@ -709,7 +709,7 @@ if (is_win) {
]
foreach(locale, locales_as_mac_outputs) {
- sources += [ "$root_gen_dir/repack/locales/$locale.pak" ]
+ sources += [ "$root_gen_dir/chrome/repack/locales/$locale.pak" ]
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index 3e93269..9821a4b 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -233,7 +233,7 @@ template("chrome_paks") {
additional_source_patterns = invoker.additional_locale_source_patterns
}
input_locales = locales
- output_dir = "${invoker.output_dir}/locales"
+ output_dir = "${invoker.output_dir}/chrome/locales"
outputs = [
diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni
index f4a3caf..8ae7639 100644
--- chrome/chrome_repack_locales.gni
+++ chrome/chrome_repack_locales.gni
@@ -188,9 +188,9 @@ template("chrome_repack_locales") {
if (defined(invoker.output_dir)) {
output = "${invoker.output_dir}/${output_locale}.pak"
} else if (is_mac || is_ios) {
- output = "${root_gen_dir}/repack/locales/${output_locale}.pak"
+ output = "${root_gen_dir}/chrome/repack/locales/${output_locale}.pak"
} else {
- output = "${root_out_dir}/locales/${output_locale}.pak"
+ output = "${root_out_dir}/chrome/locales/${output_locale}.pak"
}
if (defined(invoker.additional_source_patterns)) {
if (is_mac) {
output_locales = locales_as_mac_outputs
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 1e269aa..b562c3e 100644
index 6994618..4ed3f85 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -125,7 +125,7 @@ template("generate_mini_installer") {

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids
index 4b6f6ad..0d17c1c 100644
index 82347ce..8e09968 100644
--- resource_ids
+++ resource_ids
@@ -14,6 +14,12 @@

View File

@ -1,8 +1,8 @@
diff --git message_loop.cc message_loop.cc
index 8a2f213..6dbaa8a 100644
index 74287b1..7309e88 100644
--- message_loop.cc
+++ message_loop.cc
@@ -143,12 +143,6 @@ MessageLoop::~MessageLoop() {
@@ -96,12 +96,6 @@ MessageLoop::~MessageLoop() {
// may be current.
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
@ -15,7 +15,7 @@ index 8a2f213..6dbaa8a 100644
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);
@@ -392,6 +386,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
@@ -313,6 +307,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
in_high_res_mode_(false),
#endif
nestable_tasks_allowed_(true),
@ -23,13 +23,13 @@ index 8a2f213..6dbaa8a 100644
+ os_modal_loop_(false),
+#endif // OS_WIN
pump_factory_(pump_factory),
message_histogram_(NULL),
run_loop_(NULL),
incoming_task_queue_(new internal::IncomingTaskQueue(this)),
diff --git message_loop.h message_loop.h
index 1957b99..93b3a9d 100644
index 5b1728e..79c4c58 100644
--- message_loop.h
+++ message_loop.h
@@ -395,6 +395,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
@@ -299,6 +299,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
void AddTaskObserver(TaskObserver* task_observer);
void RemoveTaskObserver(TaskObserver* task_observer);
@ -46,7 +46,7 @@ index 1957b99..93b3a9d 100644
// Can only be called from the thread that owns the MessageLoop.
bool is_running() const;
@@ -542,6 +552,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
@@ -437,6 +447,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// insider a (accidentally induced?) nested message pump.
bool nestable_tasks_allowed_;
@ -60,10 +60,10 @@ index 1957b99..93b3a9d 100644
// if type_ is TYPE_CUSTOM and pump_ is null.
MessagePumpFactoryCallback pump_factory_;
diff --git message_pump_win.cc message_pump_win.cc
index de20bdc..29c4504 100644
index b9b2c84..9abef7e 100644
--- message_pump_win.cc
+++ message_pump_win.cc
@@ -474,20 +474,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
@@ -478,20 +478,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
}
bool MessagePumpForUI::ProcessPumpReplacementMessage() {

View File

@ -1,8 +1,8 @@
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc
index 0b62a81..e34d210 100644
index dcf7527..46fe51e 100644
--- mime_handler_view_guest.cc
+++ mime_handler_view_guest.cc
@@ -134,6 +134,8 @@ void MimeHandlerViewGuest::CreateWebContents(
@@ -138,6 +138,8 @@ void MimeHandlerViewGuest::CreateWebContents(
WebContents::CreateParams params(browser_context(),
guest_site_instance.get());
params.guest_delegate = this;
@ -11,7 +11,7 @@ index 0b62a81..e34d210 100644
callback.Run(WebContents::Create(params));
}
@@ -158,6 +160,30 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
@@ -162,6 +164,30 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
return false;
}
@ -43,10 +43,10 @@ index 0b62a81..e34d210 100644
WebContents* source,
const content::OpenURLParams& params) {
diff --git mime_handler_view_guest.h mime_handler_view_guest.h
index ef91c24..f849918 100644
index 87d249e..c6a8ad3 100644
--- mime_handler_view_guest.h
+++ mime_handler_view_guest.h
@@ -75,6 +75,15 @@ class MimeHandlerViewGuest :
@@ -77,6 +77,15 @@ class MimeHandlerViewGuest :
bool ShouldHandleFindRequestsForEmbedder() const final;
bool ZoomPropagatesFromEmbedderToGuest() const final;

View File

@ -1,8 +1,8 @@
diff --git base/network_delegate.h base/network_delegate.h
index 36bdde9..f1ee1ae 100644
index 6fc19f9..583c8a9 100644
--- base/network_delegate.h
+++ base/network_delegate.h
@@ -36,6 +36,7 @@ namespace net {
@@ -37,6 +37,7 @@ namespace net {
// of net/base here, because we have a net_base library. Forward declarations
// are ok.
class CookieOptions;
@ -10,7 +10,7 @@ index 36bdde9..f1ee1ae 100644
class HttpRequestHeaders;
class HttpResponseHeaders;
class ProxyInfo;
@@ -115,6 +116,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
@@ -116,6 +117,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
const GURL& target_url,
const GURL& referrer_url) const;
@ -25,7 +25,7 @@ index 36bdde9..f1ee1ae 100644
// This is the interface for subclasses of NetworkDelegate to implement. These
// member functions will be called by the respective public notification
diff --git filter/filter.h filter/filter.h
index 1940399..bf8722c 100644
index 91875a2..b6c665f 100644
--- filter/filter.h
+++ filter/filter.h
@@ -59,6 +59,7 @@
@ -45,10 +45,10 @@ index 1940399..bf8722c 100644
friend class GZipUnitTest;
friend class SdchFilterChainingTest;
diff --git url_request/url_request_job.cc url_request/url_request_job.cc
index eadeb4b..2341297 100644
index f9df570..72b48ec 100644
--- url_request/url_request_job.cc
+++ url_request/url_request_job.cc
@@ -495,6 +495,9 @@ void URLRequestJob::NotifyHeadersComplete() {
@@ -489,6 +489,9 @@ void URLRequestJob::NotifyHeadersComplete() {
if (request_->status().is_success())
filter_ = SetupFilter();

View File

@ -1,8 +1,8 @@
diff --git url_request.h url_request.h
index 7a810a7..08d6331 100644
index 993afc9..a207f44 100644
--- url_request.h
+++ url_request.h
@@ -651,10 +651,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
@@ -646,10 +646,11 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// Returns the error status of the request.
// Do not use! Going to be protected!
const URLRequestStatus& status() const { return status_; }

View File

@ -1,5 +1,5 @@
diff --git BUILD.gn BUILD.gn
index ccb1e0c..0e3b185 100644
index b6b33f1..d80ead9 100644
--- BUILD.gn
+++ BUILD.gn
@@ -181,6 +181,10 @@ static_library("pdfium") {
@ -14,18 +14,18 @@ index ccb1e0c..0e3b185 100644
static_library("test_support") {
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 76540fc..5b2e2d0 100644
index 001ebb0..8b2b6cc 100644
--- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp
@@ -29,6 +29,7 @@
#include "fpdfsdk/include/fsdk_define.h"
#include "fpdfsdk/include/fsdk_pauseadapter.h"
@@ -30,6 +30,7 @@
#include "fpdfsdk/fsdk_define.h"
#include "fpdfsdk/fsdk_pauseadapter.h"
#include "fpdfsdk/javascript/ijs_runtime.h"
+#include "fxjs/include/fxjs_v8.h"
+#include "fxjs/fxjs_v8.h"
#include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h"
#include "third_party/base/numerics/safe_conversions_impl.h"
@@ -297,6 +298,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
@@ -299,6 +300,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
#endif // PDF_ENABLE_XFA
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index cb5c7d5..a1f606f 100644
index f2eb0d2..4909609 100644
--- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h
@@ -202,6 +202,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
@@ -203,6 +203,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,10 +11,10 @@ index cb5c7d5..a1f606f 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index 3e53ef5..133fcdd 100644
index 18a484d..338f2f8 100644
--- public/common/web_preferences.cc
+++ public/common/web_preferences.cc
@@ -174,6 +174,7 @@ WebPreferences::WebPreferences()
@@ -175,6 +175,7 @@ WebPreferences::WebPreferences()
pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
@ -23,10 +23,10 @@ index 3e53ef5..133fcdd 100644
inert_visual_viewport(false),
record_whole_document(false),
diff --git public/common/web_preferences.h public/common/web_preferences.h
index 3733fb1..1b54799 100644
index 5509a57..d32b4cc 100644
--- public/common/web_preferences.h
+++ public/common/web_preferences.h
@@ -187,6 +187,7 @@ struct CONTENT_EXPORT WebPreferences {
@@ -188,6 +188,7 @@ struct CONTENT_EXPORT WebPreferences {
int pinch_overlay_scrollbar_thickness;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
@ -35,10 +35,10 @@ index 3733fb1..1b54799 100644
bool inert_visual_viewport;
bool record_whole_document;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index f06587d..27702eb 100644
index 6a461f6..4eba51c 100644
--- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc
@@ -1477,6 +1477,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
@@ -1492,6 +1492,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view,
CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view);

View File

@ -166,7 +166,7 @@ index a019144..af8839d 100644
PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // defined(ENABLE_PRINT_PREVIEW)
diff --git components/printing/renderer/print_web_view_helper.cc components/printing/renderer/print_web_view_helper.cc
index 7fa310f..8946ba9 100644
index 7e9df81..33489d0 100644
--- components/printing/renderer/print_web_view_helper.cc
+++ components/printing/renderer/print_web_view_helper.cc
@@ -86,6 +86,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
@ -229,15 +229,15 @@ index 7fa310f..8946ba9 100644
// static - Not anonymous so that platform implementations can use it.
void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebCanvas* canvas,
@@ -565,7 +560,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
@@ -563,7 +558,6 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
web_view->close();
frame->close();
}
-#endif // defined(ENABLE_PRINT_PREVIEW)
// static - Not anonymous so that platform implementations can use it.
float PrintWebViewHelper::RenderPageContent(blink::WebFrame* frame,
@@ -851,6 +845,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
@@ -840,6 +834,7 @@ PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
print_for_preview_(false),
delegate_(std::move(delegate)),
print_node_in_progress_(false),
@ -245,7 +245,7 @@ index 7fa310f..8946ba9 100644
is_loading_(false),
is_scripted_preview_delayed_(false),
ipc_nesting_level_(0),
@@ -909,10 +904,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
@@ -898,10 +893,8 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
return;
if (g_is_preview_enabled) {
@ -256,7 +256,7 @@ index 7fa310f..8946ba9 100644
} else {
#if defined(ENABLE_BASIC_PRINTING)
Print(frame, blink::WebNode(), true);
@@ -936,14 +929,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
@@ -925,14 +918,10 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // defined(ENABLE_BASIC_PRINTING)
@ -271,7 +271,7 @@ index 7fa310f..8946ba9 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked,
SetScriptedPrintBlocked)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -998,7 +987,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
@@ -987,7 +976,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
}
#endif // defined(ENABLE_BASIC_PRINTING)
@ -279,7 +279,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1);
@@ -1063,7 +1051,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
@@ -1052,7 +1040,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT);
}
}
@ -287,7 +287,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points,
@@ -1088,7 +1075,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
@@ -1077,7 +1064,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
}
@ -295,7 +295,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -1249,7 +1235,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
@@ -1238,7 +1224,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true;
}
@ -304,7 +304,7 @@ index 7fa310f..8946ba9 100644
bool PrintWebViewHelper::RenderPreviewPage(
int page_number,
const PrintMsg_Print_Params& print_params) {
@@ -1279,7 +1265,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
@@ -1268,7 +1254,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
}
return PreviewPageRendered(page_number, draft_metafile.get());
}
@ -313,7 +313,7 @@ index 7fa310f..8946ba9 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_);
@@ -1309,7 +1295,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
@@ -1298,7 +1284,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true;
}
@ -321,7 +321,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1)
@@ -1324,7 +1309,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
@@ -1313,7 +1298,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
is_scripted_printing_blocked_ = blocked;
}
@ -329,7 +329,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
if (ipc_nesting_level_ > 1)
return;
@@ -1335,7 +1319,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
@@ -1324,7 +1308,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) {
@ -339,7 +339,7 @@ index 7fa310f..8946ba9 100644
return;
}
print_preview_context_.InitWithFrame(frame);
@@ -1343,7 +1329,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
@@ -1332,7 +1318,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
? PRINT_PREVIEW_USER_INITIATED_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
}
@ -347,7 +347,7 @@ index 7fa310f..8946ba9 100644
bool PrintWebViewHelper::IsPrintingEnabled() {
bool result = false;
@@ -1369,11 +1354,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
@@ -1358,11 +1343,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|.
@ -360,7 +360,7 @@ index 7fa310f..8946ba9 100644
} else {
#if defined(ENABLE_BASIC_PRINTING)
blink::WebNode duplicate_node(node);
@@ -1439,7 +1422,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1428,7 +1411,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
break;
@ -368,7 +368,7 @@ index 7fa310f..8946ba9 100644
case FAIL_PREVIEW:
int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@@ -1451,7 +1433,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1440,7 +1422,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
}
print_preview_context_.Failed(notify_browser_of_print_failure_);
break;
@ -376,7 +376,7 @@ index 7fa310f..8946ba9 100644
}
prep_frame_view_.reset();
print_pages_params_.reset();
@@ -1583,7 +1564,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
@@ -1572,7 +1553,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true;
}
@ -384,7 +384,7 @@ index 7fa310f..8946ba9 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1692,7 +1672,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
@@ -1681,7 +1661,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
return true;
}
@ -392,7 +392,7 @@ index 7fa310f..8946ba9 100644
#if defined(ENABLE_BASIC_PRINTING)
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
@@ -1801,7 +1780,6 @@ void PrintWebViewHelper::PrintPageInternal(
@@ -1790,7 +1769,6 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
@ -400,7 +400,7 @@ index 7fa310f..8946ba9 100644
if (params.params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink.
@@ -1816,7 +1794,6 @@ void PrintWebViewHelper::PrintPageInternal(
@@ -1805,7 +1783,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / fudge_factor, page_layout_in_points,
params.params);
}
@ -408,7 +408,7 @@ index 7fa310f..8946ba9 100644
float webkit_scale_factor =
RenderPageContent(frame, params.page_number, canvas_area, content_area,
@@ -1852,7 +1829,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
@@ -1841,7 +1818,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true;
}
@ -416,7 +416,7 @@ index 7fa310f..8946ba9 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
@@ -1980,7 +1956,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
@@ -1969,7 +1945,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true;
}

View File

@ -1,13 +1,13 @@
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 4558e89..6e9a472 100644
index fbe7feb..d05b2cf 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -484,7 +484,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
@@ -490,7 +490,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter();
std::vector<WebPluginInfo> plugins;
- int child_process_id = -1;
+ int child_process_id = render_process_id_;
int routing_id = MSG_ROUTING_NONE;
GURL policy_url =
main_frame_origin.unique() ? GURL() : GURL(main_frame_origin.Serialize());
// In this loop, copy the WebPluginInfo (and do not use a reference) because
// the filter might mutate it.

View File

@ -1,8 +1,8 @@
diff --git render_view_host_impl.h render_view_host_impl.h
index ca857d5..f3f54fa 100644
index f8cce52..cb56120 100644
--- render_view_host_impl.h
+++ render_view_host_impl.h
@@ -200,6 +200,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
@@ -203,6 +203,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
void set_is_swapped_out(bool is_swapped_out) {
is_swapped_out_ = is_swapped_out;
}

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index 2461641..7dfad416 100644
index be346a8..16683e7 100644
--- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm
@@ -460,9 +460,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
@@ -461,9 +461,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// Paint this view host with |background_color_| when there is no content
// ready to draw.
background_layer_.reset([[CALayer alloc] init]);

View File

@ -1,5 +1,5 @@
diff --git renderer_preferences_util.cc renderer_preferences_util.cc
index ad5e301..c64325b 100644
index aa4f1c2..cdf2fd9 100644
--- renderer_preferences_util.cc
+++ renderer_preferences_util.cc
@@ -30,7 +30,8 @@
@ -12,7 +12,7 @@ index ad5e301..c64325b 100644
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "ui/views/linux_ui/linux_ui.h"
@@ -130,7 +131,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
@@ -132,7 +133,8 @@ void UpdateFromSystemSettings(content::RendererPreferences* prefs,
prefs->caret_blink_interval = interval.InSecondsF();
#endif

View File

@ -1,3 +1,15 @@
diff --git components/browsing_data/content/BUILD.gn components/browsing_data/content/BUILD.gn
index 6229e1b..176f897 100644
--- components/browsing_data/content/BUILD.gn
+++ components/browsing_data/content/BUILD.gn
@@ -15,6 +15,7 @@ static_library("content") {
deps = [
"//base",
"//content/public/browser",
+ "//content/public/common",
"//net",
]
}
diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc
index 41f74ae..daca31a7 100644
--- content/browser/appcache/appcache_internals_ui.cc
@ -42,10 +54,10 @@ index bd02cb1..074e77f 100644
BrowserContext* browser_context);
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index 6ca86e7..cf081e4 100644
index 5b7ba41..82d8fb1 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -113,7 +113,14 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -115,7 +115,14 @@ StoragePartition* GetStoragePartitionFromConfig(
if (browser_context->IsOffTheRecord())
in_memory = true;
@ -61,8 +73,8 @@ index 6ca86e7..cf081e4 100644
}
void SaveSessionStateOnIOThread(
@@ -486,6 +493,11 @@ MojoShellConnection* BrowserContext::GetMojoShellConnectionFor(
return connection_holder ? connection_holder->shell_connection() : nullptr;
@@ -506,6 +513,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
: nullptr;
}
+// static
@ -74,10 +86,10 @@ index 6ca86e7..cf081e4 100644
CHECK(GetUserData(kMojoWasInitialized))
<< "Attempting to destroy a BrowserContext that never called "
diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc
index a5de8d5..8cd64b3 100644
index c34d15a1..429c0e8 100644
--- content/browser/devtools/protocol/service_worker_handler.cc
+++ content/browser/devtools/protocol/service_worker_handler.cc
@@ -503,10 +503,9 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
@@ -384,10 +384,9 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
if (!base::StringToInt64(registration_id, &id))
return CreateInvalidVersionIdErrorResponse();
@ -91,10 +103,10 @@ index a5de8d5..8cd64b3 100644
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index 1bab21a4..81156a8 100644
index f952adc..f0ed622 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -664,7 +664,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
@@ -675,7 +675,7 @@ void RenderProcessHostImpl::EarlyZygoteLaunch() {
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
@ -103,7 +115,7 @@ index 1bab21a4..81156a8 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -998,6 +998,22 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy(
@@ -1024,6 +1024,22 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -126,7 +138,7 @@ index 1bab21a4..81156a8 100644
AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1012,8 +1028,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1038,8 +1054,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals,
@ -137,7 +149,7 @@ index 1bab21a4..81156a8 100644
AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1044,9 +1060,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1070,9 +1086,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
resource_message_filter_ = new ResourceMessageFilter(
GetID(), PROCESS_TYPE_RENDERER,
@ -149,7 +161,7 @@ index 1bab21a4..81156a8 100644
storage_partition_impl_->GetHostZoomLevelContext(),
get_contexts_callback);
@@ -1071,14 +1087,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1097,14 +1113,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager()));
AddFilter(new VideoCaptureHost(media_stream_manager));
@ -167,7 +179,7 @@ index 1bab21a4..81156a8 100644
blob_storage_context.get()));
#if defined(ENABLE_WEBRTC)
@@ -1130,14 +1144,13 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1150,14 +1164,13 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost();
@ -184,7 +196,7 @@ index 1bab21a4..81156a8 100644
AddFilter(service_worker_filter.get());
AddFilter(new SharedWorkerMessageFilter(
@@ -1145,12 +1158,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1165,12 +1178,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
WorkerStoragePartition(
storage_partition_impl_->GetURLRequestContext(),
storage_partition_impl_->GetMediaURLRequestContext(),
@ -200,7 +212,7 @@ index 1bab21a4..81156a8 100644
message_port_message_filter_.get()));
#if defined(ENABLE_WEBRTC)
@@ -1165,11 +1178,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1185,11 +1198,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
GetID(), storage_partition_impl_->GetQuotaManager(),
GetContentClient()->browser()->CreateQuotaPermissionContext()));
@ -213,7 +225,7 @@ index 1bab21a4..81156a8 100644
resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get());
@@ -1178,7 +1188,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1198,7 +1208,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new HistogramMessageFilter());
AddFilter(new MemoryMessageFilter(this));
AddFilter(new PushMessagingMessageFilter(
@ -222,19 +234,19 @@ index 1bab21a4..81156a8 100644
#if defined(OS_ANDROID)
AddFilter(new ScreenOrientationMessageFilterAndroid());
#endif
@@ -1187,6 +1197,11 @@ void RenderProcessHostImpl::CreateMessageFilters() {
void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -1208,6 +1218,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
std::unique_ptr<shell::InterfaceRegistry> registry(
new shell::InterfaceRegistry);
+ // Cast to the derived type from StoragePartitionImpl.
+ auto platform_notification_context =
+ static_cast<PlatformNotificationContextImpl*>(
+ storage_partition_impl_->GetPlatformNotificationContext());
+
#if defined(OS_ANDROID)
interface_registry_android_ =
InterfaceRegistryAndroid::Create(registry.get());
@@ -1220,8 +1235,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
channel_->AddAssociatedInterface(
base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest,
base::Unretained(this)));
@@ -1239,8 +1254,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
AddUIThreadInterface(
registry.get(),
base::Bind(&PlatformNotificationContextImpl::CreateService,
@ -245,10 +257,10 @@ index 1bab21a4..81156a8 100644
AddUIThreadInterface(
registry.get(),
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index f9e74e7..a49359f 100644
index f07c487e..aae8a3e 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -78,7 +78,6 @@ class RenderWidgetHostImpl;
@@ -73,7 +73,6 @@ class RenderWidgetHostImpl;
class RenderWidgetHostViewFrameSubscriber;
class ResourceMessageFilter;
class StoragePartition;
@ -256,7 +268,7 @@ index f9e74e7..a49359f 100644
namespace mojom {
class StoragePartitionService;
@@ -114,7 +113,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -109,7 +108,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
public:
RenderProcessHostImpl(BrowserContext* browser_context,
@ -265,7 +277,7 @@ index f9e74e7..a49359f 100644
bool is_for_guests_only);
~RenderProcessHostImpl() override;
@@ -498,7 +497,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -484,7 +483,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
BrowserContext* browser_context_;
// Owned by |browser_context_|.
@ -355,11 +367,11 @@ index 075ae3e..57fb5fd 100644
void InitializeOnIOThread();
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
index 15be1d2..70a2816 100644
index aaa5e23..2309a2a 100644
--- content/public/browser/browser_context.h
+++ content/public/browser/browser_context.h
@@ -170,6 +170,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static MojoShellConnection* GetMojoShellConnectionFor(
static ServiceManagerConnection* GetServiceManagerConnectionFor(
BrowserContext* browser_context);
+ static const void* GetStoragePartitionMapUserDataKey();
@ -440,10 +452,10 @@ index 9b26c41..e9f4a0c 100644
"web_ui_url_fetcher.cc",
"web_ui_url_fetcher.h",
diff --git extensions/common/api/BUILD.gn extensions/common/api/BUILD.gn
index 0276c57..ca1d6f6 100644
index 010da6d..a13ba7a 100644
--- extensions/common/api/BUILD.gn
+++ extensions/common/api/BUILD.gn
@@ -98,6 +98,7 @@ group("api") {
@@ -99,6 +99,7 @@ group("api") {
public_deps = [
":generated_api",
":mojom",

View File

@ -56,7 +56,7 @@ index 696a941..ce5abcd 100644
// The time is used for simulating menu behavior for the menu button; that
// is, if the menu is shown and the button is pressed, we need to close the
diff --git view.h view.h
index 55cc02b..c402f55 100644
index 28171db..747930c 100644
--- view.h
+++ view.h
@@ -18,6 +18,7 @@
@ -67,7 +67,7 @@ index 55cc02b..c402f55 100644
#include "build/build_config.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/base/accelerators/accelerator.h"
@@ -112,7 +113,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
@@ -113,7 +114,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
public ui::LayerOwner,
public ui::AcceleratorTarget,
public ui::EventTarget,

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 72004fe..ff7ba8c7 100644
index 852e71f..b765a5b 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -747,6 +747,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
@@ -769,6 +769,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
}
}
#endif
@ -17,7 +17,7 @@ index 72004fe..ff7ba8c7 100644
if (host_ && set_focus_on_mouse_down_or_key_event_) {
set_focus_on_mouse_down_or_key_event_ = false;
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index a8e8627..2ec202f 100644
index 292087d..8d6da47 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -44,6 +44,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
@ -40,7 +40,7 @@ index a8e8627..2ec202f 100644
return renderer_frame_number_;
}
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
index b68718d..5b209ca 100644
index 5e25a02..b81350b 100644
--- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -107,6 +107,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@ -51,7 +51,7 @@ index b68718d..5b209ca 100644
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
@@ -468,6 +469,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
@@ -477,6 +478,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// destroyed before the RWHV is destroyed.
TextInputManager* text_input_manager_;
@ -169,10 +169,10 @@ index 884df90..518a69c 100644
// a reference.
corewm::TooltipWin* tooltip_;
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 38a416b..6343597 100644
index 816faa3..4c2d702 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -194,6 +194,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
@@ -195,6 +195,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
use_native_frame_(false),
should_maximize_after_map_(false),
use_argb_visual_(false),
@ -180,17 +180,15 @@ index 38a416b..6343597 100644
drag_drop_client_(NULL),
native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura),
@@ -206,7 +207,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
has_pointer_(false),
@@ -208,6 +209,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
has_window_focus_(false),
has_pointer_focus_(false),
- close_widget_factory_(this) {}
+ close_widget_factory_(this),
+ xwindow_destroyed_(false) {}
modal_dialog_xid_(0),
+ xwindow_destroyed_(false),
close_widget_factory_(this),
weak_factory_(this) {}
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
window()->ClearProperty(kHostForRootWindow);
@@ -542,7 +544,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
@@ -545,7 +547,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources.
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@ -200,7 +198,7 @@ index 38a416b..6343597 100644
xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed();
@@ -683,6 +686,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
@@ -686,6 +689,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
}
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -209,7 +207,7 @@ index 38a416b..6343597 100644
return ToDIPRect(bounds_in_pixels_);
}
@@ -1205,6 +1210,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
@@ -1208,6 +1213,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
}
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
@ -218,7 +216,7 @@ index 38a416b..6343597 100644
return bounds_in_pixels_;
}
@@ -1264,6 +1271,8 @@ void DesktopWindowTreeHostX11::SetBounds(
@@ -1267,6 +1274,8 @@ void DesktopWindowTreeHostX11::SetBounds(
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
@ -227,9 +225,9 @@ index 38a416b..6343597 100644
return bounds_in_pixels_.origin();
}
@@ -1382,9 +1391,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
None;
}
@@ -1390,9 +1399,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
attribute_mask |= CWBorderPixel;
swa.border_pixel = 0;
+ gfx::AcceleratedWidget parent_widget = params.parent_widget;
+ if (parent_widget == gfx::kNullAcceleratedWidget)
@ -244,7 +242,7 @@ index 38a416b..6343597 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(),
0, // border width
@@ -2013,6 +2028,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
@@ -2022,6 +2037,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
@ -256,12 +254,12 @@ index 38a416b..6343597 100644
case FocusOut:
OnFocusEvent(xev->type == FocusIn, event->xfocus.mode,
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 07e35ca..7746296 100644
index a4b68b3..bb82659 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -83,6 +83,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// internal list of open windows.
static void CleanUpWindowList(void (*func)(aura::Window* window));
@@ -91,6 +91,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// there is no dialog on the host window.
XID GetModalDialog();
+ void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; }
+
@ -272,7 +270,7 @@ index 07e35ca..7746296 100644
protected:
// Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window,
@@ -290,6 +296,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -301,6 +307,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|.
gfx::Rect bounds_in_pixels_;
@ -282,7 +280,7 @@ index 07e35ca..7746296 100644
// Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure
@@ -329,6 +338,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -340,6 +349,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Whether we used an ARGB visual for our window.
bool use_argb_visual_;
@ -293,18 +291,18 @@ index 07e35ca..7746296 100644
DesktopDragDropClientAuraX11* drag_drop_client_;
std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_;
@@ -414,6 +427,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@@ -427,6 +440,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
XID modal_dialog_xid_;
+ // True if the xwindow has already been destroyed.
+ bool xwindow_destroyed_;
+
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
};
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
base::WeakPtrFactory<DesktopWindowTreeHostX11> weak_factory_;
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
index 4b3db3f..103bba3 100644
index 68e6acd..07eb1fc 100644
--- ui/views/widget/widget.cc
+++ ui/views/widget/widget.cc
@@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type)
@ -352,7 +350,7 @@ index 4b3db3f..103bba3 100644
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git ui/views/widget/widget.h ui/views/widget/widget.h
index a92dbce..db28032 100644
index 1e62c09..551518e 100644
--- ui/views/widget/widget.h
+++ ui/views/widget/widget.h
@@ -234,12 +234,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@ -373,7 +371,7 @@ index a92dbce..db28032 100644
// Used only by mus and is necessitated by mus not being a NativeView.
ui::Window* parent_mus = nullptr;
// Specifies the initial bounds of the Widget. Default is empty, which means
@@ -756,6 +761,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -753,6 +758,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
bool movement_disabled() const { return movement_disabled_; }
void set_movement_disabled(bool disabled) { movement_disabled_ = disabled; }
@ -384,7 +382,7 @@ index a92dbce..db28032 100644
// Returns the work area bounds of the screen the Widget belongs to.
gfx::Rect GetWorkAreaBoundsInScreen() const;
@@ -974,6 +983,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@@ -971,6 +980,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// disabled.
bool movement_disabled_;
@ -412,10 +410,10 @@ index b843416..8b81a51 100644
}
case Widget::InitParams::TYPE_CONTROL:
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
index ec631af..2d55a51 100644
index 020d0a1..4a613f7 100644
--- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc
@@ -851,6 +851,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
@@ -850,6 +850,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
} else {
style &= ~WS_MINIMIZEBOX;
}
@ -424,7 +422,7 @@ index ec631af..2d55a51 100644
SetWindowLong(hwnd(), GWL_STYLE, style);
}
@@ -2469,8 +2471,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -2472,8 +2474,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable.
@ -440,10 +438,10 @@ index ec631af..2d55a51 100644
// There are cases where the code handling the message destroys the window,
diff --git ui/views/win/hwnd_message_handler_delegate.h ui/views/win/hwnd_message_handler_delegate.h
index ddf26d2..79e5db2 100644
index 14021805..c4843c8 100644
--- ui/views/win/hwnd_message_handler_delegate.h
+++ ui/views/win/hwnd_message_handler_delegate.h
@@ -57,6 +57,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
@@ -59,6 +59,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
virtual bool CanMinimize() const = 0;
virtual bool CanActivate() const = 0;

View File

@ -29,10 +29,10 @@ index e639319..5f75a9a 100644
void EnterFullscreenModeForTab(content::WebContents* contents,
const GURL& origin) final;
diff --git chrome/browser/prerender/prerender_contents.cc chrome/browser/prerender/prerender_contents.cc
index 5e4b3add..7a21502 100644
index 4ded1cb..ce3306b 100644
--- chrome/browser/prerender/prerender_contents.cc
+++ chrome/browser/prerender/prerender_contents.cc
@@ -131,7 +131,9 @@ class PrerenderContents::WebContentsDelegateImpl
@@ -141,7 +141,9 @@ class PrerenderContents::WebContentsDelegateImpl
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -44,10 +44,10 @@ index 5e4b3add..7a21502 100644
// window.opener property, terminate prerendering.
prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW);
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index b9b1da9..dde8843 100644
index 869fbec..7ca4f52 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -1580,7 +1580,9 @@ bool Browser::ShouldCreateWebContents(
@@ -1588,7 +1588,9 @@ bool Browser::ShouldCreateWebContents(
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -59,10 +59,10 @@ index b9b1da9..dde8843 100644
// If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents(
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index dae2e25..b32308c 100644
index 5410f5a..a6aaef1 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -613,7 +613,9 @@ class Browser : public TabStripModelObserver,
@@ -619,7 +619,9 @@ class Browser : public TabStripModelObserver,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -71,14 +71,14 @@ index dae2e25..b32308c 100644
+ 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,
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index be05e4a4c..58d5f4a 100644
index d7a0cbb..7883136 100644
--- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc
@@ -1557,6 +1557,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name = params.main_frame_name;
@@ -1577,6 +1577,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
+ if (params.view && params.delegate_view) {
@ -90,7 +90,7 @@ index be05e4a4c..58d5f4a 100644
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -1589,6 +1595,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1607,6 +1613,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::move(view_),
&render_view_host_delegate_view_));
}
@ -98,7 +98,7 @@ index be05e4a4c..58d5f4a 100644
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -2042,11 +2049,14 @@ void WebContentsImpl::CreateNewWindow(
@@ -2060,11 +2067,14 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -114,7 +114,7 @@ index be05e4a4c..58d5f4a 100644
if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
@@ -2070,6 +2080,8 @@ void WebContentsImpl::CreateNewWindow(
@@ -2088,6 +2098,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.opener_render_process_id = render_process_id;
create_params.opener_render_frame_id = params.opener_render_frame_id;
create_params.opener_suppressed = params.opener_suppressed;
@ -139,10 +139,10 @@ index fa0afb5..d677b31 100644
WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
index 163a2ad..63e116e 100644
index 8c66b2a..ed523c7 100644
--- content/public/browser/web_contents.h
+++ content/public/browser/web_contents.h
@@ -55,8 +55,10 @@ class PageState;
@@ -59,8 +59,10 @@ class PageState;
class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
@ -153,7 +153,7 @@ index 163a2ad..63e116e 100644
struct CustomContextMenuContext;
struct DropData;
struct Manifest;
@@ -157,6 +159,10 @@ class WebContents : public PageNavigator,
@@ -161,6 +163,10 @@ class WebContents : public PageNavigator,
// Note that the pre-created renderer process may not be used if the first
// navigation requires a dedicated or privileged process, such as a WebUI.
bool initialize_renderer;
@ -165,10 +165,10 @@ index 163a2ad..63e116e 100644
// Creates a new WebContents.
diff --git content/public/browser/web_contents_delegate.cc content/public/browser/web_contents_delegate.cc
index 399255a..cde5fd3 100644
index d107135..2d290e1 100644
--- content/public/browser/web_contents_delegate.cc
+++ content/public/browser/web_contents_delegate.cc
@@ -147,7 +147,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
@@ -148,7 +148,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -180,10 +180,10 @@ index 399255a..cde5fd3 100644
}
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
index b7d17d2..c5b66e0 100644
index 62ef1de..824b0e1 100644
--- content/public/browser/web_contents_delegate.h
+++ content/public/browser/web_contents_delegate.h
@@ -41,9 +41,11 @@ class JavaScriptDialogManager;
@@ -45,9 +45,11 @@ class JavaScriptDialogManager;
class PageState;
class RenderFrameHost;
class RenderViewHost;
@ -195,7 +195,7 @@ index b7d17d2..c5b66e0 100644
struct ColorSuggestion;
struct ContextMenuParams;
struct DropData;
@@ -310,7 +312,9 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -314,7 +316,9 @@ class CONTENT_EXPORT WebContentsDelegate {
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,

View File

@ -1,76 +1,75 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index f081d46..eaedd72 100644
index f1a79c4..021a083 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -869,7 +869,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select)
{
notifyPopupOpeningObservers();
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *m_webView);
@@ -892,7 +892,7 @@ bool ChromeClientImpl::hasOpenedPopup() const {
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
notifyPopupOpeningObservers();
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *m_webView);
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index 5b4dacf..aec9256 100644
index 966246f..a528578 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -416,6 +416,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebPageVisibilityState visibilit
, m_enableFakePageScaleAnimationForTesting(false)
, m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false)
+ , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0)
@@ -4095,9 +4096,14 @@ void WebViewImpl::pageScaleFactorChanged()
m_client->pageScaleFactorChanged();
@@ -405,6 +405,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
m_enableFakePageScaleAnimationForTesting(false),
m_fakePageScaleAnimationPageScaleFactor(0),
m_fakePageScaleAnimationUseAnchor(false),
+ m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus),
m_doingDragAndDrop(false),
m_ignoreInputEvents(false),
m_compositorDeviceScaleFactorOverride(0),
@@ -4249,8 +4250,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() {
m_devToolsEmulator->mainFrameScrollOrScaleChanged();
}
+void WebViewImpl::setUseExternalPopupMenusThisInstance(bool useExternalPopupMenus)
+{
+ m_shouldUseExternalPopupMenus = useExternalPopupMenus;
+void WebViewImpl::setUseExternalPopupMenusThisInstance(
+ bool useExternalPopupMenus) {
+ m_shouldUseExternalPopupMenus = useExternalPopupMenus;
+}
+
bool WebViewImpl::useExternalPopupMenus()
{
- return shouldUseExternalPopupMenus;
+ return m_shouldUseExternalPopupMenus;
bool WebViewImpl::useExternalPopupMenus() {
- return shouldUseExternalPopupMenus;
+ return m_shouldUseExternalPopupMenus;
}
void WebViewImpl::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index a69995d..de1bec7 100644
index 8e74ed5..6a37808 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -384,7 +384,8 @@ public:
@@ -380,7 +380,8 @@ class WEB_EXPORT WebViewImpl final
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool useExternalPopupMenus();
+ void setUseExternalPopupMenusThisInstance(bool);
+ bool useExternalPopupMenus();
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool useExternalPopupMenus();
+ void setUseExternalPopupMenusThisInstance(bool);
+ bool useExternalPopupMenus();
bool shouldAutoResize() const
{
@@ -679,6 +680,8 @@ private:
float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor;
bool shouldAutoResize() const { return m_shouldAutoResize; }
+ bool m_shouldUseExternalPopupMenus;
@@ -685,6 +686,8 @@ class WEB_EXPORT WebViewImpl final
float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor;
+ bool m_shouldUseExternalPopupMenus;
+
bool m_doingDragAndDrop;
bool m_doingDragAndDrop;
bool m_ignoreInputEvents;
bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h
index 89a9582..2ba00bd 100644
index fde211e..fea968a 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -438,6 +438,7 @@ public:
@@ -443,6 +443,7 @@ class WebView : protected WebWidget {
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Hides any popup (suggestions, selects...) that might be showing.
virtual void hidePopups() = 0;
// Hides any popup (suggestions, selects...) that might be showing.
virtual void hidePopups() = 0;

View File

@ -0,0 +1,239 @@
diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd
index dbd83a1..acf844e 100644
--- chrome/app/generated_resources.grd
+++ chrome/app/generated_resources.grd
@@ -7082,7 +7082,7 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
</if>
<message name="IDS_PLUGIN_BLOCKED_BY_POLICY" desc="The placeholder text for a plugin blocked by enterprise policy.">
- <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> is blocked by enterprise policy
+ <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> is not allowed
</message>
<if expr="chromeos">
<message name="IDS_NACL_PLUGIN_BLOCKED" desc="The placeholder text for a blocked plugin.">
diff --git components/plugins/renderer/loadable_plugin_placeholder.cc components/plugins/renderer/loadable_plugin_placeholder.cc
index 9bc0478..d0263d3 100644
--- components/plugins/renderer/loadable_plugin_placeholder.cc
+++ components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -127,11 +127,10 @@ void LoadablePluginPlaceholder::ReplacePlugin(blink::WebPlugin* new_plugin) {
// this point.
new_plugin = container->plugin();
+ plugin()->RestoreTitleText();
container->invalidate();
container->reportGeometry();
- if (plugin()->focused())
- new_plugin->updateFocus(true, blink::WebFocusTypeNone);
- container->element().setAttribute("title", plugin()->old_title());
+ plugin()->ReplayReceivedData(new_plugin);
plugin()->destroy();
}
diff --git components/plugins/renderer/webview_plugin.cc components/plugins/renderer/webview_plugin.cc
index af1d919..0429d59 100644
--- components/plugins/renderer/webview_plugin.cc
+++ components/plugins/renderer/webview_plugin.cc
@@ -17,7 +17,9 @@
#include "content/public/renderer/render_view.h"
#include "gin/converter.h"
#include "skia/ext/platform_canvas.h"
+#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/WebKit/public/platform/WebURL.h"
+#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
@@ -40,8 +42,10 @@ using blink::WebPlugin;
using blink::WebPluginContainer;
using blink::WebPoint;
using blink::WebRect;
+using blink::WebSize;
using blink::WebString;
using blink::WebURLError;
+using blink::WebURLRequest;
using blink::WebURLResponse;
using blink::WebVector;
using blink::WebView;
@@ -54,16 +58,16 @@ WebViewPlugin::WebViewPlugin(content::RenderView* render_view,
delegate_(delegate),
container_(nullptr),
web_view_(WebView::create(this, blink::WebPageVisibilityStateVisible)),
+ finished_loading_(false),
focused_(false),
is_painting_(false),
is_resizing_(false),
- web_frame_client_(this),
weak_factory_(this) {
// ApplyWebPreferences before making a WebLocalFrame so that the frame sees a
// consistent view of our preferences.
content::RenderView::ApplyWebPreferences(preferences, web_view_);
- WebLocalFrame* web_frame = WebLocalFrame::create(
- blink::WebTreeScopeType::Document, &web_frame_client_);
+ WebLocalFrame* web_frame =
+ WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
web_view_->setMainFrame(web_frame);
// TODO(dcheng): The main frame widget currently has a special case.
// Eliminate this once WebView is no longer a WebWidget.
@@ -87,6 +91,42 @@ WebViewPlugin::~WebViewPlugin() {
web_view_->close();
}
+void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) {
+ const WebURLResponse& response =
+ web_view_->mainFrame()->dataSource()->response();
+ if (!response.isNull()) {
+ plugin->didReceiveResponse(response);
+ size_t total_bytes = 0;
+ for (std::list<std::string>::iterator it = data_.begin(); it != data_.end();
+ ++it) {
+ plugin->didReceiveData(
+ it->c_str(), base::checked_cast<int, size_t>(it->length()));
+ total_bytes += it->length();
+ }
+ UMA_HISTOGRAM_MEMORY_KB(
+ "PluginDocument.Memory",
+ (base::checked_cast<int, size_t>(total_bytes / 1024)));
+ UMA_HISTOGRAM_COUNTS(
+ "PluginDocument.NumChunks",
+ (base::checked_cast<int, size_t>(data_.size())));
+ }
+ // We need to transfer the |focused_| to new plugin after it loaded.
+ if (focused_) {
+ plugin->updateFocus(true, blink::WebFocusTypeNone);
+ }
+ if (finished_loading_) {
+ plugin->didFinishLoading();
+ }
+ if (error_) {
+ plugin->didFailLoading(*error_);
+ }
+}
+
+void WebViewPlugin::RestoreTitleText() {
+ if (container_)
+ container_->element().setAttribute("title", old_title_);
+}
+
WebPluginContainer* WebViewPlugin::container() const { return container_; }
bool WebViewPlugin::initialize(WebPluginContainer* container) {
@@ -215,20 +255,18 @@ blink::WebInputEventResult WebViewPlugin::handleInputEvent(
return handled;
}
-void WebViewPlugin::didReceiveResponse(const WebURLResponse& response) {
- NOTREACHED();
-}
-
void WebViewPlugin::didReceiveData(const char* data, int data_length) {
- NOTREACHED();
+ data_.push_back(std::string(data, data_length));
}
void WebViewPlugin::didFinishLoading() {
- NOTREACHED();
+ DCHECK(!finished_loading_);
+ finished_loading_ = true;
}
void WebViewPlugin::didFailLoading(const WebURLError& error) {
- NOTREACHED();
+ DCHECK(!error_.get());
+ error_.reset(new WebURLError(error));
}
bool WebViewPlugin::acceptsLoadDrops() { return false; }
@@ -277,9 +315,8 @@ void WebViewPlugin::scheduleAnimation() {
}
}
-void WebViewPlugin::PluginWebFrameClient::didClearWindowObject(
- WebLocalFrame* frame) {
- if (!plugin_->delegate_)
+void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) {
+ if (!delegate_)
return;
v8::Isolate* isolate = blink::mainThreadIsolate();
@@ -291,7 +328,7 @@ void WebViewPlugin::PluginWebFrameClient::didClearWindowObject(
v8::Local<v8::Object> global = context->Global();
global->Set(gin::StringToV8(isolate, "plugin"),
- plugin_->delegate_->GetV8Handle(isolate));
+ delegate_->GetV8Handle(isolate));
}
void WebViewPlugin::OnDestruct() {}
diff --git components/plugins/renderer/webview_plugin.h components/plugins/renderer/webview_plugin.h
index 086fa6d..6f69dec 100644
--- components/plugins/renderer/webview_plugin.h
+++ components/plugins/renderer/webview_plugin.h
@@ -42,6 +42,7 @@ class Size;
class WebViewPlugin : public blink::WebPlugin,
public blink::WebViewClient,
+ public blink::WebFrameClient,
public content::RenderViewObserver {
public:
class Delegate {
@@ -74,8 +75,12 @@ class WebViewPlugin : public blink::WebPlugin,
blink::WebView* web_view() { return web_view_; }
- bool focused() const { return focused_; }
- const blink::WebString& old_title() const { return old_title_; }
+ // When loading a plugin document (i.e. a full page plugin not embedded in
+ // another page), we save all data that has been received, and replay it with
+ // this method on the actual plugin.
+ void ReplayReceivedData(blink::WebPlugin* plugin);
+
+ void RestoreTitleText();
// WebPlugin methods:
blink::WebPluginContainer* container() const override;
@@ -103,7 +108,7 @@ class WebViewPlugin : public blink::WebPlugin,
const blink::WebInputEvent& event,
blink::WebCursorInfo& cursor_info) override;
- void didReceiveResponse(const blink::WebURLResponse& response) override;
+ void didReceiveResponse(const blink::WebURLResponse& response) override {}
void didReceiveData(const char* data, int data_length) override;
void didFinishLoading() override;
void didFailLoading(const blink::WebURLError& error) override;
@@ -129,6 +134,9 @@ class WebViewPlugin : public blink::WebPlugin,
void didChangeCursor(const blink::WebCursorInfo& cursor) override;
void scheduleAnimation() override;
+ // WebFrameClient methods:
+ void didClearWindowObject(blink::WebLocalFrame* frame) override;
+
private:
friend class base::DeleteHelper<WebViewPlugin>;
WebViewPlugin(content::RenderView* render_view,
@@ -156,23 +164,14 @@ class WebViewPlugin : public blink::WebPlugin,
gfx::Rect rect_;
+ std::list<std::string> data_;
+ std::unique_ptr<blink::WebURLError> error_;
blink::WebString old_title_;
+ bool finished_loading_;
bool focused_;
bool is_painting_;
bool is_resizing_;
- // A helper needed to create a WebLocalFrame.
- class PluginWebFrameClient : public blink::WebFrameClient {
- public:
- PluginWebFrameClient(WebViewPlugin* plugin) : plugin_(plugin) {}
- ~PluginWebFrameClient() override {}
- void didClearWindowObject(blink::WebLocalFrame* frame) override;
-
- private:
- WebViewPlugin* plugin_;
- };
- PluginWebFrameClient web_frame_client_;
-
// Should be invalidated when destroy() is called.
base::WeakPtrFactory<WebViewPlugin> weak_factory_;
};

View File

@ -457,7 +457,7 @@ void TestChangeDirectory(CefRefPtr<CefCookieManager> manager,
DeleteAllCookies(manager, event);
// Set the new temporary directory as the storage location.
EXPECT_TRUE(manager->SetStoragePath(temp_dir.path().value(), false, NULL));
EXPECT_TRUE(manager->SetStoragePath(temp_dir.GetPath().value(), false, NULL));
// Wait for the storage location change to complete on the IO thread.
WaitForIOThread();
@ -481,7 +481,7 @@ void TestChangeDirectory(CefRefPtr<CefCookieManager> manager,
VerifyNoCookies(manager, event, true);
// Set the new temporary directory as the storage location.
EXPECT_TRUE(manager->SetStoragePath(temp_dir.path().value(), false, NULL));
EXPECT_TRUE(manager->SetStoragePath(temp_dir.GetPath().value(), false, NULL));
// Wait for the storage location change to complete on the IO thread.
WaitForIOThread();
@ -539,7 +539,7 @@ TEST(CookieTest, DomainCookieOnDisk) {
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -593,7 +593,7 @@ TEST(CookieTest, HostCookieOnDisk) {
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -647,7 +647,7 @@ TEST(CookieTest, MultipleCookiesOnDisk) {
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -698,7 +698,7 @@ TEST(CookieTest, AllCookiesOnDisk) {
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -752,7 +752,7 @@ TEST(CookieTest, SessionCookieNoPersist) {
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -768,7 +768,7 @@ TEST(CookieTest, SessionCookieNoPersist) {
event.Wait();
// Create a new manager to read the same cookie store.
manager = CefCookieManager::CreateManager(temp_dir.path().value(), false,
manager = CefCookieManager::CreateManager(temp_dir.GetPath().value(), false,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -788,7 +788,7 @@ TEST(CookieTest, SessionCookieWillPersist) {
EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), true,
CefCookieManager::CreateManager(temp_dir.GetPath().value(), true,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());
@ -804,7 +804,7 @@ TEST(CookieTest, SessionCookieWillPersist) {
event.Wait();
// Create a new manager to read the same cookie store.
manager = CefCookieManager::CreateManager(temp_dir.path().value(), true,
manager = CefCookieManager::CreateManager(temp_dir.GetPath().value(), true,
new TestCompletionCallback(&event));
event.Wait();
EXPECT_TRUE(manager.get());

View File

@ -158,7 +158,7 @@ class DownloadTestHandler : public TestHandler {
// Create a new temporary directory.
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
test_path_ = temp_dir_.path().AppendASCII(kTestFileName);
test_path_ = temp_dir_.GetPath().AppendASCII(kTestFileName);
if (test_mode_ == NAVIGATED) {
// Add the resource that we'll navigate to.

View File

@ -176,7 +176,7 @@ TEST(RequestContextTest, CreateContextSharedOnDisk) {
EXPECT_TRUE(tempdir.CreateUniqueTempDir());
CefRequestContextSettings settings;
CefString(&settings.cache_path) = tempdir.path().value();
CefString(&settings.cache_path) = tempdir.GetPath().value();
CefRefPtr<CefRequestContext> context1 =
CefRequestContext::CreateContext(settings, NULL);

View File

@ -693,7 +693,7 @@ TEST(ResourceManagerTest, DirectoryProvider) {
EXPECT_TRUE(scoped_dir.CreateUniqueTempDir());
// Write the files to disk.
const base::FilePath& temp_dir = scoped_dir.path();
const base::FilePath& temp_dir = scoped_dir.GetPath();
WriteFile(temp_dir.AppendASCII(kFile1), CreateContents(success1_message));
WriteFile(temp_dir.AppendASCII(kFile2), CreateContents(success2_message));
@ -750,7 +750,7 @@ TEST(ResourceManagerTest, ArchiveProvider) {
base::ScopedTempDir scoped_dir;
EXPECT_TRUE(scoped_dir.CreateUniqueTempDir());
const base::FilePath& temp_dir = scoped_dir.path();
const base::FilePath& temp_dir = scoped_dir.GetPath();
// Write the files to disk.
const base::FilePath& file_dir = temp_dir.AppendASCII("files");

View File

@ -716,7 +716,7 @@ class RequestTestRunner : public base::RefCountedThreadSafe<RequestTestRunner> {
EXPECT_TRUE(post_file_tmpdir_.CreateUniqueTempDir());
const base::FilePath& path =
post_file_tmpdir_.path().Append(FILE_PATH_LITERAL("example.txt"));
post_file_tmpdir_.GetPath().Append(FILE_PATH_LITERAL("example.txt"));
const char content[] = "HELLO FRIEND!";
int write_ct = base::WriteFile(path, content, sizeof(content) - 1);
EXPECT_EQ(static_cast<int>(sizeof(content) - 1), write_ct);
@ -1009,7 +1009,7 @@ class RequestTestHandler : public TestHandler,
if (context_mode_ == CONTEXT_ONDISK) {
EXPECT_TRUE(context_tmpdir_.CreateUniqueTempDir());
CefString(&settings.cache_path) = context_tmpdir_.path().value();
CefString(&settings.cache_path) = context_tmpdir_.GetPath().value();
}
// Create a new temporary request context.