Commit 2ca1398e authored by kov@webkit.org's avatar kov@webkit.org

WebCore

2009-04-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Xan Lopez.

        https://bugs.webkit.org/show_bug.cgi?id=25243
        Crash when data:// loads are cancelled

        Properly handle cancellation of the load for data:// loads. This
        fixes crashing in the followin test:

        plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::parseDataUrl):

WebKit/gtk

2009-04-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Xan Lopez.

        Handle the case when the plugin view is destroyed during
        didReceiveResponse, to avoid crashing.

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::committedLoad):

git-svn-id: svn://svn.chromium.org/blink/trunk@42670 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 317a50ee
2009-04-20 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Xan Lopez.
https://bugs.webkit.org/show_bug.cgi?id=25243
Crash when data:// loads are cancelled
Properly handle cancellation of the load for data:// loads. This
fixes crashing in the followin test:
plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::parseDataUrl):
2009-04-19 Dan Bernstein <mitz@apple.com> 2009-04-19 Dan Bernstein <mitz@apple.com>
- maybe fix release builds - maybe fix release builds
...@@ -366,8 +366,11 @@ static gboolean parseDataUrl(gpointer callback_data) ...@@ -366,8 +366,11 @@ static gboolean parseDataUrl(gpointer callback_data)
{ {
ResourceHandle* handle = static_cast<ResourceHandle*>(callback_data); ResourceHandle* handle = static_cast<ResourceHandle*>(callback_data);
ResourceHandleClient* client = handle->client(); ResourceHandleClient* client = handle->client();
ResourceHandleInternal* d = handle->getInternal();
if (d->m_cancelled)
return false;
handle->getInternal()->m_idleHandler = 0; d->m_idleHandler = 0;
ASSERT(client); ASSERT(client);
if (!client) if (!client)
...@@ -403,6 +406,9 @@ static gboolean parseDataUrl(gpointer callback_data) ...@@ -403,6 +406,9 @@ static gboolean parseDataUrl(gpointer callback_data)
response.setTextEncodingName(charset); response.setTextEncodingName(charset);
client->didReceiveResponse(handle, response); client->didReceiveResponse(handle, response);
if (d->m_cancelled)
return false;
// Use the GLib Base64 if available, since WebCore's decoder isn't // Use the GLib Base64 if available, since WebCore's decoder isn't
// general-purpose and fails on Acid3 test 97 (whitespace). // general-purpose and fails on Acid3 test 97 (whitespace).
#ifdef USE_GLIB_BASE64 #ifdef USE_GLIB_BASE64
...@@ -422,8 +428,15 @@ static gboolean parseDataUrl(gpointer callback_data) ...@@ -422,8 +428,15 @@ static gboolean parseDataUrl(gpointer callback_data)
data = decodeURLEscapeSequences(data, TextEncoding(charset)); data = decodeURLEscapeSequences(data, TextEncoding(charset));
response.setTextEncodingName("UTF-16"); response.setTextEncodingName("UTF-16");
client->didReceiveResponse(handle, response); client->didReceiveResponse(handle, response);
if (d->m_cancelled)
return false;
if (data.length() > 0) if (data.length() > 0)
client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0); client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0);
if (d->m_cancelled)
return false;
} }
client->didFinishLoading(handle); client->didFinishLoading(handle);
......
2009-04-20 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Xan Lopez.
Handle the case when the plugin view is destroyed during
didReceiveResponse, to avoid crashing.
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::committedLoad):
2009-04-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2009-04-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Alexey Proskuryakov. Reviewed by Alexey Proskuryakov.
......
...@@ -201,6 +201,13 @@ void FrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, ...@@ -201,6 +201,13 @@ void FrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data,
m_pluginView->didReceiveResponse(loader->response()); m_pluginView->didReceiveResponse(loader->response());
m_hasSentResponseToPlugin = true; m_hasSentResponseToPlugin = true;
} }
// FIXME: We may want to investigate refactoring our plugin loading
// code to be similar to mac's.
// Also, see http://trac.webkit.org/changeset/24118.
if (!m_pluginView)
return;
m_pluginView->didReceiveData(data, length); m_pluginView->didReceiveData(data, length);
} }
} }
......
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