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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 14 matching lines...) Expand all
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #ifndef V8_INSPECTOR_V8DEBUGGERSCRIPT_H_ 30 #ifndef V8_INSPECTOR_V8DEBUGGERSCRIPT_H_
31 #define V8_INSPECTOR_V8DEBUGGERSCRIPT_H_ 31 #define V8_INSPECTOR_V8DEBUGGERSCRIPT_H_
32 32
33 #include "src/base/macros.h" 33 #include "src/base/macros.h"
34 #include "src/inspector/string-16.h" 34 #include "src/inspector/string-16.h"
35 #include "src/inspector/string-util.h"
35 36
36 #include "include/v8.h" 37 #include "include/v8.h"
37 #include "src/debug/debug-interface.h" 38 #include "src/debug/debug-interface.h"
38 39
39 namespace v8_inspector { 40 namespace v8_inspector {
40 41
41 class V8DebuggerScript { 42 class V8DebuggerScript {
42 public: 43 public:
43 V8DebuggerScript(v8::Isolate* isolate, v8::Local<v8::debug::Script> script, 44 static std::unique_ptr<V8DebuggerScript> Create(
44 bool isLiveEdit); 45 v8::Isolate* isolate, v8::Local<v8::debug::Script> script,
45 V8DebuggerScript(String16 id, String16 url, String16 source); 46 bool isLiveEdit);
46 ~V8DebuggerScript(); 47 static std::unique_ptr<V8DebuggerScript> CreateWasm(
48 v8::Isolate* isolate, v8::Local<v8::debug::WasmScript> underlyingScript,
49 String16 id, String16 url, String16 source);
50
51 virtual ~V8DebuggerScript();
47 52
48 const String16& scriptId() const { return m_id; } 53 const String16& scriptId() const { return m_id; }
49 const String16& url() const { return m_url; } 54 const String16& url() const { return m_url; }
50 bool hasSourceURL() const { return !m_sourceURL.isEmpty(); } 55 bool hasSourceURL() const { return !m_sourceURL.isEmpty(); }
51 const String16& sourceURL() const; 56 const String16& sourceURL() const;
52 const String16& sourceMappingURL() const { return m_sourceMappingURL; } 57 virtual const String16& sourceMappingURL() const = 0;
53 String16 source(v8::Isolate*) const; 58 virtual String16 source(v8::Isolate*) const { return m_source; }
54 const String16& hash(v8::Isolate*) const; 59 const String16& hash(v8::Isolate*) const;
55 int startLine() const { return m_startLine; } 60 int startLine() const { return m_startLine; }
56 int startColumn() const { return m_startColumn; } 61 int startColumn() const { return m_startColumn; }
57 int endLine() const { return m_endLine; } 62 int endLine() const { return m_endLine; }
58 int endColumn() const { return m_endColumn; } 63 int endColumn() const { return m_endColumn; }
59 int executionContextId() const { return m_executionContextId; } 64 int executionContextId() const { return m_executionContextId; }
60 const String16& executionContextAuxData() const { 65 virtual const String16& executionContextAuxData() const = 0;
61 return m_executionContextAuxData; 66 virtual bool isLiveEdit() const = 0;
62 }
63 bool isLiveEdit() const { return m_isLiveEdit; }
64 67
65 void setSourceURL(const String16&); 68 void setSourceURL(const String16&);
66 void setSourceMappingURL(const String16&); 69 virtual void setSourceMappingURL(const String16&) = 0;
67 void setSource(v8::Local<v8::String>); 70 virtual void setSource(v8::Local<v8::String> source) {
71 m_source = toProtocolString(source);
72 }
68 73
69 bool getPossibleBreakpoints(const v8::debug::Location& start, 74 virtual bool getPossibleBreakpoints(
70 const v8::debug::Location& end, 75 const v8::debug::Location& start, const v8::debug::Location& end,
71 std::vector<v8::debug::Location>* locations); 76 std::vector<v8::debug::Location>* locations) = 0;
72 77
73 private: 78 protected:
79 V8DebuggerScript(v8::Isolate*, String16 id, String16 url);
80
74 String16 m_id; 81 String16 m_id;
75 String16 m_url; 82 String16 m_url;
76 String16 m_sourceURL; 83 String16 m_sourceURL;
77 String16 m_sourceMappingURL;
78 v8::Global<v8::String> m_sourceObj;
79 String16 m_source; 84 String16 m_source;
80 mutable String16 m_hash; 85 mutable String16 m_hash;
81 int m_startLine = 0; 86 int m_startLine = 0;
82 int m_startColumn = 0; 87 int m_startColumn = 0;
83 int m_endLine = 0; 88 int m_endLine = 0;
84 int m_endColumn = 0; 89 int m_endColumn = 0;
85 int m_executionContextId = 0; 90 int m_executionContextId = 0;
86 String16 m_executionContextAuxData;
87 bool m_isLiveEdit = false;
88 91
89 v8::Isolate* m_isolate; 92 v8::Isolate* m_isolate;
90 v8::Global<v8::debug::Script> m_script;
91 93
94 private:
92 DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript); 95 DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript);
93 }; 96 };
94 97
95 } // namespace v8_inspector 98 } // namespace v8_inspector
96 99
97 #endif // V8_INSPECTOR_V8DEBUGGERSCRIPT_H_ 100 #endif // V8_INSPECTOR_V8DEBUGGERSCRIPT_H_
OLDNEW
« 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