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

Unified Diff: src/inspector/v8-debugger-script.h

Issue 2532433003: [inspector] Split V8DebuggerScript implementation for wasm (Closed)
Patch Set: Fix rebase Created 4 years 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
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/inspector/v8-debugger-script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger-script.h
diff --git a/src/inspector/v8-debugger-script.h b/src/inspector/v8-debugger-script.h
index 38b7bc8dd6fc5c34ad51e551419caca654937f9d..3484ba6d16e7ad7f8b200350214674f254c85902 100644
--- a/src/inspector/v8-debugger-script.h
+++ b/src/inspector/v8-debugger-script.h
@@ -32,6 +32,7 @@
#include "src/base/macros.h"
#include "src/inspector/string-16.h"
+#include "src/inspector/string-util.h"
#include "include/v8.h"
#include "src/debug/debug-interface.h"
@@ -40,42 +41,46 @@ namespace v8_inspector {
class V8DebuggerScript {
public:
- V8DebuggerScript(v8::Isolate* isolate, v8::Local<v8::debug::Script> script,
- bool isLiveEdit);
- V8DebuggerScript(String16 id, String16 url, String16 source);
- ~V8DebuggerScript();
+ static std::unique_ptr<V8DebuggerScript> Create(
+ v8::Isolate* isolate, v8::Local<v8::debug::Script> script,
+ bool isLiveEdit);
+ static std::unique_ptr<V8DebuggerScript> CreateWasm(
+ v8::Isolate* isolate, v8::Local<v8::debug::WasmScript> underlyingScript,
+ String16 id, String16 url, String16 source);
+
+ virtual ~V8DebuggerScript();
const String16& scriptId() const { return m_id; }
const String16& url() const { return m_url; }
bool hasSourceURL() const { return !m_sourceURL.isEmpty(); }
const String16& sourceURL() const;
- const String16& sourceMappingURL() const { return m_sourceMappingURL; }
- String16 source(v8::Isolate*) const;
+ virtual const String16& sourceMappingURL() const = 0;
+ virtual String16 source(v8::Isolate*) const { return m_source; }
const String16& hash(v8::Isolate*) const;
int startLine() const { return m_startLine; }
int startColumn() const { return m_startColumn; }
int endLine() const { return m_endLine; }
int endColumn() const { return m_endColumn; }
int executionContextId() const { return m_executionContextId; }
- const String16& executionContextAuxData() const {
- return m_executionContextAuxData;
- }
- bool isLiveEdit() const { return m_isLiveEdit; }
+ virtual const String16& executionContextAuxData() const = 0;
+ virtual bool isLiveEdit() const = 0;
void setSourceURL(const String16&);
- void setSourceMappingURL(const String16&);
- void setSource(v8::Local<v8::String>);
+ virtual void setSourceMappingURL(const String16&) = 0;
+ virtual void setSource(v8::Local<v8::String> source) {
+ m_source = toProtocolString(source);
+ }
- bool getPossibleBreakpoints(const v8::debug::Location& start,
- const v8::debug::Location& end,
- std::vector<v8::debug::Location>* locations);
+ virtual bool getPossibleBreakpoints(
+ const v8::debug::Location& start, const v8::debug::Location& end,
+ std::vector<v8::debug::Location>* locations) = 0;
+
+ protected:
+ V8DebuggerScript(v8::Isolate*, String16 id, String16 url);
- private:
String16 m_id;
String16 m_url;
String16 m_sourceURL;
- String16 m_sourceMappingURL;
- v8::Global<v8::String> m_sourceObj;
String16 m_source;
mutable String16 m_hash;
int m_startLine = 0;
@@ -83,12 +88,10 @@ class V8DebuggerScript {
int m_endLine = 0;
int m_endColumn = 0;
int m_executionContextId = 0;
- String16 m_executionContextAuxData;
- bool m_isLiveEdit = false;
v8::Isolate* m_isolate;
- v8::Global<v8::debug::Script> m_script;
+ private:
DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript);
};
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/inspector/v8-debugger-script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698