<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[42615] trunk/WebKit/mac</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/42615">42615</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2009-04-17 10:46:44 -0700 (Fri, 17 Apr 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-04-17  Anders Carlsson  &lt;andersca@apple.com&gt;

        Reviewed by Sam Weinig.

        WebKit side of &lt;rdar://problem/6449642&gt;.
        
        * Plugins/Hosted/HostedNetscapePluginStream.h:
        (WebKit::HostedNetscapePluginStream::create):
        New function that creates a stream from a frame loader.
        
        * Plugins/Hosted/HostedNetscapePluginStream.mm:
        (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream):
        Add the constructor that takes a frame loader.
        
        * Plugins/Hosted/NetscapePluginHostManager.h:
        * Plugins/Hosted/NetscapePluginHostManager.mm:
        (WebKit::NetscapePluginHostManager::instantiatePlugin):
        Pass &quot;fullFrame&quot; to the plug-in host.
        
        * Plugins/Hosted/NetscapePluginHostProxy.mm:
        (WKPCCancelLoadURL):
        Call NetscapePluginInstanceProxy::cancelStreamLoad.
        
        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
        (WebKit::NetscapePluginInstanceProxy::create):
        Pass &quot;fullFrame&quot; to the constructor.
        
        (WebKit::NetscapePluginInstanceProxy::manualStream):
        New getter for the manual stream.
        
        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
        (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
        Take the implicit request into account if we have a full frame plug-in.
        
        (WebKit::NetscapePluginInstanceProxy::setManualStream):
        Setter for the manual stream.
        
        (WebKit::NetscapePluginInstanceProxy::cancelStreamLoad):
        Cancel the manual stream if necessary.
        
        * Plugins/Hosted/WebHostedNetscapePluginView.h:
        WebHostedNetscapePluginView now conforms to the WebPluginManualLoader protocol.
        
        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
        (-[WebHostedNetscapePluginView createPlugin]):
        Pass &quot;fullFrame&quot; to instantiatePlugin.
        
        (-[WebHostedNetscapePluginView pluginView:receivedResponse:]):
        (-[WebHostedNetscapePluginView pluginView:receivedData:]):
        (-[WebHostedNetscapePluginView pluginView:receivedError:]):
        (-[WebHostedNetscapePluginView pluginViewFinishedLoading:]):
        Call the equivalent manual stream functions.
        
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::createPlugin):
        Use a macro for getting the plug-in view type.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacPluginsHostedHostedNetscapePluginStreamh">trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h</a></li>
<li><a href="#trunkWebKitmacPluginsHostedHostedNetscapePluginStreammm">trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm</a></li>
<li><a href="#trunkWebKitmacPluginsHostedNetscapePluginHostManagerh">trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h</a></li>
<li><a href="#trunkWebKitmacPluginsHostedNetscapePluginHostManagermm">trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm</a></li>
<li><a href="#trunkWebKitmacPluginsHostedNetscapePluginHostProxymm">trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm</a></li>
<li><a href="#trunkWebKitmacPluginsHostedNetscapePluginInstanceProxyh">trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h</a></li>
<li><a href="#trunkWebKitmacPluginsHostedNetscapePluginInstanceProxymm">trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm</a></li>
<li><a href="#trunkWebKitmacPluginsHostedWebHostedNetscapePluginViewh">trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h</a></li>
<li><a href="#trunkWebKitmacPluginsHostedWebHostedNetscapePluginViewmm">trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebFrameLoaderClientmm">trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/ChangeLog        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2009-04-17  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Reviewed by Sam Weinig.
+
+        WebKit side of &lt;rdar://problem/6449642&gt;.
+        
+        * Plugins/Hosted/HostedNetscapePluginStream.h:
+        (WebKit::HostedNetscapePluginStream::create):
+        New function that creates a stream from a frame loader.
+        
+        * Plugins/Hosted/HostedNetscapePluginStream.mm:
+        (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream):
+        Add the constructor that takes a frame loader.
+        
+        * Plugins/Hosted/NetscapePluginHostManager.h:
+        * Plugins/Hosted/NetscapePluginHostManager.mm:
+        (WebKit::NetscapePluginHostManager::instantiatePlugin):
+        Pass &quot;fullFrame&quot; to the plug-in host.
+        
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WKPCCancelLoadURL):
+        Call NetscapePluginInstanceProxy::cancelStreamLoad.
+        
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        (WebKit::NetscapePluginInstanceProxy::create):
+        Pass &quot;fullFrame&quot; to the constructor.
+        
+        (WebKit::NetscapePluginInstanceProxy::manualStream):
+        New getter for the manual stream.
+        
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
+        Take the implicit request into account if we have a full frame plug-in.
+        
+        (WebKit::NetscapePluginInstanceProxy::setManualStream):
+        Setter for the manual stream.
+        
+        (WebKit::NetscapePluginInstanceProxy::cancelStreamLoad):
+        Cancel the manual stream if necessary.
+        
+        * Plugins/Hosted/WebHostedNetscapePluginView.h:
+        WebHostedNetscapePluginView now conforms to the WebPluginManualLoader protocol.
+        
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView createPlugin]):
+        Pass &quot;fullFrame&quot; to instantiatePlugin.
+        
+        (-[WebHostedNetscapePluginView pluginView:receivedResponse:]):
+        (-[WebHostedNetscapePluginView pluginView:receivedData:]):
+        (-[WebHostedNetscapePluginView pluginView:receivedError:]):
+        (-[WebHostedNetscapePluginView pluginViewFinishedLoading:]):
+        Call the equivalent manual stream functions.
+        
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createPlugin):
+        Use a macro for getting the plug-in view type.
+
</ins><span class="cx"> 2009-04-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dan Bernstein
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedHostedNetscapePluginStreamh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -51,13 +51,18 @@
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(new HostedNetscapePluginStream(instance, streamID, request));
</span><span class="cx">     }
</span><del>-    
</del><ins>+    static PassRefPtr&lt;HostedNetscapePluginStream&gt; create(NetscapePluginInstanceProxy* instance, WebCore::FrameLoader* frameLoader)
+    {
+        return adoptRef(new HostedNetscapePluginStream(instance, frameLoader));
+    }
+                                     
</ins><span class="cx">     uint32_t streamID() const { return m_streamID; }
</span><span class="cx">     
</span><span class="cx">     void startStreamWithResponse(NSURLResponse *response);
</span><span class="cx">     void didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char* bytes, int length);
</span><span class="cx">     void didFinishLoading(WebCore::NetscapePlugInStreamLoader*);
</span><del>-    
</del><ins>+    void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&amp;);
+
</ins><span class="cx">     void start();
</span><span class="cx">     void stop();
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +73,7 @@
</span><span class="cx">     void cancelLoad(NSError *);
</span><span class="cx"> 
</span><span class="cx">     HostedNetscapePluginStream(NetscapePluginInstanceProxy*, uint32_t streamID, NSURLRequest *);
</span><ins>+    HostedNetscapePluginStream(NetscapePluginInstanceProxy*, WebCore::FrameLoader*);
</ins><span class="cx">     
</span><span class="cx">     void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers);
</span><span class="cx"> 
</span><span class="lines">@@ -75,7 +81,6 @@
</span><span class="cx"> 
</span><span class="cx">     // NetscapePlugInStreamLoaderClient methods.
</span><span class="cx">     void didReceiveResponse(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceResponse&amp;);
</span><del>-    void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&amp;);
</del><span class="cx">     bool wantsAllStreams() const;
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;NetscapePluginInstanceProxy&gt; m_instance;
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedHostedNetscapePluginStreammm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -57,6 +57,14 @@
</span><span class="cx">         [m_request.get() _web_setHTTPReferrer:nil];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HostedNetscapePluginStream::HostedNetscapePluginStream(NetscapePluginInstanceProxy* instance, WebCore::FrameLoader* frameLoader)
+    : m_instance(instance)
+    , m_streamID(1)
+    , m_isTerminated(false)
+    , m_frameLoader(frameLoader)
+{
+}
+
</ins><span class="cx"> void HostedNetscapePluginStream::startStreamWithResponse(NSURLResponse *response)
</span><span class="cx"> {
</span><span class="cx">     didReceiveResponse(0, response);
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedNetscapePluginHostManagerh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static NetscapePluginHostManager&amp; shared();
</span><span class="cx">     
</span><del>-    PassRefPtr&lt;NetscapePluginInstanceProxy&gt; instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL);
</del><ins>+    PassRefPtr&lt;NetscapePluginInstanceProxy&gt; instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame);
</ins><span class="cx"> 
</span><span class="cx">     void pluginHostDied(NetscapePluginHostProxy*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedNetscapePluginHostManagermm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;NetscapePluginInstanceProxy&gt; NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL)
</del><ins>+PassRefPtr&lt;NetscapePluginInstanceProxy&gt; NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame)
</ins><span class="cx"> {
</span><span class="cx">     NetscapePluginHostProxy* hostProxy = hostForPackage(pluginPackage);
</span><span class="cx">     if (!hostProxy)
</span><span class="lines">@@ -220,10 +220,12 @@
</span><span class="cx">     if (sourceURL)
</span><span class="cx">         [properties.get() setObject:[sourceURL absoluteString] forKey:@&quot;sourceURL&quot;];
</span><span class="cx">     
</span><ins>+    [properties.get() setObject:[NSNumber numberWithBool:fullFrame] forKey:@&quot;fullFrame&quot;];
+    
</ins><span class="cx">     NSData *data = [NSPropertyListSerialization dataFromPropertyList:properties.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil];
</span><span class="cx">     ASSERT(data);
</span><span class="cx">     
</span><del>-    RefPtr&lt;NetscapePluginInstanceProxy&gt; instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView);
</del><ins>+    RefPtr&lt;NetscapePluginInstanceProxy&gt; instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame);
</ins><span class="cx">     uint32_t requestID = instance-&gt;nextRequestID();
</span><span class="cx">     kern_return_t kr = _WKPHInstantiatePlugin(hostProxy-&gt;port(), requestID, (uint8_t*)[data bytes], [data length], instance-&gt;pluginID());
</span><span class="cx">     if (kr == MACH_SEND_INVALID_DEST) {
</span><span class="lines">@@ -234,7 +236,7 @@
</span><span class="cx">         hostProxy = hostForPackage(pluginPackage);
</span><span class="cx">         
</span><span class="cx">         // Create a new instance.
</span><del>-        instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView);
</del><ins>+        instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame);
</ins><span class="cx">         requestID = instance-&gt;nextRequestID();
</span><span class="cx">         kr = _WKPHInstantiatePlugin(hostProxy-&gt;port(), requestID, (uint8_t*)[data bytes], [data length], instance-&gt;pluginID());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedNetscapePluginHostProxymm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -368,11 +368,9 @@
</span><span class="cx">     if (!instanceProxy)
</span><span class="cx">         return KERN_FAILURE;
</span><span class="cx">     
</span><del>-    HostedNetscapePluginStream* pluginStream = instanceProxy-&gt;pluginStream(streamID);
-    if (!pluginStream)
</del><ins>+    if (!instanceProxy-&gt;cancelStreamLoad(streamID, reason))
</ins><span class="cx">         return KERN_FAILURE;
</span><del>-
-    pluginStream-&gt;cancelLoad(reason);
</del><ins>+    
</ins><span class="cx">     return KERN_SUCCESS;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedNetscapePluginInstanceProxyh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx">     
</span><span class="cx"> class NetscapePluginInstanceProxy : public RefCounted&lt;NetscapePluginInstanceProxy&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;NetscapePluginInstanceProxy&gt; create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView)
</del><ins>+    static PassRefPtr&lt;NetscapePluginInstanceProxy&gt; create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView));
</del><ins>+        return adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin));
</ins><span class="cx">     }
</span><span class="cx">     ~NetscapePluginInstanceProxy();
</span><span class="cx">     
</span><span class="lines">@@ -79,9 +79,12 @@
</span><span class="cx">     WebHostedNetscapePluginView *pluginView() const { return m_pluginView; }
</span><span class="cx">     NetscapePluginHostProxy* hostProxy() const { return m_pluginHostProxy; }
</span><span class="cx">     
</span><del>-    HostedNetscapePluginStream *pluginStream(uint32_t streamID);
</del><ins>+    bool cancelStreamLoad(uint32_t streamID, NPReason);
</ins><span class="cx">     void disconnectStream(HostedNetscapePluginStream*);
</span><span class="cx">     
</span><ins>+    void setManualStream(PassRefPtr&lt;HostedNetscapePluginStream&gt;);
+    HostedNetscapePluginStream* manualStream() const { return m_manualStream.get(); }
+    
</ins><span class="cx">     void pluginHostDied();
</span><span class="cx">     
</span><span class="cx">     void resize(NSRect size, NSRect clipRect);
</span><span class="lines">@@ -242,7 +245,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx"> private:
</span><del>-    NetscapePluginInstanceProxy(NetscapePluginHostProxy*, WebHostedNetscapePluginView *);
</del><ins>+    NetscapePluginInstanceProxy(NetscapePluginHostProxy*, WebHostedNetscapePluginView *, bool fullFramePlugin);
</ins><span class="cx"> 
</span><span class="cx">     NPError loadRequest(NSURLRequest *, const char* cTarget, bool currentEventIsUserGesture, uint32_t&amp; streamID);
</span><span class="cx">     
</span><span class="lines">@@ -291,6 +294,8 @@
</span><span class="cx">     unsigned m_pluginFunctionCallDepth;
</span><span class="cx">     bool m_shouldStopSoon;
</span><span class="cx">     uint32_t m_currentRequestID;
</span><ins>+    
+    RefPtr&lt;HostedNetscapePluginStream&gt; m_manualStream;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedNetscapePluginInstanceProxymm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> 
</span><span class="cx"> static uint32_t pluginIDCounter;
</span><span class="cx"> 
</span><del>-NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView)
</del><ins>+NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin)
</ins><span class="cx">     : m_pluginHostProxy(pluginHostProxy)
</span><span class="cx">     , m_pluginView(pluginView)
</span><span class="cx">     , m_requestTimer(this, &amp;NetscapePluginInstanceProxy::requestTimerFired)
</span><span class="lines">@@ -108,6 +108,12 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_pluginView);
</span><span class="cx">     
</span><ins>+    if (fullFramePlugin) {
+        // For full frame plug-ins, the first requestID will always be the one for the already
+        // open stream.
+        ++m_currentRequestID;
+    }
+    
</ins><span class="cx">     // Assign a plug-in ID.
</span><span class="cx">     do {
</span><span class="cx">         m_pluginID = ++pluginIDCounter;
</span><span class="lines">@@ -186,11 +192,29 @@
</span><span class="cx">     invalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HostedNetscapePluginStream *NetscapePluginInstanceProxy::pluginStream(uint32_t streamID)
</del><ins>+void NetscapePluginInstanceProxy::setManualStream(PassRefPtr&lt;HostedNetscapePluginStream&gt; manualStream) 
</ins><span class="cx"> {
</span><del>-    return m_streams.get(streamID).get();
</del><ins>+    ASSERT(!m_manualStream);
+    
+    m_manualStream = manualStream;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool NetscapePluginInstanceProxy::cancelStreamLoad(uint32_t streamID, NPReason reason) 
+{
+    HostedNetscapePluginStream* stream = 0;
+    
+    if (m_manualStream &amp;&amp; streamID == 1)
+        stream = m_manualStream.get();
+    else
+        stream = m_streams.get(streamID).get();
+    
+    if (!streamID)
+        return false;
+    
+    stream-&gt;cancelLoad(reason);
+    return true;
+}
+
</ins><span class="cx"> void NetscapePluginInstanceProxy::disconnectStream(HostedNetscapePluginStream* stream)
</span><span class="cx"> {
</span><span class="cx">     m_streams.remove(stream-&gt;streamID());
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedWebHostedNetscapePluginViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -31,10 +31,11 @@
</span><span class="cx"> #import &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><ins>+    class HostedNetscapePluginStream;
</ins><span class="cx">     class NetscapePluginInstanceProxy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-@interface WebHostedNetscapePluginView : WebBaseNetscapePluginView
</del><ins>+@interface WebHostedNetscapePluginView : WebBaseNetscapePluginView&lt;WebPluginManualLoader&gt;
</ins><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;NSArray&gt; _attributeKeys;
</span><span class="cx">     RetainPtr&lt;NSArray&gt; _attributeValues;
</span></span></pre></div>
<a id="trunkWebKitmacPluginsHostedWebHostedNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -26,15 +26,18 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebHostedNetscapePluginView.h&quot;
</span><span class="cx"> 
</span><ins>+#import &quot;HostedNetscapePluginStream.h&quot;
</ins><span class="cx"> #import &quot;NetscapePluginInstanceProxy.h&quot;
</span><span class="cx"> #import &quot;NetscapePluginHostManager.h&quot;
</span><span class="cx"> #import &quot;NetscapePluginHostProxy.h&quot;
</span><span class="cx"> #import &quot;WebTextInputWindowController.h&quot;
</span><ins>+#import &quot;WebFrameInternal.h&quot;
</ins><span class="cx"> #import &quot;WebView.h&quot;
</span><span class="cx"> #import &quot;WebViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebUIDelegate.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &lt;CoreFoundation/CoreFoundation.h&gt;
</span><ins>+#import &lt;WebCore/Frame.h&gt;
</ins><span class="cx"> #import &lt;WebCore/HTMLPlugInElement.h&gt;
</span><span class="cx"> #import &lt;WebCore/runtime.h&gt;
</span><span class="cx"> #import &lt;WebCore/runtime_root.h&gt;
</span><span class="lines">@@ -97,7 +100,7 @@
</span><span class="cx"> 
</span><span class="cx">     NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()];
</span><span class="cx"> 
</span><del>-    _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get());
</del><ins>+    _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), _mode == NP_FULL);
</ins><span class="cx">     if (!_proxy) 
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><span class="lines">@@ -345,6 +348,48 @@
</span><span class="cx">     return _proxy-&gt;createBindingsInstance(rootObject);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response
+{
+    ASSERT(_loadManually);
+    if (!_proxy)
+        return;
+    
+    ASSERT(!_proxy-&gt;manualStream());
+
+    _proxy-&gt;setManualStream(HostedNetscapePluginStream::create(_proxy.get(), core([self webFrame])-&gt;loader()));
+    _proxy-&gt;manualStream()-&gt;startStreamWithResponse(response);
+}
+
+- (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data
+{
+    ASSERT(_loadManually);
+    if (!_proxy)
+        return;
+    
+    if (HostedNetscapePluginStream* manualStream = _proxy-&gt;manualStream())
+        manualStream-&gt;didReceiveData(0, static_cast&lt;const char*&gt;([data bytes]), [data length]);
+}
+
+- (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error
+{
+    ASSERT(_loadManually);
+    if (!_proxy)
+        return;
+    
+    if (HostedNetscapePluginStream* manualStream = _proxy-&gt;manualStream())
+        manualStream-&gt;didFail(0, error);
+}
+
+- (void)pluginViewFinishedLoading:(NSView *)pluginView
+{
+    ASSERT(_loadManually);
+    if (!_proxy)
+        return;
+    
+    if (HostedNetscapePluginStream* manualStream = _proxy-&gt;manualStream())
+        manualStream-&gt;didFinishLoading(0);
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebFrameLoaderClientmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (42614 => 42615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2009-04-17 17:44:57 UTC (rev 42614)
+++ trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm        2009-04-17 17:46:44 UTC (rev 42615)
</span><span class="lines">@@ -1375,14 +1375,11 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> 
</span><del>-static Class netscapePluginViewClass()
-{
</del><span class="cx"> #if USE(PLUGIN_HOST_PROCESS)
</span><del>-    return [WebHostedNetscapePluginView class];
</del><ins>+#define NETSCAPE_PLUGIN_VIEW WebHostedNetscapePluginView
</ins><span class="cx"> #else
</span><del>-    return [WebNetscapePluginView class];
</del><ins>+#define NETSCAPE_PLUGIN_VIEW WebNetscapePluginView
</ins><span class="cx"> #endif
</span><del>-}
</del><span class="cx"> 
</span><span class="cx"> Widget* WebFrameLoaderClient::createPlugin(const IntSize&amp; size, HTMLPlugInElement* element, const KURL&amp; url,
</span><span class="cx">     const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually)
</span><span class="lines">@@ -1452,7 +1449,7 @@
</span><span class="cx">             
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">         else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
</span><del>-            WebBaseNetscapePluginView *pluginView = [[[netscapePluginViewClass() alloc]
</del><ins>+            WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
</ins><span class="cx">                 initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
</span><span class="cx">                 pluginPackage:(WebNetscapePluginPackage *)pluginPackage
</span><span class="cx">                 URL:URL
</span><span class="lines">@@ -1501,8 +1498,8 @@
</span><span class="cx">     NSView *pluginView = pluginWidget-&gt;platformWidget();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-    if ([pluginView isKindOfClass:[WebNetscapePluginView class]])
-        [representation _redirectDataToManualLoader:(WebNetscapePluginView *)pluginView forPluginView:pluginView];
</del><ins>+    if ([pluginView isKindOfClass:[NETSCAPE_PLUGIN_VIEW class]])
+        [representation _redirectDataToManualLoader:(NETSCAPE_PLUGIN_VIEW *)pluginView forPluginView:pluginView];
</ins><span class="cx">     else {
</span><span class="cx"> #else
</span><span class="cx">     {
</span><span class="lines">@@ -1545,7 +1542,7 @@
</span><span class="cx">         } 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">         else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
</span><del>-            view = [[[netscapePluginViewClass() alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
</del><ins>+            view = [[[NETSCAPE_PLUGIN_VIEW alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
</ins><span class="cx">                 pluginPackage:(WebNetscapePluginPackage *)pluginPackage
</span><span class="cx">                 URL:nil
</span><span class="cx">                 baseURL:baseURL
</span></span></pre>
</div>
</div>

</body>
</html>