OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 void setPauseOnNextStatement(bool pause); | 73 void setPauseOnNextStatement(bool pause); |
74 bool canBreakProgram(); | 74 bool canBreakProgram(); |
75 void breakProgram(); | 75 void breakProgram(); |
76 void continueProgram(); | 76 void continueProgram(); |
77 void stepIntoStatement(); | 77 void stepIntoStatement(); |
78 void stepOverStatement(const ScriptValue& frame); | 78 void stepOverStatement(const ScriptValue& frame); |
79 void stepOutOfFunction(const ScriptValue& frame); | 79 void stepOutOfFunction(const ScriptValue& frame); |
80 | 80 |
81 bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, Sc riptValue* newCallFrames, ScriptObject* result); | 81 bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, Sc riptValue* newCallFrames, ScriptObject* result); |
82 void updateCallStack(ScriptValue* callFrame); | 82 void updateCallStack(ScriptValue* callFrame); |
83 bool requestAsyncCallFrames(); | |
yurys
2013/12/03 13:41:08
It should be requestCallStack, from the ScriptDebu
aandrey
2013/12/04 12:45:47
Done.
| |
83 | 84 |
84 class Task { | 85 class Task { |
85 public: | 86 public: |
86 virtual ~Task() { } | 87 virtual ~Task() { } |
87 virtual void run() = 0; | 88 virtual void run() = 0; |
88 }; | 89 }; |
89 static void interruptAndRun(PassOwnPtr<Task>, v8::Isolate*); | 90 static void interruptAndRun(PassOwnPtr<Task>, v8::Isolate*); |
90 void runPendingTasks(); | 91 void runPendingTasks(); |
91 | 92 |
92 bool isPaused(); | 93 bool isPaused(); |
(...skipping 10 matching lines...) Expand all Loading... | |
103 virtual void setPreprocessorSource(const String&) { } | 104 virtual void setPreprocessorSource(const String&) { } |
104 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } | 105 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } |
105 virtual PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCo de&); | 106 virtual PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCo de&); |
106 virtual String preprocessEventListener(Frame*, const String& source, const S tring& url, const String& functionName); | 107 virtual String preprocessEventListener(Frame*, const String& source, const S tring& url, const String& functionName); |
107 | 108 |
108 protected: | 109 protected: |
109 explicit ScriptDebugServer(v8::Isolate*); | 110 explicit ScriptDebugServer(v8::Isolate*); |
110 virtual ~ScriptDebugServer(); | 111 virtual ~ScriptDebugServer(); |
111 | 112 |
112 ScriptValue currentCallFrame(); | 113 ScriptValue currentCallFrame(); |
114 ScriptValue currentCallFrame(v8::Handle<v8::Object> executionState, v8::Hand le<v8::Context> pausedContext); | |
113 | 115 |
114 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte xt>) = 0; | 116 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte xt>) = 0; |
115 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; | 117 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; |
116 virtual void quitMessageLoopOnPause() = 0; | 118 virtual void quitMessageLoopOnPause() = 0; |
117 | 119 |
118 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; | 120 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&) ; |
119 void handleProgramBreak(v8::Handle<v8::Object> executionState, v8::Handle<v8 ::Value> exception, v8::Handle<v8::Array> hitBreakpoints); | 121 void handleProgramBreak(v8::Handle<v8::Object> executionState, v8::Handle<v8 ::Value> exception, v8::Handle<v8::Array> hitBreakpoints); |
120 void handleProgramBreak(const v8::Debug::EventDetails&, v8::Handle<v8::Value > exception, v8::Handle<v8::Array> hitBreakpointNumbers); | 122 void handleProgramBreak(const v8::Debug::EventDetails&, v8::Handle<v8::Value > exception, v8::Handle<v8::Array> hitBreakpointNumbers); |
121 | 123 |
124 static void asyncCallFramesCallback(const v8::FunctionCallbackInfo<v8::Value >&); | |
125 void handleAsyncCallFrames(v8::Handle<v8::Object> executionState); | |
126 | |
122 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails ); | 127 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails ); |
123 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); | 128 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); |
124 | 129 |
125 void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Ob ject> sourceObject); | 130 void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Ob ject> sourceObject); |
126 | 131 |
127 void ensureDebuggerScriptCompiled(); | 132 void ensureDebuggerScriptCompiled(); |
128 | 133 |
129 PauseOnExceptionsState m_pauseOnExceptionsState; | 134 PauseOnExceptionsState m_pauseOnExceptionsState; |
130 ScopedPersistent<v8::Object> m_debuggerScript; | 135 ScopedPersistent<v8::Object> m_debuggerScript; |
131 ScopedPersistent<v8::Object> m_executionState; | 136 ScopedPersistent<v8::Object> m_executionState; |
132 v8::Handle<v8::Context> m_pausedContext; | 137 v8::Handle<v8::Context> m_pausedContext; |
133 bool m_breakpointsActivated; | 138 bool m_breakpointsActivated; |
134 ScopedPersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; | 139 ScopedPersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; |
140 ScopedPersistent<v8::FunctionTemplate> m_asyncCallFramesCallbackTemplate; | |
135 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; | 141 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; |
136 v8::Isolate* m_isolate; | 142 v8::Isolate* m_isolate; |
137 | 143 |
138 private: | 144 private: |
139 void stepCommandWithFrame(const char* functionName, const ScriptValue& frame ); | 145 void stepCommandWithFrame(const char* functionName, const ScriptValue& frame ); |
140 PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> execut ionState, int maximumLimit); | 146 PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> execut ionState, int maximumLimit); |
141 bool executeSkipPauseRequest(ScriptDebugListener::SkipPauseRequest, v8::Hand le<v8::Object> executionState); | 147 bool executeSkipPauseRequest(ScriptDebugListener::SkipPauseRequest, v8::Hand le<v8::Object> executionState); |
142 | 148 |
143 bool m_runningNestedMessageLoop; | 149 bool m_runningNestedMessageLoop; |
144 }; | 150 }; |
145 | 151 |
146 } // namespace WebCore | 152 } // namespace WebCore |
147 | 153 |
148 | 154 |
149 #endif // ScriptDebugServer_h | 155 #endif // ScriptDebugServer_h |
OLD | NEW |