| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010-2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| 11 * 2. Redistributions in binary form must reproduce the above copyright | 11 * 2. Redistributions in binary form must reproduce the above copyright |
| 12 * notice, this list of conditions and the following disclaimer in the | 12 * notice, this list of conditions and the following disclaimer in the |
| 13 * documentation and/or other materials provided with the distribution. | 13 * documentation and/or other materials provided with the distribution. |
| 14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of | 14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 15 * its contributors may be used to endorse or promote products derived | 15 * its contributors may be used to endorse or promote products derived |
| 16 * from this software without specific prior written permission. | 16 * from this software without specific prior written permission. |
| 17 * | 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_ | 30 #ifndef DartInspectorDebuggerAgent_h |
| 31 #define SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_ | 31 #define DartInspectorDebuggerAgent_h |
| 32 | 32 |
| 33 #include "gen/v8_inspector/InspectorFrontend.h" | 33 #include "bindings/common/ScriptState.h" |
| 34 #include "sky/engine/bindings/core/v8/ScriptState.h" | 34 #include "bindings/core/dart/DartInjectedScript.h" |
| 35 #include "sky/engine/core/frame/ConsoleTypes.h" | 35 #include "bindings/core/dart/DartInjectedScriptManager.h" |
| 36 #include "sky/engine/core/inspector/ConsoleAPITypes.h" | 36 #include "bindings/core/dart/DartScriptDebugListener.h" |
| 37 #include "sky/engine/v8_inspector/AsyncCallStackTracker.h" | 37 #include "core/InspectorFrontend.h" |
| 38 #include "sky/engine/v8_inspector/InjectedScript.h" | 38 #include "core/frame/ConsoleTypes.h" |
| 39 #include "sky/engine/v8_inspector/InspectorBaseAgent.h" | 39 #include "core/inspector/ConsoleAPITypes.h" |
| 40 #include "sky/engine/v8_inspector/PromiseTracker.h" | 40 #include "core/inspector/InspectorBaseAgent.h" |
| 41 #include "sky/engine/v8_inspector/ScriptBreakpoint.h" | 41 #include "core/inspector/ScriptBreakpoint.h" |
| 42 #include "sky/engine/v8_inspector/ScriptDebugListener.h" | 42 #include "wtf/Forward.h" |
| 43 #include "sky/engine/wtf/Forward.h" | 43 #include "wtf/HashMap.h" |
| 44 #include "sky/engine/wtf/HashMap.h" | 44 #include "wtf/PassRefPtr.h" |
| 45 #include "sky/engine/wtf/PassRefPtr.h" | 45 #include "wtf/Vector.h" |
| 46 #include "sky/engine/wtf/Vector.h" | 46 #include "wtf/text/StringHash.h" |
| 47 #include "sky/engine/wtf/text/StringHash.h" | |
| 48 | 47 |
| 49 namespace blink { | 48 namespace blink { |
| 50 | 49 |
| 51 class ConsoleMessage; | |
| 52 class Document; | 50 class Document; |
| 53 class Event; | 51 class Event; |
| 54 class EventListener; | 52 class EventListener; |
| 55 class EventTarget; | 53 class EventTarget; |
| 54 class ExecutionContextTask; |
| 56 class FormData; | 55 class FormData; |
| 57 class HTTPHeaderMap; | 56 class HTTPHeaderMap; |
| 58 class InjectedScriptManager; | |
| 59 class InspectorFrontend; | 57 class InspectorFrontend; |
| 60 class InstrumentingAgents; | 58 class InstrumentingAgents; |
| 61 class JavaScriptCallFrame; | 59 class JavaScriptCallFrame; |
| 62 class JSONObject; | 60 class JSONObject; |
| 63 class KURL; | 61 class KURL; |
| 64 class MutationObserver; | 62 class MutationObserver; |
| 65 class ScriptArguments; | 63 class ScriptArguments; |
| 66 class ScriptAsyncCallStack; | 64 class ScriptAsyncCallStack; |
| 67 class ScriptCallStack; | 65 class ScriptCallStack; |
| 68 class ScriptDebugServer; | 66 class ScriptCallFrame; |
| 67 class DartScriptDebugServer; |
| 69 class ScriptRegexp; | 68 class ScriptRegexp; |
| 70 class ScriptSourceCode; | 69 class ScriptSourceCode; |
| 71 class ScriptValue; | 70 class ScriptValue; |
| 72 class ThreadableLoaderClient; | 71 class ThreadableLoaderClient; |
| 73 class XMLHttpRequest; | 72 class XMLHttpRequest; |
| 73 class InspectorDebuggerAgent; |
| 74 | 74 |
| 75 typedef String ErrorString; | 75 typedef String ErrorString; |
| 76 | 76 |
| 77 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { | 77 class DartInspectorDebuggerAgent : public DartScriptDebugListener { |
| 78 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); | 78 WTF_MAKE_NONCOPYABLE(DartInspectorDebuggerAgent); |
| 79 WTF_MAKE_FAST_ALLOCATED; | |
| 80 public: | 79 public: |
| 81 enum BreakpointSource { | 80 enum BreakpointSource { |
| 82 UserBreakpointSource, | 81 UserBreakpointSource, |
| 83 DebugCommandBreakpointSource, | 82 DebugCommandBreakpointSource, |
| 84 MonitorCommandBreakpointSource | 83 MonitorCommandBreakpointSource |
| 85 }; | 84 }; |
| 85 explicit DartInspectorDebuggerAgent(DartInjectedScriptManager*, InspectorDeb
uggerAgent*, InspectorPageAgent*); |
| 86 | 86 |
| 87 static const char backtraceObjectGroup[]; | 87 static const char backtraceObjectGroup[]; |
| 88 | 88 |
| 89 virtual ~InspectorDebuggerAgent(); | 89 ~DartInspectorDebuggerAgent(); |
| 90 virtual void canSetScriptSource(ErrorString*, bool* result) FINAL { *result
= true; } |
| 90 | 91 |
| 91 virtual void canSetScriptSource(ErrorString*, bool* result) override final {
*result = true; } | 92 virtual void init() FINAL; |
| 92 | 93 virtual void setFrontend(InspectorFrontend*) FINAL; |
| 93 virtual void virtualInit() override final; | 94 virtual void clearFrontend() FINAL; |
| 94 virtual void setFrontend(InspectorFrontend*) override final; | 95 virtual void restore() FINAL; |
| 95 virtual void clearFrontend() override final; | |
| 96 virtual void restore() override final; | |
| 97 | 96 |
| 98 bool isPaused(); | 97 bool isPaused(); |
| 99 bool runningNestedMessageLoop(); | 98 bool runningNestedMessageLoop(); |
| 100 void addMessageToConsole(ConsoleMessage*); | |
| 101 | 99 |
| 102 // Part of the protocol. | 100 // Part of the protocol. |
| 103 virtual void enable(ErrorString*) override final; | 101 virtual void enable(ErrorString*) FINAL; |
| 104 virtual void disable(ErrorString*) override final; | 102 virtual void disable(ErrorString*) FINAL; |
| 105 virtual void setBreakpointsActive(ErrorString*, bool active) override final; | 103 virtual void setBreakpointsActive(ErrorString*, bool active) FINAL; |
| 106 virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilR
eload) override final; | 104 virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilR
eload) FINAL; |
| 107 | 105 |
| 108 virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String*
optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, co
nst String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugg
er::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >&
locations) override final; | 106 virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String*
optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, co
nst String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugg
er::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >&
locations) FINAL; |
| 109 virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location,
const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<T
ypeBuilder::Debugger::Location>& actualLocation) override final; | 107 virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location,
const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<T
ypeBuilder::Debugger::Location>& actualLocation) FINAL; |
| 110 virtual void removeBreakpoint(ErrorString*, const String& breakpointId) over
ride final; | 108 virtual void removeBreakpoint(ErrorString*, const String& breakpointId) FINA
L; |
| 111 virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& loca
tion, const bool* interstateLocationOpt) override final; | 109 virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& loca
tion, const bool* interstateLocationOpt) FINAL; |
| 112 virtual void getStepInPositions(ErrorString*, const String& callFrameId, Ref
Ptr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions) override f
inal; | 110 virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilde
r::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&) FINAL; |
| 113 virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilde
r::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&) override
final; | |
| 114 | 111 |
| 115 virtual void searchInContent(ErrorString*, const String& scriptId, const Str
ing& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefP
tr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) override final; | 112 virtual void searchInContent(ErrorString*, const String& scriptId, const Str
ing& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefP
tr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) FINAL; |
| 116 virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::Set
ScriptSourceError>&, const String& scriptId, const String& newContent, const boo
l* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCa
llFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>&
asyncStackTrace) override final; | 113 virtual void getScriptSource(ErrorString*, const String& scriptId, String* s
criptSource) FINAL; |
| 117 virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<Ty
peBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSON
Object>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace) ove
rride final; | 114 virtual void getFunctionDetails(ErrorString*, const String& functionId, RefP
tr<TypeBuilder::Debugger::FunctionDetails>&) FINAL; |
| 118 virtual void getScriptSource(ErrorString*, const String& scriptId, String* s
criptSource) override final; | 115 virtual void pause(ErrorString*) FINAL; |
| 119 virtual void getFunctionDetails(ErrorString*, const String& functionId, RefP
tr<TypeBuilder::Debugger::FunctionDetails>&) override final; | 116 virtual void resume(ErrorString*) FINAL; |
| 120 virtual void getCollectionEntries(ErrorString*, const String& objectId, RefP
tr<TypeBuilder::Array<TypeBuilder::Debugger::CollectionEntry> >&) override final
; | 117 virtual void stepOver(ErrorString*) FINAL; |
| 121 virtual void pause(ErrorString*) override final; | 118 virtual void stepInto(ErrorString*) FINAL; |
| 122 virtual void resume(ErrorString*) override final; | 119 virtual void stepOut(ErrorString*) FINAL; |
| 123 virtual void stepOver(ErrorString*) override final; | 120 virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) FI
NAL; |
| 124 virtual void stepInto(ErrorString*) override final; | |
| 125 virtual void stepOut(ErrorString*) override final; | |
| 126 virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) ov
erride final; | |
| 127 virtual void evaluateOnCallFrame(ErrorString*, | 121 virtual void evaluateOnCallFrame(ErrorString*, |
| 128 const String& callFrameId, | 122 const String& callFrameId, |
| 129 const String& expression, | 123 const String& expression, |
| 130 const String* objectGroup, | 124 const String* objectGroup, |
| 131 const bool* includeCommandLineAPI, | 125 const bool* includeCommandLineAPI, |
| 132 const bool* doNotPauseOnExceptionsAndMuteConsole, | 126 const bool* doNotPauseOnExceptionsAndMuteConsole, |
| 133 const bool* returnByValue, | 127 const bool* returnByValue, |
| 134 const bool* generatePreview, | 128 const bool* generatePreview, |
| 135 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, | 129 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, |
| 136 TypeBuilder::OptOutput<bool>* wasThrown, | 130 TypeBuilder::OptOutput<bool>* wasThrown, |
| 137 RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) override final; | 131 RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) FINAL; |
| 138 virtual void compileScript(ErrorString*, const String& expression, const Str
ing& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilde
r::Debugger::ScriptId>*, RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) overr
ide; | 132 virtual void getCompletionsOnCallFrame(ErrorString*, |
| 139 virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&,
const int* executionContextId, const String* objectGroup, const bool* doNotPaus
eOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) override; | 133 const String& callFrameId, |
| 140 virtual void setOverlayMessage(ErrorString*, const String*) override; | 134 const String& expression, |
| 141 virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String
& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callF
rame, const String* in_functionObjectId) override final; | 135 RefPtr<TypeBuilder::Array<String> >& result) FINAL; |
| 142 virtual void skipStackFrames(ErrorString*, const String* pattern) override f
inal; | 136 virtual void setOverlayMessage(ErrorString*, const String*); |
| 143 virtual void setAsyncCallStackDepth(ErrorString*, int depth) override final; | 137 virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String
& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callF
rame, const String* in_functionObjectId) FINAL; |
| 138 virtual void skipStackFrames(ErrorString*, const String* pattern) FINAL; |
| 144 | 139 |
| 145 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); | 140 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); |
| 146 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); | |
| 147 void didRemoveTimer(ExecutionContext*, int timerId); | |
| 148 bool willFireTimer(ExecutionContext*, int timerId); | |
| 149 void didFireTimer(); | |
| 150 void didRequestAnimationFrame(Document*, int callbackId); | |
| 151 void didCancelAnimationFrame(Document*, int callbackId); | |
| 152 bool willFireAnimationFrame(Document*, int callbackId); | |
| 153 void didFireAnimationFrame(); | |
| 154 void didEnqueueEvent(EventTarget*, Event*); | |
| 155 void didRemoveEvent(EventTarget*, Event*); | |
| 156 void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture); | |
| 157 void didHandleEvent(); | |
| 158 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*); | |
| 159 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); | |
| 160 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); | |
| 161 void didDeliverMutationRecords(); | |
| 162 // void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*
); | |
| 163 // void didKillAllExecutionContextTasks(ExecutionContext*); | |
| 164 // void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextT
ask*); | |
| 165 // void didPerformExecutionContextTask(); | |
| 166 int traceAsyncOperationStarting(ExecutionContext*, const String& operationNa
me, int prevOperationId = 0); | |
| 167 void traceAsyncOperationCompleted(ExecutionContext*, int operationId); | |
| 168 void traceAsyncOperationCompletedCallbackStarting(ExecutionContext*, int ope
rationId); | |
| 169 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); | |
| 170 void traceAsyncCallbackCompleted(); | |
| 171 bool canBreakProgram(); | 141 bool canBreakProgram(); |
| 172 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); | 142 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); |
| 173 void scriptExecutionBlockedByCSP(const String& directiveText); | 143 void scriptExecutionBlockedByCSP(const String& directiveText); |
| 174 | 144 |
| 175 class Listener { | 145 class Listener : public WillBeGarbageCollectedMixin { |
| 176 public: | 146 public: |
| 177 virtual ~Listener() { } | 147 virtual ~Listener() { } |
| 178 virtual void debuggerWasEnabled() = 0; | 148 virtual void debuggerWasEnabled() = 0; |
| 179 virtual void debuggerWasDisabled() = 0; | 149 virtual void debuggerWasDisabled() = 0; |
| 180 virtual void stepInto() = 0; | 150 virtual void stepInto() = 0; |
| 181 virtual void didPause() = 0; | 151 virtual void didPause() = 0; |
| 182 }; | 152 }; |
| 183 void setListener(Listener* listener) { m_listener = listener; } | 153 void setListener(Listener* listener) { m_listener = listener; } |
| 184 | 154 |
| 185 bool enabled(); | 155 bool enabled(); |
| 186 | 156 |
| 187 virtual ScriptDebugServer& scriptDebugServer() = 0; | 157 virtual DartScriptDebugServer& scriptDebugServer() = 0; |
| 188 | 158 |
| 189 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); | 159 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); |
| 190 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); | 160 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); |
| 191 | 161 |
| 162 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> currentAsyncStackTraceForConsol
e(); |
| 163 |
| 164 bool isDartScriptId(const String& scriptId); |
| 165 bool isDartURL(const String* const optionalURL, const String* const optional
URLRegex); |
| 166 |
| 192 protected: | 167 protected: |
| 193 explicit InspectorDebuggerAgent(InjectedScriptManager*); | |
| 194 | 168 |
| 195 virtual void startListeningScriptDebugServer() = 0; | 169 virtual void startListeningScriptDebugServer() = 0; |
| 196 virtual void stopListeningScriptDebugServer() = 0; | 170 virtual void stopListeningScriptDebugServer() = 0; |
| 197 virtual void muteConsole() = 0; | 171 virtual void muteConsole() = 0; |
| 198 virtual void unmuteConsole() = 0; | 172 virtual void unmuteConsole() = 0; |
| 199 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } | 173 DartInjectedScriptManager* injectedScriptManager() { return m_injectedScript
Manager; } |
| 200 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; | 174 virtual DartInjectedScript* injectedScriptForEval(ErrorString*, const int* e
xecutionContextId) = 0; |
| 201 | 175 |
| 202 virtual void enable(); | 176 virtual void enable(); |
| 203 virtual void disable(); | 177 virtual void disable(); |
| 204 virtual SkipPauseRequest didPause(ScriptState*, const ScriptValue& callFrame
s, const ScriptValue& exception, const Vector<String>& hitBreakpoints) override
final; | 178 virtual SkipPauseRequest didPause(ScriptState*, Dart_StackTrace callFrames,
const ScriptValue& exception, const Vector<String>& hitBreakpoints) FINAL; |
| 205 virtual void didContinue() override final; | 179 virtual void didContinue() FINAL; |
| 206 void reset(); | 180 void reset(); |
| 207 void pageDidCommitLoad(); | 181 void pageDidCommitLoad(); |
| 208 | 182 |
| 209 private: | 183 protected: |
| 210 bool shouldSkipInspectorInternals(); | |
| 211 SkipPauseRequest shouldSkipExceptionPause(); | 184 SkipPauseRequest shouldSkipExceptionPause(); |
| 212 SkipPauseRequest shouldSkipStepPause(); | 185 SkipPauseRequest shouldSkipStepPause(); |
| 213 bool isTopCallFrameInFramework(); | 186 bool isTopCallFrameInFramework(); |
| 214 | 187 |
| 215 void cancelPauseOnNextStatement(); | 188 void cancelPauseOnNextStatement(); |
| 216 void addMessageToConsole(MessageSource, MessageType); | 189 void addMessageToConsole(MessageSource, MessageType); |
| 217 | 190 |
| 218 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 191 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
| 219 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); | |
| 220 | 192 |
| 221 virtual void didParseSource(const String& scriptId, const Script&, CompileRe
sult) override final; | 193 virtual void didParseSource(const String& scriptId, const Script&, CompileRe
sult) FINAL; |
| 222 virtual void didReceiveV8AsyncTaskEvent(ExecutionContext*, const String& eve
ntType, const String& eventName, int id) override final; | |
| 223 virtual void didReceiveV8PromiseEvent(ScriptState*, v8::Handle<v8::Object> p
romise, v8::Handle<v8::Value> parentPromise, int status) override final; | |
| 224 | 194 |
| 225 void setPauseOnExceptionsImpl(ErrorString*, int); | 195 void setPauseOnExceptionsImpl(ErrorString*, int); |
| 226 | 196 |
| 227 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; | 197 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; |
| 228 void removeBreakpoint(const String& breakpointId); | 198 void removeBreakpoint(const String& breakpointId); |
| 229 void clear(); | 199 void clear(); |
| 230 bool assertPaused(ErrorString*); | 200 bool assertPaused(ErrorString*); |
| 231 void clearBreakDetails(); | 201 void clearBreakDetails(); |
| 232 | 202 |
| 233 String sourceMapURLForScript(const Script&, CompileResult); | 203 String sourceMapURLForScript(const Script&, CompileResult); |
| 234 | 204 |
| 235 PassRefPtr<JavaScriptCallFrame> topCallFrameSkipUnknownSources(); | 205 ScriptCallFrame topCallFrameSkipUnknownSources(); |
| 236 String scriptURL(JavaScriptCallFrame*); | 206 |
| 237 AsyncCallStackTracker& asyncCallStackTracker() { return *m_asyncCallStackTra
cker; }; | 207 InspectorState* state(); |
| 238 | 208 |
| 239 typedef HashMap<String, Script> ScriptsMap; | 209 typedef HashMap<String, Script> ScriptsMap; |
| 240 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; | 210 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; |
| 241 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; | 211 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; |
| 242 | 212 |
| 243 RawPtr<InjectedScriptManager> m_injectedScriptManager; | 213 DartInjectedScriptManager* m_injectedScriptManager; |
| 244 InspectorFrontend::Debugger* m_frontend; | 214 InspectorFrontend::Debugger* m_frontend; |
| 245 RefPtr<ScriptState> m_pausedScriptState; | 215 RefPtr<ScriptState> m_pausedScriptState; |
| 246 ScriptValue m_currentCallStack; | 216 Dart_StackTrace m_currentCallStack; |
| 247 ScriptsMap m_scripts; | 217 ScriptsMap m_scripts; |
| 248 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; | 218 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; |
| 249 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 219 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
| 250 String m_continueToLocationBreakpointId; | 220 String m_continueToLocationBreakpointId; |
| 251 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 221 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
| 252 RefPtr<JSONObject> m_breakAuxData; | 222 RefPtr<JSONObject> m_breakAuxData; |
| 253 bool m_javaScriptPauseScheduled; | 223 bool m_javaScriptPauseScheduled; |
| 254 bool m_debuggerStepScheduled; | 224 bool m_debuggerStepScheduled; |
| 255 bool m_steppingFromFramework; | 225 bool m_steppingFromFramework; |
| 256 bool m_pausingOnNativeEvent; | 226 bool m_pausingOnNativeEvent; |
| 257 RawPtr<Listener> m_listener; | 227 RawPtrWillBeMember<Listener> m_listener; |
| 258 | 228 |
| 259 int m_skippedStepInCount; | 229 int m_skippedStepInCount; |
| 260 int m_minFrameCountForSkip; | 230 int m_minFrameCountForSkip; |
| 261 bool m_skipAllPauses; | 231 bool m_skipAllPauses; |
| 262 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 232 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
| 263 OwnPtr<AsyncCallStackTracker> m_asyncCallStackTracker; | 233 InspectorDebuggerAgent* m_inspectorDebuggerAgent; |
| 264 PromiseTracker m_promiseTracker; | 234 InspectorPageAgent* m_pageAgent; |
| 265 }; | 235 }; |
| 266 | 236 |
| 267 } // namespace blink | 237 } // namespace blink |
| 268 | 238 |
| 269 | 239 |
| 270 #endif // SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_ | 240 #endif // !defined(DartInspectorDebuggerAgent_h) |
| OLD | NEW |