Title: [143124] trunk/Source
Revision
143124
Author
[email protected]
Date
2013-02-16 22:01:39 -0800 (Sat, 16 Feb 2013)

Log Message

Source/WebCore: Remove multi-threading gunk from WebKit2's PluginInfoStore.
<http://webkit.org/b/110046>

Reviewed by Alexey Proskuryakov.

Remove now-unused code for making deep (isolated) copies of WebCore plugin structures.

* plugins/PluginData.h:
(MimeClassInfo):
(PluginInfo):

Source/WebKit2: Remove multi-threading gunk from PluginInfoStore.
<http://webkit.org/b/110046>

Reviewed by Alexey Proskuryakov.

PluginInfoStore is never accessed from multiple threads anymore, so remove the Mutex locking
and stop making isolated copies of everything.

* Shared/Plugins/PluginModuleInfo.h:
(PluginModuleInfo):
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::loadPluginsIfNecessary):
(WebKit::PluginInfoStore::plugins):
(WebKit::PluginInfoStore::findPluginForMIMEType):
(WebKit::PluginInfoStore::findPluginForExtension):
(WebKit::PluginInfoStore::findPlugin):
(WebKit::PluginInfoStore::infoForPluginWithPath):
* UIProcess/Plugins/PluginInfoStore.h:
(PluginInfoStore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143123 => 143124)


--- trunk/Source/WebCore/ChangeLog	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebCore/ChangeLog	2013-02-17 06:01:39 UTC (rev 143124)
@@ -1,3 +1,16 @@
+2013-02-16  Andreas Kling  <[email protected]>
+
+        Remove multi-threading gunk from WebKit2's PluginInfoStore.
+        <http://webkit.org/b/110046>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove now-unused code for making deep (isolated) copies of WebCore plugin structures.
+
+        * plugins/PluginData.h:
+        (MimeClassInfo):
+        (PluginInfo):
+
 2013-02-16  Alexey Proskuryakov  <[email protected]>
 
         Identifier generated twice in FrameLoader::loadResourceSynchronously()

Modified: trunk/Source/WebCore/plugins/PluginData.h (143123 => 143124)


--- trunk/Source/WebCore/plugins/PluginData.h	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebCore/plugins/PluginData.h	2013-02-17 06:01:39 UTC (rev 143124)
@@ -33,16 +33,6 @@
     String type;
     String desc;
     Vector<String> extensions;
-
-    MimeClassInfo isolatedCopy() const
-    {
-        MimeClassInfo clone;
-        clone.type = type.isolatedCopy();
-        clone.desc = desc.isolatedCopy();
-        for (unsigned i = 0; i < extensions.size(); ++i)
-            clone.extensions.append(extensions[i].isolatedCopy());
-        return clone;
-    }
 };
 
 inline bool operator==(const MimeClassInfo& a, const MimeClassInfo& b)
@@ -55,17 +45,6 @@
     String file;
     String desc;
     Vector<MimeClassInfo> mimes;
-
-    PluginInfo isolatedCopy() const
-    {
-        PluginInfo clone;
-        clone.name = name.isolatedCopy();
-        clone.file = file.isolatedCopy();
-        clone.desc = desc.isolatedCopy();
-        for (unsigned i = 0; i < mimes.size(); ++i)
-            clone.mimes.append(mimes[i].isolatedCopy());
-        return clone;
-    }
 };
 
 // FIXME: merge with PluginDatabase in the future

Modified: trunk/Source/WebKit2/ChangeLog (143123 => 143124)


--- trunk/Source/WebKit2/ChangeLog	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-17 06:01:39 UTC (rev 143124)
@@ -1,3 +1,25 @@
+2013-02-16  Andreas Kling  <[email protected]>
+
+        Remove multi-threading gunk from PluginInfoStore.
+        <http://webkit.org/b/110046>
+
+        Reviewed by Alexey Proskuryakov.
+
+        PluginInfoStore is never accessed from multiple threads anymore, so remove the Mutex locking
+        and stop making isolated copies of everything.
+
+        * Shared/Plugins/PluginModuleInfo.h:
+        (PluginModuleInfo):
+        * UIProcess/Plugins/PluginInfoStore.cpp:
+        (WebKit::PluginInfoStore::loadPluginsIfNecessary):
+        (WebKit::PluginInfoStore::plugins):
+        (WebKit::PluginInfoStore::findPluginForMIMEType):
+        (WebKit::PluginInfoStore::findPluginForExtension):
+        (WebKit::PluginInfoStore::findPlugin):
+        (WebKit::PluginInfoStore::infoForPluginWithPath):
+        * UIProcess/Plugins/PluginInfoStore.h:
+        (PluginInfoStore):
+
 2013-02-16  Sam Weinig  <[email protected]>
 
         Fix non-production builds.

Modified: trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h (143123 => 143124)


--- trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebKit2/Shared/Plugins/PluginModuleInfo.h	2013-02-17 06:01:39 UTC (rev 143124)
@@ -55,19 +55,6 @@
     String bundleIdentifier;
     String versionString;
 #endif
-
-    PluginModuleInfo isolatedCopy() const
-    {
-        PluginModuleInfo clone;
-        clone.path = path.isolatedCopy();
-        clone.info = info.isolatedCopy();
-#if PLATFORM(MAC)
-        clone.pluginArchitecture = pluginArchitecture;
-        clone.bundleIdentifier = bundleIdentifier.isolatedCopy();
-        clone.versionString = versionString.isolatedCopy();
-#endif
-        return clone;
-    }
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp (143123 => 143124)


--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp	2013-02-17 06:01:39 UTC (rev 143124)
@@ -71,16 +71,6 @@
 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)
@@ -100,14 +90,10 @@
     // Then load plug-ins that are not in the standard plug-ins directories.
     addFromVector(uniquePluginPaths, individualPluginPaths());
 
-    Vector<PluginModuleInfo> plugins;
-
     PathHashSet::const_iterator end = uniquePluginPaths.end();
     for (PathHashSet::const_iterator it = uniquePluginPaths.begin(); it != end; ++it)
-        loadPlugin(plugins, *it);
+        loadPlugin(m_plugins, *it);
 
-    m_plugins = deepIsolatedCopyPluginInfoVector(plugins);
-
     m_pluginListIsUpToDate = true;
 }
 
@@ -126,15 +112,12 @@
 
 Vector<PluginModuleInfo> PluginInfoStore::plugins()
 {
-    MutexLocker locker(m_pluginsLock);
     loadPluginsIfNecessary();
-    return deepIsolatedCopyPluginInfoVector(m_plugins);
+    return m_plugins;
 }
 
 PluginModuleInfo PluginInfoStore::findPluginForMIMEType(const String& mimeType) const
 {
-    MutexLocker locker(m_pluginsLock);
-
     ASSERT(!mimeType.isNull());
     
     for (size_t i = 0; i < m_plugins.size(); ++i) {
@@ -152,8 +135,6 @@
 
 PluginModuleInfo PluginInfoStore::findPluginForExtension(const String& extension, String& mimeType) const
 {
-    MutexLocker locker(m_pluginsLock);
-
     ASSERT(!extension.isNull());
     
     for (size_t i = 0; i < m_plugins.size(); ++i) {
@@ -207,10 +188,7 @@
 
 PluginModuleInfo PluginInfoStore::findPlugin(String& mimeType, const KURL& url)
 {
-    {
-        MutexLocker locker(m_pluginsLock);
-        loadPluginsIfNecessary();
-    }
+    loadPluginsIfNecessary();
     
     // First, check if we can get the plug-in based on its MIME type.
     if (!mimeType.isNull()) {
@@ -242,8 +220,6 @@
 
 PluginModuleInfo PluginInfoStore::infoForPluginWithPath(const String& pluginPath) const
 {
-    MutexLocker locker(m_pluginsLock);
-
     for (size_t i = 0; i < m_plugins.size(); ++i) {
         if (m_plugins[i].path == pluginPath)
             return m_plugins[i];

Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h (143123 => 143124)


--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h	2013-02-17 05:42:45 UTC (rev 143123)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h	2013-02-17 06:01:39 UTC (rev 143124)
@@ -29,7 +29,6 @@
 #if ENABLE(NETSCAPE_PLUGIN_API)
 
 #include "PluginModuleInfo.h"
-#include <wtf/ThreadingPrimitives.h>
 
 namespace WebCore {
     class KURL;
@@ -89,8 +88,6 @@
     Vector<String> m_additionalPluginsDirectories;
     Vector<PluginModuleInfo> m_plugins;
     bool m_pluginListIsUpToDate;
-
-    mutable Mutex m_pluginsLock;
 };
     
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to