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 20 matching lines...) Expand all Loading... |
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 "platform/inspector_protocol/String16.h" |
35 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
37 #include <v8.h> | 37 #include <v8.h> |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
| 41 class V8DebuggerClient; |
| 42 |
41 class JavaScriptCallFrame { | 43 class JavaScriptCallFrame { |
42 public: | 44 public: |
43 static PassOwnPtr<JavaScriptCallFrame> create(v8::Local<v8::Context> debugge
rContext, v8::Local<v8::Object> callFrame) | 45 static PassOwnPtr<JavaScriptCallFrame> create(V8DebuggerClient* client, v8::
Local<v8::Context> debuggerContext, v8::Local<v8::Object> callFrame) |
44 { | 46 { |
45 return adoptPtr(new JavaScriptCallFrame(debuggerContext, callFrame)); | 47 return adoptPtr(new JavaScriptCallFrame(client, debuggerContext, callFra
me)); |
46 } | 48 } |
47 ~JavaScriptCallFrame(); | 49 ~JavaScriptCallFrame(); |
48 | 50 |
49 PassOwnPtr<JavaScriptCallFrame> caller(); | 51 PassOwnPtr<JavaScriptCallFrame> caller(); |
50 | 52 |
51 int sourceID() const; | 53 int sourceID() const; |
52 int line() const; | 54 int line() const; |
53 int column() const; | 55 int column() const; |
54 String16 scriptName() const; | 56 String16 scriptName() const; |
55 String16 functionName() const; | 57 String16 functionName() const; |
(...skipping 13 matching lines...) Expand all Loading... |
69 v8::Local<v8::Value> evaluateWithExceptionDetails(v8::Local<v8::Value> expre
ssion, v8::Local<v8::Value> scopeExtension); | 71 v8::Local<v8::Value> evaluateWithExceptionDetails(v8::Local<v8::Value> expre
ssion, v8::Local<v8::Value> scopeExtension); |
70 v8::MaybeLocal<v8::Value> restart(); | 72 v8::MaybeLocal<v8::Value> restart(); |
71 v8::MaybeLocal<v8::Value> setVariableValue(int scopeNumber, v8::Local<v8::Va
lue> variableName, v8::Local<v8::Value> newValue); | 73 v8::MaybeLocal<v8::Value> setVariableValue(int scopeNumber, v8::Local<v8::Va
lue> variableName, v8::Local<v8::Value> newValue); |
72 | 74 |
73 static v8::Local<v8::Object> createExceptionDetails(v8::Isolate*, v8::Local<
v8::Message>); | 75 static v8::Local<v8::Object> createExceptionDetails(v8::Isolate*, v8::Local<
v8::Message>); |
74 | 76 |
75 // FIXME: store this template in per isolate data | 77 // FIXME: store this template in per isolate data |
76 void setWrapperTemplate(v8::Local<v8::FunctionTemplate> wrapperTemplate, v8:
:Isolate* isolate) { m_wrapperTemplate.Reset(isolate, wrapperTemplate); } | 78 void setWrapperTemplate(v8::Local<v8::FunctionTemplate> wrapperTemplate, v8:
:Isolate* isolate) { m_wrapperTemplate.Reset(isolate, wrapperTemplate); } |
77 v8::Local<v8::FunctionTemplate> wrapperTemplate(v8::Isolate* isolate) { retu
rn v8::Local<v8::FunctionTemplate>::New(isolate, m_wrapperTemplate); } | 79 v8::Local<v8::FunctionTemplate> wrapperTemplate(v8::Isolate* isolate) { retu
rn v8::Local<v8::FunctionTemplate>::New(isolate, m_wrapperTemplate); } |
78 | 80 |
| 81 V8DebuggerClient* client() { return m_client; } |
| 82 |
79 private: | 83 private: |
80 JavaScriptCallFrame(v8::Local<v8::Context> debuggerContext, v8::Local<v8::Ob
ject> callFrame); | 84 JavaScriptCallFrame(V8DebuggerClient*, v8::Local<v8::Context> debuggerContex
t, v8::Local<v8::Object> callFrame); |
81 | 85 |
82 int callV8FunctionReturnInt(const char* name) const; | 86 int callV8FunctionReturnInt(const char* name) const; |
83 String16 callV8FunctionReturnString(const char* name) const; | 87 String16 callV8FunctionReturnString(const char* name) const; |
84 v8::Local<v8::Value> callScopeLocationFunction(const char* name, int scopeIn
dex) const; | 88 v8::Local<v8::Value> callScopeLocationFunction(const char* name, int scopeIn
dex) const; |
85 | 89 |
| 90 V8DebuggerClient* m_client; |
86 v8::Isolate* m_isolate; | 91 v8::Isolate* m_isolate; |
87 OwnPtr<JavaScriptCallFrame> m_caller; | 92 OwnPtr<JavaScriptCallFrame> m_caller; |
88 v8::Global<v8::Context> m_debuggerContext; | 93 v8::Global<v8::Context> m_debuggerContext; |
89 v8::Global<v8::Object> m_callFrame; | 94 v8::Global<v8::Object> m_callFrame; |
90 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; | 95 v8::Global<v8::FunctionTemplate> m_wrapperTemplate; |
91 }; | 96 }; |
92 | 97 |
93 } // namespace blink | 98 } // namespace blink |
94 | 99 |
95 #endif // JavaScriptCallFrame_h | 100 #endif // JavaScriptCallFrame_h |
OLD | NEW |