OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef JavaScriptCallFrame_h | 31 #ifndef JavaScriptCallFrame_h |
32 #define JavaScriptCallFrame_h | 32 #define JavaScriptCallFrame_h |
33 | 33 |
| 34 #include "platform/inspector_protocol/String16.h" |
34 #include "wtf/PassOwnPtr.h" | 35 #include "wtf/PassOwnPtr.h" |
35 #include "wtf/text/WTFString.h" | |
36 #include <v8.h> | 36 #include <v8.h> |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class V8DebuggerClient; | 40 class V8DebuggerClient; |
41 | 41 |
42 class JavaScriptCallFrame { | 42 class JavaScriptCallFrame { |
43 public: | 43 public: |
44 static PassOwnPtr<JavaScriptCallFrame> create(V8DebuggerClient* client, v8::
Local<v8::Context> debuggerContext, v8::Local<v8::Object> callFrame) | 44 static PassOwnPtr<JavaScriptCallFrame> create(V8DebuggerClient* client, v8::
Local<v8::Context> debuggerContext, v8::Local<v8::Object> callFrame) |
45 { | 45 { |
46 return adoptPtr(new JavaScriptCallFrame(client, debuggerContext, callFra
me)); | 46 return adoptPtr(new JavaScriptCallFrame(client, debuggerContext, callFra
me)); |
47 } | 47 } |
48 ~JavaScriptCallFrame(); | 48 ~JavaScriptCallFrame(); |
49 | 49 |
50 PassOwnPtr<JavaScriptCallFrame> caller(); | 50 PassOwnPtr<JavaScriptCallFrame> caller(); |
51 | 51 |
52 int sourceID() const; | 52 int sourceID() const; |
53 int line() const; | 53 int line() const; |
54 int column() const; | 54 int column() const; |
55 String scriptName() const; | 55 String16 scriptName() const; |
56 String functionName() const; | 56 String16 functionName() const; |
57 int functionLine() const; | 57 int functionLine() const; |
58 int functionColumn() const; | 58 int functionColumn() const; |
59 | 59 |
60 v8::Local<v8::Value> scopeChain() const; | 60 v8::Local<v8::Value> scopeChain() const; |
61 int scopeType(int scopeIndex) const; | 61 int scopeType(int scopeIndex) const; |
62 v8::Local<v8::String> scopeName(int scopeIndex) const; | 62 v8::Local<v8::String> scopeName(int scopeIndex) const; |
63 v8::Local<v8::Value> scopeStartLocation(int scopeIndex) const; | 63 v8::Local<v8::Value> scopeStartLocation(int scopeIndex) const; |
64 v8::Local<v8::Value> scopeEndLocation(int scopeIndex) const; | 64 v8::Local<v8::Value> scopeEndLocation(int scopeIndex) const; |
65 v8::Local<v8::Value> thisObject() const; | 65 v8::Local<v8::Value> thisObject() const; |
66 String stepInPositions() const; | 66 String16 stepInPositions() const; |
67 bool isAtReturn() const; | 67 bool isAtReturn() const; |
68 v8::Local<v8::Value> returnValue() const; | 68 v8::Local<v8::Value> returnValue() const; |
69 | 69 |
70 v8::Local<v8::Value> evaluateWithExceptionDetails(v8::Local<v8::Value> expre
ssion, v8::Local<v8::Value> scopeExtension); | 70 v8::Local<v8::Value> evaluateWithExceptionDetails(v8::Local<v8::Value> expre
ssion, v8::Local<v8::Value> scopeExtension); |
71 v8::MaybeLocal<v8::Value> restart(); | 71 v8::MaybeLocal<v8::Value> restart(); |
72 v8::MaybeLocal<v8::Value> setVariableValue(int scopeNumber, v8::Local<v8::Va
lue> variableName, v8::Local<v8::Value> newValue); | 72 v8::MaybeLocal<v8::Value> setVariableValue(int scopeNumber, v8::Local<v8::Va
lue> variableName, v8::Local<v8::Value> newValue); |
73 | 73 |
74 static v8::Local<v8::Object> createExceptionDetails(v8::Isolate*, v8::Local<
v8::Message>); | 74 static v8::Local<v8::Object> createExceptionDetails(v8::Isolate*, v8::Local<
v8::Message>); |
75 | 75 |
76 // FIXME: store this template in per isolate data | 76 // FIXME: store this template in per isolate data |
77 void setWrapperTemplate(v8::Local<v8::FunctionTemplate> wrapperTemplate, v8:
:Isolate* isolate) { m_wrapperTemplate.Reset(isolate, wrapperTemplate); } | 77 void setWrapperTemplate(v8::Local<v8::FunctionTemplate> wrapperTemplate, v8:
:Isolate* isolate) { m_wrapperTemplate.Reset(isolate, wrapperTemplate); } |
78 v8::Local<v8::FunctionTemplate> wrapperTemplate(v8::Isolate* isolate) { retu
rn v8::Local<v8::FunctionTemplate>::New(isolate, m_wrapperTemplate); } | 78 v8::Local<v8::FunctionTemplate> wrapperTemplate(v8::Isolate* isolate) { retu
rn v8::Local<v8::FunctionTemplate>::New(isolate, m_wrapperTemplate); } |
79 | 79 |
80 V8DebuggerClient* client() { return m_client; } | 80 V8DebuggerClient* client() { return m_client; } |
81 | 81 |
82 private: | 82 private: |
83 JavaScriptCallFrame(V8DebuggerClient*, v8::Local<v8::Context> debuggerContex
t, v8::Local<v8::Object> callFrame); | 83 JavaScriptCallFrame(V8DebuggerClient*, v8::Local<v8::Context> debuggerContex
t, v8::Local<v8::Object> callFrame); |
84 | 84 |
85 int callV8FunctionReturnInt(const char* name) const; | 85 int callV8FunctionReturnInt(const char* name) const; |
86 String callV8FunctionReturnString(const char* name) const; | 86 String16 callV8FunctionReturnString(const char* name) const; |
87 v8::Local<v8::Value> callScopeLocationFunction(const char* name, int scopeIn
dex) const; | 87 v8::Local<v8::Value> callScopeLocationFunction(const char* name, int scopeIn
dex) const; |
88 | 88 |
89 V8DebuggerClient* m_client; | 89 V8DebuggerClient* m_client; |
90 v8::Isolate* m_isolate; | 90 v8::Isolate* m_isolate; |
91 OwnPtr<JavaScriptCallFrame> m_caller; | 91 OwnPtr<JavaScriptCallFrame> m_caller; |
92 v8::Global<v8::Context> m_debuggerContext; | 92 v8::Global<v8::Context> m_debuggerContext; |
93 v8::Global<v8::Object> m_callFrame; | 93 v8::Global<v8::Object> m_callFrame; |
94 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; | 94 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // JavaScriptCallFrame_h | 99 #endif // JavaScriptCallFrame_h |
OLD | NEW |