#ifndef InspectorDebuggerAgent_h
#define InspectorDebuggerAgent_h
-#include "bindings/v8/ScriptState.h"
+#include "bindings/core/v8/ScriptState.h"
#include "core/InspectorFrontend.h"
#include "core/frame/ConsoleTypes.h"
#include "core/inspector/AsyncCallStackTracker.h"
#include "wtf/Vector.h"
#include "wtf/text/StringHash.h"
-namespace WebCore {
+namespace blink {
class Document;
class Event;
class EventListener;
class EventTarget;
+class ExecutionContextTask;
class FormData;
class HTTPHeaderMap;
class InjectedScriptManager;
class KURL;
class MutationObserver;
class ScriptArguments;
+class ScriptAsyncCallStack;
class ScriptCallStack;
class ScriptDebugServer;
class ScriptRegexp;
typedef String ErrorString;
class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommandHandler {
- WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent);
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
enum BreakpointSource {
UserBreakpointSource,
static const char backtraceObjectGroup[];
virtual ~InspectorDebuggerAgent();
+ virtual void trace(Visitor*);
virtual void canSetScriptSource(ErrorString*, bool* result) OVERRIDE FINAL { *result = true; }
bool isPaused();
bool runningNestedMessageLoop();
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, PassRefPtrWillBeRawPtr<ScriptCallStack>, unsigned long);
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>, unsigned long);
+ void addConsoleAPIMessageToConsole(MessageType, MessageLevel, const String&, ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>, unsigned long);
String preprocessEventListener(LocalFrame*, const String& source, const String& url, const String& functionName);
PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&);
const bool* returnByValue,
const bool* generatePreview,
RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
- TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL;
+ TypeBuilder::OptOutput<bool>* wasThrown,
+ RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) OVERRIDE FINAL;
virtual void compileScript(ErrorString*, const String& expression, const String& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) OVERRIDE;
virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const int* executionContextId, const String* objectGroup, const bool* doNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) OVERRIDE;
virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE;
void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture);
void didHandleEvent();
void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicString& method, const KURL&, bool async, FormData* body, const HTTPHeaderMap& headers, bool includeCrendentials);
+ void didDispatchXHRLoadendEvent(XMLHttpRequest*);
void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*);
void didClearAllMutationRecords(ExecutionContext*, MutationObserver*);
void willDeliverMutationRecords(ExecutionContext*, MutationObserver*);
void didDeliverMutationRecords();
+ void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*);
+ void didKillAllExecutionContextTasks(ExecutionContext*);
+ void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask*);
+ void didPerformExecutionContextTask();
+ int traceAsyncOperationStarting(ExecutionContext*, const String& operationName, int prevOperationId = 0);
+ void traceAsyncOperationCompleted(ExecutionContext*, int operationId);
+ void traceAsyncOperationCompletedCallbackStarting(ExecutionContext*, int operationId);
+ void traceAsyncCallbackStarting(ExecutionContext*, int operationId);
+ void traceAsyncCallbackCompleted();
bool canBreakProgram();
void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
void scriptExecutionBlockedByCSP(const String& directiveText);
- class Listener {
+ class Listener : public WillBeGarbageCollectedMixin {
public:
virtual ~Listener() { }
virtual void debuggerWasEnabled() = 0;
void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource, const String& condition = String());
void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumber, BreakpointSource);
+ PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> currentAsyncStackTraceForConsole();
+
protected:
explicit InspectorDebuggerAgent(InjectedScriptManager*);
private:
SkipPauseRequest shouldSkipExceptionPause();
SkipPauseRequest shouldSkipStepPause();
+ bool isTopCallFrameInFramework();
void cancelPauseOnNextStatement();
void addMessageToConsole(MessageSource, MessageType);
PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCallFrames();
PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace();
- virtual void didParseSource(const String& scriptId, const Script&) OVERRIDE FINAL;
- virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) OVERRIDE FINAL;
+ virtual void didParseSource(const String& scriptId, const Script&, CompileResult) OVERRIDE FINAL;
+ virtual void didReceiveV8AsyncTaskEvent(ExecutionContext*, const String& eventType, const String& eventName, int id) OVERRIDE FINAL;
void setPauseOnExceptionsImpl(ErrorString*, int);
bool assertPaused(ErrorString*);
void clearBreakDetails();
- String sourceMapURLForScript(const Script&);
+ String sourceMapURLForScript(const Script&, CompileResult);
+ PassRefPtrWillBeRawPtr<JavaScriptCallFrame> topCallFrameSkipUnknownSources();
String scriptURL(JavaScriptCallFrame*);
+ AsyncCallStackTracker& asyncCallStackTracker() { return *m_asyncCallStackTracker; };
typedef HashMap<String, Script> ScriptsMap;
typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpointIdsMap;
typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBreakpointToBreakpointIdAndSourceMap;
- InjectedScriptManager* m_injectedScriptManager;
+ RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
InspectorFrontend::Debugger* m_frontend;
RefPtr<ScriptState> m_pausedScriptState;
ScriptValue m_currentCallStack;
RefPtr<JSONObject> m_breakAuxData;
bool m_javaScriptPauseScheduled;
bool m_debuggerStepScheduled;
+ bool m_steppingFromFramework;
bool m_pausingOnNativeEvent;
- Listener* m_listener;
+ RawPtrWillBeMember<Listener> m_listener;
int m_skippedStepInCount;
int m_minFrameCountForSkip;
bool m_skipAllPauses;
OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp;
- AsyncCallStackTracker m_asyncCallStackTracker;
+ OwnPtrWillBeMember<AsyncCallStackTracker> m_asyncCallStackTracker;
};
-} // namespace WebCore
+} // namespace blink
#endif // !defined(InspectorDebuggerAgent_h)