Title: [161771] trunk/Source/WebCore
Revision
161771
Author
ander...@apple.com
Date
2014-01-11 11:31:26 -0800 (Sat, 11 Jan 2014)

Log Message

ScriptDebugServer should use a separate member function for its timer handler
https://bugs.webkit.org/show_bug.cgi?id=126819

Reviewed by Sam Weinig.

It's weird to have subclasses override a timer handler and sometimes invoke
the timer handler directly so make it a separate member function instead.

* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
* bindings/js/PageScriptDebugServer.h:
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::ScriptDebugServer):
(WebCore::ScriptDebugServer::recompileAllJSFunctionsTimerFired):
* bindings/js/ScriptDebugServer.h:
* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::addListener):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
* bindings/js/WorkerScriptDebugServer.h:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::start):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (161770 => 161771)


--- trunk/Source/WebCore/ChangeLog	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/ChangeLog	2014-01-11 19:31:26 UTC (rev 161771)
@@ -1,5 +1,29 @@
 2014-01-11  Anders Carlsson  <ander...@apple.com>
 
+        ScriptDebugServer should use a separate member function for its timer handler
+        https://bugs.webkit.org/show_bug.cgi?id=126819
+
+        Reviewed by Sam Weinig.
+
+        It's weird to have subclasses override a timer handler and sometimes invoke 
+        the timer handler directly so make it a separate member function instead.
+
+        * bindings/js/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
+        * bindings/js/PageScriptDebugServer.h:
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::recompileAllJSFunctionsTimerFired):
+        * bindings/js/ScriptDebugServer.h:
+        * bindings/js/WorkerScriptDebugServer.cpp:
+        (WebCore::WorkerScriptDebugServer::addListener):
+        (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
+        * bindings/js/WorkerScriptDebugServer.h:
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::start):
+
+2014-01-11  Anders Carlsson  <ander...@apple.com>
+
         Simplify Timer and DeferrableOneShotTimer using std::function
         https://bugs.webkit.org/show_bug.cgi?id=126816
 

Modified: trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp	2014-01-11 19:31:26 UTC (rev 161771)
@@ -117,7 +117,7 @@
     }
 }
 
-void PageScriptDebugServer::recompileAllJSFunctions(Timer<ScriptDebugServer>*)
+void PageScriptDebugServer::recompileAllJSFunctions()
 {
     JSLockHolder lock(JSDOMWindow::commonVM());
     // If _javascript_ stack is not empty postpone recompilation.

Modified: trunk/Source/WebCore/bindings/js/PageScriptDebugServer.h (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/PageScriptDebugServer.h	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/PageScriptDebugServer.h	2014-01-11 19:31:26 UTC (rev 161771)
@@ -51,7 +51,7 @@
     void addListener(ScriptDebugListener*, Page*);
     void removeListener(ScriptDebugListener*, Page*);
 
-    virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>*);
+    virtual void recompileAllJSFunctions() OVERRIDE;
 
 private:
     typedef HashMap<Page*, OwnPtr<ListenerSet>> PageListenersMap;

Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp	2014-01-11 19:31:26 UTC (rev 161771)
@@ -54,7 +54,7 @@
     : Debugger(isInWorkerThread)
     , m_doneProcessingDebuggerEvents(true)
     , m_callingListeners(false)
-    , m_recompileTimer(this, &ScriptDebugServer::recompileAllJSFunctions)
+    , m_recompileTimer(this, &ScriptDebugServer::recompileAllJSFunctionsTimerFired)
 {
 }
 
@@ -285,6 +285,11 @@
     m_recompileTimer.startOneShot(0);
 }
 
+void ScriptDebugServer::recompileAllJSFunctionsTimerFired(Timer<ScriptDebugServer>&)
+{
+    recompileAllJSFunctions();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(_javascript__DEBUGGER)

Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.h (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.h	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.h	2014-01-11 19:31:26 UTC (rev 161771)
@@ -60,7 +60,7 @@
     void clearBreakpoints();
 
     void recompileAllJSFunctionsSoon();
-    virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) = 0;
+    virtual void recompileAllJSFunctions() = 0;
 
     class Task {
         WTF_MAKE_FAST_ALLOCATED;
@@ -106,6 +106,8 @@
     virtual void handlePause(JSC::Debugger::ReasonForPause, JSC::JSGlobalObject*) OVERRIDE FINAL;
     virtual void notifyDoneProcessingDebuggerEvents() OVERRIDE FINAL;
 
+    void recompileAllJSFunctionsTimerFired(Timer<ScriptDebugServer>&);
+
     bool m_callingListeners;
     BreakpointIDToActionsMap m_breakpointIDToActions;
     Timer<ScriptDebugServer> m_recompileTimer;

Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp	2014-01-11 19:31:26 UTC (rev 161771)
@@ -58,10 +58,10 @@
     if (m_listeners.isEmpty())
         m_workerGlobalScope->script()->attachDebugger(this);
     m_listeners.add(listener);
-    recompileAllJSFunctions(0);
+    recompileAllJSFunctions();
 }
 
-void WorkerScriptDebugServer::recompileAllJSFunctions(Timer<ScriptDebugServer>*)
+void WorkerScriptDebugServer::recompileAllJSFunctions()
 {
     JSC::VM* vm = m_workerGlobalScope->script()->vm();
 

Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h (161770 => 161771)


--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h	2014-01-11 19:31:26 UTC (rev 161771)
@@ -50,7 +50,7 @@
 
     void interruptAndRunTask(PassOwnPtr<ScriptDebugServer::Task>);
 
-    void recompileAllJSFunctions(Timer<ScriptDebugServer>*);
+    void recompileAllJSFunctions() OVERRIDE;
 
 private:
     virtual ListenerSet* getListenersForGlobalObject(JSC::JSGlobalObject*) OVERRIDE { return &m_listeners; }

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp (161770 => 161771)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2014-01-11 19:17:55 UTC (rev 161770)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2014-01-11 19:31:26 UTC (rev 161771)
@@ -349,7 +349,7 @@
         return;
     if (!enabled()) {
         enable(true);
-        PageScriptDebugServer::shared().recompileAllJSFunctions(0);
+        PageScriptDebugServer::shared().recompileAllJSFunctions();
     }
     m_recordingCPUProfile = true;
     String title = getCurrentUserInitiatedProfileName(true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to