| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "webkit/glue/plugins/plugin_lib.h" | 7 #include "webkit/glue/plugins/plugin_lib.h" |
| 8 | 8 |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "base/scoped_cftyperef.h" | 10 #include "base/scoped_cftyperef.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // (1) <<plugindescription>> | 304 // (1) <<plugindescription>> |
| 305 // (2) <<pluginname>> | 305 // (2) <<pluginname>> |
| 306 // | 306 // |
| 307 // Strictly speaking, only STR# 128 is required. | 307 // Strictly speaking, only STR# 128 is required. |
| 308 | 308 |
| 309 // We are accessing the bundle contained in the NativeLibrary but not | 309 // We are accessing the bundle contained in the NativeLibrary but not |
| 310 // unloading it. We use a scoped_ptr to make sure the NativeLibraryStruct is | 310 // unloading it. We use a scoped_ptr to make sure the NativeLibraryStruct is |
| 311 // not leaked. | 311 // not leaked. |
| 312 scoped_ptr<base::NativeLibraryStruct> native_library( | 312 scoped_ptr<base::NativeLibraryStruct> native_library( |
| 313 base::LoadNativeLibrary(filename)); | 313 base::LoadNativeLibrary(filename)); |
| 314 if (native_library->type != base::BUNDLE) | 314 if (!native_library.get() || native_library->type != base::BUNDLE) |
| 315 return false; | 315 return false; |
| 316 scoped_cftyperef<CFBundleRef> bundle(native_library->bundle); | 316 scoped_cftyperef<CFBundleRef> bundle(native_library->bundle); |
| 317 if (!bundle) | 317 if (!bundle) |
| 318 return false; | 318 return false; |
| 319 | 319 |
| 320 // preflight | 320 // preflight |
| 321 | 321 |
| 322 OSType type = 0; | 322 OSType type = 0; |
| 323 CFBundleGetPackageInfo(bundle.get(), &type, NULL); | 323 CFBundleGetPackageInfo(bundle.get(), &type, NULL); |
| 324 if (type != FOUR_CHAR_CODE('BRPL')) | 324 if (type != FOUR_CHAR_CODE('BRPL')) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 336 | 336 |
| 337 if (ReadSTRPluginInfo(filename, bundle.get(), info)) | 337 if (ReadSTRPluginInfo(filename, bundle.get(), info)) |
| 338 return true; | 338 return true; |
| 339 | 339 |
| 340 // ... or not | 340 // ... or not |
| 341 | 341 |
| 342 return false; | 342 return false; |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace NPAPI | 345 } // namespace NPAPI |
| OLD | NEW |