Changeset 31466 in webkit
- Timestamp:
- Mar 31, 2008 9:56:15 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31465 r31466 1 2008-03-29 Adam Roben <aroben@apple.com> 2 3 Fix Bug 18208: Acid3 test 65 takes >33ms due to plugin refreshing on 4 Windows 5 6 <http://bugs.webkit.org/show_bug.cgi?id=18208> 7 8 We now keep track of all the plugin paths found each time refresh() is 9 called. We'll only instantiate PluginPackages if there are new paths 10 or paths with changed timestamps since the last time refresh() was 11 called. 12 13 Reviewed by Darin Adler and Anders Carlsson. 14 15 * plugins/PluginDatabase.cpp: 16 (WebCore::PluginDatabase::refresh): 17 - Only instantiate PluginPackages if there is a new path or a path 18 with a changed timestamp since we last ran refresh(). 19 - Cache the set of plugin paths found and their timestamps for the 20 next call to refresh(). 21 - Only re-register MIME types if our set of plugins changed. 22 * plugins/PluginDatabase.h: Added a new member to cache plugin paths 23 and their timestamps. 24 1 25 2008-03-29 Adam Roben <aroben@apple.com> 2 26 -
trunk/WebCore/plugins/PluginDatabase.cpp
r31465 r31466 69 69 70 70 if (!m_plugins.isEmpty()) { 71 m_registeredMIMETypes.clear();72 73 71 PluginSet pluginsToUnload; 74 72 getDeletedPlugins(pluginsToUnload); … … 84 82 HashSet<String> paths; 85 83 getPluginPathsInDirectories(paths); 84 85 HashMap<String, time_t> pathsWithTimes; 86 87 // We should only skip unchanged files if we didn't remove any plugins above. If we did remove 88 // any plugins, we need to look at every plugin file so that, e.g., if the user has two versions 89 // of RealPlayer installed and just removed the newer one, we'll pick up the older one. 90 bool shouldSkipUnchangedFiles = !pluginSetChanged; 86 91 87 92 HashSet<String>::const_iterator pathsEnd = paths.end(); … … 91 96 continue; 92 97 98 pathsWithTimes.add(*it, lastModified); 99 100 // If the path's timestamp hasn't changed since the last time we ran refresh(), we don't have to do anything. 101 if (shouldSkipUnchangedFiles && m_pluginPathsWithTimes.get(*it) == lastModified) 102 continue; 103 93 104 if (RefPtr<PluginPackage> oldPackage = m_pluginsByPath.get(*it)) { 94 if (oldPackage->lastModified() == lastModified) 95 continue; 105 ASSERT(!shouldSkipUnchangedFiles || oldPackage->lastModified() != lastModified); 96 106 remove(oldPackage.get()); 97 107 } … … 100 110 pluginSetChanged = true; 101 111 } 112 113 // Cache all the paths we found with their timestamps for next time. 114 pathsWithTimes.swap(m_pluginPathsWithTimes); 115 116 if (!pluginSetChanged) 117 return false; 118 119 m_registeredMIMETypes.clear(); 102 120 103 121 // Register plug-in MIME types … … 111 129 } 112 130 113 return pluginSetChanged;131 return true; 114 132 } 115 133 -
trunk/WebCore/plugins/PluginDatabase.h
r31465 r31466 77 77 PluginSet m_plugins; 78 78 HashMap<String, RefPtr<PluginPackage> > m_pluginsByPath; 79 HashMap<String, time_t> m_pluginPathsWithTimes; 79 80 }; 80 81
Note: See TracChangeset
for help on using the changeset viewer.