void PageRuntimeAgent::didCreateIsolatedContext(Frame* frame, ScriptState* scriptState, SecurityOrigin* origin) { if (!m_state->getBoolean(PageRuntimeAgentState::reportExecutionContextCreation)) return; ASSERT(m_frontend); String frameId = m_pageAgent->frameId(frame); notifyContextCreated(frameId, scriptState, origin, false); }
void PageRuntimeAgent::didCreateIsolatedContext(Frame* frame, JSC::ExecState* scriptState, SecurityOrigin* origin) { if (!m_enabled) return; ASSERT(m_frontendDispatcher); String frameId = m_pageAgent->frameId(frame); notifyContextCreated(frameId, scriptState, origin, false); }
void PageRuntimeAgent::reportExecutionContextCreation() { Vector<std::pair<JSC::ExecState*, SecurityOrigin*>> isolatedContexts; for (Frame* frame = &m_inspectedPage->mainFrame(); frame; frame = frame->tree().traverseNext()) { if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) continue; String frameId = m_pageAgent->frameId(frame); JSC::ExecState* scriptState = mainWorldExecState(frame); notifyContextCreated(frameId, scriptState, 0, true); frame->script().collectIsolatedContexts(isolatedContexts); if (isolatedContexts.isEmpty()) continue; for (size_t i = 0; i< isolatedContexts.size(); i++) notifyContextCreated(frameId, isolatedContexts[i].first, isolatedContexts[i].second, false); isolatedContexts.clear(); } }
void PageRuntimeAgent::didClearWindowObject(Frame* frame) { if (!m_state->getBoolean(PageRuntimeAgentState::reportExecutionContextCreation)) return; ASSERT(m_frontend); String frameId = m_pageAgent->frameId(frame); ScriptState* scriptState = mainWorldScriptState(frame); notifyContextCreated(frameId, scriptState, 0, true); }
void PageRuntimeAgent::didCreateMainWorldContext(Frame* frame) { m_mainWorldContextCreated = true; if (!m_enabled) return; ASSERT(m_frontendDispatcher); String frameId = m_pageAgent->frameId(frame); JSC::ExecState* scriptState = mainWorldExecState(frame); notifyContextCreated(frameId, scriptState, 0, true); }
void PageRuntimeAgent::didCreateMainWorldContext(Frame& frame) { m_mainWorldContextCreated = true; if (!enabled()) return; String frameId = m_pageAgent->frameId(&frame); JSC::ExecState* scriptState = mainWorldExecState(&frame); notifyContextCreated(frameId, scriptState, nullptr, true); }
void PageRuntimeAgent::setReportExecutionContextCreation(ErrorString*, bool enable) { m_state->setBoolean(PageRuntimeAgentState::reportExecutionContextCreation, enable); if (!enable) return; Vector<std::pair<ScriptState*, SecurityOrigin*> > isolatedContexts; for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript)) continue; String frameId = m_pageAgent->frameId(frame); ScriptState* scriptState = mainWorldScriptState(frame); notifyContextCreated(frameId, scriptState, 0, true); frame->script()->collectIsolatedContexts(isolatedContexts); if (isolatedContexts.isEmpty()) continue; for (size_t i = 0; i< isolatedContexts.size(); i++) notifyContextCreated(frameId, isolatedContexts[i].first, isolatedContexts[i].second, false); isolatedContexts.clear(); } }
void PageRuntimeAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world) { if (world != mainThreadNormalWorld()) return; m_mainWorldContextCreated = true; if (!m_enabled) return; ASSERT(m_frontend); String frameId = m_pageAgent->frameId(frame); ScriptState* scriptState = mainWorldScriptState(frame); notifyContextCreated(frameId, scriptState, 0, true); }