Changeset 64663 in webkit


Ignore:
Timestamp:
Aug 4, 2010 12:09:39 PM (14 years ago)
Author:
Adam Roben
Message:

Move bundle-loading code from NetscapePluginModule to a new Module class

This allows more NetscapePluginModule code to be cross-platform.

Fixes <http://webkit.org/b/43497> NetscapePluginModule::try/unload
should be cross-platform

Reviewed by Anders Carlsson.

  • Platform/Module.cpp: Added.

(WebKit::Module::Module): Store our path.
(WebKit::Module::~Module): Unload our native module.

  • Platform/Module.h: Added.

(WebKit::Module::leakBundle): Does what it says.
(WebKit::Module::functionPointer): Returns a pointer to the named
function, with the right type.

  • Platform/mac/ModuleMac.mm: Added.

(WebKit::Module::load): Code was moved here from
NetscapePluginModule::tryLoad.
(WebKit::Module::unload): Just clears our bundle.
(WebKit::Module::platformFunctionPointer): Code was moved here from
NetscapePluginModuleMac.cpp.

  • Platform/qt/ModuleQt.cpp: Added.

(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer):

  • Platform/win/ModuleWin.cpp: Added.

(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer):
Just stubbed out these functions.

  • WebKit2.xcodeproj/project.pbxproj: Added Module.
  • WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:

(WebKit::NetscapePluginModule::tryLoad):
(WebKit::NetscapePluginModule::unload):
Moved here from NetscapePluginModuleMac.cpp. Now uses the
cross-platform m_module member.

  • WebProcess/Plugins/Netscape/NetscapePluginModule.h: Replaced

m_bundle with m_module.

  • WebProcess/Plugins/Netscape/mac/NetscapePluginModuleMac.cpp: Removed.
  • win/WebKit2.vcproj: Added Module.
Location:
trunk/WebKit2
Files:
1 added
5 edited
3 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r64662 r64663  
     12010-08-04  Adam Roben  <aroben@apple.com>
     2
     3        Move bundle-loading code from NetscapePluginModule to a new Module
     4        class
     5
     6        This allows more NetscapePluginModule code to be cross-platform.
     7
     8        Fixes <http://webkit.org/b/43497> NetscapePluginModule::try/unload
     9        should be cross-platform
     10
     11        Reviewed by Anders Carlsson.
     12
     13        * Platform/Module.cpp: Added.
     14        (WebKit::Module::Module): Store our path.
     15        (WebKit::Module::~Module): Unload our native module.
     16
     17        * Platform/Module.h: Added.
     18        (WebKit::Module::leakBundle): Does what it says.
     19        (WebKit::Module::functionPointer): Returns a pointer to the named
     20        function, with the right type.
     21
     22        * Platform/mac/ModuleMac.mm: Added.
     23        (WebKit::Module::load): Code was moved here from
     24        NetscapePluginModule::tryLoad.
     25        (WebKit::Module::unload): Just clears our bundle.
     26        (WebKit::Module::platformFunctionPointer): Code was moved here from
     27        NetscapePluginModuleMac.cpp.
     28
     29        * Platform/qt/ModuleQt.cpp: Added.
     30        (WebKit::Module::load):
     31        (WebKit::Module::unload):
     32        (WebKit::Module::platformFunctionPointer):
     33        * Platform/win/ModuleWin.cpp: Added.
     34        (WebKit::Module::load):
     35        (WebKit::Module::unload):
     36        (WebKit::Module::platformFunctionPointer):
     37        Just stubbed out these functions.
     38
     39        * WebKit2.xcodeproj/project.pbxproj: Added Module.
     40
     41        * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
     42        (WebKit::NetscapePluginModule::tryLoad):
     43        (WebKit::NetscapePluginModule::unload):
     44        Moved here from NetscapePluginModuleMac.cpp. Now uses the
     45        cross-platform m_module member.
     46
     47        * WebProcess/Plugins/Netscape/NetscapePluginModule.h: Replaced
     48        m_bundle with m_module.
     49
     50        * WebProcess/Plugins/Netscape/mac/NetscapePluginModuleMac.cpp: Removed.
     51
     52        * win/WebKit2.vcproj: Added Module.
     53
    1542010-08-04  Brady Eidson  <beidson@apple.com>
    255
  • trunk/WebKit2/Platform/Module.h

    r64662 r64663  
    2424 */
    2525
    26 #ifndef NetscapePluginModule_h
    27 #define NetscapePluginModule_h
     26#ifndef Module_h
     27#define Module_h
    2828
    29 #include <WebCore/npfunctions.h>
    3029#include <WebCore/PlatformString.h>
    31 #include <wtf/RefCounted.h>
     30#include <wtf/Noncopyable.h>
    3231
    3332#if PLATFORM(MAC)
     
    3736namespace WebKit {
    3837
    39 class NetscapePluginModule : public RefCounted<NetscapePluginModule> {
     38class Module : public Noncopyable {
    4039public:
    41     static PassRefPtr<NetscapePluginModule> getOrCreate(const WebCore::String& pluginPath);
    42     ~NetscapePluginModule();
     40    Module(const WebCore::String& path);
     41    ~Module();
    4342
    44     const NPPluginFuncs& pluginFuncs() const { return m_pluginFuncs; }
     43    bool load();
     44    // Note: On Mac this leaks the CFBundle to avoid crashes when a bundle is unloaded and there are
     45    // live Objective-C objects whose methods come from that bundle.
     46    void unload();
    4547
    46     void pluginCreated();
    47     void pluginDestroyed();
     48    template<typename FunctionType> FunctionType functionPointer(const char* functionName) const;
    4849
    4950private:
    50     explicit NetscapePluginModule(const WebCore::String& pluginPath);
     51    void* platformFunctionPointer(const char* functionName) const;
    5152
    52     bool tryLoad();
    53     bool load();
    54     void unload();
    55 
    56     void shutdown();
    57 
    58     WebCore::String m_pluginPath;
    59     bool m_isInitialized;
    60     unsigned m_pluginCount;
    61 
    62     NPP_ShutdownProcPtr m_shutdownProcPtr;
    63     NPPluginFuncs m_pluginFuncs;
    64 
     53    WebCore::String m_path;
    6554#if PLATFORM(MAC)
    6655    RetainPtr<CFBundleRef> m_bundle;
    6756#endif
    6857};
    69    
    70 } // namespace WebKit
    7158
    72 #endif // NetscapePluginModule_h
     59template<typename FunctionType> FunctionType Module::functionPointer(const char* functionName) const
     60{
     61    return reinterpret_cast<FunctionType>(platformFunctionPointer(functionName));
     62}
     63
     64}
     65
     66#endif
  • trunk/WebKit2/Platform/mac/ModuleMac.mm

    r64662 r64663  
    2424 */
    2525
    26 #include "NetscapePluginModule.h"
    27 #include "NetscapeBrowserFuncs.h"
     26#include "Module.h"
    2827
    2928namespace WebKit {
    3029
    31 void NetscapePluginModule::unload()
     30bool Module::load()
    3231{
    33     if (m_bundle) {
    34         // We explicitly leak the bundle here, to avoid crashes when a bundle is unloaded and there are live Objective-C objects
    35         // whose methods come from that bundle.
    36         m_bundle.releaseRef();
    37     }
    38 }
    39 
    40 template<typename FuncType>
    41 static inline FuncType pointerToFunction(CFBundleRef bundle, const char* functionName)
    42 {
    43     RetainPtr<CFStringRef> functionNameString(AdoptCF, CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, functionName, kCFStringEncodingASCII, kCFAllocatorNull));
    44     return reinterpret_cast<FuncType>(CFBundleGetFunctionPointerForName(bundle, functionNameString.get()));
    45 }
    46    
    47 bool NetscapePluginModule::tryLoad()
    48 {
    49     RetainPtr<CFStringRef> bundlePath(AdoptCF, m_pluginPath.createCFString());
    50     RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateWithFileSystemPath(0, bundlePath.get(), kCFURLPOSIXPathStyle, FALSE));
     32    RetainPtr<CFStringRef> bundlePath(AdoptCF, m_path.createCFString());
     33    RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateWithFileSystemPath(kCFAllocatorDefault, bundlePath.get(), kCFURLPOSIXPathStyle, FALSE));
    5134    if (!bundleURL)
    5235        return false;
    5336
    54     m_bundle.adoptCF(CFBundleCreate(kCFAllocatorDefault, bundleURL.get()));
    55     if (!m_bundle)
    56         return false;
    57    
    58     if (!CFBundleLoadExecutable(m_bundle.get()))
     37    RetainPtr<CFBundleRef> bundle(AdoptCF, CFBundleCreate(kCFAllocatorDefault, bundleURL.get()));
     38    if (!bundle)
    5939        return false;
    6040
    61     NP_InitializeFuncPtr initializeFuncPtr = pointerToFunction<NP_InitializeFuncPtr>(m_bundle.get(), "NP_Initialize");
    62     if (!initializeFuncPtr)
     41    if (!CFBundleLoadExecutable(bundle.get()))
    6342        return false;
    6443
    65     NP_GetEntryPointsFuncPtr getEntryPointsFuncPtr = pointerToFunction<NP_GetEntryPointsFuncPtr>(m_bundle.get(), "NP_GetEntryPoints");
    66     if (!getEntryPointsFuncPtr)
    67         return false;
    68 
    69     m_shutdownProcPtr = pointerToFunction<NPP_ShutdownProcPtr>(m_bundle.get(), "NP_Shutdown");
    70     if (!m_shutdownProcPtr)
    71         return false;
    72 
    73     if (initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR)
    74         return false;
    75    
    76     m_pluginFuncs.size = sizeof(NPPluginFuncs);
    77     m_pluginFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
    78     if (getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR)
    79         return false;
    80 
     44    m_bundle.adoptCF(bundle.releaseRef());
    8145    return true;
    8246}
    8347
    84 } // namespace WebKit
     48void Module::unload()
     49{
     50    // See the comment in Module.h for why we leak the bundle here.
     51    m_bundle.releaseRef();
     52}
     53
     54void* Module::platformFunctionPointer(const char* functionName) const
     55{
     56    if (!m_bundle)
     57        return 0;
     58    RetainPtr<CFStringRef> functionNameString(AdoptCF, CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, functionName, kCFStringEncodingASCII, kCFAllocatorNull));
     59    return CFBundleGetFunctionPointerForName(m_bundle.get(), functionNameString.get());
     60}
     61
     62}
  • trunk/WebKit2/Platform/qt/ModuleQt.cpp

    r64662 r64663  
    2424 */
    2525
    26 #ifndef NetscapePluginModule_h
    27 #define NetscapePluginModule_h
     26#include "Module.h"
    2827
    29 #include <WebCore/npfunctions.h>
    30 #include <WebCore/PlatformString.h>
    31 #include <wtf/RefCounted.h>
    32 
    33 #if PLATFORM(MAC)
    34 #include <wtf/RetainPtr.h>
    35 #endif
     28#include "NotImplemented.h"
    3629
    3730namespace WebKit {
    3831
    39 class NetscapePluginModule : public RefCounted<NetscapePluginModule> {
    40 public:
    41     static PassRefPtr<NetscapePluginModule> getOrCreate(const WebCore::String& pluginPath);
    42     ~NetscapePluginModule();
     32bool Module::load()
     33{
     34    notImplemented();
     35    return false;
     36}
    4337
    44     const NPPluginFuncs& pluginFuncs() const { return m_pluginFuncs; }
     38void Module::unload()
     39{
     40    notImplemented();
     41}
    4542
    46     void pluginCreated();
    47     void pluginDestroyed();
     43void* Module::platformFunctionPointer(const char* functionName) const
     44{
     45    notImplemented();
     46    return 0;
     47}
    4848
    49 private:
    50     explicit NetscapePluginModule(const WebCore::String& pluginPath);
    51 
    52     bool tryLoad();
    53     bool load();
    54     void unload();
    55 
    56     void shutdown();
    57 
    58     WebCore::String m_pluginPath;
    59     bool m_isInitialized;
    60     unsigned m_pluginCount;
    61 
    62     NPP_ShutdownProcPtr m_shutdownProcPtr;
    63     NPPluginFuncs m_pluginFuncs;
    64 
    65 #if PLATFORM(MAC)
    66     RetainPtr<CFBundleRef> m_bundle;
    67 #endif
    68 };
    69    
    70 } // namespace WebKit
    71 
    72 #endif // NetscapePluginModule_h
     49}
  • trunk/WebKit2/Platform/win/ModuleWin.cpp

    r64662 r64663  
    2424 */
    2525
    26 #ifndef NetscapePluginModule_h
    27 #define NetscapePluginModule_h
     26#include "Module.h"
    2827
    29 #include <WebCore/npfunctions.h>
    30 #include <WebCore/PlatformString.h>
    31 #include <wtf/RefCounted.h>
    32 
    33 #if PLATFORM(MAC)
    34 #include <wtf/RetainPtr.h>
    35 #endif
     28#include "NotImplemented.h"
    3629
    3730namespace WebKit {
    3831
    39 class NetscapePluginModule : public RefCounted<NetscapePluginModule> {
    40 public:
    41     static PassRefPtr<NetscapePluginModule> getOrCreate(const WebCore::String& pluginPath);
    42     ~NetscapePluginModule();
     32bool Module::load()
     33{
     34    notImplemented();
     35    return false;
     36}
    4337
    44     const NPPluginFuncs& pluginFuncs() const { return m_pluginFuncs; }
     38void Module::unload()
     39{
     40    notImplemented();
     41}
    4542
    46     void pluginCreated();
    47     void pluginDestroyed();
     43void* Module::platformFunctionPointer(const char* functionName) const
     44{
     45    notImplemented();
     46    return 0;
     47}
    4848
    49 private:
    50     explicit NetscapePluginModule(const WebCore::String& pluginPath);
    51 
    52     bool tryLoad();
    53     bool load();
    54     void unload();
    55 
    56     void shutdown();
    57 
    58     WebCore::String m_pluginPath;
    59     bool m_isInitialized;
    60     unsigned m_pluginCount;
    61 
    62     NPP_ShutdownProcPtr m_shutdownProcPtr;
    63     NPPluginFuncs m_pluginFuncs;
    64 
    65 #if PLATFORM(MAC)
    66     RetainPtr<CFBundleRef> m_bundle;
    67 #endif
    68 };
    69    
    70 } // namespace WebKit
    71 
    72 #endif // NetscapePluginModule_h
     49}
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r64662 r64663  
    6262                1A6FB90B11E66FBC00DB1371 /* NetscapePluginModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FB90911E66FBC00DB1371 /* NetscapePluginModule.h */; };
    6363                1A6FB90C11E66FBC00DB1371 /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FB90A11E66FBC00DB1371 /* NetscapePluginModule.cpp */; };
    64                 1A6FBA0311E6813E00DB1371 /* NetscapePluginModuleMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FBA0211E6813E00DB1371 /* NetscapePluginModuleMac.cpp */; };
    6564                1A6FBA2A11E6862700DB1371 /* NetscapeBrowserFuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FBA2811E6862700DB1371 /* NetscapeBrowserFuncs.h */; };
    6665                1A6FBA2B11E6862700DB1371 /* NetscapeBrowserFuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FBA2911E6862700DB1371 /* NetscapeBrowserFuncs.cpp */; };
     
    272271                BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF69FA71176D1CB00471A52 /* WKNavigationData.h */; settings = {ATTRIBUTES = (Public, ); }; };
    273272                BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */; };
     273                C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA481209E45000A49D01 /* ModuleMac.mm */; };
     274                C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA451209E2BA00A49D01 /* Module.cpp */; };
     275                C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E3AA441209E2BA00A49D01 /* Module.h */; };
    274276                D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */; };
    275277                D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B9484311FF4B6500032B39 /* WebPopupMenu.h */; };
     
    365367                1A6FB90911E66FBC00DB1371 /* NetscapePluginModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginModule.h; sourceTree = "<group>"; };
    366368                1A6FB90A11E66FBC00DB1371 /* NetscapePluginModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePluginModule.cpp; sourceTree = "<group>"; };
    367                 1A6FBA0211E6813E00DB1371 /* NetscapePluginModuleMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePluginModuleMac.cpp; sourceTree = "<group>"; };
    368369                1A6FBA2811E6862700DB1371 /* NetscapeBrowserFuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapeBrowserFuncs.h; sourceTree = "<group>"; };
    369370                1A6FBA2911E6862700DB1371 /* NetscapeBrowserFuncs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapeBrowserFuncs.cpp; sourceTree = "<group>"; };
     
    581582                BCF69FA71176D1CB00471A52 /* WKNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationData.h; sourceTree = "<group>"; };
    582583                BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationData.cpp; sourceTree = "<group>"; };
     584                C0E3AA441209E2BA00A49D01 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = "<group>"; };
     585                C0E3AA451209E2BA00A49D01 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Module.cpp; sourceTree = "<group>"; };
     586                C0E3AA481209E45000A49D01 /* ModuleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModuleMac.mm; sourceTree = "<group>"; };
    583587                D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPopupMenu.cpp; sourceTree = "<group>"; };
    584588                D3B9484311FF4B6500032B39 /* WebPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPopupMenu.h; sourceTree = "<group>"; };
     
    755759                        children = (
    756760                                1AE5B7F911E7AED200BA6767 /* NetscapePluginMac.mm */,
    757                                 1A6FBA0211E6813E00DB1371 /* NetscapePluginModuleMac.cpp */,
    758761                        );
    759762                        path = mac;
     
    765768                                1A24B5F011F531E800C38269 /* MachUtilities.cpp */,
    766769                                1A24B5F111F531E800C38269 /* MachUtilities.h */,
     770                                C0E3AA481209E45000A49D01 /* ModuleMac.mm */,
    767771                                BC0092F5115837A300E0AE2A /* RunLoopMac.mm */,
    768772                                BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */,
     
    11541158                                1AB5A1BA10E021D30040F6CF /* CoreIPC */,
    11551159                                1A7E814E1152D2240003695B /* mac */,
     1160                                C0E3AA451209E2BA00A49D01 /* Module.cpp */,
     1161                                C0E3AA441209E2BA00A49D01 /* Module.h */,
    11561162                                BC8780FB1161C2B800CC2768 /* PlatformProcessIdentifier.h */,
    11571163                                BC2E6E771141970C00A63B1E /* RunLoop.cpp */,
     
    13581364                                51578B831209ECEF00A37C4A /* WebData.h in Headers */,
    13591365                                514AF6C91209EE7300A26C97 /* WKData.h in Headers */,
     1366                                C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */,
    13601367                        );
    13611368                        runOnlyForDeploymentPostprocessing = 0;
     
    14781485                                1AE5B7FB11E7AED200BA6767 /* NetscapePluginMac.mm in Sources */,
    14791486                                1A6FB90C11E66FBC00DB1371 /* NetscapePluginModule.cpp in Sources */,
    1480                                 1A6FBA0311E6813E00DB1371 /* NetscapePluginModuleMac.cpp in Sources */,
    14811487                                1AA5889311EE70400061B882 /* NetscapePluginStream.cpp in Sources */,
    14821488                                BC111B51112F619200337BAB /* PageClientImpl.mm in Sources */,
     
    15631569                                0FB659A61208B9EE0044816C /* DrawingAreaBase.cpp in Sources */,
    15641570                                514AF6C81209EE7300A26C97 /* WKData.cpp in Sources */,
     1571                                C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */,
     1572                                C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */,
    15651573                        );
    15661574                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp

    r63047 r64663  
    2525
    2626#include "NetscapePluginModule.h"
     27
     28#include "Module.h"
     29#include "NetscapeBrowserFuncs.h"
     30#include <wtf/PassOwnPtr.h>
    2731
    2832using namespace WebCore;
     
    110114}
    111115
     116bool NetscapePluginModule::tryLoad()
     117{
     118    m_module = adoptPtr(new Module(m_pluginPath));
     119    if (!m_module->load())
     120        return false;
     121
     122    NP_InitializeFuncPtr initializeFuncPtr = m_module->functionPointer<NP_InitializeFuncPtr>("NP_Initialize");
     123    if (!initializeFuncPtr)
     124        return false;
     125
     126    NP_GetEntryPointsFuncPtr getEntryPointsFuncPtr = m_module->functionPointer<NP_GetEntryPointsFuncPtr>("NP_GetEntryPoints");
     127    if (!getEntryPointsFuncPtr)
     128        return false;
     129
     130    m_shutdownProcPtr = m_module->functionPointer<NPP_ShutdownProcPtr>("NP_Shutdown");
     131    if (!m_shutdownProcPtr)
     132        return false;
     133
     134    if (initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR)
     135        return false;
     136
     137    m_pluginFuncs.size = sizeof(NPPluginFuncs);
     138    m_pluginFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
     139    if (getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR)
     140        return false;
     141
     142    return true;
     143}
     144
     145void NetscapePluginModule::unload()
     146{
     147    m_module = 0;
     148}
     149
    112150} // namespace WebKit
    113151
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.h

    r63047 r64663  
    2727#define NetscapePluginModule_h
    2828
     29#include "Module.h"
     30#include <WebCore/PlatformString.h>
    2931#include <WebCore/npfunctions.h>
    30 #include <WebCore/PlatformString.h>
    3132#include <wtf/RefCounted.h>
    32 
    33 #if PLATFORM(MAC)
    34 #include <wtf/RetainPtr.h>
    35 #endif
    3633
    3734namespace WebKit {
     
    6360    NPPluginFuncs m_pluginFuncs;
    6461
    65 #if PLATFORM(MAC)
    66     RetainPtr<CFBundleRef> m_bundle;
    67 #endif
     62    OwnPtr<Module> m_module;
    6863};
    6964   
  • trunk/WebKit2/win/WebKit2.vcproj

    r64662 r64663  
    13301330                        </File>
    13311331                        <File
     1332                                RelativePath="..\Platform\Module.cpp"
     1333                                >
     1334                        </File>
     1335                        <File
     1336                                RelativePath="..\Platform\Module.h"
     1337                                >
     1338                        </File>
     1339                        <File
    13321340                                RelativePath="..\Platform\RunLoop.cpp"
    13331341                                >
     
    13521360                                Name="win"
    13531361                                >
     1362                                <File
     1363                                        RelativePath="..\Platform\win\ModuleWin.cpp"
     1364                                        >
     1365                                </File>
    13541366                                <File
    13551367                                        RelativePath="..\Platform\win\RunLoopWin.cpp"
Note: See TracChangeset for help on using the changeset viewer.