Beispiel #1
0
void InspectorWorkerAgent::connectToWorker(ErrorString* error, int workerId)
{
    WorkerFrontendChannel* channel = m_idToChannel.get(workerId);
    if (channel)
        channel->connectToWorkerContext();
    else
        *error = "Worker is gone";
}
Beispiel #2
0
void InspectorWorkerAgent::createWorkerFrontendChannel(WorkerContextProxy* workerContextProxy, const String& url)
{
    WorkerFrontendChannel* channel = new WorkerFrontendChannel(m_inspectorFrontend, workerContextProxy);
    m_idToChannel.set(channel->id(), channel);

    ASSERT(m_inspectorFrontend);
    bool autoconnectToWorkers = m_state->getBoolean(WorkerAgentState::autoconnectToWorkers);
    if (autoconnectToWorkers)
        channel->connectToWorkerContext();
    m_inspectorFrontend->worker()->workerCreated(channel->id(), url, autoconnectToWorkers);
}