Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: sky/engine/bindings-dart/core/dart/DartInspectorDebuggerAgent.h

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/engine/bindings-dart/core/dart/DartInspectorDebuggerAgent.h
diff --git a/sky/engine/v8_inspector/InspectorDebuggerAgent.h b/sky/engine/bindings-dart/core/dart/DartInspectorDebuggerAgent.h
similarity index 50%
copy from sky/engine/v8_inspector/InspectorDebuggerAgent.h
copy to sky/engine/bindings-dart/core/dart/DartInspectorDebuggerAgent.h
index a6ce44a4d6458aa7dc95fbee87e0733c4b8a1833..79761d52579f773d3411db8b3fcf798ba4c03dec 100644
--- a/sky/engine/v8_inspector/InspectorDebuggerAgent.h
+++ b/sky/engine/bindings-dart/core/dart/DartInspectorDebuggerAgent.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2010-2011 Google Inc. All rights reserved.
+ * Copyright (C) 2010-2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,35 +27,33 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_
-#define SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_
-
-#include "gen/v8_inspector/InspectorFrontend.h"
-#include "sky/engine/bindings/core/v8/ScriptState.h"
-#include "sky/engine/core/frame/ConsoleTypes.h"
-#include "sky/engine/core/inspector/ConsoleAPITypes.h"
-#include "sky/engine/v8_inspector/AsyncCallStackTracker.h"
-#include "sky/engine/v8_inspector/InjectedScript.h"
-#include "sky/engine/v8_inspector/InspectorBaseAgent.h"
-#include "sky/engine/v8_inspector/PromiseTracker.h"
-#include "sky/engine/v8_inspector/ScriptBreakpoint.h"
-#include "sky/engine/v8_inspector/ScriptDebugListener.h"
-#include "sky/engine/wtf/Forward.h"
-#include "sky/engine/wtf/HashMap.h"
-#include "sky/engine/wtf/PassRefPtr.h"
-#include "sky/engine/wtf/Vector.h"
-#include "sky/engine/wtf/text/StringHash.h"
+#ifndef DartInspectorDebuggerAgent_h
+#define DartInspectorDebuggerAgent_h
+
+#include "bindings/common/ScriptState.h"
+#include "bindings/core/dart/DartInjectedScript.h"
+#include "bindings/core/dart/DartInjectedScriptManager.h"
+#include "bindings/core/dart/DartScriptDebugListener.h"
+#include "core/InspectorFrontend.h"
+#include "core/frame/ConsoleTypes.h"
+#include "core/inspector/ConsoleAPITypes.h"
+#include "core/inspector/InspectorBaseAgent.h"
+#include "core/inspector/ScriptBreakpoint.h"
+#include "wtf/Forward.h"
+#include "wtf/HashMap.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/Vector.h"
+#include "wtf/text/StringHash.h"
namespace blink {
-class ConsoleMessage;
class Document;
class Event;
class EventListener;
class EventTarget;
+class ExecutionContextTask;
class FormData;
class HTTPHeaderMap;
-class InjectedScriptManager;
class InspectorFrontend;
class InstrumentingAgents;
class JavaScriptCallFrame;
@@ -65,65 +63,61 @@ class MutationObserver;
class ScriptArguments;
class ScriptAsyncCallStack;
class ScriptCallStack;
-class ScriptDebugServer;
+class ScriptCallFrame;
+class DartScriptDebugServer;
class ScriptRegexp;
class ScriptSourceCode;
class ScriptValue;
class ThreadableLoaderClient;
class XMLHttpRequest;
+class InspectorDebuggerAgent;
typedef String ErrorString;
-class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommandHandler {
- WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent);
- WTF_MAKE_FAST_ALLOCATED;
+class DartInspectorDebuggerAgent : public DartScriptDebugListener {
+ WTF_MAKE_NONCOPYABLE(DartInspectorDebuggerAgent);
public:
enum BreakpointSource {
UserBreakpointSource,
DebugCommandBreakpointSource,
MonitorCommandBreakpointSource
};
+ explicit DartInspectorDebuggerAgent(DartInjectedScriptManager*, InspectorDebuggerAgent*, InspectorPageAgent*);
static const char backtraceObjectGroup[];
- virtual ~InspectorDebuggerAgent();
+ ~DartInspectorDebuggerAgent();
+ virtual void canSetScriptSource(ErrorString*, bool* result) FINAL { *result = true; }
- virtual void canSetScriptSource(ErrorString*, bool* result) override final { *result = true; }
-
- virtual void virtualInit() override final;
- virtual void setFrontend(InspectorFrontend*) override final;
- virtual void clearFrontend() override final;
- virtual void restore() override final;
+ virtual void init() FINAL;
+ virtual void setFrontend(InspectorFrontend*) FINAL;
+ virtual void clearFrontend() FINAL;
+ virtual void restore() FINAL;
bool isPaused();
bool runningNestedMessageLoop();
- void addMessageToConsole(ConsoleMessage*);
// Part of the protocol.
- virtual void enable(ErrorString*) override final;
- virtual void disable(ErrorString*) override final;
- virtual void setBreakpointsActive(ErrorString*, bool active) override final;
- virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilReload) override final;
-
- virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& locations) override final;
- virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location, const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder::Debugger::Location>& actualLocation) override final;
- virtual void removeBreakpoint(ErrorString*, const String& breakpointId) override final;
- virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& location, const bool* interstateLocationOpt) override final;
- virtual void getStepInPositions(ErrorString*, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions) override final;
- virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&) override final;
-
- virtual void searchInContent(ErrorString*, const String& scriptId, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) override final;
- virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, const String& scriptId, const String& newContent, const bool* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace) override final;
- virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace) override final;
- virtual void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource) override final;
- virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>&) override final;
- virtual void getCollectionEntries(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CollectionEntry> >&) override final;
- virtual void pause(ErrorString*) override final;
- virtual void resume(ErrorString*) override final;
- virtual void stepOver(ErrorString*) override final;
- virtual void stepInto(ErrorString*) override final;
- virtual void stepOut(ErrorString*) override final;
- virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) override final;
+ virtual void enable(ErrorString*) FINAL;
+ virtual void disable(ErrorString*) FINAL;
+ virtual void setBreakpointsActive(ErrorString*, bool active) FINAL;
+ virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilReload) FINAL;
+
+ virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& locations) FINAL;
+ virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location, const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<TypeBuilder::Debugger::Location>& actualLocation) FINAL;
+ virtual void removeBreakpoint(ErrorString*, const String& breakpointId) FINAL;
+ virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& location, const bool* interstateLocationOpt) FINAL;
+ virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&) FINAL;
+
+ virtual void searchInContent(ErrorString*, const String& scriptId, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) FINAL;
+ virtual void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource) FINAL;
+ virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>&) FINAL;
+ virtual void pause(ErrorString*) FINAL;
+ virtual void resume(ErrorString*) FINAL;
+ virtual void stepOver(ErrorString*) FINAL;
+ virtual void stepInto(ErrorString*) FINAL;
+ virtual void stepOut(ErrorString*) FINAL;
+ virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) FINAL;
virtual void evaluateOnCallFrame(ErrorString*,
const String& callFrameId,
const String& expression,
@@ -134,45 +128,21 @@ public:
const bool* generatePreview,
RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
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;
- virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callFrame, const String* in_functionObjectId) override final;
- virtual void skipStackFrames(ErrorString*, const String* pattern) override final;
- virtual void setAsyncCallStackDepth(ErrorString*, int depth) override final;
+ RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) FINAL;
+ virtual void getCompletionsOnCallFrame(ErrorString*,
+ const String& callFrameId,
+ const String& expression,
+ RefPtr<TypeBuilder::Array<String> >& result) FINAL;
+ virtual void setOverlayMessage(ErrorString*, const String*);
+ virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callFrame, const String* in_functionObjectId) FINAL;
+ virtual void skipStackFrames(ErrorString*, const String* pattern) FINAL;
void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
- void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singleShot);
- void didRemoveTimer(ExecutionContext*, int timerId);
- bool willFireTimer(ExecutionContext*, int timerId);
- void didFireTimer();
- void didRequestAnimationFrame(Document*, int callbackId);
- void didCancelAnimationFrame(Document*, int callbackId);
- bool willFireAnimationFrame(Document*, int callbackId);
- void didFireAnimationFrame();
- void didEnqueueEvent(EventTarget*, Event*);
- void didRemoveEvent(EventTarget*, Event*);
- void willHandleEvent(EventTarget*, Event*, EventListener*, bool useCapture);
- void didHandleEvent();
- 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;
@@ -184,30 +154,33 @@ public:
bool enabled();
- virtual ScriptDebugServer& scriptDebugServer() = 0;
+ virtual DartScriptDebugServer& scriptDebugServer() = 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();
+
+ bool isDartScriptId(const String& scriptId);
+ bool isDartURL(const String* const optionalURL, const String* const optionalURLRegex);
+
protected:
- explicit InspectorDebuggerAgent(InjectedScriptManager*);
virtual void startListeningScriptDebugServer() = 0;
virtual void stopListeningScriptDebugServer() = 0;
virtual void muteConsole() = 0;
virtual void unmuteConsole() = 0;
- InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
- virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
+ DartInjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
+ virtual DartInjectedScript* injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
virtual void enable();
virtual void disable();
- virtual SkipPauseRequest didPause(ScriptState*, const ScriptValue& callFrames, const ScriptValue& exception, const Vector<String>& hitBreakpoints) override final;
- virtual void didContinue() override final;
+ virtual SkipPauseRequest didPause(ScriptState*, Dart_StackTrace callFrames, const ScriptValue& exception, const Vector<String>& hitBreakpoints) FINAL;
+ virtual void didContinue() FINAL;
void reset();
void pageDidCommitLoad();
-private:
- bool shouldSkipInspectorInternals();
+protected:
SkipPauseRequest shouldSkipExceptionPause();
SkipPauseRequest shouldSkipStepPause();
bool isTopCallFrameInFramework();
@@ -216,11 +189,8 @@ private:
void addMessageToConsole(MessageSource, MessageType);
PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCallFrames();
- PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace();
- 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;
- virtual void didReceiveV8PromiseEvent(ScriptState*, v8::Handle<v8::Object> promise, v8::Handle<v8::Value> parentPromise, int status) override final;
+ virtual void didParseSource(const String& scriptId, const Script&, CompileResult) FINAL;
void setPauseOnExceptionsImpl(ErrorString*, int);
@@ -232,18 +202,18 @@ private:
String sourceMapURLForScript(const Script&, CompileResult);
- PassRefPtr<JavaScriptCallFrame> topCallFrameSkipUnknownSources();
- String scriptURL(JavaScriptCallFrame*);
- AsyncCallStackTracker& asyncCallStackTracker() { return *m_asyncCallStackTracker; };
+ ScriptCallFrame topCallFrameSkipUnknownSources();
+
+ InspectorState* state();
typedef HashMap<String, Script> ScriptsMap;
typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpointIdsMap;
typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBreakpointToBreakpointIdAndSourceMap;
- RawPtr<InjectedScriptManager> m_injectedScriptManager;
+ DartInjectedScriptManager* m_injectedScriptManager;
InspectorFrontend::Debugger* m_frontend;
RefPtr<ScriptState> m_pausedScriptState;
- ScriptValue m_currentCallStack;
+ Dart_StackTrace m_currentCallStack;
ScriptsMap m_scripts;
BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpointIds;
DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints;
@@ -254,17 +224,17 @@ private:
bool m_debuggerStepScheduled;
bool m_steppingFromFramework;
bool m_pausingOnNativeEvent;
- RawPtr<Listener> m_listener;
+ RawPtrWillBeMember<Listener> m_listener;
int m_skippedStepInCount;
int m_minFrameCountForSkip;
bool m_skipAllPauses;
OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp;
- OwnPtr<AsyncCallStackTracker> m_asyncCallStackTracker;
- PromiseTracker m_promiseTracker;
+ InspectorDebuggerAgent* m_inspectorDebuggerAgent;
+ InspectorPageAgent* m_pageAgent;
};
} // namespace blink
-#endif // SKY_ENGINE_V8_INSPECTOR_INSPECTORDEBUGGERAGENT_H_
+#endif // !defined(DartInspectorDebuggerAgent_h)

Powered by Google App Engine
This is Rietveld 408576698