2011-07-02 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Jul 2011 23:40:31 +0000 (23:40 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Jul 2011 23:40:31 +0000 (23:40 +0000)
        Move the plug-in controller member variable up to the shared Plugin base class
        https://bugs.webkit.org/show_bug.cgi?id=63867

        Reviewed by Sam Weinig.

        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        (WebKit::NetscapePlugin::NetscapePlugin):
        Remove m_pluginController.

        (WebKit::NetscapePlugin::invalidate):
        (WebKit::NetscapePlugin::userAgent):
        (WebKit::NetscapePlugin::loadURL):
        (WebKit::NetscapePlugin::setStatusbarText):
        (WebKit::NetscapePlugin::evaluate):
        (WebKit::NetscapePlugin::isPrivateBrowsingEnabled):
        (WebKit::NetscapePlugin::windowScriptNPObject):
        (WebKit::NetscapePlugin::pluginElementNPObject):
        (WebKit::NetscapePlugin::tryToShortCircuitInvoke):
        (WebKit::NetscapePlugin::cancelStreamLoad):
        (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
        (WebKit::NetscapePlugin::proxiesForURL):
        (WebKit::NetscapePlugin::cookiesForURL):
        (WebKit::NetscapePlugin::setCookiesForURL):
        (WebKit::NetscapePlugin::getAuthenticationInfo):
        Use controller() instead of m_pluginController.

        (WebKit::NetscapePlugin::initialize):
        This doesn't take a PluginController parameter anymore.

        (WebKit::NetscapePlugin::destroy):
        No need to null out the plug-in controller.

        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        Remove m_pluginController member variable.

        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::compositingRenderServerPort):
        (WebKit::NetscapePlugin::platformSetFocus):
        (WebKit::NetscapePlugin::windowFocusChanged):
        Use controller() instead of m_pluginController.

        * WebProcess/Plugins/Plugin.cpp:
        (WebKit::Plugin::Plugin):
        Initialize m_pluginController.

        (WebKit::Plugin::initialize):
        New function that initializes the plug-in controller and then calls the real
        virtual initialize member function.

        * WebProcess/Plugins/Plugin.h:
        Add m_pluginController member variable and a new initialize virtual member function that doesn't take a
        PluginController parameter. Make the "old" initialize member function set up the plug-in controller.

        (WebKit::Plugin::controller):
        This is now a simple getter.

        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::PluginProxy):
        Remove m_pluginController.

        (WebKit::PluginProxy::pluginProcessCrashed):
        Use controller(), remove a bogus null check.

        (WebKit::PluginProxy::initialize):
        This doesn't take a PluginController parameter now.

        (WebKit::PluginProxy::destroy):
        No need to null out the plug-in controller member variable.

        (WebKit::PluginProxy::loadURL):
        (WebKit::PluginProxy::proxiesForURL):
        (WebKit::PluginProxy::cookiesForURL):
        (WebKit::PluginProxy::setCookiesForURL):
        (WebKit::PluginProxy::getAuthenticationInfo):
        (WebKit::PluginProxy::windowNPObjectID):
        (WebKit::PluginProxy::getPluginElementNPObject):
        (WebKit::PluginProxy::evaluate):
        (WebKit::PluginProxy::cancelStreamLoad):
        (WebKit::PluginProxy::cancelManualStreamLoad):
        (WebKit::PluginProxy::setStatusbarText):
        (WebKit::PluginProxy::setComplexTextInputEnabled):
        (WebKit::PluginProxy::update):
        Use controller() instead of m_pluginController.

        * WebProcess/Plugins/PluginProxy.h:
        Remove m_pluginController.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90326 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit2/WebProcess/Plugins/Plugin.cpp
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h

index 5b3f70a..5d30899 100644 (file)
@@ -1,3 +1,92 @@
+2011-07-02  Anders Carlsson  <andersca@apple.com>
+
+        Move the plug-in controller member variable up to the shared Plugin base class
+        https://bugs.webkit.org/show_bug.cgi?id=63867
+
+        Reviewed by Sam Weinig.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::NetscapePlugin):
+        Remove m_pluginController.
+
+        (WebKit::NetscapePlugin::invalidate):
+        (WebKit::NetscapePlugin::userAgent):
+        (WebKit::NetscapePlugin::loadURL):
+        (WebKit::NetscapePlugin::setStatusbarText):
+        (WebKit::NetscapePlugin::evaluate):
+        (WebKit::NetscapePlugin::isPrivateBrowsingEnabled):
+        (WebKit::NetscapePlugin::windowScriptNPObject):
+        (WebKit::NetscapePlugin::pluginElementNPObject):
+        (WebKit::NetscapePlugin::tryToShortCircuitInvoke):
+        (WebKit::NetscapePlugin::cancelStreamLoad):
+        (WebKit::NetscapePlugin::isAcceleratedCompositingEnabled):
+        (WebKit::NetscapePlugin::proxiesForURL):
+        (WebKit::NetscapePlugin::cookiesForURL):
+        (WebKit::NetscapePlugin::setCookiesForURL):
+        (WebKit::NetscapePlugin::getAuthenticationInfo):
+        Use controller() instead of m_pluginController.
+
+        (WebKit::NetscapePlugin::initialize):
+        This doesn't take a PluginController parameter anymore.
+
+        (WebKit::NetscapePlugin::destroy):
+        No need to null out the plug-in controller.
+
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        Remove m_pluginController member variable.
+
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::compositingRenderServerPort):
+        (WebKit::NetscapePlugin::platformSetFocus):
+        (WebKit::NetscapePlugin::windowFocusChanged):
+        Use controller() instead of m_pluginController.
+        
+        * WebProcess/Plugins/Plugin.cpp:
+        (WebKit::Plugin::Plugin):
+        Initialize m_pluginController.
+
+        (WebKit::Plugin::initialize):
+        New function that initializes the plug-in controller and then calls the real
+        virtual initialize member function.
+
+        * WebProcess/Plugins/Plugin.h:
+        Add m_pluginController member variable and a new initialize virtual member function that doesn't take a
+        PluginController parameter. Make the "old" initialize member function set up the plug-in controller.
+
+        (WebKit::Plugin::controller):
+        This is now a simple getter.
+
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::PluginProxy):
+        Remove m_pluginController.
+
+        (WebKit::PluginProxy::pluginProcessCrashed):
+        Use controller(), remove a bogus null check.
+
+        (WebKit::PluginProxy::initialize):
+        This doesn't take a PluginController parameter now.
+
+        (WebKit::PluginProxy::destroy):
+        No need to null out the plug-in controller member variable.
+
+        (WebKit::PluginProxy::loadURL):
+        (WebKit::PluginProxy::proxiesForURL):
+        (WebKit::PluginProxy::cookiesForURL):
+        (WebKit::PluginProxy::setCookiesForURL):
+        (WebKit::PluginProxy::getAuthenticationInfo):
+        (WebKit::PluginProxy::windowNPObjectID):
+        (WebKit::PluginProxy::getPluginElementNPObject):
+        (WebKit::PluginProxy::evaluate):
+        (WebKit::PluginProxy::cancelStreamLoad):
+        (WebKit::PluginProxy::cancelManualStreamLoad):
+        (WebKit::PluginProxy::setStatusbarText):
+        (WebKit::PluginProxy::setComplexTextInputEnabled):
+        (WebKit::PluginProxy::update):
+        Use controller() instead of m_pluginController.
+        
+        * WebProcess/Plugins/PluginProxy.h:
+        Remove m_pluginController.
+
 2011-07-01  Darin Adler  <darin@apple.com>
 
         Consider backing scale factor when setting up graphics layers
index f009323..52f2232 100644 (file)
@@ -55,8 +55,7 @@ PassRefPtr<NetscapePlugin> NetscapePlugin::create(PassRefPtr<NetscapePluginModul
 }
     
 NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule)
-    : m_pluginController(0)
-    , m_nextRequestID(0)
+    : m_nextRequestID(0)
     , m_pluginModule(pluginModule)
     , m_npWindow()
     , m_isStarted(false)
@@ -120,7 +119,7 @@ void NetscapePlugin::invalidate(const NPRect* invalidRect)
     if (platformInvalidate(rect))
         return;
 
-    m_pluginController->invalidate(rect);
+    controller()->invalidate(rect);
 }
 
 const char* NetscapePlugin::userAgent(NPP npp)
@@ -144,7 +143,7 @@ const char* NetscapePlugin::userAgent()
 #endif
 
     if (m_userAgent.isNull()) {
-        m_userAgent = m_pluginController->userAgent().utf8();
+        m_userAgent = controller()->userAgent().utf8();
         ASSERT(!m_userAgent.isNull());
     }
     return m_userAgent.data();
@@ -155,7 +154,7 @@ void NetscapePlugin::loadURL(const String& method, const String& urlString, cons
 {
     uint64_t requestID = ++m_nextRequestID;
     
-    m_pluginController->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups());
+    controller()->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups());
 
     if (target.isNull()) {
         // The browser is going to send the data in a stream, create a plug-in stream.
@@ -209,7 +208,7 @@ void NetscapePlugin::setIsTransparent(bool isTransparent)
 
 void NetscapePlugin::setStatusbarText(const String& statusbarText)
 {
-    m_pluginController->setStatusbarText(statusbarText);
+    controller()->setStatusbarText(statusbarText);
 }
 
 void NetscapePlugin::setException(const String& exceptionString)
@@ -224,38 +223,38 @@ void NetscapePlugin::setException(const String& exceptionString)
 
 bool NetscapePlugin::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result)
 {
-    return m_pluginController->evaluate(npObject, scriptString, result, allowPopups());
+    return controller()->evaluate(npObject, scriptString, result, allowPopups());
 }
 
 bool NetscapePlugin::isPrivateBrowsingEnabled()
 {
-    return m_pluginController->isPrivateBrowsingEnabled();
+    return controller()->isPrivateBrowsingEnabled();
 }
 
 NPObject* NetscapePlugin::windowScriptNPObject()
 {
-    return m_pluginController->windowScriptNPObject();
+    return controller()->windowScriptNPObject();
 }
 
 NPObject* NetscapePlugin::pluginElementNPObject()
 {
-    return m_pluginController->pluginElementNPObject();
+    return controller()->pluginElementNPObject();
 }
 
 bool NetscapePlugin::tryToShortCircuitInvoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, bool& returnValue, NPVariant& result)
 {
-    return m_pluginController->tryToShortCircuitInvoke(npObject, methodName, arguments, argumentCount, returnValue, result);
+    return controller()->tryToShortCircuitInvoke(npObject, methodName, arguments, argumentCount, returnValue, result);
 }
 
 void NetscapePlugin::cancelStreamLoad(NetscapePluginStream* pluginStream)
 {
     if (pluginStream == m_manualStream) {
-        m_pluginController->cancelManualStreamLoad();
+        controller()->cancelManualStreamLoad();
         return;
     }
 
     // Ask the plug-in controller to cancel this stream load.
-    m_pluginController->cancelStreamLoad(pluginStream->streamID());
+    controller()->cancelStreamLoad(pluginStream->streamID());
 }
 
 void NetscapePlugin::removePluginStream(NetscapePluginStream* pluginStream)
@@ -272,7 +271,7 @@ void NetscapePlugin::removePluginStream(NetscapePluginStream* pluginStream)
 bool NetscapePlugin::isAcceleratedCompositingEnabled()
 {
 #if USE(ACCELERATED_COMPOSITING)
-    return m_pluginController->isAcceleratedCompositingEnabled();
+    return controller()->isAcceleratedCompositingEnabled();
 #else
     return false;
 #endif
@@ -292,22 +291,22 @@ void NetscapePlugin::popPopupsEnabledState()
 
 String NetscapePlugin::proxiesForURL(const String& urlString)
 {
-    return m_pluginController->proxiesForURL(urlString);
+    return controller()->proxiesForURL(urlString);
 }
     
 String NetscapePlugin::cookiesForURL(const String& urlString)
 {
-    return m_pluginController->cookiesForURL(urlString);
+    return controller()->cookiesForURL(urlString);
 }
 
 void NetscapePlugin::setCookiesForURL(const String& urlString, const String& cookieString)
 {
-    m_pluginController->setCookiesForURL(urlString, cookieString);
+    controller()->setCookiesForURL(urlString, cookieString);
 }
 
 bool NetscapePlugin::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
 {
-    return m_pluginController->getAuthenticationInfo(protectionSpace, username, password);
+    return controller()->getAuthenticationInfo(protectionSpace, username, password);
 }
 
 NPError NetscapePlugin::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* savedData)
@@ -434,13 +433,8 @@ bool NetscapePlugin::allowPopups() const
     return false;
 }
 
-bool NetscapePlugin::initialize(PluginController* pluginController, const Parameters& parameters)
+bool NetscapePlugin::initialize(const Parameters& parameters)
 {
-    ASSERT(!m_pluginController);
-    ASSERT(pluginController);
-
-    m_pluginController = pluginController;
-    
     uint16_t mode = parameters.loadManually ? NP_FULL : NP_EMBED;
     
     m_loadManually = parameters.loadManually;
@@ -521,7 +515,6 @@ void NetscapePlugin::destroy()
     NPP_Destroy(0);
 
     m_isStarted = false;
-    m_pluginController = 0;
 
     platformDestroy();
 }
@@ -768,9 +761,4 @@ bool NetscapePlugin::supportsSnapshotting() const
     return false;
 }
 
-PluginController* NetscapePlugin::controller()
-{
-    return m_pluginController;
-}
-
 } // namespace WebKit
index fc80173..08ce630 100644 (file)
@@ -146,7 +146,7 @@ private:
     void platformSetFocus(bool);
 
     // Plugin
-    virtual bool initialize(PluginController*, const Parameters&);
+    virtual bool initialize(const Parameters&);
     virtual void destroy();
     virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& dirtyRect);
     virtual PassRefPtr<ShareableBitmap> snapshot();
@@ -191,14 +191,11 @@ private:
 
     bool supportsSnapshotting() const;
 
-    virtual PluginController* controller();
-
 #if PLUGIN_ARCHITECTURE(WIN)
     static BOOL WINAPI hookedTrackPopupMenu(HMENU, UINT uFlags, int x, int y, int nReserved, HWND, const RECT*);
     void scheduleWindowedGeometryUpdate();
 #endif
 
-    PluginController* m_pluginController;
     uint64_t m_nextRequestID;
 
     typedef HashMap<uint64_t, std::pair<String, void*> > PendingURLNotifyMap;
index 6195f46..a24d74a 100644 (file)
@@ -176,7 +176,7 @@ NPError NetscapePlugin::popUpContextMenu(NPMenu* npMenu)
 
 mach_port_t NetscapePlugin::compositingRenderServerPort()
 {
-    return m_pluginController->compositingRenderServerPort();
+    return controller()->compositingRenderServerPort();
 }
 
 #ifndef NP_NO_CARBON
@@ -787,7 +787,7 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& keyboar
 void NetscapePlugin::platformSetFocus(bool hasFocus)
 {
     m_pluginHasFocus = hasFocus;
-    m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+    controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
 
     switch (m_eventModel) {
         case NPEventModelCocoa: {
@@ -815,7 +815,7 @@ void NetscapePlugin::platformSetFocus(bool hasFocus)
 void NetscapePlugin::windowFocusChanged(bool hasFocus)
 {
     m_windowHasFocus = hasFocus;
-    m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+    controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
 
     switch (m_eventModel) {
         case NPEventModelCocoa: {
index 89a0101..330edee 100644 (file)
@@ -73,6 +73,7 @@ bool Plugin::Parameters::decode(CoreIPC::ArgumentDecoder* decoder, Parameters& p
 }
 
 Plugin::Plugin()
+    : m_pluginController(0)
 {
 }
 
@@ -80,4 +81,14 @@ Plugin::~Plugin()
 {
 }
 
+bool Plugin::initialize(PluginController* pluginController, const Parameters& parameters)
+{
+    ASSERT(!m_pluginController);
+    ASSERT(pluginController);
+
+    m_pluginController = pluginController;
+
+    return initialize(parameters);
+}
+
 } // namespace WebKit
index 8f6abbc..6050aba 100644 (file)
@@ -72,10 +72,21 @@ public:
         static bool decode(CoreIPC::ArgumentDecoder*, Parameters&);
     };
 
+    // Sets the active plug-in controller and initializes the plug-in.
+    bool initialize(PluginController*, const Parameters&);
+
+    // Returns the plug-in controller for this plug-in.
+    PluginController* controller() { return m_pluginController; }
+
     virtual ~Plugin();
-    
+
+private:
+
     // Initializes the plug-in. If the plug-in fails to initialize this should return false.
-    virtual bool initialize(PluginController*, const Parameters&) = 0;
+    // This is only called by the other initialize overload so it can be made private.
+    virtual bool initialize(const Parameters&) = 0;
+
+public:
 
     // Destroys the plug-in.
     virtual void destroy() = 0;
@@ -178,12 +189,11 @@ public:
     // Called when the private browsing state for this plug-in changes.
     virtual void privateBrowsingStateChanged(bool) = 0;
 
-    // Returns the plug-in controller for this plug-in.
-    // FIXME: We could just have the controller be a member variable of Plugin.
-    virtual PluginController* controller() = 0;
-
 protected:
     Plugin();
+
+private:
+    PluginController* m_pluginController;
 };
     
 } // namespace WebKit
index d34fe36..85af396 100644 (file)
@@ -63,7 +63,6 @@ PassRefPtr<PluginProxy> PluginProxy::create(const String& pluginPath)
 PluginProxy::PluginProxy(const String& pluginPath)
     : m_pluginPath(pluginPath)
     , m_pluginInstanceID(generatePluginInstanceID())
-    , m_pluginController(0)
     , m_pluginBackingStoreContainsValidData(false)
     , m_isStarted(false)
     , m_waitingForPaintInResponseToUpdate(false)
@@ -77,17 +76,11 @@ PluginProxy::~PluginProxy()
 
 void PluginProxy::pluginProcessCrashed()
 {
-    if (m_pluginController)
-        m_pluginController->pluginProcessCrashed();
+    controller()->pluginProcessCrashed();
 }
 
-bool PluginProxy::initialize(PluginController* pluginController, const Parameters& parameters)
+bool PluginProxy::initialize(const Parameters& parameters)
 {
-    ASSERT(!m_pluginController);
-    ASSERT(pluginController);
-
-    m_pluginController = pluginController;
-
     ASSERT(!m_connection);
     m_connection = WebProcess::shared().pluginProcessConnectionManager().getPluginProcessConnection(m_pluginPath);
     
@@ -103,10 +96,10 @@ bool PluginProxy::initialize(PluginController* pluginController, const Parameter
     creationParameters.pluginInstanceID = m_pluginInstanceID;
     creationParameters.windowNPObjectID = windowNPObjectID();
     creationParameters.parameters = parameters;
-    creationParameters.userAgent = pluginController->userAgent();
-    creationParameters.isPrivateBrowsingEnabled = pluginController->isPrivateBrowsingEnabled();
+    creationParameters.userAgent = controller()->userAgent();
+    creationParameters.isPrivateBrowsingEnabled = controller()->isPrivateBrowsingEnabled();
 #if USE(ACCELERATED_COMPOSITING)
-    creationParameters.isAcceleratedCompositingEnabled = pluginController->isAcceleratedCompositingEnabled();
+    creationParameters.isAcceleratedCompositingEnabled = controller()->isAcceleratedCompositingEnabled();
 #endif
 
     bool result = false;
@@ -130,7 +123,6 @@ void PluginProxy::destroy()
     m_connection->connection()->sendSync(Messages::WebProcessConnection::DestroyPlugin(m_pluginInstanceID), Messages::WebProcessConnection::DestroyPlugin::Reply(), 0);
 
     m_isStarted = false;
-    m_pluginController = 0;
 
     m_connection->removePluginProxy(this);
 }
@@ -381,39 +373,34 @@ void PluginProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
     m_connection->connection()->send(Messages::PluginControllerProxy::PrivateBrowsingStateChanged(isPrivateBrowsingEnabled), m_pluginInstanceID);
 }
 
-PluginController* PluginProxy::controller()
-{
-    return m_pluginController;
-}
-
 void PluginProxy::loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups)
 {
-    m_pluginController->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups);
+    controller()->loadURL(requestID, method, urlString, target, headerFields, httpBody, allowPopups);
 }
 
 void PluginProxy::proxiesForURL(const String& urlString, String& proxyString)
 {
-    proxyString = m_pluginController->proxiesForURL(urlString);
+    proxyString = controller()->proxiesForURL(urlString);
 }
 
 void PluginProxy::cookiesForURL(const String& urlString, String& cookieString)
 {
-    cookieString = m_pluginController->cookiesForURL(urlString);
+    cookieString = controller()->cookiesForURL(urlString);
 }
 
 void PluginProxy::setCookiesForURL(const String& urlString, const String& cookieString)
 {
-    m_pluginController->setCookiesForURL(urlString, cookieString);
+    controller()->setCookiesForURL(urlString, cookieString);
 }
 
 void PluginProxy::getAuthenticationInfo(const ProtectionSpace& protectionSpace, bool& returnValue, String& username, String& password)
 {
-    returnValue = m_pluginController->getAuthenticationInfo(protectionSpace, username, password);
+    returnValue = controller()->getAuthenticationInfo(protectionSpace, username, password);
 }
 
 uint64_t PluginProxy::windowNPObjectID()
 {
-    NPObject* windowScriptNPObject = m_pluginController->windowScriptNPObject();
+    NPObject* windowScriptNPObject = controller()->windowScriptNPObject();
     if (!windowScriptNPObject)
         return 0;
 
@@ -425,7 +412,7 @@ uint64_t PluginProxy::windowNPObjectID()
 
 void PluginProxy::getPluginElementNPObject(uint64_t& pluginElementNPObjectID)
 {
-    NPObject* pluginElementNPObject = m_pluginController->pluginElementNPObject();
+    NPObject* pluginElementNPObject = controller()->pluginElementNPObject();
     if (!pluginElementNPObject) {
         pluginElementNPObjectID = 0;
         return;
@@ -437,7 +424,7 @@ void PluginProxy::getPluginElementNPObject(uint64_t& pluginElementNPObjectID)
 
 void PluginProxy::evaluate(const NPVariantData& npObjectAsVariantData, const String& scriptString, bool allowPopups, bool& returnValue, NPVariantData& resultData)
 {
-    PluginController::PluginDestructionProtector protector(m_pluginController);
+    PluginController::PluginDestructionProtector protector(controller());
 
     NPVariant npObjectAsVariant = m_connection->npRemoteObjectMap()->npVariantDataToNPVariant(npObjectAsVariantData, this);
     if (!NPVARIANT_IS_OBJECT(npObjectAsVariant) || !(NPVARIANT_TO_OBJECT(npObjectAsVariant))) {
@@ -446,7 +433,7 @@ void PluginProxy::evaluate(const NPVariantData& npObjectAsVariantData, const Str
     }
         
     NPVariant result;
-    returnValue = m_pluginController->evaluate(NPVARIANT_TO_OBJECT(npObjectAsVariant), scriptString, &result, allowPopups);
+    returnValue = controller()->evaluate(NPVARIANT_TO_OBJECT(npObjectAsVariant), scriptString, &result, allowPopups);
     if (!returnValue)
         return;
 
@@ -461,23 +448,23 @@ void PluginProxy::evaluate(const NPVariantData& npObjectAsVariantData, const Str
 
 void PluginProxy::cancelStreamLoad(uint64_t streamID)
 {
-    m_pluginController->cancelStreamLoad(streamID);
+    controller()->cancelStreamLoad(streamID);
 }
 
 void PluginProxy::cancelManualStreamLoad()
 {
-    m_pluginController->cancelManualStreamLoad();
+    controller()->cancelManualStreamLoad();
 }
 
 void PluginProxy::setStatusbarText(const String& statusbarText)
 {
-    m_pluginController->setStatusbarText(statusbarText);
+    controller()->setStatusbarText(statusbarText);
 }
 
 #if PLATFORM(MAC)
 void PluginProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
 {
-    m_pluginController->setComplexTextInputEnabled(complexTextInputEnabled);
+    controller()->setComplexTextInputEnabled(complexTextInputEnabled);
 }
 #endif
     
@@ -499,7 +486,7 @@ void PluginProxy::update(const IntRect& paintedRect)
 
     // Ask the controller to invalidate the rect for us.
     m_waitingForPaintInResponseToUpdate = true;
-    m_pluginController->invalidate(paintedRectPluginCoordinates);
+    controller()->invalidate(paintedRectPluginCoordinates);
 }
 
 } // namespace WebKit
index 8f9ba2e..1b3444c 100644 (file)
@@ -63,7 +63,7 @@ private:
     explicit PluginProxy(const String& pluginPath);
 
     // Plugin
-    virtual bool initialize(PluginController*, const Parameters&);
+    virtual bool initialize(const Parameters&);
     virtual void destroy();
     virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect& dirtyRect);
     virtual PassRefPtr<ShareableBitmap> snapshot();
@@ -102,8 +102,6 @@ private:
 
     virtual void privateBrowsingStateChanged(bool);
 
-    virtual PluginController* controller();
-
     bool needsBackingStore() const;
     uint64_t windowNPObjectID();
 
@@ -128,8 +126,6 @@ private:
     RefPtr<PluginProcessConnection> m_connection;
     uint64_t m_pluginInstanceID;
 
-    PluginController* m_pluginController;
-
     // The plug-in rect in window coordinates.
     WebCore::IntRect m_frameRect;