2009-03-05 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2009 23:18:30 +0000 (23:18 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2009 23:18:30 +0000 (23:18 +0000)
        Reviewed by Adam Roben.

        Eliminate a ref-counting leak in InspectorController.

        * inspector/InspectorController.h: Made constructor private, added static create method.
        * page/Page.cpp:
        (WebCore::Page::Page): Change initializer to use static create method.

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

WebCore/ChangeLog
WebCore/inspector/InspectorController.h
WebCore/page/Page.cpp

index e3e78292bb196b783f40906ee40e138d04e4eb3a..23927154b5239d9844d826370a07e391009344a0 100644 (file)
@@ -1,3 +1,13 @@
+2009-03-05  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Adam Roben.
+
+        Eliminate a ref-counting leak in InspectorController.
+
+        * inspector/InspectorController.h: Made constructor private, added static create method.
+        * page/Page.cpp:
+        (WebCore::Page::Page): Change initializer to use static create method.
+
 2009-03-05  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Reviewed by Timothy Hatcher.
index a25f0edab05e1fd41da6aa5bb5acb32d2a5a0183..a2f6f44dbaff4b88ee31e5186ae3c4ab07e7c555 100644 (file)
@@ -130,7 +130,11 @@ public:
         } m_simpleContent;
     };
 
-    InspectorController(Page*, InspectorClient*);
+    static PassRefPtr<InspectorController> create(Page* page, InspectorClient* inspectorClient)
+    {
+        return adoptRef(new InspectorController(page, inspectorClient));
+    }
+
     ~InspectorController();
 
     void inspectedPageDestroyed();
@@ -258,6 +262,7 @@ public:
     const String& platform() const;
 
 private:
+    InspectorController(Page*, InspectorClient*);
     void focusNode();
 
     void addConsoleMessage(JSC::ExecState*, ConsoleMessage*);
index eeefc202371afe847d6364c2662005e7755f957f..5f6bc8b38ac30a6f193ebb11cd1f428d347e768d 100644 (file)
@@ -108,7 +108,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
     , m_dragController(new DragController(this, dragClient))
     , m_focusController(new FocusController(this))
     , m_contextMenuController(new ContextMenuController(this, contextMenuClient))
-    , m_inspectorController(new InspectorController(this, inspectorClient))
+    , m_inspectorController(InspectorController::create(this, inspectorClient))
     , m_settings(new Settings(this))
     , m_progress(new ProgressTracker)
     , m_backForwardList(BackForwardList::create(this))