From 670f55f780252d9eae82b486b7b421a3cba18340 Mon Sep 17 00:00:00 2001 From: "stuartmorgan@chromium.org" Date: Tue, 2 Feb 2010 22:39:49 +0000 Subject: 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 --- webkit/glue/plugins/plugin_lib_mac.mm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'webkit/glue') 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 native_library( - base::LoadNativeLibrary(filename)); - if (!native_library.get() || native_library->type != base::BUNDLE) + scoped_cftyperef bundle_url(CFURLCreateFromFileSystemRepresentation( + kCFAllocatorDefault, (const UInt8*)filename.value().c_str(), + filename.value().length(), true)); + if (!bundle_url) return false; - scoped_cftyperef bundle(native_library->bundle); + scoped_cftyperef bundle(CFBundleCreate(kCFAllocatorDefault, + bundle_url.get())); if (!bundle) return false; -- cgit v1.1