void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* frame, SecurityOrigin* origin) { ASSERT(isMainThread()); v8::HandleScope handles(scriptState->isolate()); DOMWrapperWorld& world = scriptState->world(); std::unique_ptr<protocol::DictionaryValue> auxDataValue = protocol::DictionaryValue::create(); auxDataValue->setBoolean("isDefault", world.isMainWorld()); auxDataValue->setString("frameId", IdentifiersFactory::frameId(frame)); String auxData = auxDataValue->toJSONString(); String humanReadableName = world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : String(); String originString = origin ? origin->toRawString() : String(); v8_inspector::V8ContextInfo contextInfo( scriptState->context(), contextGroupId(frame), toV8InspectorStringView(humanReadableName)); contextInfo.origin = toV8InspectorStringView(originString); contextInfo.auxData = toV8InspectorStringView(auxData); contextInfo.hasMemoryOnConsole = scriptState->getExecutionContext() && scriptState->getExecutionContext()->isDocument(); v8Inspector()->contextCreated(contextInfo); }
void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* frame, SecurityOrigin* origin) { ASSERT(isMainThread()); v8::HandleScope handles(scriptState->isolate()); DOMWrapperWorld& world = scriptState->world(); debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame), scriptState->getExecutionContext()->isDocument())); }
void MainThreadDebugger::initializeContext(v8::Local<v8::Context> context, LocalFrame* frame, int worldId) { String type = worldId == MainWorldId ? "page" : "injected"; V8Debugger::setContextDebugData(context, type, contextGroupId(frame)); }
void MainThreadDebugger::didClearContextsForFrame(LocalFrame* frame) { DCHECK(isMainThread()); if (frame->localFrameRoot() == frame) v8Inspector()->resetContextGroup(contextGroupId(frame)); }
int MainThreadDebugger::contextGroupId(ExecutionContext* context) { LocalFrame* frame = toFrame(context); return frame ? contextGroupId(frame) : 0; }