Update to Chromium revision 2b3ae3b8 (#394939)

This commit is contained in:
Marshall Greenblatt
2016-05-24 19:35:43 -04:00
parent 582ce074aa
commit ab2636b012
125 changed files with 619 additions and 626 deletions

View File

@ -59,7 +59,8 @@ CefPluginPlaceholder::CefPluginPlaceholder(
status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed),
title_(title),
has_host_(false),
context_menu_request_id_(0) {
context_menu_request_id_(0),
ignore_updates_(false) {
RenderThread::Get()->AddObserver(this);
}
@ -285,6 +286,31 @@ blink::WebPlugin* CefPluginPlaceholder::CreatePlugin() {
GetPluginParams(), std::move(throttler));
}
void CefPluginPlaceholder::OnLoadedRectUpdate(
const gfx::Rect& unobscured_rect,
content::RenderFrame::PeripheralContentStatus status) {
// If the placeholder is in the blocked state, do nothing.
if (ignore_updates_)
return;
// This should only be called once.
set_delayed(false);
// block tiny cross-origin - simply by not continuing the load chain.
if (status ==
content::RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_TINY) {
ignore_updates_ = true;
return;
}
// For essential content, powersaver can be turned off.
if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL)
set_power_saver_enabled(false);
AllowLoading();
LoadPlugin();
}
gin::ObjectTemplateBuilder CefPluginPlaceholder::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
gin::ObjectTemplateBuilder builder =

View File

@ -11,13 +11,13 @@
#include "chrome/renderer/plugins/power_saver_info.h"
#include "components/plugins/renderer/loadable_plugin_placeholder.h"
#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/render_process_observer.h"
#include "content/public/renderer/render_thread_observer.h"
enum class CefViewHostMsg_GetPluginInfo_Status;
class CefPluginPlaceholder final
: public plugins::LoadablePluginPlaceholder,
public content::RenderProcessObserver,
public content::RenderThreadObserver,
public content::ContextMenuClient,
public gin::Wrappable<CefPluginPlaceholder> {
public:
@ -50,8 +50,11 @@ class CefPluginPlaceholder final
const base::string16& title);
~CefPluginPlaceholder() override;
// content::LoadablePluginPlaceholder method
// content::LoadablePluginPlaceholder overrides:
blink::WebPlugin* CreatePlugin() override;
void OnLoadedRectUpdate(
const gfx::Rect& unobscured_rect,
content::RenderFrame::PeripheralContentStatus status) override;
// gin::Wrappable (via PluginPlaceholder) method
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
@ -64,7 +67,7 @@ class CefPluginPlaceholder final
v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) override;
void ShowContextMenu(const blink::WebMouseEvent&) override;
// content::RenderProcessObserver methods:
// content::RenderThreadObserver methods:
void PluginListChanged() override;
// content::ContextMenuClient methods:
@ -83,6 +86,8 @@ class CefPluginPlaceholder final
int context_menu_request_id_; // Nonzero when request pending.
base::string16 plugin_name_;
bool ignore_updates_;
DISALLOW_COPY_AND_ASSIGN(CefPluginPlaceholder);
};