OSDN Git Service

Merge webkit.org at R49305 : PluginView::init and destructor have been moved to commo...
authorSteve Block <steveblock@google.com>
Sun, 11 Oct 2009 22:28:11 +0000 (23:28 +0100)
committerSteve Block <steveblock@google.com>
Mon, 19 Oct 2009 23:45:05 +0000 (00:45 +0100)
See http://trac.webkit.org/changeset/47966 and http://trac.webkit.org/changeset/47967

Change-Id: If5b9594b032d5a7d456fe3bb6092eafef3655c34

WebCore/plugins/PluginView.cpp
WebCore/plugins/android/PluginViewAndroid.cpp

index 976e3ea..c066e25 100644 (file)
@@ -290,7 +290,12 @@ PluginView::~PluginView()
 
     m_parentFrame->script()->cleanupScriptObjectsForPlugin(this);
 
+#if PLATFORM(ANDROID)
+    // Since we have no legacy plugins to check, we ignore the quirks check.
+    if (m_plugin)
+#else
     if (m_plugin && !(m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin)))
+#endif
         m_plugin->unload();
 }
 
index 7d10993..a8bc319 100644 (file)
@@ -163,58 +163,18 @@ void PluginView::platformInit()
     m_npWindow.window = 0;
 }
 
-void PluginView::platformStart()
+bool PluginView::platformStart()
 {
-    notImplemented();
+    android::WebViewCore* c = android::WebViewCore::getWebViewCore(this->parent());
+    m_window->init(c);
+    return true;
 }
 
-PluginView::~PluginView()
+void PluginView::platformDestroy()
 {
-    stop();
-
-    deleteAllValues(m_requests);
-
-    freeStringArray(m_paramNames, m_paramCount);
-    freeStringArray(m_paramValues, m_paramCount);
-
-    m_parentFrame->script()->cleanupScriptObjectsForPlugin(this);
-
-// Since we have no legacy plugins to check, we ignore the quirks check
-//    if (m_plugin && !m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin))
-    if (m_plugin) {
-        m_plugin->unload();
-    }
     delete m_window;
 }
 
-void PluginView::init()
-{
-    if (m_haveInitialized)
-        return;
-    m_haveInitialized = true;
-
-    android::WebViewCore* c = android::WebViewCore::getWebViewCore(this->parent());
-    m_window->init(c);
-
-    if (!m_plugin) {
-        ASSERT(m_status == PluginStatusCanNotFindPlugin);
-        return;
-    }
-
-    if (!m_plugin->load()) {
-        m_plugin = 0;
-        m_status = PluginStatusCanNotLoadPlugin;
-        return;
-    }
-
-    if (!start()) {
-        m_status = PluginStatusCanNotLoadPlugin;
-        return;
-    }
-
-    m_status = PluginStatusLoadedSuccessfully;
-}
-
 void PluginView::handleTouchEvent(TouchEvent* event)
 {
     if (!m_window->isAcceptingEvent(kTouch_ANPEventFlag))