31 #ifndef V8_INSPECTOR_V8_RUNTIME_AGENT_IMPL_H_ 32 #define V8_INSPECTOR_V8_RUNTIME_AGENT_IMPL_H_ 34 #include <unordered_map> 36 #include "src/base/macros.h" 37 #include "src/inspector/protocol/Forward.h" 38 #include "src/inspector/protocol/Runtime.h" 40 #include "include/v8.h" 45 class InspectedContext;
46 class RemoteObjectIdBase;
47 class V8ConsoleMessage;
48 class V8InspectorImpl;
49 class V8InspectorSessionImpl;
51 using protocol::Response;
52 using protocol::Maybe;
57 protocol::DictionaryValue* state);
62 Response enable()
override;
63 Response disable()
override;
64 void evaluate(
const String16& expression, Maybe<String16> objectGroup,
65 Maybe<bool> includeCommandLineAPI, Maybe<bool> silent,
66 Maybe<int> executionContextId, Maybe<bool> returnByValue,
67 Maybe<bool> generatePreview, Maybe<bool> userGesture,
68 Maybe<bool> awaitPromise, Maybe<bool> throwOnSideEffect,
69 Maybe<double> timeout,
70 std::unique_ptr<EvaluateCallback>)
override;
71 void awaitPromise(
const String16& promiseObjectId, Maybe<bool> returnByValue,
72 Maybe<bool> generatePreview,
73 std::unique_ptr<AwaitPromiseCallback>)
override;
75 const String16& expression, Maybe<String16> objectId,
76 Maybe<protocol::Array<protocol::Runtime::CallArgument>> optionalArguments,
77 Maybe<bool> silent, Maybe<bool> returnByValue,
78 Maybe<bool> generatePreview, Maybe<bool> userGesture,
79 Maybe<bool> awaitPromise, Maybe<int> executionContextId,
80 Maybe<String16> objectGroup,
81 std::unique_ptr<CallFunctionOnCallback>)
override;
82 Response releaseObject(
const String16& objectId)
override;
83 Response getProperties(
84 const String16& objectId, Maybe<bool> ownProperties,
85 Maybe<bool> accessorPropertiesOnly, Maybe<bool> generatePreview,
86 std::unique_ptr<protocol::Array<protocol::Runtime::PropertyDescriptor>>*
88 Maybe<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>*
90 Maybe<protocol::Runtime::ExceptionDetails>*)
override;
91 Response releaseObjectGroup(
const String16& objectGroup)
override;
92 Response runIfWaitingForDebugger()
override;
93 Response setCustomObjectFormatterEnabled(
bool)
override;
94 Response setMaxCallStackSizeToCapture(
int)
override;
95 Response discardConsoleEntries()
override;
96 Response compileScript(
const String16& expression,
const String16& sourceURL,
97 bool persistScript, Maybe<int> executionContextId,
99 Maybe<protocol::Runtime::ExceptionDetails>*)
override;
100 void runScript(
const String16&, Maybe<int> executionContextId,
101 Maybe<String16> objectGroup, Maybe<bool> silent,
102 Maybe<bool> includeCommandLineAPI, Maybe<bool> returnByValue,
103 Maybe<bool> generatePreview, Maybe<bool> awaitPromise,
104 std::unique_ptr<RunScriptCallback>)
override;
105 Response queryObjects(
106 const String16& prototypeObjectId, Maybe<String16> objectGroup,
107 std::unique_ptr<protocol::Runtime::RemoteObject>* objects)
override;
108 Response globalLexicalScopeNames(
109 Maybe<int> executionContextId,
110 std::unique_ptr<protocol::Array<String16>>* outNames)
override;
111 Response getIsolateId(
String16* outIsolateId)
override;
112 Response getHeapUsage(
double* out_usedSize,
double* out_totalSize)
override;
113 void terminateExecution(
114 std::unique_ptr<TerminateExecutionCallback> callback)
override;
116 Response addBinding(
const String16& name,
117 Maybe<int> executionContextId)
override;
118 Response removeBinding(
const String16& name)
override;
124 void inspect(std::unique_ptr<protocol::Runtime::RemoteObject> objectToInspect,
125 std::unique_ptr<protocol::DictionaryValue> hints);
127 bool enabled()
const {
return m_enabled; }
134 int executionContextId);
138 protocol::DictionaryValue* m_state;
139 protocol::Runtime::Frontend m_frontend;
142 std::unordered_map<String16, std::unique_ptr<v8::Global<v8::Script>>>
150 #endif // V8_INSPECTOR_V8_RUNTIME_AGENT_IMPL_H_