| Index: third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
| diff --git a/third_party/WebKit/Source/platform/plugins/PluginData.cpp b/third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
| index 8f676b81ed27498dfdd03b299479d57f2c4463a6..61823f3952c06752013712caf9fa9eaabccffcca 100644
|
| --- a/third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
| +++ b/third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
| @@ -24,48 +24,17 @@
|
| #include "platform/plugins/PluginData.h"
|
|
|
| #include "platform/plugins/PluginListBuilder.h"
|
| +#include "platform/weborigin/SecurityOrigin.h"
|
| #include "public/platform/Platform.h"
|
| +#include "public/platform/WebSecurityOrigin.h"
|
|
|
| namespace blink {
|
|
|
| -class PluginCache {
|
| -public:
|
| - PluginCache() : m_loaded(false), m_refresh(false) { }
|
| - ~PluginCache() { reset(false); }
|
| -
|
| - void reset(bool refresh)
|
| - {
|
| - m_plugins.clear();
|
| - m_loaded = false;
|
| - m_refresh = refresh;
|
| - }
|
| -
|
| - const Vector<PluginInfo>& plugins()
|
| - {
|
| - if (!m_loaded) {
|
| - PluginListBuilder builder(&m_plugins);
|
| - Platform::current()->getPluginList(m_refresh, &builder);
|
| - m_loaded = true;
|
| - m_refresh = false;
|
| - }
|
| - return m_plugins;
|
| - }
|
| -
|
| -private:
|
| - Vector<PluginInfo> m_plugins;
|
| - bool m_loaded;
|
| - bool m_refresh;
|
| -};
|
| -
|
| -static PluginCache& pluginCache()
|
| +PluginData::PluginData(SecurityOrigin* mainFrameOrigin)
|
| + : m_mainFrameOrigin(mainFrameOrigin)
|
| {
|
| - DEFINE_STATIC_LOCAL(PluginCache, cache, ());
|
| - return cache;
|
| -}
|
| -
|
| -PluginData::PluginData(const Page* page)
|
| -{
|
| - initPlugins(page);
|
| + PluginListBuilder builder(&m_plugins);
|
| + Platform::current()->getPluginList(false, WebSecurityOrigin(m_mainFrameOrigin), &builder);
|
|
|
| for (unsigned i = 0; i < m_plugins.size(); ++i) {
|
| const PluginInfo& plugin = m_plugins[i];
|
| @@ -103,17 +72,11 @@ String PluginData::pluginNameForMimeType(const String& mimeType) const
|
| return String();
|
| }
|
|
|
| -void PluginData::initPlugins(const Page*)
|
| -{
|
| - const Vector<PluginInfo>& plugins = pluginCache().plugins();
|
| - for (size_t i = 0; i < plugins.size(); ++i)
|
| - m_plugins.append(plugins[i]);
|
| -}
|
| -
|
| -void PluginData::refresh()
|
| +void PluginData::refreshBrowserSidePluginCache()
|
| {
|
| - pluginCache().reset(true);
|
| - pluginCache().plugins(); // Force the plugins to be reloaded now.
|
| + Vector<PluginInfo> plugins;
|
| + PluginListBuilder builder(&plugins);
|
| + Platform::current()->getPluginList(true, WebSecurityOrigin::createUnique(), &builder);
|
| }
|
|
|
| } // namespace blink
|
|
|