| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 Copyright (C) 2000 Daniel Molkentin (molkentin@kde.org) | 3 Copyright (C) 2000 Daniel Molkentin (molkentin@kde.org) |
| 4 Copyright (C) 2000 Stefan Schimanski (schimmi@kde.org) | 4 Copyright (C) 2000 Stefan Schimanski (schimmi@kde.org) |
| 5 Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All Rights Reserved. | 5 Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All Rights Reserved. |
| 6 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| 11 version 2 of the License, or (at your option) any later version. | 11 version 2 of the License, or (at your option) any later version. |
| 12 | 12 |
| 13 This library is distributed in the hope that it will be useful, | 13 This library is distributed in the hope that it will be useful, |
| 14 but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 Library General Public License for more details. | 16 Library General Public License for more details. |
| 17 | 17 |
| 18 You should have received a copy of the GNU Library General Public License | 18 You should have received a copy of the GNU Library General Public License |
| 19 along with this library; see the file COPYING.LIB. If not, write to | 19 along with this library; see the file COPYING.LIB. If not, write to |
| 20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 Boston, MA 02110-1301, USA. | 21 Boston, MA 02110-1301, USA. |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include "platform/plugins/PluginData.h" | 24 #include "platform/plugins/PluginData.h" |
| 25 | 25 |
| 26 #include "platform/plugins/PluginListBuilder.h" | 26 #include "platform/plugins/PluginListBuilder.h" |
| 27 #include "public/platform/Platform.h" | 27 #include "public/platform/Platform.h" |
| 28 #include "wtf/CurrentTime.h" |
| 28 | 29 |
| 29 namespace blink { | 30 namespace blink { |
| 30 | 31 |
| 31 class PluginCache { | 32 class PluginCache { |
| 32 public: | 33 public: |
| 33 PluginCache() : m_loaded(false), m_refresh(false) { } | 34 PluginCache() : m_loaded(false), m_refresh(false) { } |
| 34 ~PluginCache() { reset(false); } | 35 ~PluginCache() { reset(false); } |
| 35 | 36 |
| 36 void reset(bool refresh) | 37 void reset(bool refresh) |
| 37 { | 38 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 bool m_refresh; | 58 bool m_refresh; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 static PluginCache& pluginCache() | 61 static PluginCache& pluginCache() |
| 61 { | 62 { |
| 62 DEFINE_STATIC_LOCAL(PluginCache, cache, ()); | 63 DEFINE_STATIC_LOCAL(PluginCache, cache, ()); |
| 63 return cache; | 64 return cache; |
| 64 } | 65 } |
| 65 | 66 |
| 66 PluginData::PluginData(const Page* page) | 67 PluginData::PluginData(const Page* page) |
| 68 : m_modified(WTF::currentTime()) |
| 67 { | 69 { |
| 68 initPlugins(page); | 70 initPlugins(page); |
| 69 | 71 |
| 70 for (unsigned i = 0; i < m_plugins.size(); ++i) { | 72 for (unsigned i = 0; i < m_plugins.size(); ++i) { |
| 71 const PluginInfo& plugin = m_plugins[i]; | 73 const PluginInfo& plugin = m_plugins[i]; |
| 72 for (unsigned j = 0; j < plugin.mimes.size(); ++j) { | 74 for (unsigned j = 0; j < plugin.mimes.size(); ++j) { |
| 73 m_mimes.append(plugin.mimes[j]); | 75 m_mimes.append(plugin.mimes[j]); |
| 74 m_mimePluginIndices.append(i); | 76 m_mimePluginIndices.append(i); |
| 75 } | 77 } |
| 76 } | 78 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 m_plugins.append(plugins[i]); | 112 m_plugins.append(plugins[i]); |
| 111 } | 113 } |
| 112 | 114 |
| 113 void PluginData::refresh() | 115 void PluginData::refresh() |
| 114 { | 116 { |
| 115 pluginCache().reset(true); | 117 pluginCache().reset(true); |
| 116 pluginCache().plugins(); // Force the plugins to be reloaded now. | 118 pluginCache().plugins(); // Force the plugins to be reloaded now. |
| 117 } | 119 } |
| 118 | 120 |
| 119 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |