Commit 727d0762 authored by mitz@apple.com's avatar mitz@apple.com

<rdar://problem/7044385> Crash at NetscapePlugInStreamLoader::didReceiveResponse()

Reviewed by Anders Carlsson.

The crash was caused by having two streams with a streamID of 1.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Fixed a typo. Now
correctly increments m_currentURLRequestID to account for the manual stream.
(WebKit::NetscapePluginInstanceProxy::disconnectStream): If the stream is the manual stream,
null it out instead of trying to remove it from the map. Added an assertion.
(WebKit::NetscapePluginInstanceProxy::loadRequest): Added an assertion.



git-svn-id: svn://svn.chromium.org/blink/trunk@54178 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1848851e
2010-02-01 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
<rdar://problem/7044385> Crash at NetscapePlugInStreamLoader::didReceiveResponse()
The crash was caused by having two streams with a streamID of 1.
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Fixed a typo. Now
correctly increments m_currentURLRequestID to account for the manual stream.
(WebKit::NetscapePluginInstanceProxy::disconnectStream): If the stream is the manual stream,
null it out instead of trying to remove it from the map. Added an assertion.
(WebKit::NetscapePluginInstanceProxy::loadRequest): Added an assertion.
== Rolled over to ChangeLog-2010-01-29 == == Rolled over to ChangeLog-2010-01-29 ==
...@@ -126,7 +126,7 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy ...@@ -126,7 +126,7 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
if (fullFramePlugin) { if (fullFramePlugin) {
// For full frame plug-ins, the first requestID will always be the one for the already // For full frame plug-ins, the first requestID will always be the one for the already
// open stream. // open stream.
++m_currentRequestID; ++m_currentURLRequestID;
} }
// Assign a plug-in ID. // Assign a plug-in ID.
...@@ -261,6 +261,12 @@ bool NetscapePluginInstanceProxy::cancelStreamLoad(uint32_t streamID, NPReason r ...@@ -261,6 +261,12 @@ bool NetscapePluginInstanceProxy::cancelStreamLoad(uint32_t streamID, NPReason r
void NetscapePluginInstanceProxy::disconnectStream(HostedNetscapePluginStream* stream) void NetscapePluginInstanceProxy::disconnectStream(HostedNetscapePluginStream* stream)
{ {
if (stream == m_manualStream) {
m_manualStream = 0;
return;
}
ASSERT(m_streams.get(stream->streamID()) == stream);
m_streams.remove(stream->streamID()); m_streams.remove(stream->streamID());
} }
...@@ -655,6 +661,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch ...@@ -655,6 +661,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch
} else { } else {
RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, requestID, request); RefPtr<HostedNetscapePluginStream> stream = HostedNetscapePluginStream::create(this, requestID, request);
ASSERT(!m_streams.contains(requestID));
m_streams.add(requestID, stream); m_streams.add(requestID, stream);
stream->start(); stream->start();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment