Title: [127031] trunk/Source/WebCore
Revision
127031
Author
commit-qu...@webkit.org
Date
2012-08-29 12:49:21 -0700 (Wed, 29 Aug 2012)

Log Message

Web Inspector: Refactor InspectorFrontendClientLocal to remove ScriptState as member
https://bugs.webkit.org/show_bug.cgi?id=95343

Patch by Vivek Galatage <vivekgalat...@gmail.com> on 2012-08-29
Reviewed by Yury Semikhatsky.

The ScriptState is not required to be stored as a member to
InspectorFrontendClientLocal hence removing it as member.

No new tests due to code refactoring.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
(WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
(WebCore::InspectorFrontendClientLocal::windowObjectCleared):
* inspector/InspectorFrontendClientLocal.h:
(WebCore):
(InspectorFrontendClientLocal):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127030 => 127031)


--- trunk/Source/WebCore/ChangeLog	2012-08-29 19:43:49 UTC (rev 127030)
+++ trunk/Source/WebCore/ChangeLog	2012-08-29 19:49:21 UTC (rev 127031)
@@ -1,3 +1,23 @@
+2012-08-29  Vivek Galatage  <vivekgalat...@gmail.com>
+
+        Web Inspector: Refactor InspectorFrontendClientLocal to remove ScriptState as member
+        https://bugs.webkit.org/show_bug.cgi?id=95343
+
+        Reviewed by Yury Semikhatsky.
+
+        The ScriptState is not required to be stored as a member to
+        InspectorFrontendClientLocal hence removing it as member.
+
+        No new tests due to code refactoring.
+
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+        * inspector/InspectorFrontendClientLocal.h:
+        (WebCore):
+        (InspectorFrontendClientLocal):
+
 2012-08-28  Shawn Singh  <shawnsi...@chromium.org>
 
         [chromium] Do not clip root layer's subtree to viewport

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp (127030 => 127031)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2012-08-29 19:43:49 UTC (rev 127030)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2012-08-29 19:49:21 UTC (rev 127031)
@@ -49,6 +49,7 @@
 #include "PlatformString.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
+#include "ScriptState.h"
 #include "Settings.h"
 #include "Timer.h"
 #include "UserGestureIndicator.h"
@@ -111,7 +112,6 @@
 InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage, PassOwnPtr<Settings> settings)
     : m_inspectorController(inspectorController)
     , m_frontendPage(frontendPage)
-    , m_frontendScriptState(0)
     , m_settings(settings)
     , m_frontendLoaded(false)
 {
@@ -124,7 +124,6 @@
     if (m_frontendHost)
         m_frontendHost->disconnectClient();
     m_frontendPage = 0;
-    m_frontendScriptState = 0;
     m_inspectorController = 0;
 }
 
@@ -132,10 +131,10 @@
 {
     if (m_frontendHost)
         m_frontendHost->disconnectClient();
-    // FIXME: don't keep reference to the script state
-    m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
+    
+    ScriptState* frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
     m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get());
+    ScriptGlobalObject::set(frontendScriptState, "InspectorFrontendHost", m_frontendHost.get());
 }
 
 void InspectorFrontendClientLocal::frontendLoaded()

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (127030 => 127031)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2012-08-29 19:43:49 UTC (rev 127030)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2012-08-29 19:49:21 UTC (rev 127031)
@@ -33,12 +33,12 @@
 
 #include "InspectorFrontendClient.h"
 #include "PlatformString.h"
-#include "ScriptState.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
 
+class Frame;
 class InspectorController;
 class InspectorBackendDispatchTask;
 class InspectorFrontendHost;
@@ -111,8 +111,7 @@
 
     friend class FrontendMenuProvider;
     InspectorController* m_inspectorController;
-    Page* m_frontendPage;
-    ScriptState* m_frontendScriptState;
+    Page* m_frontendPage;    
     // TODO(yurys): this ref shouldn't be needed.
     RefPtr<InspectorFrontendHost> m_frontendHost;
     OwnPtr<InspectorFrontendClientLocal::Settings> m_settings;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to