OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 #ifndef V8DebuggerScript_h | 30 #ifndef V8DebuggerScript_h |
31 #define V8DebuggerScript_h | 31 #define V8DebuggerScript_h |
32 | 32 |
33 #include "platform/inspector_protocol/Allocator.h" | 33 #include "platform/inspector_protocol/Allocator.h" |
34 #include "platform/inspector_protocol/String16.h" | 34 #include "platform/inspector_protocol/String16.h" |
35 #include <v8.h> | 35 #include <v8.h> |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class V8DebuggerScript { | 39 class V8DebuggerScript { |
40 PROTOCOL_DISALLOW_NEW(); | 40 PROTOCOL_DISALLOW_COPY(V8DebuggerScript); |
41 public: | 41 public: |
42 V8DebuggerScript(); | 42 V8DebuggerScript(v8::Isolate*, v8::Local<v8::Object>, bool isLiveEdit); |
| 43 ~V8DebuggerScript(); |
43 | 44 |
| 45 String16 scriptId() const { return m_id; } |
44 String16 url() const { return m_url; } | 46 String16 url() const { return m_url; } |
45 bool hasSourceURL() const { return !m_sourceURL.isEmpty(); } | 47 bool hasSourceURL() const { return !m_sourceURL.isEmpty(); } |
46 String16 sourceURL() const; | 48 String16 sourceURL() const; |
47 String16 sourceMappingURL() const { return m_sourceMappingURL; } | 49 String16 sourceMappingURL() const { return m_sourceMappingURL; } |
48 String16 source() const { return m_source; } | 50 v8::Local<v8::String> source(v8::Isolate*) const; |
49 String16 hash() const { return m_hash; } | 51 String16 hash() const { return m_hash; } |
50 int startLine() const { return m_startLine; } | 52 int startLine() const { return m_startLine; } |
51 int startColumn() const { return m_startColumn; } | 53 int startColumn() const { return m_startColumn; } |
52 int endLine() const { return m_endLine; } | 54 int endLine() const { return m_endLine; } |
53 int endColumn() const { return m_endColumn; } | 55 int endColumn() const { return m_endColumn; } |
54 int executionContextId() const { return m_executionContextId; } | 56 int executionContextId() const { return m_executionContextId; } |
55 bool isContentScript() const { return m_isContentScript; } | 57 bool isContentScript() const { return m_isContentScript; } |
56 bool isInternalScript() const { return m_isInternalScript; } | 58 bool isInternalScript() const { return m_isInternalScript; } |
57 bool isLiveEdit() const { return m_isLiveEdit; } | 59 bool isLiveEdit() const { return m_isLiveEdit; } |
58 | 60 |
59 V8DebuggerScript& setURL(const String16&); | 61 void setSourceURL(const String16&); |
60 V8DebuggerScript& setSourceURL(const String16&); | 62 void setSourceMappingURL(const String16&); |
61 V8DebuggerScript& setSourceMappingURL(const String16&); | 63 void setSource(v8::Isolate*, v8::Local<v8::String>); |
62 V8DebuggerScript& setSource(const String16&); | |
63 V8DebuggerScript& setHash(const String16&); | |
64 V8DebuggerScript& setStartLine(int); | |
65 V8DebuggerScript& setStartColumn(int); | |
66 V8DebuggerScript& setEndLine(int); | |
67 V8DebuggerScript& setEndColumn(int); | |
68 V8DebuggerScript& setExecutionContextId(int); | |
69 V8DebuggerScript& setIsContentScript(bool); | |
70 V8DebuggerScript& setIsInternalScript(bool); | |
71 V8DebuggerScript& setIsLiveEdit(bool); | |
72 | 64 |
73 private: | 65 private: |
| 66 String16 m_id; |
74 String16 m_url; | 67 String16 m_url; |
75 String16 m_sourceURL; | 68 String16 m_sourceURL; |
76 String16 m_sourceMappingURL; | 69 String16 m_sourceMappingURL; |
77 String16 m_source; | 70 v8::Global<v8::String> m_source; |
78 String16 m_hash; | 71 String16 m_hash; |
79 int m_startLine; | 72 int m_startLine; |
80 int m_startColumn; | 73 int m_startColumn; |
81 int m_endLine; | 74 int m_endLine; |
82 int m_endColumn; | 75 int m_endColumn; |
83 int m_executionContextId; | 76 int m_executionContextId; |
84 bool m_isContentScript; | 77 bool m_isContentScript; |
85 bool m_isInternalScript; | 78 bool m_isInternalScript; |
86 bool m_isLiveEdit; | 79 bool m_isLiveEdit; |
87 }; | 80 }; |
88 | 81 |
89 struct V8DebuggerParsedScript { | |
90 String16 scriptId; | |
91 V8DebuggerScript script; | |
92 bool success; | |
93 }; | |
94 | |
95 } // namespace blink | 82 } // namespace blink |
96 | 83 |
97 | 84 |
98 #endif // V8DebuggerScript_h | 85 #endif // V8DebuggerScript_h |
OLD | NEW |