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

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

Issue 2532433003: [inspector] Split V8DebuggerScript implementation for wasm (Closed)
Patch Set: Minor refactoring Created 4 years, 1 month 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/inspector/v8-debugger-script.h
diff --git a/src/inspector/v8-debugger-script.h b/src/inspector/v8-debugger-script.h
index 4405756460fc58ed8417fa85a054a469bd2e33fe..a27a7368925978648b5b28f2e67f5e83d32ca5a7 100644
--- a/src/inspector/v8-debugger-script.h
+++ b/src/inspector/v8-debugger-script.h
@@ -40,44 +40,45 @@ namespace v8_inspector {
class V8DebuggerScript {
public:
- V8DebuggerScript(v8::Isolate* isolate,
- v8::Local<v8::DebugInterface::Script> script,
- bool isLiveEdit);
- V8DebuggerScript(String16 id, String16 url, String16 source);
- ~V8DebuggerScript();
+ static std::unique_ptr<V8DebuggerScript> Create(
+ v8::Isolate* isolate, v8::Local<v8::DebugInterface::Script> script,
+ bool isLiveEdit);
+ static std::unique_ptr<V8DebuggerScript> CreateWasm(
+ v8::Local<v8::DebugInterface::Script> script, 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&) {}
kozy 2016/11/30 18:34:37 If sourceMappingUrl getter is abstract, lets make
Clemens Hammacher 2016/12/02 17:44:13 Done.
+ virtual void setSource(v8::Local<v8::String>) {}
kozy 2016/11/30 18:34:37 Can we assign new source to m_source here?
Clemens Hammacher 2016/12/02 17:44:13 Done. But note that this requires to include strin
- bool getPossibleBreakpoints(
+ virtual bool getPossibleBreakpoints(
const v8::DebugInterface::Location& start,
const v8::DebugInterface::Location& end,
- std::vector<v8::DebugInterface::Location>* locations);
+ std::vector<v8::DebugInterface::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;
@@ -85,12 +86,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::DebugInterface::Script> m_script;
+ private:
DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript);
};

Powered by Google App Engine
This is Rietveld 408576698