Javascript in foreground tabs should not wait synchronously for plug-ins to load
[WebKit-https.git] / Source / WebKit2 / WebProcess / Plugins / PluginView.cpp
index 0a0c6b6..8f50d87 100644 (file)
@@ -550,19 +550,8 @@ JSObject* PluginView::scriptObject(JSGlobalObject* globalObject)
     if (m_isWaitingForSynchronousInitialization)
         return 0;
 
-    // The plug-in can be null here if it failed to initialize previously.
-    if (!m_plugin)
-        return 0;
-
-    // If the plug-in exists but is not initialized then we're still initializing asynchronously.
-    // We need to wait here until initialization has either succeeded or failed.
-    if (m_plugin->isBeingAsynchronouslyInitialized()) {
-        m_isWaitingForSynchronousInitialization = true;
-        m_plugin->waitForAsynchronousInitialization();
-        m_isWaitingForSynchronousInitialization = false;
-    }
-
-    // The plug-in can be null here if it still failed to initialize.
+    // We might not have started initialization of the plug-in yet, the plug-in might be in the middle
+    // of being initializing asynchronously, or initialization might have previously failed.
     if (!m_isInitialized || !m_plugin)
         return 0;