summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 22:39:49 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 22:39:49 +0000
commit670f55f780252d9eae82b486b7b421a3cba18340 (patch)
tree7cd84fb904bfdd1e1feb14a8e4601134366ec7c5 /webkit
parentc749b06328198b1f87e3784fc14e41111a3f4116 (diff)
downloadchromium_src-670f55f780252d9eae82b486b7b421a3cba18340.zip
chromium_src-670f55f780252d9eae82b486b7b421a3cba18340.tar.gz
chromium_src-670f55f780252d9eae82b486b7b421a3cba18340.tar.bz2
Use CFBundle directly when reading Mac plugin information
Fixes a leak of bundle resources (and prevents us from loading them at all in the common case). BUG=34149 TEST=Visit about:plugins, then run lsof on the browser process; plugin .rsrc files should not show up in the list. Review URL: http://codereview.chromium.org/565017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_lib_mac.mm13
1 files changed, 6 insertions, 7 deletions
diff --git a/webkit/glue/plugins/plugin_lib_mac.mm b/webkit/glue/plugins/plugin_lib_mac.mm
index 9f4d1dd..b8ae784 100644
--- a/webkit/glue/plugins/plugin_lib_mac.mm
+++ b/webkit/glue/plugins/plugin_lib_mac.mm
@@ -306,14 +306,13 @@ bool PluginLib::ReadWebPluginInfo(const FilePath &filename,
//
// Strictly speaking, only STR# 128 is required.
- // We are accessing the bundle contained in the NativeLibrary but not
- // unloading it. We use a scoped_ptr to make sure the NativeLibraryStruct is
- // not leaked.
- scoped_ptr<base::NativeLibraryStruct> native_library(
- base::LoadNativeLibrary(filename));
- if (!native_library.get() || native_library->type != base::BUNDLE)
+ scoped_cftyperef<CFURLRef> bundle_url(CFURLCreateFromFileSystemRepresentation(
+ kCFAllocatorDefault, (const UInt8*)filename.value().c_str(),
+ filename.value().length(), true));
+ if (!bundle_url)
return false;
- scoped_cftyperef<CFBundleRef> bundle(native_library->bundle);
+ scoped_cftyperef<CFBundleRef> bundle(CFBundleCreate(kCFAllocatorDefault,
+ bundle_url.get()));
if (!bundle)
return false;