Memory leak in NetworkInfoClient
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2012 23:35:41 +0000 (23:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2012 23:35:41 +0000 (23:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86603

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-05-17
Reviewed by Adam Barth.

Source/WebCore:

Fix a memory leak in NetworkInfoClient by using OwnPtr and
change the class not to inherite from RefCounted.

* Modules/networkinfo/NetworkInfoClient.h:

Source/WebKit/efl:

Fix a memory leak in NetworkInfoClient by using OwnPtr and making
the client to be owned by the View.

* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_priv_new):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117515 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/networkinfo/NetworkInfoClient.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_view.cpp

index fa0653e..0e03426 100644 (file)
@@ -1,3 +1,15 @@
+2012-05-17  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
+
+        Memory leak in NetworkInfoClient
+        https://bugs.webkit.org/show_bug.cgi?id=86603
+
+        Reviewed by Adam Barth.
+
+        Fix a memory leak in NetworkInfoClient by using OwnPtr and
+        change the class not to inherite from RefCounted.
+
+        * Modules/networkinfo/NetworkInfoClient.h:
+
 2012-05-17  Joshua Bell  <jsbell@chromium.org>
 
         IndexedDB: Remove IDBIndex.storeName
index 729118e..a35d145 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 class NetworkInfoController;
 class Page;
 
-class NetworkInfoClient : public RefCounted<NetworkInfoClient> {
+class NetworkInfoClient {
 public:
     virtual ~NetworkInfoClient() { }
 
index 24567e6..5461fb5 100644 (file)
@@ -1,3 +1,17 @@
+2012-05-17  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
+
+        Memory leak in NetworkInfoClient
+        https://bugs.webkit.org/show_bug.cgi?id=86603
+
+        Reviewed by Adam Barth.
+
+        Fix a memory leak in NetworkInfoClient by using OwnPtr and making
+        the client to be owned by the View.
+
+        * ewk/ewk_view.cpp:
+        (_Ewk_View_Private_Data):
+        (_ewk_view_priv_new):
+
 2012-05-17  Hironori Bono  <hbono@chromium.org>
 
         [Refactoring] Move platform-specific code in Editor::respondToChangedSelection to the WebKit layer
index 7e2ef80..ceb203d 100644 (file)
@@ -239,6 +239,9 @@ struct _Ewk_View_Private_Data {
     WebCore::ViewportArguments viewportArguments;
     Ewk_History* history;
     OwnPtr<PageClientEfl> pageClient;
+#if ENABLE(NETWORK_INFO)
+    OwnPtr<WebCore::NetworkInfoClientEfl> networkInfoClient;
+#endif
 #if ENABLE(INPUT_TYPE_COLOR)
     WebCore::ColorChooserClient* colorChooserClient;
 #endif
@@ -728,7 +731,8 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
 #endif
 
 #if ENABLE(NETWORK_INFO)
-    WebCore::provideNetworkInfoTo(priv->page.get(), new WebCore::NetworkInfoClientEfl);
+    priv->networkInfoClient = adoptPtr(new WebCore::NetworkInfoClientEfl);
+    WebCore::provideNetworkInfoTo(priv->page.get(), priv->networkInfoClient.get());
 #endif
 
 #if ENABLE(VIBRATION)