Lines Matching refs:v8

26 v8::Local<v8::Private> inspectedContextPrivateKey(v8::Isolate* isolate) {  in inspectedContextPrivateKey()
27 return v8::Private::ForApi( in inspectedContextPrivateKey()
33 explicit ConsoleHelper(const v8::FunctionCallbackInfo<v8::Value>& info) in ConsoleHelper()
40 v8::Local<v8::Object> ensureConsole() { in ensureConsole()
44 m_console = m_info.Data().As<v8::Object>(); in ensureConsole()
51 v8::Local<v8::Object> console = ensureConsole(); in ensureInspectedContext()
53 v8::Local<v8::Private> key = inspectedContextPrivateKey(m_isolate); in ensureInspectedContext()
54 v8::Local<v8::Value> inspectedContextValue; in ensureInspectedContext()
59 inspectedContextValue.As<v8::External>()->Value()); in ensureInspectedContext()
73 std::vector<v8::Local<v8::Value>> arguments; in reportCall()
80 std::vector<v8::Local<v8::Value>> arguments; in reportCallWithDefaultArgument()
87 std::vector<v8::Local<v8::Value>> arguments(1, in reportCallWithArgument()
93 const std::vector<v8::Local<v8::Value>>& arguments) { in reportCall()
108 std::vector<v8::Local<v8::Value>> arguments(1, in reportDeprecatedCall()
115 if (m_info[0]->IsBoolean()) return m_info[0].As<v8::Boolean>()->Value(); in firstArgToBoolean()
121 v8::Local<v8::String> titleValue; in firstArgToString()
123 if (!m_info[0].As<v8::Object>()->ObjectProtoToString(m_context).ToLocal( in firstArgToString()
133 v8::MaybeLocal<v8::Object> firstArgAsObject() { in firstArgAsObject()
135 return v8::MaybeLocal<v8::Object>(); in firstArgAsObject()
136 return m_info[0].As<v8::Object>(); in firstArgAsObject()
139 v8::MaybeLocal<v8::Function> firstArgAsFunction() { in firstArgAsFunction()
141 return v8::MaybeLocal<v8::Function>(); in firstArgAsFunction()
142 v8::Local<v8::Function> func = m_info[0].As<v8::Function>(); in firstArgAsFunction()
144 func = func->GetBoundFunction().As<v8::Function>(); in firstArgAsFunction()
148 v8::MaybeLocal<v8::Map> privateMap(const char* name) { in privateMap()
149 v8::Local<v8::Object> console = ensureConsole(); in privateMap()
150 v8::Local<v8::Private> privateKey = in privateMap()
151 v8::Private::ForApi(m_isolate, toV8StringInternalized(m_isolate, name)); in privateMap()
152 v8::Local<v8::Value> mapValue; in privateMap()
154 return v8::MaybeLocal<v8::Map>(); in privateMap()
156 v8::Local<v8::Map> map = v8::Map::New(m_isolate); in privateMap()
158 return v8::MaybeLocal<v8::Map>(); in privateMap()
161 return mapValue->IsMap() ? mapValue.As<v8::Map>() in privateMap()
162 : v8::MaybeLocal<v8::Map>(); in privateMap()
165 int32_t getIntFromMap(v8::Local<v8::Map> map, const String16& key, in getIntFromMap()
167 v8::Local<v8::String> v8Key = toV8String(m_isolate, key); in getIntFromMap()
169 v8::Local<v8::Value> intValue; in getIntFromMap()
171 return static_cast<int32_t>(intValue.As<v8::Integer>()->Value()); in getIntFromMap()
174 void setIntOnMap(v8::Local<v8::Map> map, const String16& key, int32_t value) { in setIntOnMap()
175 v8::Local<v8::String> v8Key = toV8String(m_isolate, key); in setIntOnMap()
176 if (!map->Set(m_context, v8Key, v8::Integer::New(m_isolate, value)) in setIntOnMap()
181 double getDoubleFromMap(v8::Local<v8::Map> map, const String16& key, in getDoubleFromMap()
183 v8::Local<v8::String> v8Key = toV8String(m_isolate, key); in getDoubleFromMap()
185 v8::Local<v8::Value> intValue; in getDoubleFromMap()
187 return intValue.As<v8::Number>()->Value(); in getDoubleFromMap()
190 void setDoubleOnMap(v8::Local<v8::Map> map, const String16& key, in setDoubleOnMap()
192 v8::Local<v8::String> v8Key = toV8String(m_isolate, key); in setDoubleOnMap()
193 if (!map->Set(m_context, v8Key, v8::Number::New(m_isolate, value)) in setDoubleOnMap()
222 const v8::FunctionCallbackInfo<v8::Value>& m_info;
223 v8::Isolate* m_isolate;
224 v8::Local<v8::Context> m_context;
225 v8::Local<v8::Object> m_console;
230 v8::Local<v8::Object> console = ensureConsole(); in checkAndSetPrivateFlagOnConsole()
231 v8::Local<v8::Private> key = in checkAndSetPrivateFlagOnConsole()
232 v8::Private::ForApi(m_isolate, toV8StringInternalized(m_isolate, name)); in checkAndSetPrivateFlagOnConsole()
233 v8::Local<v8::Value> flagValue; in checkAndSetPrivateFlagOnConsole()
238 DCHECK(flagValue.As<v8::Boolean>()->Value()); in checkAndSetPrivateFlagOnConsole()
241 if (!console->SetPrivate(m_context, key, v8::True(m_isolate)) in checkAndSetPrivateFlagOnConsole()
250 void returnDataCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in returnDataCallback()
254 void createBoundFunctionProperty(v8::Local<v8::Context> context, in createBoundFunctionProperty()
255 v8::Local<v8::Object> console, in createBoundFunctionProperty()
257 v8::FunctionCallback callback, in createBoundFunctionProperty()
259 v8::Local<v8::String> funcName = in createBoundFunctionProperty()
261 v8::Local<v8::Function> func; in createBoundFunctionProperty()
262 if (!v8::Function::New(context, callback, console, 0, in createBoundFunctionProperty()
263 v8::ConstructorBehavior::kThrow) in createBoundFunctionProperty()
268 v8::Local<v8::String> returnValue = in createBoundFunctionProperty()
270 v8::Local<v8::Function> toStringFunction; in createBoundFunctionProperty()
271 if (v8::Function::New(context, returnDataCallback, returnValue, 0, in createBoundFunctionProperty()
272 v8::ConstructorBehavior::kThrow) in createBoundFunctionProperty()
283 void V8Console::debugCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in debugCallback()
287 void V8Console::errorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in errorCallback()
291 void V8Console::infoCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in infoCallback()
295 void V8Console::logCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in logCallback()
299 void V8Console::warnCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in warnCallback()
303 void V8Console::dirCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in dirCallback()
308 const v8::FunctionCallbackInfo<v8::Value>& info) { in dirxmlCallback()
312 void V8Console::tableCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in tableCallback()
316 void V8Console::traceCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in traceCallback()
321 void V8Console::groupCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in groupCallback()
327 const v8::FunctionCallbackInfo<v8::Value>& info) { in groupCollapsedCallback()
333 const v8::FunctionCallbackInfo<v8::Value>& info) { in groupEndCallback()
338 void V8Console::clearCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in clearCallback()
343 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in countCallback()
359 v8::Local<v8::Map> countMap; in countCallback()
368 const v8::FunctionCallbackInfo<v8::Value>& info) { in assertCallback()
372 std::vector<v8::Local<v8::Value>> arguments; in assertCallback()
385 const v8::FunctionCallbackInfo<v8::Value>& info) { in markTimelineCallback()
394 const v8::FunctionCallbackInfo<v8::Value>& info) { in profileCallback()
401 const v8::FunctionCallbackInfo<v8::Value>& info) { in profileEndCallback()
407 static void timeFunction(const v8::FunctionCallbackInfo<v8::Value>& info, in timeFunction()
415 v8::Local<v8::Map> timeMap; in timeFunction()
421 static void timeEndFunction(const v8::FunctionCallbackInfo<v8::Value>& info, in timeEndFunction()
429 v8::Local<v8::Map> timeMap; in timeEndFunction()
440 const v8::FunctionCallbackInfo<v8::Value>& info) { in timelineCallback()
448 const v8::FunctionCallbackInfo<v8::Value>& info) { in timelineEndCallback()
456 void V8Console::timeCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in timeCallback()
461 const v8::FunctionCallbackInfo<v8::Value>& info) { in timeEndCallback()
466 const v8::FunctionCallbackInfo<v8::Value>& info) { in timeStampCallback()
475 const v8::FunctionCallbackInfo<v8::Value>& info) { in memoryGetterCallback()
477 v8::Local<v8::Value> memoryValue; in memoryGetterCallback()
488 const v8::FunctionCallbackInfo<v8::Value>& info) { in memorySetterCallback()
494 void V8Console::keysCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in keysCallback()
495 v8::Isolate* isolate = info.GetIsolate(); in keysCallback()
496 info.GetReturnValue().Set(v8::Array::New(isolate)); in keysCallback()
499 v8::Local<v8::Object> obj; in keysCallback()
501 v8::Local<v8::Array> names; in keysCallback()
508 const v8::FunctionCallbackInfo<v8::Value>& info) { in valuesCallback()
509 v8::Isolate* isolate = info.GetIsolate(); in valuesCallback()
510 info.GetReturnValue().Set(v8::Array::New(isolate)); in valuesCallback()
513 v8::Local<v8::Object> obj; in valuesCallback()
515 v8::Local<v8::Array> names; in valuesCallback()
516 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in valuesCallback()
518 v8::Local<v8::Array> values = v8::Array::New(isolate, names->Length()); in valuesCallback()
520 v8::Local<v8::Value> key; in valuesCallback()
522 v8::Local<v8::Value> value; in valuesCallback()
530 v8::Local<v8::Function> function, in setFunctionBreakpoint()
538 if (lineNumber == v8::Function::kLineOffsetNotFound || in setFunctionBreakpoint()
539 columnNumber == v8::Function::kLineOffsetNotFound) in setFunctionBreakpoint()
550 const v8::FunctionCallbackInfo<v8::Value>& info) { in debugFunctionCallback()
552 v8::Local<v8::Function> function; in debugFunctionCallback()
560 const v8::FunctionCallbackInfo<v8::Value>& info) { in undebugFunctionCallback()
562 v8::Local<v8::Function> function; in undebugFunctionCallback()
570 const v8::FunctionCallbackInfo<v8::Value>& info) { in monitorFunctionCallback()
572 v8::Local<v8::Function> function; in monitorFunctionCallback()
574 v8::Local<v8::Value> name = function->GetName(); in monitorFunctionCallback()
575 if (!name->IsString() || !v8::Local<v8::String>::Cast(name)->Length()) in monitorFunctionCallback()
593 const v8::FunctionCallbackInfo<v8::Value>& info) { in unmonitorFunctionCallback()
595 v8::Local<v8::Function> function; in unmonitorFunctionCallback()
603 const v8::FunctionCallbackInfo<v8::Value>& info) { in lastEvaluationResultCallback()
611 static void inspectImpl(const v8::FunctionCallbackInfo<v8::Value>& info, in inspectImpl()
636 const v8::FunctionCallbackInfo<v8::Value>& info) { in inspectCallback()
640 void V8Console::copyCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { in copyCallback()
644 void V8Console::inspectedObject(const v8::FunctionCallbackInfo<v8::Value>& info, in inspectedObject()
650 v8::Isolate* isolate = info.GetIsolate(); in inspectedObject()
654 info.GetReturnValue().Set(v8::Undefined(isolate)); in inspectedObject()
658 v8::Local<v8::Object> V8Console::createConsole( in createConsole()
660 v8::Local<v8::Context> context = inspectedContext->context(); in createConsole()
661 v8::Context::Scope contextScope(context); in createConsole()
662 v8::Isolate* isolate = context->GetIsolate(); in createConsole()
663 v8::MicrotasksScope microtasksScope(isolate, in createConsole()
664 v8::MicrotasksScope::kDoNotRunMicrotasks); in createConsole()
666 v8::Local<v8::Object> console = v8::Object::New(isolate); in createConsole()
668 console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false); in createConsole()
720 v8::Function::New(context, V8Console::memoryGetterCallback, console, 0, in createConsole()
721 v8::ConstructorBehavior::kThrow) in createConsole()
723 v8::Function::New(context, V8Console::memorySetterCallback, in createConsole()
724 v8::Local<v8::Value>(), 0, in createConsole()
725 v8::ConstructorBehavior::kThrow) in createConsole()
727 static_cast<v8::PropertyAttribute>(v8::None), v8::DEFAULT); in createConsole()
730 v8::External::New(isolate, inspectedContext)); in createConsole()
734 void V8Console::clearInspectedContextIfNeeded(v8::Local<v8::Context> context, in clearInspectedContextIfNeeded()
735 v8::Local<v8::Object> console) { in clearInspectedContextIfNeeded()
736 v8::Isolate* isolate = context->GetIsolate(); in clearInspectedContextIfNeeded()
738 v8::External::New(isolate, nullptr)); in clearInspectedContextIfNeeded()
741 v8::Local<v8::Object> V8Console::createCommandLineAPI( in createCommandLineAPI()
743 v8::Local<v8::Context> context = inspectedContext->context(); in createCommandLineAPI()
744 v8::Isolate* isolate = context->GetIsolate(); in createCommandLineAPI()
745 v8::MicrotasksScope microtasksScope(isolate, in createCommandLineAPI()
746 v8::MicrotasksScope::kDoNotRunMicrotasks); in createCommandLineAPI()
748 v8::Local<v8::Object> commandLineAPI = v8::Object::New(isolate); in createCommandLineAPI()
750 commandLineAPI->SetPrototype(context, v8::Null(isolate)).FromMaybe(false); in createCommandLineAPI()
815 v8::External::New(isolate, inspectedContext)); in createCommandLineAPI()
827 v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { in accessorGetterCallback()
829 info.Data().As<v8::External>()->Value()); in accessorGetterCallback()
832 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in accessorGetterCallback()
839 v8::Local<v8::Object> commandLineAPI = scope->m_commandLineAPI; in accessorGetterCallback()
841 v8::Local<v8::Value> value; in accessorGetterCallback()
845 v8::MicrotasksScope microtasks(info.GetIsolate(), in accessorGetterCallback()
846 v8::MicrotasksScope::kDoNotRunMicrotasks); in accessorGetterCallback()
847 if (value.As<v8::Function>() in accessorGetterCallback()
857 v8::Local<v8::Name> name, v8::Local<v8::Value> value, in accessorSetterCallback()
858 const v8::PropertyCallbackInfo<void>& info) { in accessorSetterCallback()
860 info.Data().As<v8::External>()->Value()); in accessorSetterCallback()
861 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in accessorSetterCallback()
872 v8::Local<v8::Context> context, v8::Local<v8::Object> commandLineAPI, in CommandLineAPIScope()
873 v8::Local<v8::Object> global) in CommandLineAPIScope()
877 m_installedMethods(v8::Set::New(context->GetIsolate())), in CommandLineAPIScope()
879 v8::Local<v8::Array> names; in CommandLineAPIScope()
881 v8::Local<v8::External> externalThis = in CommandLineAPIScope()
882 v8::External::New(context->GetIsolate(), this); in CommandLineAPIScope()
884 v8::Local<v8::Value> name; in CommandLineAPIScope()
890 ->SetAccessor(context, v8::Local<v8::Name>::Cast(name), in CommandLineAPIScope()
893 externalThis, v8::DEFAULT, v8::DontEnum) in CommandLineAPIScope()
905 v8::Local<v8::Array> names = m_installedMethods->AsArray(); in ~CommandLineAPIScope()
907 v8::Local<v8::Value> name; in ~CommandLineAPIScope()
910 v8::Local<v8::Value> descriptor; in ~CommandLineAPIScope()
913 m_context, v8::Local<v8::String>::Cast(name)) in ~CommandLineAPIScope()