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

Unified Diff: src/debug/debug-interface.h

Issue 2449213002: [inspector] migrate scriptParsed and getCompiledScripts to native (Closed)
Patch Set: addressed comments Created 4 years, 2 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: src/debug/debug-interface.h
diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h
index 0577ecc4ca2b5980aaa979da0e74831b9a2bea47..77bab3a50c6336a780394fd068c9febfcad6af83 100644
--- a/src/debug/debug-interface.h
+++ b/src/debug/debug-interface.h
@@ -6,6 +6,7 @@
#define V8_DEBUG_DEBUG_INTERFACE_H_
#include "include/v8-debug.h"
+#include "include/v8-util.h"
#include "include/v8.h"
namespace v8 {
@@ -138,6 +139,43 @@ class DebugInterface {
static void PrepareStep(Isolate* isolate, StepAction action);
static void ClearStepping(Isolate* isolate);
+
+ /**
+ * Native wrapper around v8::internal::Script object.
+ */
+ class Script {
+ public:
+ v8::Isolate* GetIsolate() const;
+
+ ScriptOriginOptions OriginOptions() const;
+ bool WasCompiled() const;
+ int Id() const;
+ int LineOffset() const;
+ int ColumnOffset() const;
+ std::vector<int> LineEnds() const;
+ MaybeLocal<String> Name() const;
+ MaybeLocal<String> SourceURL() const;
+ MaybeLocal<String> SourceMappingURL() const;
+ MaybeLocal<String> ContextData() const;
+ MaybeLocal<String> Source() const;
+
+ /**
+ * script parameter is a wrapper v8::internal::JSObject for
+ * v8::internal::Script.
+ * This function gets v8::internal::Script from v8::internal::JSObject and
+ * wraps it with DebugInterface::Script.
+ * Returns empty local if not called with a valid wrapper of
+ * v8::internal::Script.
+ */
+ static MaybeLocal<Script> Wrap(Isolate* isolate,
+ v8::Local<v8::Object> script);
+ };
+
+ /**
+ * Return array of compiled scripts.
+ */
+ static void GetLoadedScripts(Isolate* isolate,
+ PersistentValueVector<Script>& scripts);
};
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698