 Chromium Code Reviews
 Chromium Code Reviews Issue 2156803002:
  [HBD] Remove PluginCache and reload plugin list when origin changes  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 2156803002:
  [HBD] Remove PluginCache and reload plugin list when origin changes  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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(); | 
| } |