summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b1a55ba)
Reviewed by Holger Freyther.
Protect the ResourceHandle instance from being destroyed by
didReceiveData inside the GIO readCallback call, so that
cancelling caused by scripts is handled correctly.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::readCallback):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41110
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Holger Freyther.
+
+ Protect the ResourceHandle instance from being destroyed by
+ didReceiveData inside the GIO readCallback call, so that
+ cancelling caused by scripts is handled correctly.
+
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::readCallback):
+
2009-02-20 David Kilzer <ddkilzer@apple.com>
Make IconDatabaseNone.cpp compile with -Wunused and pass check-for-exit-time-destructors
2009-02-20 David Kilzer <ddkilzer@apple.com>
Make IconDatabaseNone.cpp compile with -Wunused and pass check-for-exit-time-destructors
static void readCallback(GObject* source, GAsyncResult* res, gpointer)
{
static void readCallback(GObject* source, GAsyncResult* res, gpointer)
{
- ResourceHandle* handle = static_cast<ResourceHandle*>(g_object_get_data(source, "webkit-resource"));
+ // didReceiveData may cancel the load, which may release the last reference.
+ RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(source, "webkit-resource"));
if (error) {
ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
cleanupGioOperation(d);
if (error) {
ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
cleanupGioOperation(d);
- client->didFail(handle, resourceError);
+ client->didFail(handle.get(), resourceError);
return;
} else if (!nread) {
g_input_stream_close_async(d->m_input_stream, G_PRIORITY_DEFAULT,
return;
} else if (!nread) {
g_input_stream_close_async(d->m_input_stream, G_PRIORITY_DEFAULT,
- client->didReceiveData(handle, d->m_buffer, nread, d->m_total);
+ client->didReceiveData(handle.get(), d->m_buffer, nread, d->m_total);
+
+ if (d->m_cancelled) {
+ cleanupGioOperation(d);
+ return;
+ }
g_input_stream_read_async(d->m_input_stream, d->m_buffer, d->m_bufsize,
G_PRIORITY_DEFAULT, d->m_cancellable,
g_input_stream_read_async(d->m_input_stream, d->m_buffer, d->m_bufsize,
G_PRIORITY_DEFAULT, d->m_cancellable,