summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm')
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm20
1 files changed, 12 insertions, 8 deletions
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
index 246a3ca..a29be2d 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
@@ -29,7 +29,7 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebBaseNetscapePluginStream.h"
-#import "WebBaseNetscapePluginView.h"
+#import "WebNetscapePluginView.h"
#import "WebFrameInternal.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
@@ -45,6 +45,7 @@
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKitSystemInterface.h>
#import <wtf/HashMap.h>
+#import <wtf/StdLibExtras.h>
using namespace WebCore;
@@ -55,7 +56,7 @@ static NSString *CarbonPathFromPOSIXPath(NSString *posixPath);
typedef HashMap<NPStream*, NPP> StreamMap;
static StreamMap& streams()
{
- static StreamMap staticStreams;
+ DEFINE_STATIC_LOCAL(StreamMap, staticStreams, ());
return staticStreams;
}
@@ -134,7 +135,7 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
{
memset(&m_stream, 0, sizeof(NPStream));
- WebBaseNetscapePluginView *view = (WebBaseNetscapePluginView *)plugin->ndata;
+ WebNetscapePluginView *view = (WebNetscapePluginView *)plugin->ndata;
// This check has already been done by the plug-in view.
ASSERT(FrameLoader::canLoad([request URL], String(), core([view webFrame])->document()));
@@ -148,9 +149,6 @@ WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plug
if (core([view webFrame])->loader()->shouldHideReferrer([request URL], core([view webFrame])->loader()->outgoingReferrer()))
[m_request.get() _web_setHTTPReferrer:nil];
-
- m_loader = NetscapePlugInStreamLoader::create(core([view webFrame]), this);
- m_loader->setShouldBufferData(false);
}
WebNetscapePluginStream::~WebNetscapePluginStream()
@@ -173,13 +171,13 @@ void WebNetscapePluginStream::setPlugin(NPP plugin)
{
if (plugin) {
m_plugin = plugin;
- m_pluginView = static_cast<WebBaseNetscapePluginView *>(m_plugin->ndata);
+ m_pluginView = static_cast<WebNetscapePluginView *>(m_plugin->ndata);
WebNetscapePluginPackage *pluginPackage = [m_pluginView.get() pluginPackage];
m_pluginFuncs = [pluginPackage pluginFuncs];
} else {
- WebBaseNetscapePluginView *view = m_pluginView.get();
+ WebNetscapePluginView *view = m_pluginView.get();
m_plugin = 0;
m_pluginFuncs = 0;
@@ -256,6 +254,10 @@ void WebNetscapePluginStream::start()
{
ASSERT(m_request);
ASSERT(!m_frameLoader);
+ ASSERT(!m_loader);
+
+ m_loader = NetscapePlugInStreamLoader::create(core([m_pluginView.get() webFrame]), this);
+ m_loader->setShouldBufferData(false);
m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get());
m_loader->load(m_request.get());
@@ -434,6 +436,8 @@ void WebNetscapePluginStream::destroyStreamWithReason(NPReason reason)
// There is more data to be streamed, don't destroy the stream now.
return;
}
+
+ RefPtr<WebNetscapePluginStream> protect(this);
destroyStream();
ASSERT(!m_stream.ndata);
}