Lines Matching refs:v8

8 #include "include/v8-container.h"
9 #include "include/v8-context.h"
10 #include "include/v8-function.h"
11 #include "include/v8-json.h"
12 #include "include/v8-microtask-queue.h"
17 #include "src/inspector/v8-console-message.h"
18 #include "src/inspector/v8-inspector-impl.h"
19 #include "src/inspector/v8-stack-trace-impl.h"
26 void reportError(v8::Local<v8::Context> context, const v8::TryCatch& tryCatch) {
28 v8::Isolate* isolate = context->GetIsolate();
30 static_cast<V8InspectorImpl*>(v8::debug::GetInspector(isolate));
33 v8::Local<v8::String> message = tryCatch.Message()->Get();
34 v8::Local<v8::String> prefix =
36 message = v8::String::Concat(isolate, prefix, message);
37 std::vector<v8::Local<v8::Value>> arguments;
48 void reportError(v8::Local<v8::Context> context, const v8::TryCatch& tryCatch,
50 v8::Isolate* isolate = context->GetIsolate();
55 InjectedScript* getInjectedScript(v8::Local<v8::Context> context,
57 v8::Isolate* isolate = context->GetIsolate();
59 static_cast<V8InspectorImpl*>(v8::debug::GetInspector(isolate));
67 v8::Local<v8::Context> context,
68 v8::Local<v8::Array> jsonML, int maxDepth) {
70 v8::Isolate* isolate = context->GetIsolate();
71 v8::TryCatch tryCatch(isolate);
79 v8::Local<v8::Value> firstValue;
84 v8::Local<v8::String> objectLiteral = toV8String(isolate, "object");
86 firstValue.As<v8::String>()->StringEquals(objectLiteral)) {
87 v8::Local<v8::Value> attributesValue;
96 v8::Local<v8::Object> attributes = attributesValue.As<v8::Object>();
97 v8::Local<v8::Value> originValue;
108 v8::Local<v8::Value> configValue;
131 v8::Local<v8::Value> jsonWrapper;
133 if (!v8::JSON::Parse(context, toV8String(isolate, serialized))
144 v8::Local<v8::Value> value;
149 if (value->IsArray() && value.As<v8::Array>()->Length() > 0 &&
151 value.As<v8::Array>(), maxDepth - 1)) {
159 void bodyCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
160 v8::Isolate* isolate = info.GetIsolate();
161 v8::TryCatch tryCatch(isolate);
162 v8::Local<v8::Context> context = isolate->GetCurrentContext();
163 v8::Local<v8::Object> bodyConfig = info.Data().As<v8::Object>();
165 v8::Local<v8::Value> objectValue;
175 v8::Local<v8::Object> object = objectValue.As<v8::Object>();
177 v8::Local<v8::Value> formatterValue;
187 v8::Local<v8::Object> formatter = formatterValue.As<v8::Object>();
189 v8::Local<v8::Value> bodyValue;
199 v8::Local<v8::Function> bodyFunction = bodyValue.As<v8::Function>();
201 v8::Local<v8::Value> configValue;
208 v8::Local<v8::Value> sessionIdValue;
219 v8::Local<v8::Value> groupNameValue;
230 v8::Local<v8::Value> formattedValue;
231 v8::Local<v8::Value> args[] = {object, configValue};
241 v8::Local<v8::Array> jsonML = formattedValue.As<v8::Array>();
244 sessionIdValue.As<v8::Int32>()->Value(),
245 toProtocolString(isolate, groupNameValue.As<v8::String>()), context,
254 v8::Local<v8::Object> object,
255 v8::MaybeLocal<v8::Value> maybeConfig, int maxDepth,
257 v8::Local<v8::Context> context;
262 v8::Isolate* isolate = context->GetIsolate();
263 v8::MicrotasksScope microtasksScope(isolate,
264 v8::MicrotasksScope::kDoNotRunMicrotasks);
265 v8::TryCatch tryCatch(isolate);
267 v8::Local<v8::Value> configValue;
268 if (!maybeConfig.ToLocal(&configValue)) configValue = v8::Undefined(isolate);
270 v8::Local<v8::Object> global = context->Global();
271 v8::Local<v8::Value> formattersValue;
278 v8::Local<v8::Array> formatters = formattersValue.As<v8::Array>();
279 v8::Local<v8::String> headerLiteral = toV8String(isolate, "header");
280 v8::Local<v8::String> hasBodyLiteral = toV8String(isolate, "hasBody");
282 v8::Local<v8::Value> formatterValue;
291 v8::Local<v8::Object> formatter = formatterValue.As<v8::Object>();
293 v8::Local<v8::Value> headerValue;
302 v8::Local<v8::Function> headerFunction = headerValue.As<v8::Function>();
304 v8::Local<v8::Value> formattedValue;
305 v8::Local<v8::Value> args[] = {object, configValue};
312 v8::Local<v8::Array> jsonML = formattedValue.As<v8::Array>();
314 v8::Local<v8::Value> hasBodyFunctionValue;
321 v8::Local<v8::Function> hasBodyFunction =
322 hasBodyFunctionValue.As<v8::Function>();
323 v8::Local<v8::Value> hasBodyValue;
336 v8::Local<v8::String> header;
337 if (!v8::JSON::Stringify(context, jsonML).ToLocal(&header)) {
342 v8::Local<v8::Function> bodyFunction;
344 v8::Local<v8::Object> bodyConfig = v8::Object::New(isolate);
347 v8::Integer::New(isolate, sessionId))
380 if (!v8::Function::New(context, bodyCallback, bodyConfig)