| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_INSPECTOR_V8CONSOLE_H_ | |
| 6 #define V8_INSPECTOR_V8CONSOLE_H_ | |
| 7 | |
| 8 #include "src/inspector/Allocator.h" | |
| 9 | |
| 10 #include <v8.h> | |
| 11 | |
| 12 namespace v8_inspector { | |
| 13 | |
| 14 class InspectedContext; | |
| 15 | |
| 16 // Console API | |
| 17 // https://console.spec.whatwg.org/#console-interface | |
| 18 class V8Console { | |
| 19 public: | |
| 20 static v8::Local<v8::Object> createConsole(InspectedContext*, bool hasMemory
Attribute); | |
| 21 static void clearInspectedContextIfNeeded(v8::Local<v8::Context>, v8::Local<
v8::Object> console); | |
| 22 static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*); | |
| 23 | |
| 24 class CommandLineAPIScope { | |
| 25 V8_INSPECTOR_DISALLOW_COPY(CommandLineAPIScope); | |
| 26 public: | |
| 27 CommandLineAPIScope(v8::Local<v8::Context>, v8::Local<v8::Object> comman
dLineAPI, v8::Local<v8::Object> global); | |
| 28 ~CommandLineAPIScope(); | |
| 29 | |
| 30 private: | |
| 31 static void accessorGetterCallback(v8::Local<v8::Name>, const v8::Proper
tyCallbackInfo<v8::Value>&); | |
| 32 static void accessorSetterCallback(v8::Local<v8::Name>, v8::Local<v8::Va
lue>, const v8::PropertyCallbackInfo<void>&); | |
| 33 | |
| 34 v8::Local<v8::Context> m_context; | |
| 35 v8::Local<v8::Object> m_commandLineAPI; | |
| 36 v8::Local<v8::Object> m_global; | |
| 37 v8::Local<v8::Set> m_installedMethods; | |
| 38 bool m_cleanup; | |
| 39 }; | |
| 40 | |
| 41 private: | |
| 42 static void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 43 static void errorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 44 static void infoCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 45 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 46 static void warnCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 47 static void dirCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 48 static void dirxmlCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 49 static void tableCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 50 static void traceCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 51 static void groupCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 52 static void groupCollapsedCallback(const v8::FunctionCallbackInfo<v8::Value>
&); | |
| 53 static void groupEndCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 54 static void clearCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 55 static void countCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 56 static void assertCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 57 static void markTimelineCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | |
| 58 static void profileCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 59 static void profileEndCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 60 static void timelineCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 61 static void timelineEndCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 62 static void timeCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 63 static void timeEndCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 64 static void timeStampCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 65 // TODO(foolip): There is no spec for the Memory Info API, see blink-dev: | |
| 66 // https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJ
z71NmPwJ | |
| 67 static void memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | |
| 68 static void memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | |
| 69 | |
| 70 // CommandLineAPI | |
| 71 static void keysCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 72 static void valuesCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 73 static void debugFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | |
| 74 static void undebugFunctionCallback(const v8::FunctionCallbackInfo<v8::Value
>&); | |
| 75 static void monitorFunctionCallback(const v8::FunctionCallbackInfo<v8::Value
>&); | |
| 76 static void unmonitorFunctionCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); | |
| 77 static void lastEvaluationResultCallback(const v8::FunctionCallbackInfo<v8::
Value>&); | |
| 78 static void inspectCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 79 static void copyCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 80 static void inspectedObject(const v8::FunctionCallbackInfo<v8::Value>&, unsi
gned num); | |
| 81 static void inspectedObject0(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 0); } | |
| 82 static void inspectedObject1(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 1); } | |
| 83 static void inspectedObject2(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 2); } | |
| 84 static void inspectedObject3(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 3); } | |
| 85 static void inspectedObject4(const v8::FunctionCallbackInfo<v8::Value>& info
) { inspectedObject(info, 4); } | |
| 86 }; | |
| 87 | |
| 88 } // namespace v8_inspector | |
| 89 | |
| 90 #endif // V8_INSPECTOR_V8CONSOLE_H_ | |
| OLD | NEW |