Title: [108601] trunk/Source/WebCore
- Revision
- 108601
- Author
- [email protected]
- Date
- 2012-02-22 19:57:28 -0800 (Wed, 22 Feb 2012)
Log Message
[BlackBerry] NetworkJob can access deleted objects.
https://bugs.webkit.org/show_bug.cgi?id=79246
Patch by Yong Li <[email protected]> on 2012-02-22
Reviewed by Antonio Gomes.
When a NetworkJob is created by unload handler, we still need
to send the request to the server, but we shouldn't save and
keep using the Frame pointer because the frame is being detached.
The NetworkJob will be cancelled by PingLoader as soon as it gets
first response from host.
Also see https://bugs.webkit.org/show_bug.cgi?id=30457.
No new tests because existing test case is good enough like
LayoutTests/http/tests/navigation/image-load-in-unload-handler.html.
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::NetworkJob):
(WebCore::NetworkJob::initialize):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (108600 => 108601)
--- trunk/Source/WebCore/ChangeLog 2012-02-23 03:44:48 UTC (rev 108600)
+++ trunk/Source/WebCore/ChangeLog 2012-02-23 03:57:28 UTC (rev 108601)
@@ -1,3 +1,24 @@
+2012-02-22 Yong Li <[email protected]>
+
+ [BlackBerry] NetworkJob can access deleted objects.
+ https://bugs.webkit.org/show_bug.cgi?id=79246
+
+ Reviewed by Antonio Gomes.
+
+ When a NetworkJob is created by unload handler, we still need
+ to send the request to the server, but we shouldn't save and
+ keep using the Frame pointer because the frame is being detached.
+ The NetworkJob will be cancelled by PingLoader as soon as it gets
+ first response from host.
+ Also see https://bugs.webkit.org/show_bug.cgi?id=30457.
+
+ No new tests because existing test case is good enough like
+ LayoutTests/http/tests/navigation/image-load-in-unload-handler.html.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::NetworkJob):
+ (WebCore::NetworkJob::initialize):
+
2012-02-22 Kenichi Ishibashi <[email protected]>
[WebSocket] Remove zlib.h from WebSocketDeflater.h
Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp (108600 => 108601)
--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-02-23 03:44:48 UTC (rev 108600)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-02-23 03:57:28 UTC (rev 108601)
@@ -111,6 +111,7 @@
, m_redirectCount(0)
, m_deferredData(*this)
, m_deferLoadingCount(0)
+ , m_frame(0)
{
}
@@ -137,6 +138,14 @@
m_streamFactory = streamFactory;
m_frame = &frame;
+
+ if (m_frame && m_frame->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal) {
+ // In the case the frame will be detached soon, we still need to ping the server, but it is
+ // no longer safe to reference the Frame object.
+ // See http://trac.webkit.org/changeset/65910 and https://bugs.webkit.org/show_bug.cgi?id=30457.
+ m_frame = 0;
+ }
+
m_redirectCount = redirectCount;
m_deferLoadingCount = deferLoadingCount;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes