OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 V8_INSPECTOR_INJECTEDSCRIPT_H_ | 31 #ifndef V8_INSPECTOR_INJECTEDSCRIPT_H_ |
32 #define V8_INSPECTOR_INJECTEDSCRIPT_H_ | 32 #define V8_INSPECTOR_INJECTEDSCRIPT_H_ |
33 | 33 |
34 #include "src/inspector/Allocator.h" | 34 #include "src/base/macros.h" |
35 #include "src/inspector/InjectedScriptNative.h" | 35 #include "src/inspector/InjectedScriptNative.h" |
36 #include "src/inspector/InspectedContext.h" | 36 #include "src/inspector/InspectedContext.h" |
37 #include "src/inspector/V8Console.h" | 37 #include "src/inspector/V8Console.h" |
38 #include "src/inspector/V8Debugger.h" | 38 #include "src/inspector/V8Debugger.h" |
39 #include "src/inspector/protocol/Forward.h" | 39 #include "src/inspector/protocol/Forward.h" |
40 #include "src/inspector/protocol/Runtime.h" | 40 #include "src/inspector/protocol/Runtime.h" |
41 | 41 |
42 #include "include/v8.h" | 42 #include "include/v8.h" |
43 | 43 |
44 namespace v8_inspector { | 44 namespace v8_inspector { |
45 | 45 |
46 class RemoteObjectId; | 46 class RemoteObjectId; |
47 class V8FunctionCall; | 47 class V8FunctionCall; |
48 class V8InspectorImpl; | 48 class V8InspectorImpl; |
49 class V8InspectorSessionImpl; | 49 class V8InspectorSessionImpl; |
50 | 50 |
51 using protocol::ErrorString; | 51 using protocol::ErrorString; |
52 using protocol::Maybe; | 52 using protocol::Maybe; |
53 | 53 |
54 class InjectedScript final { | 54 class InjectedScript final { |
55 V8_INSPECTOR_DISALLOW_COPY(InjectedScript); | 55 DISALLOW_COPY_AND_ASSIGN(InjectedScript); |
56 | 56 |
57 public: | 57 public: |
58 static std::unique_ptr<InjectedScript> create(InspectedContext*); | 58 static std::unique_ptr<InjectedScript> create(InspectedContext*); |
59 ~InjectedScript(); | 59 ~InjectedScript(); |
60 | 60 |
61 InspectedContext* context() const { return m_context; } | 61 InspectedContext* context() const { return m_context; } |
62 | 62 |
63 void getProperties( | 63 void getProperties( |
64 ErrorString*, v8::Local<v8::Object>, const String16& groupName, | 64 ErrorString*, v8::Local<v8::Object>, const String16& groupName, |
65 bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, | 65 bool ownProperties, bool accessorPropertiesOnly, bool generatePreview, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 v8::HandleScope m_handleScope; | 134 v8::HandleScope m_handleScope; |
135 v8::TryCatch m_tryCatch; | 135 v8::TryCatch m_tryCatch; |
136 v8::Local<v8::Context> m_context; | 136 v8::Local<v8::Context> m_context; |
137 std::unique_ptr<V8Console::CommandLineAPIScope> m_commandLineAPIScope; | 137 std::unique_ptr<V8Console::CommandLineAPIScope> m_commandLineAPIScope; |
138 bool m_ignoreExceptionsAndMuteConsole; | 138 bool m_ignoreExceptionsAndMuteConsole; |
139 V8Debugger::PauseOnExceptionsState m_previousPauseOnExceptionsState; | 139 V8Debugger::PauseOnExceptionsState m_previousPauseOnExceptionsState; |
140 bool m_userGesture; | 140 bool m_userGesture; |
141 }; | 141 }; |
142 | 142 |
143 class ContextScope : public Scope { | 143 class ContextScope : public Scope { |
144 V8_INSPECTOR_DISALLOW_COPY(ContextScope); | 144 DISALLOW_COPY_AND_ASSIGN(ContextScope); |
145 | 145 |
146 public: | 146 public: |
147 ContextScope(ErrorString*, V8InspectorImpl*, int contextGroupId, | 147 ContextScope(ErrorString*, V8InspectorImpl*, int contextGroupId, |
148 int executionContextId); | 148 int executionContextId); |
149 ~ContextScope(); | 149 ~ContextScope(); |
150 | 150 |
151 private: | 151 private: |
152 void findInjectedScript(V8InspectorSessionImpl*) override; | 152 void findInjectedScript(V8InspectorSessionImpl*) override; |
153 int m_executionContextId; | 153 int m_executionContextId; |
154 }; | 154 }; |
155 | 155 |
156 class ObjectScope : public Scope { | 156 class ObjectScope : public Scope { |
157 V8_INSPECTOR_DISALLOW_COPY(ObjectScope); | 157 DISALLOW_COPY_AND_ASSIGN(ObjectScope); |
158 | 158 |
159 public: | 159 public: |
160 ObjectScope(ErrorString*, V8InspectorImpl*, int contextGroupId, | 160 ObjectScope(ErrorString*, V8InspectorImpl*, int contextGroupId, |
161 const String16& remoteObjectId); | 161 const String16& remoteObjectId); |
162 ~ObjectScope(); | 162 ~ObjectScope(); |
163 const String16& objectGroupName() const { return m_objectGroupName; } | 163 const String16& objectGroupName() const { return m_objectGroupName; } |
164 v8::Local<v8::Value> object() const { return m_object; } | 164 v8::Local<v8::Value> object() const { return m_object; } |
165 | 165 |
166 private: | 166 private: |
167 void findInjectedScript(V8InspectorSessionImpl*) override; | 167 void findInjectedScript(V8InspectorSessionImpl*) override; |
168 String16 m_remoteObjectId; | 168 String16 m_remoteObjectId; |
169 String16 m_objectGroupName; | 169 String16 m_objectGroupName; |
170 v8::Local<v8::Value> m_object; | 170 v8::Local<v8::Value> m_object; |
171 }; | 171 }; |
172 | 172 |
173 class CallFrameScope : public Scope { | 173 class CallFrameScope : public Scope { |
174 V8_INSPECTOR_DISALLOW_COPY(CallFrameScope); | 174 DISALLOW_COPY_AND_ASSIGN(CallFrameScope); |
175 | 175 |
176 public: | 176 public: |
177 CallFrameScope(ErrorString*, V8InspectorImpl*, int contextGroupId, | 177 CallFrameScope(ErrorString*, V8InspectorImpl*, int contextGroupId, |
178 const String16& remoteCallFrameId); | 178 const String16& remoteCallFrameId); |
179 ~CallFrameScope(); | 179 ~CallFrameScope(); |
180 size_t frameOrdinal() const { return m_frameOrdinal; } | 180 size_t frameOrdinal() const { return m_frameOrdinal; } |
181 | 181 |
182 private: | 182 private: |
183 void findInjectedScript(V8InspectorSessionImpl*) override; | 183 void findInjectedScript(V8InspectorSessionImpl*) override; |
184 String16 m_remoteCallFrameId; | 184 String16 m_remoteCallFrameId; |
(...skipping 13 matching lines...) Expand all Loading... |
198 InspectedContext* m_context; | 198 InspectedContext* m_context; |
199 v8::Global<v8::Value> m_value; | 199 v8::Global<v8::Value> m_value; |
200 v8::Global<v8::Value> m_lastEvaluationResult; | 200 v8::Global<v8::Value> m_lastEvaluationResult; |
201 std::unique_ptr<InjectedScriptNative> m_native; | 201 std::unique_ptr<InjectedScriptNative> m_native; |
202 v8::Global<v8::Object> m_commandLineAPI; | 202 v8::Global<v8::Object> m_commandLineAPI; |
203 }; | 203 }; |
204 | 204 |
205 } // namespace v8_inspector | 205 } // namespace v8_inspector |
206 | 206 |
207 #endif // V8_INSPECTOR_INJECTEDSCRIPT_H_ | 207 #endif // V8_INSPECTOR_INJECTEDSCRIPT_H_ |
OLD | NEW |