2008-10-29 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Oct 2008 18:12:31 +0000 (18:12 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Oct 2008 18:12:31 +0000 (18:12 +0000)
        Reviewed by Kevin Decker.

        * Plugins/WebBaseNetscapePluginStream.h:
        * Plugins/WebBaseNetscapePluginStream.mm:
        (WebNetscapePluginStream::WebNetscapePluginStream):
        (WebNetscapePluginStream::~WebNetscapePluginStream):
        (WebNetscapePluginStream::start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38002 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebBaseNetscapePluginStream.h
WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm

index 42eeda7..1ea67b6 100644 (file)
@@ -1,5 +1,15 @@
 2008-10-29  Anders Carlsson  <andersca@apple.com>
 
+        Reviewed by Kevin Decker.
+
+        * Plugins/WebBaseNetscapePluginStream.h:
+        * Plugins/WebBaseNetscapePluginStream.mm:
+        (WebNetscapePluginStream::WebNetscapePluginStream):
+        (WebNetscapePluginStream::~WebNetscapePluginStream):
+        (WebNetscapePluginStream::start):
+
+2008-10-29  Anders Carlsson  <andersca@apple.com>
+
         Reviewed by Sam Weinig.
 
         Remove an unused forward class declaration.
index c2cb315..c2e8a21 100644 (file)
@@ -119,8 +119,8 @@ private:
     bool m_newStreamSuccessful;
     
     WebCore::FrameLoader* m_frameLoader;
-    WebCore::NetscapePlugInStreamLoader* m_loader;
-    NSURLRequest *m_request;
+    RefPtr<WebCore::NetscapePlugInStreamLoader> m_loader;
+    RetainPtr<NSMutableURLRequest> m_request;
     NPPluginFuncs *m_pluginFuncs;
 
     void deliverDataTimerFired(WebCore::Timer<WebNetscapePluginStream>* timer);
index 2d610f5..5666f61 100644 (file)
@@ -109,8 +109,6 @@ WebNetscapePluginStream::WebNetscapePluginStream(FrameLoader* frameLoader)
     , m_isTerminated(false)
     , m_newStreamSuccessful(false)
     , m_frameLoader(frameLoader)
-    , m_loader(0)
-    , m_request(0)
     , m_pluginFuncs(0)
     , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired)
 {
@@ -130,8 +128,7 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
     , m_isTerminated(false)
     , m_newStreamSuccessful(false)
     , m_frameLoader(0)
-    , m_loader(0)
-    , m_request([request mutableCopy])
+    , m_request(AdoptNS, [request mutableCopy])
     , m_pluginFuncs(0)
     , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired)
 {
@@ -150,9 +147,9 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
     streams().add(&m_stream, plugin);
         
     if (core([view webFrame])->loader()->shouldHideReferrer([request URL], core([view webFrame])->loader()->outgoingReferrer()))
-        [(NSMutableURLRequest *)m_request _web_setHTTPReferrer:nil];
+        [m_request.get() _web_setHTTPReferrer:nil];
     
-    m_loader = NetscapePlugInStreamLoader::create(core([view webFrame]), this).releaseRef();
+    m_loader = NetscapePlugInStreamLoader::create(core([view webFrame]), this);
     m_loader->setShouldBufferData(false);
 }
 
@@ -166,10 +163,6 @@ WebNetscapePluginStream::~WebNetscapePluginStream()
     ASSERT(!m_path);
     ASSERT(m_fileDescriptor == -1);
     
-    if (m_loader)
-        m_loader->deref();
-    [m_request release];
-    
     free((void *)m_stream.url);
     free(m_headers);
     
@@ -264,8 +257,8 @@ void WebNetscapePluginStream::start()
     ASSERT(m_request);
     ASSERT(!m_frameLoader);
     
-    m_loader->documentLoader()->addPlugInStreamLoader(m_loader);
-    m_loader->load(m_request);    
+    m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get());
+    m_loader->load(m_request.get());
 }
 
 void WebNetscapePluginStream::stop()