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 "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
9 #include "include/v8-util.h" | 9 #include "include/v8-util.h" |
10 #include "include/v8.h" | 10 #include "include/v8.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 MaybeLocal<String> Name() const; | 164 MaybeLocal<String> Name() const; |
165 MaybeLocal<String> SourceURL() const; | 165 MaybeLocal<String> SourceURL() const; |
166 MaybeLocal<String> SourceMappingURL() const; | 166 MaybeLocal<String> SourceMappingURL() const; |
167 MaybeLocal<Value> ContextData() const; | 167 MaybeLocal<Value> ContextData() const; |
168 MaybeLocal<String> Source() const; | 168 MaybeLocal<String> Source() const; |
169 bool IsWasm() const; | 169 bool IsWasm() const; |
170 bool GetPossibleBreakpoints(const debug::Location& start, | 170 bool GetPossibleBreakpoints(const debug::Location& start, |
171 const debug::Location& end, | 171 const debug::Location& end, |
172 std::vector<debug::Location>* locations) const; | 172 std::vector<debug::Location>* locations) const; |
173 | 173 |
174 /** | |
175 * script parameter is a wrapper v8::internal::JSObject for | |
176 * v8::internal::Script. | |
177 * This function gets v8::internal::Script from v8::internal::JSObject and | |
178 * wraps it with DebugInterface::Script. | |
179 * Returns empty local if not called with a valid wrapper of | |
180 * v8::internal::Script. | |
181 */ | |
182 static MaybeLocal<Script> Wrap(Isolate* isolate, | |
183 v8::Local<v8::Object> script); | |
184 | |
185 private: | 174 private: |
186 int GetSourcePosition(const debug::Location& location) const; | 175 int GetSourcePosition(const debug::Location& location) const; |
187 }; | 176 }; |
188 | 177 |
189 // Specialization for wasm Scripts. | 178 // Specialization for wasm Scripts. |
190 class WasmScript : public Script { | 179 class WasmScript : public Script { |
191 public: | 180 public: |
192 static WasmScript* Cast(Script* script); | 181 static WasmScript* Cast(Script* script); |
193 | 182 |
194 int NumFunctions() const; | 183 int NumFunctions() const; |
195 int NumImportedFunctions() const; | 184 int NumImportedFunctions() const; |
196 | 185 |
197 debug::WasmDisassembly DisassembleFunction(int function_index) const; | 186 debug::WasmDisassembly DisassembleFunction(int function_index) const; |
198 }; | 187 }; |
199 | 188 |
200 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); | 189 void GetLoadedScripts(Isolate* isolate, PersistentValueVector<Script>& scripts); |
201 | 190 |
202 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, | 191 MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, |
203 Local<String> source); | 192 Local<String> source); |
204 | 193 |
205 typedef std::function<void(debug::PromiseDebugActionType type, int id, | 194 typedef std::function<void(debug::PromiseDebugActionType type, int id, |
206 void* data)> | 195 void* data)> |
207 AsyncTaskListener; | 196 AsyncTaskListener; |
208 void SetAsyncTaskListener(Isolate* isolate, AsyncTaskListener listener, | 197 void SetAsyncTaskListener(Isolate* isolate, AsyncTaskListener listener, |
209 void* data); | 198 void* data); |
210 | 199 |
| 200 typedef std::function<void(v8::Local<Script> script, bool has_compile_error, |
| 201 void* data)> |
| 202 CompileEventListener; |
| 203 void SetCompileEventListener(Isolate* isolate, CompileEventListener listener, |
| 204 void* data); |
| 205 |
211 } // namespace debug | 206 } // namespace debug |
212 } // namespace v8 | 207 } // namespace v8 |
213 | 208 |
214 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 209 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
OLD | NEW |