Lines Matching defs:context
9 #include "include/v8-context.h"
15 #include "src/inspector/inspected-context.h"
26 void reportError(v8::Local<v8::Context> context, const v8::TryCatch& tryCatch) {
28 v8::Isolate* isolate = context->GetIsolate();
31 int contextId = InspectedContext::contextId(context);
43 context, contextId, groupId, inspector,
48 void reportError(v8::Local<v8::Context> context, const v8::TryCatch& tryCatch,
50 v8::Isolate* isolate = context->GetIsolate();
52 reportError(context, tryCatch);
55 InjectedScript* getInjectedScript(v8::Local<v8::Context> context,
57 v8::Isolate* isolate = context->GetIsolate();
61 inspector->getContext(InspectedContext::contextId(context));
67 v8::Local<v8::Context> context,
70 v8::Isolate* isolate = context->GetIsolate();
74 reportError(context, tryCatch,
80 if (!jsonML->Get(context, 0).ToLocal(&firstValue)) {
81 reportError(context, tryCatch);
88 if (!jsonML->Get(context, 1).ToLocal(&attributesValue)) {
89 reportError(context, tryCatch);
93 reportError(context, tryCatch, "attributes should be an Object");
98 if (!attributes->Get(context, objectLiteral).ToLocal(&originValue)) {
99 reportError(context, tryCatch);
103 reportError(context, tryCatch,
109 if (!attributes->Get(context, toV8String(isolate, "config"))
111 reportError(context, tryCatch);
115 InjectedScript* injectedScript = getInjectedScript(context, sessionId);
117 reportError(context, tryCatch, "cannot find context with specified id");
125 reportError(context, tryCatch, "cannot wrap value");
133 if (!v8::JSON::Parse(context, toV8String(isolate, serialized))
135 reportError(context, tryCatch, "cannot wrap value");
138 if (jsonML->Set(context, 1, jsonWrapper).IsNothing()) {
139 reportError(context, tryCatch);
145 if (!jsonML->Get(context, i).ToLocal(&value)) {
146 reportError(context, tryCatch);
150 !substituteObjectTags(sessionId, groupName, context,
162 v8::Local<v8::Context> context = isolate->GetCurrentContext();
166 if (!bodyConfig->Get(context, toV8String(isolate, "object"))
168 reportError(context, tryCatch);
172 reportError(context, tryCatch, "object should be an Object");
178 if (!bodyConfig->Get(context, toV8String(isolate, "formatter"))
180 reportError(context, tryCatch);
184 reportError(context, tryCatch, "formatter should be an Object");
190 if (!formatter->Get(context, toV8String(isolate, "body"))
192 reportError(context, tryCatch);
196 reportError(context, tryCatch, "body should be a Function");
202 if (!bodyConfig->Get(context, toV8String(isolate, "config"))
204 reportError(context, tryCatch);
209 if (!bodyConfig->Get(context, toV8String(isolate, "sessionId"))
211 reportError(context, tryCatch);
215 reportError(context, tryCatch, "sessionId should be an Int32");
220 if (!bodyConfig->Get(context, toV8String(isolate, "groupName"))
222 reportError(context, tryCatch);
226 reportError(context, tryCatch, "groupName should be a string");
232 if (!bodyFunction->Call(context, formatter, 2, args)
234 reportError(context, tryCatch);
238 reportError(context, tryCatch, "body should return an Array");
245 toProtocolString(isolate, groupNameValue.As<v8::String>()), context,
257 v8::Local<v8::Context> context;
258 if (!object->GetCreationContext().ToLocal(&context)) {
262 v8::Isolate* isolate = context->GetIsolate();
270 v8::Local<v8::Object> global = context->Global();
272 if (!global->Get(context, toV8String(isolate, "devtoolsFormatters"))
274 reportError(context, tryCatch);
283 if (!formatters->Get(context, i).ToLocal(&formatterValue)) {
284 reportError(context, tryCatch);
288 reportError(context, tryCatch, "formatter should be an Object");
294 if (!formatter->Get(context, headerLiteral).ToLocal(&headerValue)) {
295 reportError(context, tryCatch);
299 reportError(context, tryCatch, "header should be a Function");
306 if (!headerFunction->Call(context, formatter, 2, args)
308 reportError(context, tryCatch);
315 if (!formatter->Get(context, hasBodyLiteral)
317 reportError(context, tryCatch);
324 if (!hasBodyFunction->Call(context, formatter, 2, args)
326 reportError(context, tryCatch);
331 if (jsonML->Length() && !substituteObjectTags(sessionId, groupName, context,
337 if (!v8::JSON::Stringify(context, jsonML).ToLocal(&header)) {
338 reportError(context, tryCatch);
346 ->CreateDataProperty(context, toV8String(isolate, "sessionId"),
349 reportError(context, tryCatch);
353 ->CreateDataProperty(context, toV8String(isolate, "formatter"),
356 reportError(context, tryCatch);
360 ->CreateDataProperty(context, toV8String(isolate, "groupName"),
363 reportError(context, tryCatch);
367 ->CreateDataProperty(context, toV8String(isolate, "config"),
370 reportError(context, tryCatch);
374 ->CreateDataProperty(context, toV8String(isolate, "object"),
377 reportError(context, tryCatch);
380 if (!v8::Function::New(context, bodyCallback, bodyConfig)
382 reportError(context, tryCatch);
390 InjectedScript* injectedScript = getInjectedScript(context, sessionId);
392 reportError(context, tryCatch, "cannot find context with specified id");