Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (191996 => 191997)
--- trunk/Source/_javascript_Core/ChangeLog 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-11-04 00:43:58 UTC (rev 191997)
@@ -1,3 +1,48 @@
+2015-11-03 Joseph Pecoraro <pecor...@apple.com>
+
+ Web Inspector: Remove duplication among ScriptDebugServer subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=150860
+
+ Reviewed by Timothy Hatcher.
+
+ ScriptDebugServer expects a list of listeners to dispatch events to.
+ However each of its subclasses had their own implementation of the
+ list because of different handling when the first was added or when
+ the last was removed. Extract common code into ScriptDebugServer
+ which simplifies things.
+
+ Subclasses now only implement a virtual methods "attachDebugger"
+ and "detachDebugger" which is the unique work done when the first
+ listener is added or last is removed.
+
+ * inspector/JSGlobalObjectScriptDebugServer.cpp:
+ (Inspector::JSGlobalObjectScriptDebugServer::attachDebugger):
+ (Inspector::JSGlobalObjectScriptDebugServer::detachDebugger):
+ (Inspector::JSGlobalObjectScriptDebugServer::addListener): Deleted.
+ (Inspector::JSGlobalObjectScriptDebugServer::removeListener): Deleted.
+ * inspector/JSGlobalObjectScriptDebugServer.h:
+ * inspector/ScriptDebugServer.cpp:
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionLog):
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionSound):
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe):
+ (Inspector::ScriptDebugServer::sourceParsed):
+ (Inspector::ScriptDebugServer::dispatchFunctionToListeners):
+ (Inspector::ScriptDebugServer::addListener):
+ (Inspector::ScriptDebugServer::removeListener):
+ * inspector/ScriptDebugServer.h:
+ * inspector/agents/InspectorDebuggerAgent.cpp:
+ (Inspector::InspectorDebuggerAgent::enable):
+ (Inspector::InspectorDebuggerAgent::disable):
+ * inspector/agents/InspectorDebuggerAgent.h:
+ * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
+ (Inspector::JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer): Deleted.
+ (Inspector::JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer): Deleted.
+ * inspector/agents/JSGlobalObjectDebuggerAgent.h:
+
+ * inspector/ScriptDebugListener.h:
+ (Inspector::ScriptDebugListener::Script::Script):
+ Drive-by convert Script to a struct, it has public fields and is used as such.
+
2015-11-03 Filip Pizlo <fpi...@apple.com>
B3::LowerToAir should recognize Neg (i.e. Sub($0, value))
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -40,34 +40,17 @@
{
}
-void JSGlobalObjectScriptDebugServer::addListener(ScriptDebugListener* listener)
+void JSGlobalObjectScriptDebugServer::attachDebugger()
{
- if (!listener)
- return;
-
- bool wasEmpty = m_listeners.isEmpty();
- m_listeners.add(listener);
-
- // First listener. Attach the debugger to the JSGlobalObject.
- if (wasEmpty) {
- attach(&m_globalObject);
- recompileAllJSFunctions();
- }
+ attach(&m_globalObject);
+ recompileAllJSFunctions();
}
-void JSGlobalObjectScriptDebugServer::removeListener(ScriptDebugListener* listener, bool isBeingDestroyed)
+void JSGlobalObjectScriptDebugServer::detachDebugger(bool isBeingDestroyed)
{
- if (!listener)
- return;
-
- m_listeners.remove(listener);
-
- // Last listener. Detach the debugger from the JSGlobalObject.
- if (m_listeners.isEmpty()) {
- detach(&m_globalObject, isBeingDestroyed ? Debugger::GlobalObjectIsDestructing : Debugger::TerminatingDebuggingSession);
- if (!isBeingDestroyed)
- recompileAllJSFunctions();
- }
+ detach(&m_globalObject, isBeingDestroyed ? Debugger::GlobalObjectIsDestructing : Debugger::TerminatingDebuggingSession);
+ if (!isBeingDestroyed)
+ recompileAllJSFunctions();
}
void JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused()
@@ -81,4 +64,3 @@
}
} // namespace Inspector
-
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -27,7 +27,6 @@
#define JSGlobalObjectScriptDebugServer_h
#include "ScriptDebugServer.h"
-#include <wtf/Forward.h>
namespace Inspector {
@@ -37,13 +36,12 @@
JSGlobalObjectScriptDebugServer(JSC::JSGlobalObject&);
virtual ~JSGlobalObjectScriptDebugServer() { }
- void addListener(ScriptDebugListener*);
- void removeListener(ScriptDebugListener*, bool isBeingDestroyed);
-
JSC::JSGlobalObject& globalObject() const { return m_globalObject; }
private:
- virtual ListenerSet& getListeners() override { return m_listeners; }
+ virtual void attachDebugger() override;
+ virtual void detachDebugger(bool isBeingDestroyed) override;
+
virtual void didPause(JSC::JSGlobalObject*) override { }
virtual void didContinue(JSC::JSGlobalObject*) override { }
virtual void runEventLoopWhilePaused() override;
@@ -54,7 +52,6 @@
// or some other async operation in a pure JSContext) we can ignore exceptions reported here.
virtual void reportException(JSC::ExecState*, JSC::Exception*) const override { }
- ListenerSet m_listeners;
JSC::JSGlobalObject& m_globalObject;
};
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugListener.h (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugListener.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugListener.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -31,7 +31,6 @@
#define ScriptDebugListener_h
#include "debugger/Debugger.h"
-#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>
namespace Deprecated {
@@ -44,26 +43,16 @@
class ScriptDebugListener {
public:
- class Script {
- public:
- Script()
- : startLine(0)
- , startColumn(0)
- , endLine(0)
- , endColumn(0)
- , isContentScript(false)
- {
- }
-
+ struct Script {
String url;
String source;
String sourceURL;
String sourceMappingURL;
- int startLine;
- int startColumn;
- int endLine;
- int endColumn;
- bool isContentScript;
+ int startLine {0};
+ int startColumn {0};
+ int endLine {0};
+ int endColumn {0};
+ bool isContentScript {false};
};
virtual ~ScriptDebugListener() { }
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -41,7 +41,6 @@
#include "SourceProvider.h"
#include <wtf/NeverDestroyed.h>
#include <wtf/TemporaryChange.h>
-#include <wtf/text/WTFString.h>
using namespace JSC;
@@ -144,14 +143,13 @@
if (m_callingListeners)
return;
- ListenerSet& listeners = getListeners();
- if (listeners.isEmpty())
+ if (m_listeners.isEmpty())
return;
TemporaryChange<bool> change(m_callingListeners, true);
Vector<ScriptDebugListener*> listenersCopy;
- copyToVector(listeners, listenersCopy);
+ copyToVector(m_listeners, listenersCopy);
for (auto* listener : listenersCopy)
listener->breakpointActionLog(exec, message);
}
@@ -161,14 +159,13 @@
if (m_callingListeners)
return;
- ListenerSet& listeners = getListeners();
- if (listeners.isEmpty())
+ if (m_listeners.isEmpty())
return;
TemporaryChange<bool> change(m_callingListeners, true);
Vector<ScriptDebugListener*> listenersCopy;
- copyToVector(listeners, listenersCopy);
+ copyToVector(m_listeners, listenersCopy);
for (auto* listener : listenersCopy)
listener->breakpointActionSound(breakpointActionIdentifier);
}
@@ -178,8 +175,7 @@
if (m_callingListeners)
return;
- ListenerSet& listeners = getListeners();
- if (listeners.isEmpty())
+ if (m_listeners.isEmpty())
return;
TemporaryChange<bool> change(m_callingListeners, true);
@@ -187,7 +183,7 @@
unsigned sampleId = m_nextProbeSampleId++;
Vector<ScriptDebugListener*> listenersCopy;
- copyToVector(listeners, listenersCopy);
+ copyToVector(m_listeners, listenersCopy);
for (auto* listener : listenersCopy)
listener->breakpointActionProbe(exec, action, m_currentProbeBatchId, sampleId, sampleValue);
}
@@ -249,17 +245,16 @@
if (m_callingListeners)
return;
- ListenerSet& listeners = getListeners();
- if (listeners.isEmpty())
+ if (m_listeners.isEmpty())
return;
TemporaryChange<bool> change(m_callingListeners, true);
bool isError = errorLine != -1;
if (isError)
- dispatchFailedToParseSource(listeners, sourceProvider, errorLine, errorMessage);
+ dispatchFailedToParseSource(m_listeners, sourceProvider, errorLine, errorMessage);
else
- dispatchDidParseSource(listeners, sourceProvider, isContentScript(exec));
+ dispatchDidParseSource(m_listeners, sourceProvider, isContentScript(exec));
}
void ScriptDebugServer::dispatchFunctionToListeners(_javascript_ExecutionCallback callback)
@@ -267,11 +262,12 @@
if (m_callingListeners)
return;
+ if (m_listeners.isEmpty())
+ return;
+
TemporaryChange<bool> change(m_callingListeners, true);
- ListenerSet& listeners = getListeners();
- if (!listeners.isEmpty())
- dispatchFunctionToListeners(listeners, callback);
+ dispatchFunctionToListeners(m_listeners, callback);
}
void ScriptDebugServer::dispatchFunctionToListeners(const ListenerSet& listeners, _javascript_ExecutionCallback callback)
@@ -333,6 +329,29 @@
return emptyActionVector;
}
+void ScriptDebugServer::addListener(ScriptDebugListener* listener)
+{
+ ASSERT(listener);
+
+ bool wasEmpty = m_listeners.isEmpty();
+ m_listeners.add(listener);
+
+ // First listener. Attach the debugger.
+ if (wasEmpty)
+ attachDebugger();
+}
+
+void ScriptDebugServer::removeListener(ScriptDebugListener* listener, bool isBeingDestroyed)
+{
+ ASSERT(listener);
+
+ m_listeners.remove(listener);
+
+ // Last listener. Detach the debugger.
+ if (m_listeners.isEmpty())
+ detachDebugger(isBeingDestroyed);
+}
+
Deprecated::ScriptValue ScriptDebugServer::exceptionOrCaughtValue(JSC::ExecState* state)
{
if (reasonForPause() == PausedForException)
Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -36,9 +36,6 @@
#include "debugger/Debugger.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
namespace JSC {
@@ -59,6 +56,9 @@
const BreakpointActions& getActionsForBreakpoint(JSC::BreakpointID);
+ void addListener(ScriptDebugListener*);
+ void removeListener(ScriptDebugListener*, bool isBeingDestroyed);
+
protected:
typedef HashSet<ScriptDebugListener*> ListenerSet;
typedef void (ScriptDebugServer::*_javascript_ExecutionCallback)(ScriptDebugListener*);
@@ -66,7 +66,9 @@
ScriptDebugServer(JSC::VM&, bool isInWorkerThread = false);
~ScriptDebugServer();
- virtual ListenerSet& getListeners() = 0;
+ virtual void attachDebugger() = 0;
+ virtual void detachDebugger(bool isBeingDestroyed) = 0;
+
virtual void didPause(JSC::JSGlobalObject*) = 0;
virtual void didContinue(JSC::JSGlobalObject*) = 0;
virtual void runEventLoopWhilePaused() = 0;
@@ -99,10 +101,11 @@
Deprecated::ScriptValue exceptionOrCaughtValue(JSC::ExecState*);
+ BreakpointIDToActionsMap m_breakpointIDToActions;
+
+ ListenerSet m_listeners;
bool m_callingListeners {false};
- BreakpointIDToActionsMap m_breakpointIDToActions;
-
unsigned m_nextProbeSampleId {1};
unsigned m_currentProbeBatchId {0};
};
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -87,7 +87,7 @@
return;
scriptDebugServer().setBreakpointsActivated(true);
- startListeningScriptDebugServer();
+ scriptDebugServer().addListener(this);
if (m_listener)
m_listener->debuggerWasEnabled();
@@ -100,7 +100,7 @@
if (!m_enabled)
return;
- stopListeningScriptDebugServer(isBeingDestroyed);
+ scriptDebugServer().removeListener(this, isBeingDestroyed);
clearInspectorBreakpointState();
ASSERT(m_javaScriptBreakpoints.isEmpty());
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -116,8 +116,6 @@
InjectedScriptManager& injectedScriptManager() const { return m_injectedScriptManager; }
virtual InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) = 0;
- virtual void startListeningScriptDebugServer() = 0;
- virtual void stopListeningScriptDebugServer(bool skipRecompile) = 0;
virtual void muteConsole() = 0;
virtual void unmuteConsole() = 0;
Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -45,16 +45,6 @@
{
}
-void JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer()
-{
- scriptDebugServer().addListener(this);
-}
-
-void JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer(bool isBeingDestroyed)
-{
- scriptDebugServer().removeListener(this, isBeingDestroyed);
-}
-
InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString& error, const int* executionContextId)
{
if (executionContextId) {
Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h (191996 => 191997)
--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -42,8 +42,6 @@
virtual JSGlobalObjectScriptDebugServer& scriptDebugServer() override { return m_scriptDebugServer; }
- virtual void startListeningScriptDebugServer() override;
- virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
virtual InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
virtual void breakpointActionLog(JSC::ExecState*, const String&) override;
Modified: trunk/Source/WebCore/ChangeLog (191996 => 191997)
--- trunk/Source/WebCore/ChangeLog 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/ChangeLog 2015-11-04 00:43:58 UTC (rev 191997)
@@ -1,3 +1,33 @@
+2015-11-03 Joseph Pecoraro <pecor...@apple.com>
+
+ Web Inspector: Remove duplication among ScriptDebugServer subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=150860
+
+ Reviewed by Timothy Hatcher.
+
+ Refactoring covered by existing tests.
+
+ * bindings/js/WorkerScriptDebugServer.cpp:
+ (WebCore::WorkerScriptDebugServer::attachDebugger):
+ (WebCore::WorkerScriptDebugServer::detachDebugger):
+ (WebCore::WorkerScriptDebugServer::addListener): Deleted.
+ (WebCore::WorkerScriptDebugServer::removeListener): Deleted.
+ * bindings/js/WorkerScriptDebugServer.h:
+ * inspector/PageDebuggerAgent.cpp:
+ (WebCore::PageDebuggerAgent::startListeningScriptDebugServer): Deleted.
+ (WebCore::PageDebuggerAgent::stopListeningScriptDebugServer): Deleted.
+ * inspector/PageDebuggerAgent.h:
+ * inspector/PageScriptDebugServer.cpp:
+ (WebCore::PageScriptDebugServer::attachDebugger):
+ (WebCore::PageScriptDebugServer::detachDebugger):
+ (WebCore::PageScriptDebugServer::addListener): Deleted.
+ (WebCore::PageScriptDebugServer::removeListener): Deleted.
+ * inspector/PageScriptDebugServer.h:
+ * inspector/WorkerDebuggerAgent.cpp:
+ (WebCore::WorkerDebuggerAgent::startListeningScriptDebugServer): Deleted.
+ (WebCore::WorkerDebuggerAgent::stopListeningScriptDebugServer): Deleted.
+ * inspector/WorkerDebuggerAgent.h:
+
2015-11-03 Jiewen Tan <jiewen_...@apple.com>
Null dereference loading Blink layout test scrollbars/custom-scrollbar-appearance-property.html
Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp (191996 => 191997)
--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -51,33 +51,18 @@
{
}
-void WorkerScriptDebugServer::addListener(ScriptDebugListener* listener)
+void WorkerScriptDebugServer::attachDebugger()
{
- if (!listener)
- return;
-
- bool wasEmpty = m_listeners.isEmpty();
- m_listeners.add(listener);
-
- if (wasEmpty) {
- m_workerGlobalScope.script()->attachDebugger(this);
- recompileAllJSFunctions();
- }
+ m_workerGlobalScope.script()->attachDebugger(this);
+ recompileAllJSFunctions();
}
-void WorkerScriptDebugServer::removeListener(ScriptDebugListener* listener, bool skipRecompile)
+void WorkerScriptDebugServer::detachDebugger(bool skipRecompile)
{
- if (!listener)
- return;
-
- m_listeners.remove(listener);
-
- if (m_listeners.isEmpty()) {
- if (m_workerGlobalScope.script())
- m_workerGlobalScope.script()->detachDebugger(this);
- if (!skipRecompile)
- recompileAllJSFunctions();
- }
+ if (m_workerGlobalScope.script())
+ m_workerGlobalScope.script()->detachDebugger(this);
+ if (!skipRecompile)
+ recompileAllJSFunctions();
}
void WorkerScriptDebugServer::recompileAllJSFunctions()
Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h (191996 => 191997)
--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -52,13 +52,12 @@
virtual void recompileAllJSFunctions() override;
- void addListener(Inspector::ScriptDebugListener*);
- void removeListener(Inspector::ScriptDebugListener*, bool skipRecompile);
-
void interruptAndRunTask(std::unique_ptr<Task>);
private:
- virtual ListenerSet& getListeners() override { return m_listeners; }
+ virtual void attachDebugger() override;
+ virtual void detachDebugger(bool isBeingDestroyed) override;
+
virtual void didPause(JSC::JSGlobalObject*) override { }
virtual void didContinue(JSC::JSGlobalObject*) override { }
virtual void runEventLoopWhilePaused() override;
@@ -66,7 +65,6 @@
virtual void reportException(JSC::ExecState*, JSC::Exception*) const override;
WorkerGlobalScope& m_workerGlobalScope;
- ListenerSet m_listeners;
String m_debuggerTaskMode;
};
Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (191996 => 191997)
--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -93,16 +93,6 @@
return InspectorDebuggerAgent::sourceMapURLForScript(script);
}
-void PageDebuggerAgent::startListeningScriptDebugServer()
-{
- scriptDebugServer().addListener(this);
-}
-
-void PageDebuggerAgent::stopListeningScriptDebugServer(bool isBeingDestroyed)
-{
- scriptDebugServer().removeListener(this, isBeingDestroyed);
-}
-
PageScriptDebugServer& PageDebuggerAgent::scriptDebugServer()
{
return m_scriptDebugServer;
Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.h (191996 => 191997)
--- trunk/Source/WebCore/inspector/PageDebuggerAgent.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -64,8 +64,6 @@
virtual String sourceMapURLForScript(const Script&) override;
private:
- virtual void startListeningScriptDebugServer() override;
- virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
virtual void muteConsole() override;
virtual void unmuteConsole() override;
Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp (191996 => 191997)
--- trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -57,32 +57,17 @@
{
}
-void PageScriptDebugServer::addListener(ScriptDebugListener* listener)
+void PageScriptDebugServer::attachDebugger()
{
- if (!listener)
- return;
-
- bool wasEmpty = m_listeners.isEmpty();
- m_listeners.add(listener);
-
- if (wasEmpty) {
- m_page.setDebugger(this);
- recompileAllJSFunctions();
- }
+ m_page.setDebugger(this);
+ recompileAllJSFunctions();
}
-void PageScriptDebugServer::removeListener(ScriptDebugListener* listener, bool isBeingDestroyed)
+void PageScriptDebugServer::detachDebugger(bool isBeingDestroyed)
{
- if (!listener)
- return;
-
- m_listeners.remove(listener);
-
- if (m_listeners.isEmpty()) {
- m_page.setDebugger(nullptr);
- if (!isBeingDestroyed)
- recompileAllJSFunctions();
- }
+ m_page.setDebugger(nullptr);
+ if (!isBeingDestroyed)
+ recompileAllJSFunctions();
}
void PageScriptDebugServer::recompileAllJSFunctions()
Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.h (191996 => 191997)
--- trunk/Source/WebCore/inspector/PageScriptDebugServer.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -28,7 +28,6 @@
#define PageScriptDebugServer_h
#include <inspector/ScriptDebugServer.h>
-#include <wtf/Forward.h>
namespace WebCore {
@@ -43,13 +42,12 @@
PageScriptDebugServer(Page&);
virtual ~PageScriptDebugServer() { }
- void addListener(Inspector::ScriptDebugListener*);
- void removeListener(Inspector::ScriptDebugListener*, bool isBeingDestroyed);
-
virtual void recompileAllJSFunctions() override;
private:
- virtual ListenerSet& getListeners() override { return m_listeners; }
+ virtual void attachDebugger() override;
+ virtual void detachDebugger(bool isBeingDestroyed) override;
+
virtual void didPause(JSC::JSGlobalObject*) override;
virtual void didContinue(JSC::JSGlobalObject*) override;
virtual void runEventLoopWhilePaused() override;
@@ -63,7 +61,6 @@
void setJavaScriptPaused(Frame*, bool paused);
void setJavaScriptPaused(FrameView*, bool paused);
- ListenerSet m_listeners;
Page& m_page;
};
Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp (191996 => 191997)
--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp 2015-11-04 00:43:58 UTC (rev 191997)
@@ -106,16 +106,6 @@
agent->m_scriptDebugServer.interruptAndRunTask(std::make_unique<RunInspectorCommandsTask>(thread, &agent->m_inspectedWorkerGlobalScope));
}
-void WorkerDebuggerAgent::startListeningScriptDebugServer()
-{
- scriptDebugServer().addListener(this);
-}
-
-void WorkerDebuggerAgent::stopListeningScriptDebugServer(bool isBeingDestroyed)
-{
- scriptDebugServer().removeListener(this, isBeingDestroyed);
-}
-
void WorkerDebuggerAgent::breakpointActionLog(JSC::ExecState*, const String& message)
{
m_inspectedWorkerGlobalScope.addConsoleMessage(MessageSource::JS, MessageLevel::Log, message);
Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h (191996 => 191997)
--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h 2015-11-04 00:41:14 UTC (rev 191996)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h 2015-11-04 00:43:58 UTC (rev 191997)
@@ -50,8 +50,6 @@
static const char* debuggerTaskMode;
static void interruptAndDispatchInspectorCommands(WorkerThread*);
- virtual void startListeningScriptDebugServer() override;
- virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
virtual WorkerScriptDebugServer& scriptDebugServer() override;
virtual Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
virtual void muteConsole() override;