OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_INSPECTOR_V8CONSOLE_H_ | 5 #ifndef V8_INSPECTOR_V8CONSOLE_H_ |
6 #define V8_INSPECTOR_V8CONSOLE_H_ | 6 #define V8_INSPECTOR_V8CONSOLE_H_ |
7 | 7 |
8 #include "src/base/macros.h" | 8 #include "src/base/macros.h" |
9 | 9 |
10 #include "include/v8.h" | 10 #include "include/v8.h" |
11 | 11 |
12 namespace v8_inspector { | 12 namespace v8_inspector { |
13 | 13 |
14 class InspectedContext; | 14 class InspectedContext; |
15 | 15 |
16 // Console API | 16 // Console API |
17 // https://console.spec.whatwg.org/#console-interface | 17 // https://console.spec.whatwg.org/#console-interface |
18 class V8Console { | 18 class V8Console { |
19 public: | 19 public: |
20 static v8::Local<v8::Object> createConsole(InspectedContext*, | 20 static v8::Local<v8::Object> createConsole(InspectedContext*, |
21 bool hasMemoryAttribute); | 21 bool hasMemoryAttribute); |
22 static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, | 22 static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, |
23 v8::Local<v8::Object> console); | 23 v8::Local<v8::Object> console); |
24 static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*); | 24 static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*); |
25 | 25 |
26 class CommandLineAPIScope { | 26 class CommandLineAPIScope { |
27 DISALLOW_COPY_AND_ASSIGN(CommandLineAPIScope); | |
28 | |
29 public: | 27 public: |
30 CommandLineAPIScope(v8::Local<v8::Context>, | 28 CommandLineAPIScope(v8::Local<v8::Context>, |
31 v8::Local<v8::Object> commandLineAPI, | 29 v8::Local<v8::Object> commandLineAPI, |
32 v8::Local<v8::Object> global); | 30 v8::Local<v8::Object> global); |
33 ~CommandLineAPIScope(); | 31 ~CommandLineAPIScope(); |
34 | 32 |
35 private: | 33 private: |
36 static void accessorGetterCallback( | 34 static void accessorGetterCallback( |
37 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&); | 35 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&); |
38 static void accessorSetterCallback(v8::Local<v8::Name>, | 36 static void accessorSetterCallback(v8::Local<v8::Name>, |
39 v8::Local<v8::Value>, | 37 v8::Local<v8::Value>, |
40 const v8::PropertyCallbackInfo<void>&); | 38 const v8::PropertyCallbackInfo<void>&); |
41 | 39 |
42 v8::Local<v8::Context> m_context; | 40 v8::Local<v8::Context> m_context; |
43 v8::Local<v8::Object> m_commandLineAPI; | 41 v8::Local<v8::Object> m_commandLineAPI; |
44 v8::Local<v8::Object> m_global; | 42 v8::Local<v8::Object> m_global; |
45 v8::Local<v8::Set> m_installedMethods; | 43 v8::Local<v8::Set> m_installedMethods; |
46 bool m_cleanup; | 44 bool m_cleanup; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(CommandLineAPIScope); |
47 }; | 47 }; |
48 | 48 |
49 private: | 49 private: |
50 static void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 50 static void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
51 static void errorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 51 static void errorCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
52 static void infoCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 52 static void infoCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
53 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 53 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
54 static void warnCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 54 static void warnCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
55 static void dirCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 55 static void dirCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
56 static void dirxmlCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 56 static void dirxmlCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 static void inspectedObject4( | 111 static void inspectedObject4( |
112 const v8::FunctionCallbackInfo<v8::Value>& info) { | 112 const v8::FunctionCallbackInfo<v8::Value>& info) { |
113 inspectedObject(info, 4); | 113 inspectedObject(info, 4); |
114 } | 114 } |
115 }; | 115 }; |
116 | 116 |
117 } // namespace v8_inspector | 117 } // namespace v8_inspector |
118 | 118 |
119 #endif // V8_INSPECTOR_V8CONSOLE_H_ | 119 #endif // V8_INSPECTOR_V8CONSOLE_H_ |
OLD | NEW |