Title: [137610] trunk/Source/WebKit2
- Revision
- 137610
- Author
- [email protected]
- Date
- 2012-12-13 10:32:53 -0800 (Thu, 13 Dec 2012)
Log Message
<rdar://problem/12870065> Frequent NetworkProcess crashes due to null connection when closing tabs
https://bugs.webkit.org/show_bug.cgi?id=104922
Reviewed by Anders Carlsson.
Don't zero out connection pointers when a connection closes. There doesn't appear
to be any reason to do this.
Tested by hitting breakpoints in all relevant objects destructors to confirm that
this doesn't introduce leaks.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::didClose):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::connectionToWebProcessDidClose):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (137609 => 137610)
--- trunk/Source/WebKit2/ChangeLog 2012-12-13 18:32:15 UTC (rev 137609)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-13 18:32:53 UTC (rev 137610)
@@ -1,3 +1,22 @@
+2012-12-13 Alexey Proskuryakov <[email protected]>
+
+ <rdar://problem/12870065> Frequent NetworkProcess crashes due to null connection when closing tabs
+ https://bugs.webkit.org/show_bug.cgi?id=104922
+
+ Reviewed by Anders Carlsson.
+
+ Don't zero out connection pointers when a connection closes. There doesn't appear
+ to be any reason to do this.
+
+ Tested by hitting breakpoints in all relevant objects destructors to confirm that
+ this doesn't introduce leaks.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
+ (WebKit::NetworkConnectionToWebProcess::didClose):
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::connectionToWebProcessDidClose):
+
2012-12-13 Thiago Marcos P. Santos <[email protected]>
[EFL] Update the way we set the cookies policy
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (137609 => 137610)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2012-12-13 18:32:15 UTC (rev 137609)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2012-12-13 18:32:53 UTC (rev 137610)
@@ -56,7 +56,6 @@
NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess()
{
- ASSERT(!m_connection);
ASSERT(m_observers.isEmpty());
}
@@ -99,20 +98,20 @@
void NetworkConnectionToWebProcess::didClose(CoreIPC::Connection*)
{
- // Protect ourself as we might be otherwise be deleted during this function
+ // Protect ourself as we might be otherwise be deleted during this function.
RefPtr<NetworkConnectionToWebProcess> protector(this);
NetworkProcess::shared().removeNetworkConnectionToWebProcess(this);
+ // FIXME (NetworkProcess): We might consider actively clearing out all requests for this connection.
+ // But that might not be necessary as the observer mechanism used above is much more direct.
+
Vector<NetworkConnectionToWebProcessObserver*> observers;
copyToVector(m_observers, observers);
for (size_t i = 0; i < observers.size(); ++i)
observers[i]->connectionToWebProcessDidClose(this);
-
- // FIXME (NetworkProcess): We might consider actively clearing out all requests for this connection.
- // But that might not be necessary as the observer mechanism used above is much more direct.
-
- m_connection = 0;
+
+ // The object may be destroyed now.
}
void NetworkConnectionToWebProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference, CoreIPC::StringReference)
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (137609 => 137610)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2012-12-13 18:32:15 UTC (rev 137609)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2012-12-13 18:32:53 UTC (rev 137610)
@@ -144,8 +144,6 @@
void NetworkResourceLoader::connectionToWebProcessDidClose(NetworkConnectionToWebProcess* connection)
{
ASSERT_ARG(connection, connection == m_connection.get());
- m_connection->unregisterObserver(this);
- m_connection = 0;
}
void NetworkResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes