OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ | 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ |
6 #define V8_DEBUG_DEBUG_INTERFACE_H_ | 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "include/v8-debug.h" | 10 #include "include/v8-debug.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 MaybeLocal<String> Name() const; | 166 MaybeLocal<String> Name() const; |
167 MaybeLocal<String> SourceURL() const; | 167 MaybeLocal<String> SourceURL() const; |
168 MaybeLocal<String> SourceMappingURL() const; | 168 MaybeLocal<String> SourceMappingURL() const; |
169 MaybeLocal<Value> ContextData() const; | 169 MaybeLocal<Value> ContextData() const; |
170 MaybeLocal<String> Source() const; | 170 MaybeLocal<String> Source() const; |
171 bool IsWasm() const; | 171 bool IsWasm() const; |
172 bool GetPossibleBreakpoints(const debug::Location& start, | 172 bool GetPossibleBreakpoints(const debug::Location& start, |
173 const debug::Location& end, | 173 const debug::Location& end, |
174 std::vector<debug::Location>* locations) const; | 174 std::vector<debug::Location>* locations) const; |
175 | 175 |
176 /** | |
177 * script parameter is a wrapper v8::internal::JSObject for | |
178 * v8::internal::Script. | |
179 * This function gets v8::internal::Script from v8::internal::JSObject and | |
180 * wraps it with DebugInterface::Script. | |
181 * Returns empty local if not called with a valid wrapper of | |
182 * v8::internal::Script. | |
183 */ | |
184 static MaybeLocal<Script> Wrap(Isolate* isolate, | |
185 v8::Local<v8::Object> script); | |
186 | |
187 private: | 176 private: |
188 int GetSourcePosition(const debug::Location& location) const; | 177 int GetSourcePosition(const debug::Location& location) const; |
189 }; | 178 }; |
190 | 179 |
191 // Specialization for wasm Scripts. | 180 // Specialization for wasm Scripts. |
192 class WasmScript : public Script { | 181 class WasmScript : public Script { |
193 public: | 182 public: |
194 static WasmScript* Cast(Script* script); | 183 static WasmScript* Cast(Script* script); |
195 | 184 |
196 int NumFunctions() const; | 185 int NumFunctions() const; |
197 int NumImportedFunctions() const; | 186 int NumImportedFunctions() const; |
198 | 187 |
199 debug::WasmDisassembly DisassembleFunction(int function_index) const; | 188 debug::WasmDisassembly DisassembleFunction(int function_index) const; |
200 }; | 189 }; |
201 | 190 |
202 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); | 191 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); |
203 | 192 |
204 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, | 193 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, |
205 Local<String> source); | 194 Local<String> source); |
206 | 195 |
207 typedef std::function<void(debug::PromiseDebugActionType type, int id, | 196 typedef std::function<void(debug::PromiseDebugActionType type, int id, |
208 void* data)> | 197 void* data)> |
209 AsyncTaskListener; | 198 AsyncTaskListener; |
210 void SetAsyncTaskListener(Isolate* isolate, AsyncTaskListener listener, | 199 void SetAsyncTaskListener(Isolate* isolate, AsyncTaskListener listener, |
211 void* data); | 200 void* data); |
212 | 201 |
| 202 typedef std::function<void(v8::Local<Script> script, bool has_compile_error, |
| 203 void* data)> |
| 204 CompileEventListener; |
| 205 void SetCompileEventListener(Isolate* isolate, CompileEventListener listener, |
| 206 void* data); |
| 207 |
213 } // namespace debug | 208 } // namespace debug |
214 } // namespace v8 | 209 } // namespace v8 |
215 | 210 |
216 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 211 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
OLD | NEW |