2009-03-12 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Mar 2009 19:52:54 +0000 (19:52 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Mar 2009 19:52:54 +0000 (19:52 +0000)
        Reviewed by Adam Treat.

        https://bugs.webkit.org/show_bug.cgi?id=24525
        REGRESSION: Inspector window doesn't close when inspected page is
        destroyed. This is a revert of r41158, which became unnecessary when
        InspectorController became ref-counted in r41462.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::inspectedPageDestroyed): Reset m_inspectedPage
            after calling close().
        (WebCore::InspectorController::stopUserInitiatedProfiling): Remove
            m_inspectedPage check guard around profile logic.

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

WebCore/ChangeLog
WebCore/inspector/InspectorController.cpp

index 9ca7732..bd09bb6 100644 (file)
@@ -1,3 +1,18 @@
+2009-03-12  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Adam Treat.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24525
+        REGRESSION: Inspector window doesn't close when inspected page is
+        destroyed. This is a revert of r41158, which became unnecessary when
+        InspectorController became ref-counted in r41462.
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::inspectedPageDestroyed): Reset m_inspectedPage
+            after calling close().
+        (WebCore::InspectorController::stopUserInitiatedProfiling): Remove
+            m_inspectedPage check guard around profile logic.
+
 2009-03-12  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Darin Fisher.
index 332793b..027da0f 100644 (file)
@@ -299,10 +299,10 @@ InspectorController::~InspectorController()
 
 void InspectorController::inspectedPageDestroyed()
 {
+    close();
+
     ASSERT(m_inspectedPage);
     m_inspectedPage = 0;
-
-    close();
 }
 
 bool InspectorController::enabled() const
@@ -837,12 +837,10 @@ void InspectorController::stopUserInitiatedProfiling()
     title += ".";
     title += UString::from(m_currentUserInitiatedProfileNumber);
 
-    if (m_inspectedPage) {
-        ExecState* exec = toJSDOMWindow(m_inspectedPage->mainFrame())->globalExec();
-        RefPtr<Profile> profile = Profiler::profiler()->stopProfiling(exec, title);
-        if (profile)
-            addProfile(profile, 0, UString());
-    }
+    ExecState* exec = toJSDOMWindow(m_inspectedPage->mainFrame())->globalExec();
+    RefPtr<Profile> profile = Profiler::profiler()->stopProfiling(exec, title);
+    if (profile)
+        addProfile(profile, 0, UString());
 
     toggleRecordButton(false);
 }