<http://webkit.org/b/86648>
<rdar://problem/
11451178>
Reviewed by Darin Adler.
Source/WebCore:
* plugins/PluginData.h:
(WebCore::MimeClassInfo::isolatedCopy):
(WebCore::PluginInfo::isolatedCopy):
Source/WebKit2:
Deep copy the internal storage of PluginInfoStore after constructing it, as we can
be doing this from a secondary thread.
* Shared/Plugins/PluginModuleInfo.h:
(WebKit::PluginModuleInfo::isolatedCopy):
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::deepIsolatedCopyPluginInfoVector):
(WebKit::PluginInfoStore::loadPluginsIfNecessary):
(WebKit::PluginInfoStore::plugins):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117471
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-16 Andreas Kling <kling@webkit.org>
+
+ Make PluginInfoStore properly thread-safe.
+ <http://webkit.org/b/86648>
+ <rdar://problem/11451178>
+
+ Reviewed by Darin Adler.
+
+ * plugins/PluginData.h:
+ (WebCore::MimeClassInfo::isolatedCopy):
+ (WebCore::PluginInfo::isolatedCopy):
+
2012-05-17 Hironori Bono <hbono@chromium.org>
[Refactoring] Move platform-specific code in Editor::respondToChangedSelection to the WebKit layer
String desc;
Vector<String> extensions;
- MimeClassInfo isolatedCopy()
+ MimeClassInfo isolatedCopy() const
{
MimeClassInfo clone;
clone.type = type.isolatedCopy();
String desc;
Vector<MimeClassInfo> mimes;
- PluginInfo isolatedCopy()
+ PluginInfo isolatedCopy() const
{
PluginInfo clone;
clone.name = name.isolatedCopy();
+2012-05-16 Andreas Kling <kling@webkit.org>
+
+ Make PluginInfoStore properly thread-safe.
+ <http://webkit.org/b/86648>
+ <rdar://problem/11451178>
+
+ Reviewed by Darin Adler.
+
+ Deep copy the internal storage of PluginInfoStore after constructing it, as we can
+ be doing this from a secondary thread.
+
+ * Shared/Plugins/PluginModuleInfo.h:
+ (WebKit::PluginModuleInfo::isolatedCopy):
+ * UIProcess/Plugins/PluginInfoStore.cpp:
+ (WebKit::deepIsolatedCopyPluginInfoVector):
+ (WebKit::PluginInfoStore::loadPluginsIfNecessary):
+ (WebKit::PluginInfoStore::plugins):
+
2012-05-17 Hironori Bono <hbono@chromium.org>
[Refactoring] Move platform-specific code in Editor::respondToChangedSelection to the WebKit layer
uint64_t fileVersion;
#endif
- PluginModuleInfo isolatedCopy()
+ PluginModuleInfo isolatedCopy() const
{
PluginModuleInfo clone;
clone.path = path.isolatedCopy();
typedef ListHashSet<String, 32> PathHashSet;
#endif
+static inline Vector<PluginModuleInfo> deepIsolatedCopyPluginInfoVector(const Vector<PluginModuleInfo>& vector)
+{
+ // Let the copy begin!
+ Vector<PluginModuleInfo> copy;
+ copy.reserveCapacity(vector.size());
+ for (unsigned i = 0; i < vector.size(); ++i)
+ copy.append(vector[i].isolatedCopy());
+ return copy;
+}
+
void PluginInfoStore::loadPluginsIfNecessary()
{
if (m_pluginListIsUpToDate)
for (PathHashSet::const_iterator it = uniquePluginPaths.begin(); it != end; ++it)
loadPlugin(plugins, *it);
- m_plugins.swap(plugins);
+ m_plugins = deepIsolatedCopyPluginInfoVector(plugins);
+
m_pluginListIsUpToDate = true;
}
{
MutexLocker locker(m_pluginsLock);
loadPluginsIfNecessary();
-
- // Let the copy begin!
- Vector<PluginModuleInfo> infos;
- for (unsigned i = 0; i < m_plugins.size(); ++i)
- infos.append(m_plugins[i].isolatedCopy());
-
- return infos;
+ return deepIsolatedCopyPluginInfoVector(m_plugins);
}
PluginModuleInfo PluginInfoStore::findPluginForMIMEType(const String& mimeType) const