Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: webkit/glue/plugins/plugin_lib_mac.mm

Issue 115896: Making the browser tests work on Unix (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/chrome.gyp ('K') | « webkit/glue/plugins/plugin_lib.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_lib_mac.mm
===================================================================
--- webkit/glue/plugins/plugin_lib_mac.mm (revision 17736)
+++ webkit/glue/plugins/plugin_lib_mac.mm (working copy)
@@ -8,7 +8,9 @@
#include "webkit/glue/plugins/plugin_lib.h"
+#include "base/native_library.h"
#include "base/scoped_cftyperef.h"
+#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "webkit/glue/plugins/plugin_list.h"
@@ -296,7 +298,14 @@
//
// Strictly speaking, only STR# 128 is required.
- scoped_cftyperef<CFBundleRef> bundle(base::LoadNativeLibrary(filename));
+ // 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->type != base::BUNDLE)
+ return false;
+ scoped_cftyperef<CFBundleRef> bundle(native_library->bundle);
if (!bundle)
return false;
« chrome/chrome.gyp ('K') | « webkit/glue/plugins/plugin_lib.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698