Changeset 61591 in webkit
- Timestamp:
- Jun 21, 2010 5:00:29 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r61589 r61591 1 2010-06-21 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Have PluginInfoStoreMac actually get plug-in info and populate the plug-in list 6 https://bugs.webkit.org/show_bug.cgi?id=40957 7 8 * UIProcess/Plugins/PluginInfoStore.cpp: 9 (WebKit::PluginInfoStore::loadPluginsIfNecessary): 10 (WebKit::PluginInfoStore::loadPluginsInDirectory): 11 (WebKit::PluginInfoStore::loadPlugin): 12 (WebKit::PluginInfoStore::getPlugins): 13 * UIProcess/Plugins/PluginInfoStore.h: 14 * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: Added. 15 (WebKit::PluginInfoStore::pluginDirectories): 16 (WebKit::PluginInfoStore::pluginPathsInDirectory): 17 (WebKit::getPluginArchitecture): 18 (WebKit::getPluginInfoFromPropertyLists): 19 (WebKit::PluginInfoStore::getPluginInfo): 20 (WebKit::PluginInfoStore::shouldUsePlugin): 21 * WebKit2.xcodeproj/project.pbxproj: 22 1 23 2010-06-21 Anders Carlsson <andersca@apple.com> 2 24 -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
r61587 r61591 48 48 } 49 49 50 void PluginInfoStore::loadPluginsIfNecessary() 51 { 52 if (m_pluginListIsUpToDate) 53 return; 54 55 m_plugins.clear(); 56 57 Vector<String> directories = pluginDirectories(); 58 for (size_t i = 0; i < directories.size(); ++i) 59 loadPluginsInDirectory(directories[i]); 60 61 m_pluginListIsUpToDate = true; 62 } 63 64 void PluginInfoStore::loadPluginsInDirectory(const String& directory) 65 { 66 Vector<String> pluginPaths = pluginPathsInDirectory(directory); 67 for (size_t i = 0; i < pluginPaths.size(); ++i) 68 loadPlugin(pluginPaths[i]); 69 } 70 71 void PluginInfoStore::loadPlugin(const String& pluginPath) 72 { 73 Plugin plugin; 74 75 if (!getPluginInfo(pluginPath, plugin)) 76 return; 77 78 if (!shouldUsePlugin(plugin, m_plugins)) 79 return; 80 81 // Add the plug-in. 82 m_plugins.append(plugin); 83 } 84 50 85 void PluginInfoStore::getPlugins(Vector<WebCore::PluginInfo>& plugins) 51 86 { 52 // FIXME: Implement. 87 loadPluginsIfNecessary(); 88 89 for (size_t i = 0; i < m_plugins.size(); ++i) 90 plugins.append(m_plugins[i].info); 53 91 } 54 92 -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.h
r61587 r61591 39 39 40 40 private: 41 PluginInfoStore(); 42 41 43 // Represents a single plug-in. 42 44 struct Plugin { … … 45 47 #if PLATFORM(MAC) 46 48 cpu_type_t pluginArchitecture; 49 unsigned versionNumber; 47 50 #endif 48 51 }; 52 53 void loadPluginsIfNecessary(); 54 void loadPluginsInDirectory(const WebCore::String& directory); 55 void loadPlugin(const WebCore::String& pluginPath); 49 56 50 PluginInfoStore(); 51 57 // Platform specific member functions. 58 static Vector<WebCore::String> pluginDirectories(); 59 static Vector<WebCore::String> pluginPathsInDirectory(const WebCore::String& directory); 60 static bool getPluginInfo(const WebCore::String& pluginPath, Plugin& plugin); 61 static bool shouldUsePlugin(const Plugin& plugin, const Vector<Plugin>& loadedPlugins); 62 52 63 Vector<Plugin> m_plugins; 53 64 bool m_pluginListIsUpToDate; -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r61589 r61591 40 40 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFCC1011D01F96008219D3 /* PluginInfoStore.h */; }; 41 41 1AEFCC1311D01F96008219D3 /* PluginInfoStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AEFCC1111D01F96008219D3 /* PluginInfoStore.cpp */; }; 42 1AEFCCBD11D02C5E008219D3 /* PluginInfoStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEFCCBC11D02C5E008219D3 /* PluginInfoStoreMac.mm */; }; 42 43 1AF3060A111B599E00F96436 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit2.framework */; }; 43 44 5DAD729C116FF86200EE5396 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; … … 258 259 1AEFCC1011D01F96008219D3 /* PluginInfoStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginInfoStore.h; sourceTree = "<group>"; }; 259 260 1AEFCC1111D01F96008219D3 /* PluginInfoStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginInfoStore.cpp; sourceTree = "<group>"; }; 261 1AEFCCBC11D02C5E008219D3 /* PluginInfoStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginInfoStoreMac.mm; sourceTree = "<group>"; }; 260 262 32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; }; 261 263 5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; }; … … 589 591 isa = PBXGroup; 590 592 children = ( 593 1AEFCCBC11D02C5E008219D3 /* PluginInfoStoreMac.mm */, 591 594 ); 592 595 path = mac; … … 1197 1200 1AEFCC1311D01F96008219D3 /* PluginInfoStore.cpp in Sources */, 1198 1201 BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */, 1202 1AEFCCBD11D02C5E008219D3 /* PluginInfoStoreMac.mm in Sources */, 1199 1203 ); 1200 1204 runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset
for help on using the changeset viewer.