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

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: Rename url parameters to main_frame_origin 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..33473ea1f13a42710cbccdc68feb1f3c907226f6 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,15 @@ void Page::refreshPlugins()
}
}
-PluginData* Page::pluginData() const
+PluginData* Page::pluginData()
{
- if (!m_pluginData)
- m_pluginData = PluginData::create(this);
+ SecurityContext* context = mainFrame()->securityContext();
+ RefPtr<SecurityOrigin> origin = context ? context->getSecurityOrigin() : SecurityOrigin::createUnique().get();
tommycli 2016/08/01 23:44:09 Add comment that context can be null in tests?
trizzofo 2016/08/02 02:36:11 Done.
+ WebSecurityOrigin webOrigin(origin.get());
+
+ if (!m_pluginData || !origin->isSameSchemeHostPort(m_origin.get()))
+ m_pluginData = PluginData::create(&webOrigin);
+ m_origin = origin;
tommycli 2016/08/01 23:44:09 Can we move this inside the conditional also? I th
trizzofo 2016/08/02 02:36:11 I thought about updating it every time because, ev
return m_pluginData.get();
}

Powered by Google App Engine
This is Rietveld 408576698