<!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>[37915] 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/37915">37915</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2008-10-27 18:31:45 -0700 (Mon, 27 Oct 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>2008-10-27  Anders Carlsson  &lt;andersca@apple.com&gt;

        Reviewed by Dan Bernstein.
        
        Use the C++ stream object in WebBaseNetscapePluginView. Use a HashSet of RefPtrs to keep track of the streams.
        
        * Plugins/WebBaseNetscapePluginStream.mm:
        (WebNetscapePluginStream::~WebNetscapePluginStream):
        (WebNetscapePluginStream::setPlugin):
        (WebNetscapePluginStream::startStream):
        (WebNetscapePluginStream::destroyStream):
        (WebNetscapePluginStream::destroyStreamWithReason):
        (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError):
        (WebNetscapePluginStream::deliverData):
        * Plugins/WebBaseNetscapePluginView.h:
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView stop]):
        (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
        (-[WebBaseNetscapePluginView disconnectStream:]):
        (-[WebBaseNetscapePluginView dealloc]):
        (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
        (-[WebBaseNetscapePluginView pluginView:receivedData:]):
        (-[WebBaseNetscapePluginView pluginView:receivedError:]):
        (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]):
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginStreammm">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewh">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewmm">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (37914 => 37915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-10-28 01:07:26 UTC (rev 37914)
+++ trunk/WebKit/mac/ChangeLog        2008-10-28 01:31:45 UTC (rev 37915)
</span><span class="lines">@@ -1,7 +1,33 @@
</span><span class="cx"> 2008-10-27  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><del>-        Reviewed by Mitz Pettel.
</del><ins>+        Reviewed by Dan Bernstein.
</ins><span class="cx">         
</span><ins>+        Use the C++ stream object in WebBaseNetscapePluginView. Use a HashSet of RefPtrs to keep track of the streams.
+        
+        * Plugins/WebBaseNetscapePluginStream.mm:
+        (WebNetscapePluginStream::~WebNetscapePluginStream):
+        (WebNetscapePluginStream::setPlugin):
+        (WebNetscapePluginStream::startStream):
+        (WebNetscapePluginStream::destroyStream):
+        (WebNetscapePluginStream::destroyStreamWithReason):
+        (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError):
+        (WebNetscapePluginStream::deliverData):
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView stop]):
+        (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
+        (-[WebBaseNetscapePluginView disconnectStream:]):
+        (-[WebBaseNetscapePluginView dealloc]):
+        (-[WebBaseNetscapePluginView pluginView:receivedResponse:]):
+        (-[WebBaseNetscapePluginView pluginView:receivedData:]):
+        (-[WebBaseNetscapePluginView pluginView:receivedError:]):
+        (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]):
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+
+2008-10-27  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+        
</ins><span class="cx">         Move code from dealloc and finalize to the WebNetscapePluginStream destructor.
</span><span class="cx">         
</span><span class="cx">         * Plugins/WebBaseNetscapePluginStream.h:
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginStreammm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm (37914 => 37915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm        2008-10-28 01:07:26 UTC (rev 37914)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm        2008-10-28 01:31:45 UTC (rev 37915)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_plugin);
</span><span class="cx">     ASSERT(m_isTerminated);
</span><del>-    ASSERT(m_stream.ndata == nil);
</del><ins>+    ASSERT(!m_stream.ndata);
</ins><span class="cx">     
</span><span class="cx">     // The stream file should have been deleted, and the path freed, in -_destroyStream
</span><span class="cx">     ASSERT(!m_path);
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx">         m_plugin = 0;
</span><span class="cx">         m_pluginFuncs = 0;
</span><span class="cx">         
</span><del>-        [view disconnectStream:m_pluginStream];
</del><ins>+        [view disconnectStream:this];
</ins><span class="cx">         m_pluginView = 0;
</span><span class="cx">     }        
</span><span class="cx"> }
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     free((void *)m_stream.url);
</span><span class="cx">     m_stream.url = strdup([m_responseURL.get() _web_URLCString]);
</span><span class="cx"> 
</span><del>-    m_stream.ndata = m_pluginStream;
</del><ins>+    m_stream.ndata = this;
</ins><span class="cx">     m_stream.end = expectedContentLength &gt; 0 ? (uint32)expectedContentLength : 0;
</span><span class="cx">     m_stream.lastmodified = (uint32)[lastModifiedDate timeIntervalSince1970];
</span><span class="cx">     m_stream.notifyData = m_notifyData;
</span><span class="lines">@@ -412,14 +412,14 @@
</span><span class="cx">     if (m_isTerminated)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WebBaseNetscapePluginStream&gt; protect(m_pluginStream);
</del><ins>+    RefPtr&lt;WebNetscapePluginStream&gt; protect(this);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(m_reason != WEB_REASON_NONE);
</span><span class="cx">     ASSERT([m_deliveryData.get() length] == 0);
</span><span class="cx">     
</span><span class="cx">     m_deliverDataTimer.stop();
</span><span class="cx"> 
</span><del>-    if (m_stream.ndata != nil) {
</del><ins>+    if (m_stream.ndata) {
</ins><span class="cx">         if (m_reason == NPRES_DONE &amp;&amp; (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) {
</span><span class="cx">             ASSERT(m_fileDescriptor == -1);
</span><span class="cx">             ASSERT(m_path);
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx">         m_headers = NULL;
</span><span class="cx">         m_stream.headers = NULL;
</span><span class="cx"> 
</span><del>-        m_stream.ndata = nil;
</del><ins>+        m_stream.ndata = 0;
</ins><span class="cx"> 
</span><span class="cx">         if (m_isTerminated)
</span><span class="cx">             return;
</span><span class="lines">@@ -493,7 +493,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     destroyStream();
</span><del>-    ASSERT(m_stream.ndata == nil);
</del><ins>+    ASSERT(!m_stream.ndata);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebNetscapePluginStream::cancelLoadWithError(NSError *error)
</span><span class="lines">@@ -525,7 +525,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError(NSError *error)
</span><span class="cx"> {
</span><del>-    RetainPtr&lt;WebBaseNetscapePluginStream&gt; protect(m_pluginStream);
</del><ins>+    RefPtr&lt;WebNetscapePluginStream&gt; protect(this);
</ins><span class="cx">     cancelLoadWithError(error);
</span><span class="cx">     destroyStreamWithError(error);
</span><span class="cx">     setPlugin(0);
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx">     if (!m_stream.ndata || [m_deliveryData.get() length] == 0)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WebBaseNetscapePluginStream&gt; protect(m_pluginStream);
</del><ins>+    RefPtr&lt;WebNetscapePluginStream&gt; protect(this);
</ins><span class="cx"> 
</span><span class="cx">     int32 totalBytes = [m_deliveryData.get() length];
</span><span class="cx">     int32 totalBytesDelivered = 0;
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h (37914 => 37915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2008-10-28 01:07:26 UTC (rev 37914)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2008-10-28 01:31:45 UTC (rev 37915)
</span><span class="lines">@@ -33,16 +33,17 @@
</span><span class="cx"> #import &lt;WebKit/npapi.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebBasePluginPackage.h&gt;
</span><span class="cx"> #import &lt;wtf/HashMap.h&gt;
</span><ins>+#import &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> @class DOMElement;
</span><span class="cx"> @class WebDataSource;
</span><span class="cx"> @class WebFrame;
</span><span class="cx"> @class WebNetscapePluginPackage;
</span><span class="cx"> @class WebNetscapePluginNullEventSender;
</span><del>-@class WebBaseNetscapePluginStream;
</del><span class="cx"> @class WebView;
</span><span class="cx"> 
</span><span class="cx"> class PluginTimer;
</span><ins>+class WebNetscapePluginStream;
</ins><span class="cx"> class WebNetscapePluginEventHandler;
</span><span class="cx"> 
</span><span class="cx"> typedef union PluginPort {
</span><span class="lines">@@ -62,7 +63,7 @@
</span><span class="cx">     WebFrame *_webFrame;
</span><span class="cx">     
</span><span class="cx">     BOOL _loadManually;
</span><del>-    WebBaseNetscapePluginStream *_manualStream;
</del><ins>+    RefPtr&lt;WebNetscapePluginStream&gt; _manualStream;
</ins><span class="cx">     unsigned _dataLengthReceived;
</span><span class="cx">     NSError *_error;
</span><span class="cx">     
</span><span class="lines">@@ -109,7 +110,8 @@
</span><span class="cx">     NSString *MIMEType;
</span><span class="cx">     NSURL *baseURL;
</span><span class="cx">     NSTrackingRectTag trackingTag;
</span><del>-    NSMutableArray *streams;
</del><ins>+    
+    HashSet&lt;RefPtr&lt;WebNetscapePluginStream&gt; &gt; streams;
</ins><span class="cx">     NSMutableDictionary *pendingFrameLoads;
</span><span class="cx">     
</span><span class="cx">     NPPluginTextInputFuncs *textInputFuncs;
</span><span class="lines">@@ -164,7 +166,7 @@
</span><span class="cx"> - (void)setMode:(int)theMode;
</span><span class="cx"> - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow;
</span><span class="cx"> - (void)viewDidMoveToHostWindow;
</span><del>-- (void)disconnectStream:(WebBaseNetscapePluginStream*)stream;
</del><ins>+- (void)disconnectStream:(WebNetscapePluginStream*)stream;
</ins><span class="cx"> 
</span><span class="cx"> // Returns the NPObject that represents the plugin interface.
</span><span class="cx"> // The return value is expected to be retained.
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (37914 => 37915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2008-10-28 01:07:26 UTC (rev 37914)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2008-10-28 01:31:45 UTC (rev 37915)
</span><span class="lines">@@ -1251,12 +1251,14 @@
</span><span class="cx">     
</span><span class="cx">     [[self webView] removePluginInstanceView:self];
</span><span class="cx"> 
</span><del>-    // To stop active streams it's necessary to invoke makeObjectsPerformSelector on a copy 
-    // of streams. This is because calling -[WebNetscapePluginStream stop] also has the side effect
-    // of removing a stream from this collection.
-    NSArray *streamsCopy = [streams copy];
-    [streamsCopy makeObjectsPerformSelector:@selector(stop)];
-    [streamsCopy release];
</del><ins>+    // To stop active streams it's necessary to invoke stop() on a copy 
+    // of streams. This is because calling WebNetscapePluginStream::stop() also has the side effect
+    // of removing a stream from this hash set.
+    Vector&lt;RefPtr&lt;WebNetscapePluginStream&gt; &gt; streamsCopy;
+    copyToVector(streams, streamsCopy);
+    for (size_t i = 0; i &lt; streamsCopy.size(); i++)
+        streamsCopy[i]-&gt;stop();
+    
</ins><span class="cx">    
</span><span class="cx">     // Stop the timers
</span><span class="cx">     [self stopTimers];
</span><span class="lines">@@ -1416,7 +1418,6 @@
</span><span class="cx"> {
</span><span class="cx">     [super initWithFrame:frame];
</span><span class="cx">  
</span><del>-    streams = [[NSMutableArray alloc] init];
</del><span class="cx">     pendingFrameLoads = [[NSMutableDictionary alloc] init];    
</span><span class="cx">     
</span><span class="cx">     // load the plug-in if it is not already loaded
</span><span class="lines">@@ -1471,9 +1472,9 @@
</span><span class="cx">     }    
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)disconnectStream:(WebBaseNetscapePluginStream*)stream
</del><ins>+- (void)disconnectStream:(WebNetscapePluginStream*)stream
</ins><span class="cx"> {
</span><del>-    [streams removeObjectIdenticalTo:stream];    
</del><ins>+    streams.remove(stream);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)dealloc
</span><span class="lines">@@ -1481,11 +1482,9 @@
</span><span class="cx">     ASSERT(!isStarted);
</span><span class="cx"> 
</span><span class="cx">     [sourceURL release];
</span><del>-    [_manualStream release];
</del><span class="cx">     [_error release];
</span><span class="cx">     
</span><span class="cx">     [pluginPackage release];
</span><del>-    [streams release];
</del><span class="cx">     [MIMEType release];
</span><span class="cx">     [baseURL release];
</span><span class="cx">     [pendingFrameLoads release];
</span><span class="lines">@@ -1756,8 +1755,8 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(_loadManually);
</span><span class="cx">     ASSERT(!_manualStream);
</span><del>-    
-    _manualStream = [[WebBaseNetscapePluginStream alloc] initWithFrameLoader:core([self webFrame])-&gt;loader()];
</del><ins>+
+    _manualStream = WebNetscapePluginStream::create(0, core([self webFrame])-&gt;loader());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data
</span><span class="lines">@@ -1770,19 +1769,17 @@
</span><span class="cx">     if (![self isStarted])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebNetscapePluginStream *manualStream = [_manualStream impl];
-    
-    if (!manualStream-&gt;plugin()) {
</del><ins>+    if (!_manualStream-&gt;plugin()) {
</ins><span class="cx"> 
</span><del>-        manualStream-&gt;setRequestURL([[[self dataSource] request] URL]);
-        manualStream-&gt;setPlugin([self plugin]);
-        ASSERT(manualStream-&gt;plugin());
</del><ins>+        _manualStream-&gt;setRequestURL([[[self dataSource] request] URL]);
+        _manualStream-&gt;setPlugin([self plugin]);
+        ASSERT(_manualStream-&gt;plugin());
</ins><span class="cx">         
</span><del>-        manualStream-&gt;startStreamWithResponse([[self dataSource] response]);
</del><ins>+        _manualStream-&gt;startStreamWithResponse([[self dataSource] response]);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (manualStream-&gt;plugin())
-        manualStream-&gt;didReceiveData(0, static_cast&lt;const char *&gt;([data bytes]), [data length]);
</del><ins>+    if (_manualStream-&gt;plugin())
+        _manualStream-&gt;didReceiveData(0, static_cast&lt;const char *&gt;([data bytes]), [data length]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error
</span><span class="lines">@@ -1797,7 +1794,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [_manualStream impl]-&gt;destroyStreamWithError(error);
</del><ins>+    _manualStream-&gt;destroyStreamWithError(error);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)pluginViewFinishedLoading:(NSView *)pluginView 
</span><span class="lines">@@ -1806,7 +1803,7 @@
</span><span class="cx">     ASSERT(_manualStream);
</span><span class="cx">     
</span><span class="cx">     if ([self isStarted])
</span><del>-        [_manualStream impl]-&gt;didFinishLoading(0);
</del><ins>+        _manualStream-&gt;didFinishLoading(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #pragma mark NSTextInput implementation
</span><span class="lines">@@ -2188,16 +2185,10 @@
</span><span class="cx">         [self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0];
</span><span class="cx">         [pluginRequest release];
</span><span class="cx">     } else {
</span><del>-        WebBaseNetscapePluginStream *stream = [[WebBaseNetscapePluginStream alloc] initWithRequest:request 
-                                                                                            plugin:plugin 
-                                                                                        notifyData:notifyData 
-                                                                                  sendNotification:sendNotification];
-        if (!stream)
-            return NPERR_INVALID_URL;
</del><ins>+        RefPtr&lt;WebNetscapePluginStream&gt; stream = WebNetscapePluginStream::create(0, request, plugin, sendNotification, notifyData);
</ins><span class="cx"> 
</span><del>-        [streams addObject:stream];
-        [stream impl]-&gt;start();
-        [stream release];
</del><ins>+        streams.add(stream.get());
+        stream-&gt;start();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return NPERR_NO_ERROR;
</span></span></pre>
</div>
</div>

</body>
</html>