Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2156803002: [HBD] Remove PluginCache and reload plugin list when origin changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address issues pointed in comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/Page.cpp
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
index 4e2a89a2e20ff22690e5f00de814170cd6d4b0ce..1c8c14d37ed2f7e1892780116973c94d7c5c4530 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -54,6 +54,7 @@
#include "platform/plugins/PluginData.h"
#include "platform/text/CompressibleString.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebSecurityOrigin.h"
namespace blink {
@@ -243,10 +244,17 @@ void Page::refreshPlugins()
}
}
-PluginData* Page::pluginData() const
+PluginData* Page::pluginData()
{
- if (!m_pluginData)
- m_pluginData = PluginData::create(this);
+ SecurityContext* context = mainFrame()->securityContext();
+ // Frame::securityContext() may return null in tests. For that reason,
+ // whenever it's null, an unique SecurityOrigin is created instead.
alexmos 2016/08/02 22:06:28 Just curious: for HBD, what set of plugins would b
trizzofo 2016/08/03 00:08:37 We want the default settings whenever the origin i
+ RefPtr<SecurityOrigin> origin = context ? context->getSecurityOrigin() : SecurityOrigin::createUnique().get();
+ WebSecurityOrigin webOrigin(origin.get());
+
+ if (!m_pluginData || !origin->isSameSchemeHostPort(m_origin.get()))
+ m_pluginData = PluginData::create(&webOrigin);
+ m_origin = origin;
return m_pluginData.get();
}

Powered by Google App Engine
This is Rietveld 408576698