WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy)
    : m_threadID(0)
    , m_workerLoaderProxy(workerLoaderProxy)
    , m_workerReportingProxy(workerReportingProxy)
    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode))
{
    MutexLocker lock(threadCountMutex());
    m_threadCount++;
}
Esempio n. 2
0
WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode)
    : m_threadID(0)
    , m_workerLoaderProxy(workerLoaderProxy)
    , m_workerReportingProxy(workerReportingProxy)
    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode))
#if ENABLE(NOTIFICATIONS)
    , m_notificationPresenter(0)
#endif
{
    MutexLocker lock(threadCountMutex());
    m_threadCount++;
}
Esempio n. 3
0
WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin)
    : m_threadID(0)
    , m_workerLoaderProxy(workerLoaderProxy)
    , m_workerReportingProxy(workerReportingProxy)
    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin))
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    , m_notificationClient(0)
#endif
{
    MutexLocker lock(threadCountMutex());
    m_threadCount++;
}
WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy)
#endif
    : m_threadID(0)
    , m_workerLoaderProxy(workerLoaderProxy)
    , m_workerReportingProxy(workerReportingProxy)
#if OS(OLYMPIA)
    , m_startupData(WorkerThreadStartupData::create(scriptURL, groupName, userAgent, sourceCode))
#else
    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode))
#endif
{
    MutexLocker lock(threadCountMutex());
    m_threadCount++;
}
WorkerThread::~WorkerThread()
{
    MutexLocker lock(threadCountMutex());
    ASSERT(m_threadCount > 0);
    m_threadCount--;
}
unsigned WorkerThread::workerThreadCount()
{
    MutexLocker lock(threadCountMutex());
    return m_threadCount;
}