[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

andersca at apple.com andersca at apple.com
Wed Dec 22 18:43:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 695019917c4297d552cc40c0d6ec75a29b0c242c
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 16 19:37:44 2010 +0000

    Save the manual plug-in stream data and redeliver it when the plug-in is initialized
    https://bugs.webkit.org/show_bug.cgi?id=51201
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Export SharedBuffer related symbols.
    
    * WebCore.exp.in:
    
    WebKit2:
    
    * WebProcess/Plugins/PluginView.cpp:
    (WebKit::PluginView::PluginView):
    Initialize m_manualStreamState.
    
    (WebKit::PluginView::manualLoadDidReceiveResponse):
    If the plug-in hasn't been initialized, store the response.
    
    (WebKit::PluginView::manualLoadDidReceiveData):
    If the plug-in hasn't been initialized, store the data.
    
    (WebKit::PluginView::manualLoadDidFinishLoading):
    If the plug-in hasn't been initialized, update the state.
    
    (WebKit::PluginView::manualLoadDidFail):
    If the plug-in hasn't been initialized, store the error and update the state.
    
    (WebKit::PluginView::initializePlugin):
    Call redeliverManualStream.
    
    (WebKit::PluginView::redeliverManualStream):
    Redeliver the manual stream to the plug-in.
    
    * WebProcess/Plugins/PluginView.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a1c0046..2fb75e0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-16  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Save the manual plug-in stream data and redeliver it when the plug-in is initialized
+        https://bugs.webkit.org/show_bug.cgi?id=51201
+
+        Export SharedBuffer related symbols.
+
+        * WebCore.exp.in:
+
 2010-12-16  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 2e41cd8..f7706e7 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -271,7 +271,9 @@ __ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
 __ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
 __ZN7WebCore12SharedBuffer12createNSDataEv
 __ZN7WebCore12SharedBuffer24createWithContentsOfFileERKN3WTF6StringE
+__ZN7WebCore12SharedBuffer6appendEPKcj
 __ZN7WebCore12SharedBufferC1EPKci
+__ZN7WebCore12SharedBufferC1Ev
 __ZN7WebCore12SharedBufferD1Ev
 __ZN7WebCore12SpellChecker8didCheckEiRKN3WTF6VectorINS_19SpellCheckingResultELm0EEE
 __ZN7WebCore12TextEncodingC1ERKN3WTF6StringE
@@ -980,6 +982,7 @@ __ZNK7WebCore12RenderObject14enclosingLayerEv
 __ZNK7WebCore12RenderObject15localToAbsoluteENS_10FloatPointEbb
 __ZNK7WebCore12RenderObject7childAtEj
 __ZNK7WebCore12RenderWidget14windowClipRectEv
+__ZNK7WebCore12SharedBuffer11getSomeDataERPKcj
 __ZNK7WebCore12SharedBuffer4dataEv
 __ZNK7WebCore12SharedBuffer4sizeEv
 __ZNK7WebCore12TextEncoding6decodeEPKcmbRb
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index e1c0341..cb91451 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,34 @@
+2010-12-16  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Save the manual plug-in stream data and redeliver it when the plug-in is initialized
+        https://bugs.webkit.org/show_bug.cgi?id=51201
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::PluginView):
+        Initialize m_manualStreamState.
+
+        (WebKit::PluginView::manualLoadDidReceiveResponse):
+        If the plug-in hasn't been initialized, store the response.
+
+        (WebKit::PluginView::manualLoadDidReceiveData):
+        If the plug-in hasn't been initialized, store the data.
+        
+        (WebKit::PluginView::manualLoadDidFinishLoading):
+        If the plug-in hasn't been initialized, update the state.
+
+        (WebKit::PluginView::manualLoadDidFail):
+        If the plug-in hasn't been initialized, store the error and update the state.
+        
+        (WebKit::PluginView::initializePlugin):
+        Call redeliverManualStream.
+
+        (WebKit::PluginView::redeliverManualStream):
+        Redeliver the manual stream to the plug-in.
+
+        * WebProcess/Plugins/PluginView.h:
+
 2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen at nokia.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKit2/WebProcess/Plugins/PluginView.cpp b/WebKit2/WebProcess/Plugins/PluginView.cpp
index 9d39fa3..a2e4f89 100644
--- a/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -250,6 +250,7 @@ PluginView::PluginView(PassRefPtr<HTMLPlugInElement> pluginElement, PassRefPtr<P
     , m_isBeingDestroyed(false)
     , m_pendingURLRequestsTimer(RunLoop::main(), this, &PluginView::pendingURLRequestsTimerFired)
     , m_npRuntimeObjectMap(this)
+    , m_manualStreamState(StreamStateInitial)
 {
 #if PLATFORM(MAC)
     m_webPage->addPluginView(this);
@@ -296,6 +297,13 @@ void PluginView::manualLoadDidReceiveResponse(const ResourceResponse& response)
     if (!m_plugin)
         return;
 
+    if (!m_isInitialized) {
+        ASSERT(m_manualStreamState == StreamStateInitial);
+        m_manualStreamState = StreamStateHasReceivedResponse;
+        m_manualStreamResponse = response;
+        return;
+    }
+
     // Compute the stream related data from the resource response.
     const KURL& responseURL = response.url();
     const String& mimeType = response.mimeType();
@@ -316,6 +324,15 @@ void PluginView::manualLoadDidReceiveData(const char* bytes, int length)
     if (!m_plugin)
         return;
 
+    if (!m_isInitialized) {
+        ASSERT(m_manualStreamState == StreamStateHasReceivedResponse);
+        if (!m_manualStreamData)
+            m_manualStreamData = SharedBuffer::create();
+
+        m_manualStreamData->append(bytes, length);
+        return;
+    }
+
     m_plugin->manualStreamDidReceiveData(bytes, length);
 }
 
@@ -325,6 +342,12 @@ void PluginView::manualLoadDidFinishLoading()
     if (!m_plugin)
         return;
 
+    if (!m_isInitialized) {
+        ASSERT(m_manualStreamState == StreamStateHasReceivedResponse);
+        m_manualStreamState = StreamStateFinished;
+        return;
+    }
+
     m_plugin->manualStreamDidFinishLoading();
 }
 
@@ -334,6 +357,13 @@ void PluginView::manualLoadDidFail(const ResourceError& error)
     if (!m_plugin)
         return;
 
+    if (!m_isInitialized) {
+        m_manualStreamState = StreamStateFinished;
+        m_manualStreamError = error;
+        m_manualStreamData = nullptr;
+        return;
+    }
+
     m_plugin->manualStreamDidFail(error.isCancellation());
 }
 
@@ -412,6 +442,8 @@ void PluginView::initializePlugin()
 
     viewGeometryDidChange();
 
+    redeliverManualStream();
+
 #if PLATFORM(MAC)
     if (m_plugin->pluginLayer()) {
         if (frame()) {
@@ -720,6 +752,38 @@ void PluginView::cancelAllStreams()
     ASSERT(m_streams.isEmpty());
 }
 
+void PluginView::redeliverManualStream()
+{
+    if (m_manualStreamState == StreamStateInitial) {
+        // Nothing to do.
+        return;
+    }
+
+    if (m_manualStreamState == StreamStateFailed) {
+        manualLoadDidFail(m_manualStreamError);
+        return;
+    }
+
+    // Deliver the response.
+    manualLoadDidReceiveResponse(m_manualStreamResponse);
+
+    // Deliver the data.
+    if (m_manualStreamData) {
+        const char* data;
+        unsigned position = 0;
+
+        while (unsigned length = m_manualStreamData->getSomeData(data, position)) {
+            manualLoadDidReceiveData(data, length);
+            position += length;
+        }
+
+        m_manualStreamData = nullptr;
+    }
+
+    if (m_manualStreamState == StreamStateFinished)
+        manualLoadDidFinishLoading();
+}
+
 void PluginView::invalidateRect(const IntRect& dirtyRect)
 {
     if (!parent() || !m_plugin || !m_isInitialized)
diff --git a/WebKit2/WebProcess/Plugins/PluginView.h b/WebKit2/WebProcess/Plugins/PluginView.h
index 9281385..07511d7 100644
--- a/WebKit2/WebProcess/Plugins/PluginView.h
+++ b/WebKit2/WebProcess/Plugins/PluginView.h
@@ -33,6 +33,8 @@
 #include "WebFrame.h"
 
 #include <WebCore/MediaCanStartListener.h>
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceResponse.h>
 #include <WebCore/PluginViewBase.h>
 #include <wtf/Deque.h>
 
@@ -91,6 +93,8 @@ private:
     void removeStream(Stream*);
     void cancelAllStreams();
 
+    void redeliverManualStream();
+
     // WebCore::PluginViewBase
 #if PLATFORM(MAC)
     virtual PlatformLayer* platformLayer() const;
@@ -160,6 +164,20 @@ private:
 
     // A map of all related NPObjects for this plug-in view.
     NPRuntimeObjectMap m_npRuntimeObjectMap;
+
+    // The manual stream state. This is used so we can deliver a manual stream to a plug-in
+    // when it is initialized.
+    enum ManualStreamState {
+        StreamStateInitial,
+        StreamStateHasReceivedResponse,
+        StreamStateFinished,
+        StreamStateFailed
+    };
+    ManualStreamState m_manualStreamState;
+
+    WebCore::ResourceResponse m_manualStreamResponse;
+    WebCore::ResourceError m_manualStreamError;
+    RefPtr<WebCore::SharedBuffer> m_manualStreamData;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list