OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 V8Console_h | 5 #ifndef V8Console_h |
6 #define V8Console_h | 6 #define V8Console_h |
7 | 7 |
8 #include "platform/inspector_protocol/InspectorProtocol.h" | 8 #include "platform/v8_inspector/Allocator.h" |
| 9 |
9 #include <v8.h> | 10 #include <v8.h> |
10 | 11 |
11 namespace v8_inspector { | 12 namespace v8_inspector { |
12 | 13 |
13 class InspectedContext; | 14 class InspectedContext; |
14 | 15 |
15 namespace protocol = blink::protocol; | |
16 | |
17 // Console API | 16 // Console API |
18 // https://console.spec.whatwg.org/#console-interface | 17 // https://console.spec.whatwg.org/#console-interface |
19 class V8Console { | 18 class V8Console { |
20 public: | 19 public: |
21 static v8::Local<v8::Object> createConsole(InspectedContext*, bool hasMemory
Attribute); | 20 static v8::Local<v8::Object> createConsole(InspectedContext*, bool hasMemory
Attribute); |
22 static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, v8::Local<
v8::Object> console); | 21 static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, v8::Local<
v8::Object> console); |
23 static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*); | 22 static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*); |
24 | 23 |
25 class CommandLineAPIScope { | 24 class CommandLineAPIScope { |
26 PROTOCOL_DISALLOW_COPY(CommandLineAPIScope); | 25 V8_INSPECTOR_DISALLOW_COPY(CommandLineAPIScope); |
27 public: | 26 public: |
28 CommandLineAPIScope(v8::Local<v8::Context>, v8::Local<v8::Object> comman
dLineAPI, v8::Local<v8::Object> global); | 27 CommandLineAPIScope(v8::Local<v8::Context>, v8::Local<v8::Object> comman
dLineAPI, v8::Local<v8::Object> global); |
29 ~CommandLineAPIScope(); | 28 ~CommandLineAPIScope(); |
30 | 29 |
31 private: | 30 private: |
32 static void accessorGetterCallback(v8::Local<v8::Name>, const v8::Proper
tyCallbackInfo<v8::Value>&); | 31 static void accessorGetterCallback(v8::Local<v8::Name>, const v8::Proper
tyCallbackInfo<v8::Value>&); |
33 static void accessorSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Va
lue>, const v8::PropertyCallbackInfo<void>&); | 32 static void accessorSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Va
lue>, const v8::PropertyCallbackInfo<void>&); |
34 | 33 |
35 v8::Local<v8::Context> m_context; | 34 v8::Local<v8::Context> m_context; |
36 v8::Local<v8::Object> m_commandLineAPI; | 35 v8::Local<v8::Object> m_commandLineAPI; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 static void inspectedObject0(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 0); } | 81 static void inspectedObject0(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 0); } |
83 static void inspectedObject1(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 1); } | 82 static void inspectedObject1(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 1); } |
84 static void inspectedObject2(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 2); } | 83 static void inspectedObject2(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 2); } |
85 static void inspectedObject3(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 3); } | 84 static void inspectedObject3(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 3); } |
86 static void inspectedObject4(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 4); } | 85 static void inspectedObject4(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 4); } |
87 }; | 86 }; |
88 | 87 |
89 } // namespace v8_inspector | 88 } // namespace v8_inspector |
90 | 89 |
91 #endif // V8Console_h | 90 #endif // V8Console_h |
OLD | NEW |