- Revision
- 136833
- Author
- christophe.du...@intel.com
- Date
- 2012-12-06 05:11:24 -0800 (Thu, 06 Dec 2012)
Log Message
[EFL][WK2] Context clients should unregister themselves when destroyed
https://bugs.webkit.org/show_bug.cgi?id=104113
Reviewed by Kenneth Rohde Christiansen.
Make sure the context clients (History and Download clients)
unregister themselves when destroyed to make sure their
callback functions are never called after the client objects
have been destroyed (i.e. when the parent Ewk_Context has
been destroyed).
This addresses crashing issues after a Ewk_Context object
gets unref'd and destroyed.
* UIProcess/efl/ContextHistoryClientEfl.cpp:
(WebKit::ContextHistoryClientEfl::ContextHistoryClientEfl):
(WebKit):
(WebKit::ContextHistoryClientEfl::~ContextHistoryClientEfl):
* UIProcess/efl/ContextHistoryClientEfl.h:
(ContextHistoryClientEfl):
* UIProcess/efl/DownloadManagerEfl.cpp:
(WebKit::DownloadManagerEfl::~DownloadManagerEfl):
(WebKit):
* UIProcess/efl/DownloadManagerEfl.h:
(DownloadManagerEfl):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (136832 => 136833)
--- trunk/Source/WebKit2/ChangeLog 2012-12-06 12:32:02 UTC (rev 136832)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-06 13:11:24 UTC (rev 136833)
@@ -1,3 +1,31 @@
+2012-12-06 Christophe Dumez <christophe.du...@intel.com>
+
+ [EFL][WK2] Context clients should unregister themselves when destroyed
+ https://bugs.webkit.org/show_bug.cgi?id=104113
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Make sure the context clients (History and Download clients)
+ unregister themselves when destroyed to make sure their
+ callback functions are never called after the client objects
+ have been destroyed (i.e. when the parent Ewk_Context has
+ been destroyed).
+
+ This addresses crashing issues after a Ewk_Context object
+ gets unref'd and destroyed.
+
+ * UIProcess/efl/ContextHistoryClientEfl.cpp:
+ (WebKit::ContextHistoryClientEfl::ContextHistoryClientEfl):
+ (WebKit):
+ (WebKit::ContextHistoryClientEfl::~ContextHistoryClientEfl):
+ * UIProcess/efl/ContextHistoryClientEfl.h:
+ (ContextHistoryClientEfl):
+ * UIProcess/efl/DownloadManagerEfl.cpp:
+ (WebKit::DownloadManagerEfl::~DownloadManagerEfl):
+ (WebKit):
+ * UIProcess/efl/DownloadManagerEfl.h:
+ (DownloadManagerEfl):
+
2012-12-05 Huang Dongsung <luxte...@company100.net>
Coordinated Graphics: Reorder messages to LayerTreeCoordinatorProxy
Modified: trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp (136832 => 136833)
--- trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp 2012-12-06 12:32:02 UTC (rev 136832)
+++ trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp 2012-12-06 13:11:24 UTC (rev 136833)
@@ -107,14 +107,15 @@
}
ContextHistoryClientEfl::ContextHistoryClientEfl(PassRefPtr<WebContext> context)
- : m_userData(0)
+ : m_context(context)
+ , m_userData(0)
, m_navigate(0)
, m_clientRedirect(0)
, m_serverRedirect(0)
, m_titleUpdated(0)
, m_populateVisitedLinks(0)
{
- ASSERT(context);
+ ASSERT(m_context);
WKContextHistoryClient wkHistoryClient;
memset(&wkHistoryClient, 0, sizeof(WKContextHistoryClient));
@@ -128,9 +129,14 @@
wkHistoryClient.didUpdateHistoryTitle = didUpdateHistoryTitle;
wkHistoryClient.populateVisitedLinks = populateVisitedLinks;
- context->initializeHistoryClient(&wkHistoryClient);
+ m_context->initializeHistoryClient(&wkHistoryClient);
}
+ContextHistoryClientEfl::~ContextHistoryClientEfl()
+{
+ m_context->initializeHistoryClient(0);
+}
+
void ContextHistoryClientEfl::setCallbacks(Ewk_History_Navigation_Cb navigate, Ewk_History_Client_Redirection_Cb clientRedirect, Ewk_History_Server_Redirection_Cb serverRedirect, Ewk_History_Title_Update_Cb titleUpdate, Ewk_History_Populate_Visited_Links_Cb populateVisitedLinks, void* data)
{
m_navigate = navigate;
Modified: trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h (136832 => 136833)
--- trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h 2012-12-06 12:32:02 UTC (rev 136832)
+++ trunk/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h 2012-12-06 13:11:24 UTC (rev 136833)
@@ -40,6 +40,8 @@
return adoptPtr(new ContextHistoryClientEfl(context));
}
+ ~ContextHistoryClientEfl();
+
void setCallbacks(Ewk_History_Navigation_Cb, Ewk_History_Client_Redirection_Cb, Ewk_History_Server_Redirection_Cb, Ewk_History_Title_Update_Cb, Ewk_History_Populate_Visited_Links_Cb, void*);
private:
@@ -51,6 +53,7 @@
static void didUpdateHistoryTitle(WKContextRef, WKPageRef, WKStringRef, WKURLRef, WKFrameRef, const void*);
static void populateVisitedLinks(WKContextRef, const void*);
+ RefPtr<WebContext> m_context;
void* m_userData;
Ewk_History_Navigation_Cb m_navigate;
Ewk_History_Client_Redirection_Cb m_clientRedirect;
Modified: trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp (136832 => 136833)
--- trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp 2012-12-06 12:32:02 UTC (rev 136832)
+++ trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp 2012-12-06 13:11:24 UTC (rev 136833)
@@ -139,6 +139,11 @@
WKContextSetDownloadClient(toAPI(context->webContext().get()), &wkDownloadClient);
}
+DownloadManagerEfl::~DownloadManagerEfl()
+{
+ WKContextSetDownloadClient(toAPI(m_context->webContext().get()), 0);
+}
+
void DownloadManagerEfl::registerDownload(DownloadProxy* download, EwkViewImpl* viewImpl)
{
uint64_t downloadId = download->downloadID();
Modified: trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h (136832 => 136833)
--- trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h 2012-12-06 12:32:02 UTC (rev 136832)
+++ trunk/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h 2012-12-06 13:11:24 UTC (rev 136833)
@@ -43,6 +43,8 @@
return adoptPtr(new DownloadManagerEfl(context));
}
+ ~DownloadManagerEfl();
+
void registerDownload(DownloadProxy*, EwkViewImpl*);
private: