@@ -81,28 +81,18 @@ GlobalObjectInspectorController::GlobalObjectInspectorController(GlobalObject& g
81
81
, m_frontendRouter(FrontendRouter::create())
82
82
, m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
83
83
, m_globalObject(globalObject)
84
+ , m_agentContext({ *this , *m_injectedScriptManager, m_frontendRouter.get (), m_backendDispatcher.get () })
85
+ , m_jsAgentContext(m_agentContext, m_globalObject)
86
+
84
87
{
85
- AgentContext baseContext = {
86
- *this ,
87
- *m_injectedScriptManager,
88
- m_frontendRouter.get (),
89
- m_backendDispatcher.get ()
90
- };
91
-
92
- JSAgentContext context = {
93
- baseContext,
94
- globalObject
95
- };
96
-
97
-
98
88
globalObject.putDirectNativeFunction (globalObject.vm (), &globalObject, Identifier::fromString (&globalObject.vm (), WTF::ASCIILiteral (" __registerDomainDispatcher" )), 0 , ®isterDispatcher, NoIntrinsic, DontEnum);
99
89
100
- auto inspectorAgent = std::make_unique<InspectorAgent>(context );
101
- auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(context );
102
- auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(context );
103
- auto debuggerAgent = std::make_unique<GlobalObjectDebuggerAgent>(context , consoleAgent.get ());
104
- auto pageAgent = std::make_unique<InspectorPageAgent>(context );
105
- auto timelineAgent = std::make_unique<InspectorTimelineAgent>(context );
90
+ auto inspectorAgent = std::make_unique<InspectorAgent>(m_jsAgentContext );
91
+ auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(m_jsAgentContext );
92
+ auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(m_jsAgentContext );
93
+ auto debuggerAgent = std::make_unique<GlobalObjectDebuggerAgent>(m_jsAgentContext , consoleAgent.get ());
94
+ auto pageAgent = std::make_unique<InspectorPageAgent>(m_jsAgentContext );
95
+ auto timelineAgent = std::make_unique<InspectorTimelineAgent>(m_jsAgentContext );
106
96
107
97
m_inspectorAgent = inspectorAgent.get ();
108
98
m_debuggerAgent = debuggerAgent.get ();
@@ -124,7 +114,7 @@ GlobalObjectInspectorController::~GlobalObjectInspectorController() {
124
114
}
125
115
126
116
void GlobalObjectInspectorController::registerDomainDispatcher (WTF::String domainIdentifier, JSC::JSCell* constructorFunction) {
127
- std::unique_ptr<DomainInspectorAgent> domainInspectorAgent = std::make_unique<DomainInspectorAgent>(m_globalObject, domainIdentifier, constructorFunction);
117
+ std::unique_ptr<DomainInspectorAgent> domainInspectorAgent = std::make_unique<DomainInspectorAgent>(domainIdentifier, constructorFunction, this -> m_jsAgentContext );
128
118
129
119
appendExtraAgent (WTF::move (domainInspectorAgent));
130
120
}
0 commit comments