Changeset 121742 in webkit


Ignore:
Timestamp:
Jul 3, 2012 1:28:44 AM (12 years ago)
Author:
charles.wei@torchmobile.com.cn
Message:

IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
https://bugs.webkit.org/show_bug.cgi?id=88338

Reviewed by David Levin.

Source/WebCore:

If the indexedDB runs in main thread it can access the GroupSettings via the document;
otherwise, we need to pass the page GroupSettings to the worker thread so that accessible
to the indexedDB running in WorkerContext.

  • Modules/indexeddb/IDBFactory.cpp:

(WebCore::IDBFactory::open):

  • workers/DedicatedWorkerThread.cpp:

(WebCore::DedicatedWorkerThread::create):
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):

  • workers/DedicatedWorkerThread.h:

(DedicatedWorkerThread):

  • workers/DefaultSharedWorkerRepository.cpp:

(SharedWorkerProxy):
(WebCore::SharedWorkerProxy::groupSettings):
(WebCore):
(WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):

  • workers/SharedWorkerThread.cpp:

(WebCore::SharedWorkerThread::create):
(WebCore::SharedWorkerThread::SharedWorkerThread):

  • workers/SharedWorkerThread.h:

(SharedWorkerThread):

  • workers/WorkerMessagingProxy.cpp:

(WebCore::WorkerMessagingProxy::startWorkerContext):

  • workers/WorkerThread.cpp:

(WebCore::WorkerThreadStartupData::create):
(WorkerThreadStartupData):
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::groupSettings):
(WebCore):

  • workers/WorkerThread.h:

(WorkerThread):

Source/WebKit/chromium:

  • src/WebSharedWorkerImpl.cpp:

(WebKit::WebSharedWorkerImpl::startWorkerContext):

  • src/WebWorkerClientImpl.cpp:

(WebKit::WebWorkerClientImpl::startWorkerContext):

Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121740 r121742  
     12012-07-03  Charles Wei  <charles.wei@torchmobile.com.cn>
     2
     3        IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
     4        https://bugs.webkit.org/show_bug.cgi?id=88338
     5
     6        Reviewed by David Levin.
     7
     8        If the indexedDB runs in main thread it can access the GroupSettings via the document;
     9        otherwise, we need to pass the page GroupSettings to the worker thread so that accessible
     10        to the indexedDB running in WorkerContext.
     11
     12        * Modules/indexeddb/IDBFactory.cpp:
     13        (WebCore::IDBFactory::open):
     14        * workers/DedicatedWorkerThread.cpp:
     15        (WebCore::DedicatedWorkerThread::create):
     16        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
     17        * workers/DedicatedWorkerThread.h:
     18        (DedicatedWorkerThread):
     19        * workers/DefaultSharedWorkerRepository.cpp:
     20        (SharedWorkerProxy):
     21        (WebCore::SharedWorkerProxy::groupSettings):
     22        (WebCore):
     23        (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
     24        * workers/SharedWorkerThread.cpp:
     25        (WebCore::SharedWorkerThread::create):
     26        (WebCore::SharedWorkerThread::SharedWorkerThread):
     27        * workers/SharedWorkerThread.h:
     28        (SharedWorkerThread):
     29        * workers/WorkerMessagingProxy.cpp:
     30        (WebCore::WorkerMessagingProxy::startWorkerContext):
     31        * workers/WorkerThread.cpp:
     32        (WebCore::WorkerThreadStartupData::create):
     33        (WorkerThreadStartupData):
     34        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
     35        (WebCore::WorkerThread::WorkerThread):
     36        (WebCore::WorkerThread::groupSettings):
     37        (WebCore):
     38        * workers/WorkerThread.h:
     39        (WorkerThread):
     40
    1412012-07-03  Balazs Kelemen  <kbalazs@webkit.org>
    242
  • trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp

    r121417 r121742  
    9595        Frame* frame = document->frame();
    9696        RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0);
    97         m_backend->open(name, request.get(), context->securityOrigin(), frame, String());
     97        m_backend->open(name, request.get(), context->securityOrigin(), frame, document->page()->group().groupSettings()->indexedDBDatabasePath());
    9898        return request;
    9999    }
    100100#if ENABLE(WORKERS)
    101101    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0);
    102     m_backend->openFromWorker(name, request.get(), context->securityOrigin(), static_cast<WorkerContext*>(context), String());
     102    WorkerContext* workerContext = static_cast<WorkerContext*>(context);
     103    GroupSettings* groupSettings = workerContext->thread()->groupSettings();
     104    m_backend->openFromWorker(name, request.get(), context->securityOrigin(), workerContext, groupSettings ? groupSettings->indexedDBDatabasePath() : String());
    103105    return request;
    104106#else
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp

    r121417 r121742  
    4040namespace WebCore {
    4141
    42 PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     42PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    4343{
    44     return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
     44    return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
    4545}
    4646
    47 DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    48     : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
     47DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     48    : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
    4949    , m_workerObjectProxy(workerObjectProxy)
    5050{
  • trunk/Source/WebCore/workers/DedicatedWorkerThread.h

    r121417 r121742  
    4242    class DedicatedWorkerThread : public WorkerThread {
    4343    public:
    44         static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
     44        static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    4545        WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
    4646        ~DedicatedWorkerThread();
     
    5151
    5252    private:
    53         DedicatedWorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
     53        DedicatedWorkerThread(const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    5454
    5555        WorkerObjectProxy& m_workerObjectProxy;
  • trunk/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp

    r121417 r121742  
    4343#include "MessagePort.h"
    4444#include "NotImplemented.h"
     45#include "PageGroup.h"
    4546#include "PlatformString.h"
    4647#include "ScriptCallStack.h"
     
    9899    void documentDetached(Document*);
    99100
     101    GroupSettings* groupSettings() const; // Page GroupSettings used by worker thread.
     102
    100103private:
    101104    SharedWorkerProxy(const String& name, const KURL&, PassRefPtr<SecurityOrigin>);
     
    161164}
    162165
     166GroupSettings* SharedWorkerProxy::groupSettings() const
     167{
     168    if (isClosing())
     169        return 0;
     170    ASSERT(m_workerDocuments.size());
     171    // Just pick the first active document, and use the groupsettings of that page.
     172    Document* document = *(m_workerDocuments.begin());
     173    if (document->page())
     174        return document->page()->group().groupSettings();
     175
     176    return 0;
     177}
     178
    163179static void postExceptionTask(ScriptExecutionContext* context, const String& errorMessage, int lineNumber, const String& sourceURL)
    164180{
     
    344360    // Another loader may have already started up a thread for this proxy - if so, just send a connect to the pre-existing thread.
    345361    if (!proxy.thread()) {
    346         RefPtr<SharedWorkerThread> thread = SharedWorkerThread::create(proxy.name(), proxy.url(), userAgent, workerScript, proxy, proxy, DontPauseWorkerContextOnStart, contentSecurityPolicy, contentSecurityPolicyType);
     362        RefPtr<SharedWorkerThread> thread = SharedWorkerThread::create(proxy.name(), proxy.url(), userAgent, proxy.groupSettings(), workerScript, proxy, proxy, DontPauseWorkerContextOnStart, contentSecurityPolicy, contentSecurityPolicyType);
    347363        proxy.setThread(thread);
    348364        thread->start();
  • trunk/Source/WebCore/workers/SharedWorkerThread.cpp

    r121417 r121742  
    3939namespace WebCore {
    4040
    41 PassRefPtr<SharedWorkerThread> SharedWorkerThread::create(const String& name, const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     41PassRefPtr<SharedWorkerThread> SharedWorkerThread::create(const String& name, const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    4242{
    43     return adoptRef(new SharedWorkerThread(name, scriptURL, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
     43    return adoptRef(new SharedWorkerThread(name, scriptURL, userAgent, settings, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
    4444}
    4545
    46 SharedWorkerThread::SharedWorkerThread(const String& name, const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    47     : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
     46SharedWorkerThread::SharedWorkerThread(const String& name, const KURL& url, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     47    : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
    4848    , m_name(name.isolatedCopy())
    4949{
  • trunk/Source/WebCore/workers/SharedWorkerThread.h

    r121417 r121742  
    4040    class SharedWorkerThread : public WorkerThread {
    4141    public:
    42         static PassRefPtr<SharedWorkerThread> create(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
     42        static PassRefPtr<SharedWorkerThread> create(const String& name, const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    4343        ~SharedWorkerThread();
    4444
     
    4747
    4848    private:
    49         SharedWorkerThread(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
     49        SharedWorkerThread(const String& name, const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    5050
    5151        String m_name;
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r121417 r121742  
    4343#include "MessageEvent.h"
    4444#include "NotImplemented.h"
     45#include "PageGroup.h"
    4546#include "ScriptCallStack.h"
    4647#include "ScriptExecutionContext.h"
     
    273274void WorkerMessagingProxy::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
    274275{
    275     RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode,
     276    // FIXME: This need to be revisited when we support nested worker one day
     277    ASSERT(m_scriptExecutionContext->isDocument());
     278    Document* document = static_cast<Document*>(m_scriptExecutionContext.get());
     279    GroupSettings* settings = 0;
     280    if (document->page())
     281        settings = document->page()->group().groupSettings();
     282    RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, settings, sourceCode, *this, *this, startMode,
    276283                                                                         m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeader(),
    277284                                                                         m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeaderType());
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r121417 r121742  
    7272    WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
    7373public:
    74     static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    75     {
    76         return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType));
     74    static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     75    {
     76        return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType));
    7777    }
    7878
    7979    KURL m_scriptURL;
    8080    String m_userAgent;
     81    OwnPtr<GroupSettings> m_groupSettings;
    8182    String m_sourceCode;
    8283    WorkerThreadStartMode m_startMode;
     
    8485    ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType;
    8586private:
    86     WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType);
     87    WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType);
    8788};
    8889
    89 WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     90WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
    9091    : m_scriptURL(scriptURL.copy())
    9192    , m_userAgent(userAgent.isolatedCopy())
     
    9596    , m_contentSecurityPolicyType(contentSecurityPolicyType)
    9697{
    97 }
    98 
    99 WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
     98    if (!settings)
     99        return;
     100
     101    m_groupSettings = GroupSettings::create();
     102    m_groupSettings->setLocalStorageQuotaBytes(settings->localStorageQuotaBytes());
     103    m_groupSettings->setIndexedDBQuotaBytes(settings->indexedDBQuotaBytes());
     104    m_groupSettings->setIndexedDBDatabasePath(settings->indexedDBDatabasePath().isolatedCopy());
     105}
     106
     107WorkerThread::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)
    100108    : m_threadID(0)
    101109    , m_workerLoaderProxy(workerLoaderProxy)
    102110    , m_workerReportingProxy(workerReportingProxy)
    103     , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
     111    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
    104112#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    105113    , m_notificationClient(0)
     
    186194}
    187195
     196GroupSettings* WorkerThread::groupSettings()
     197{
     198    return m_startupData->m_groupSettings.get();
     199}
     200
    188201class WorkerThreadShutdownFinishTask : public ScriptExecutionContext::Task {
    189202public:
  • trunk/Source/WebCore/workers/WorkerThread.h

    r121417 r121742  
    3131
    3232#include "ContentSecurityPolicy.h"
     33#include "GroupSettings.h"
    3334#include "WorkerRunLoop.h"
    3435#include <wtf/Forward.h>
     
    6263        // Number of active worker threads.
    6364        static unsigned workerThreadCount();
     65        GroupSettings* groupSettings();
    6466
    6567#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     
    6971
    7072    protected:
    71         WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
     73        WorkerThread(const KURL&, const String& userAgent, const GroupSettings*,  const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    7274
    7375        // Factory method for creating a new worker context for the thread.
  • trunk/Source/WebKit/chromium/ChangeLog

    r121721 r121742  
     12012-07-03  Charles Wei  <charles.wei@torchmobile.com.cn>
     2
     3        IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath
     4        https://bugs.webkit.org/show_bug.cgi?id=88338
     5
     6        Reviewed by David Levin.
     7
     8        * src/WebSharedWorkerImpl.cpp:
     9        (WebKit::WebSharedWorkerImpl::startWorkerContext):
     10        * src/WebWorkerClientImpl.cpp:
     11        (WebKit::WebWorkerClientImpl::startWorkerContext):
     12
    1132012-07-02  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp

    r121417 r121742  
    3535#include "DatabaseTask.h"
    3636#include "Document.h"
     37#include "GroupSettings.h"
    3738#include "KURL.h"
    3839#include "MessageEvent.h"
    3940#include "MessagePortChannel.h"
     41#include "Page.h"
     42#include "PageGroup.h"
    4043#include "PlatformMessagePortChannel.h"
    4144#include "SecurityOrigin.h"
     
    367370    initializeLoader(url);
    368371    WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerContextOnStart : DontPauseWorkerContextOnStart;
    369     setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicy,
     372    ASSERT(m_loadingDocument->isDocument());
     373    Document* document = static_cast<Document*>(m_loadingDocument.get());
     374    GroupSettings* settings = 0;
     375    if (document->page())
     376        settings = document->page()->group().groupSettings();
     377    setWorkerThread(SharedWorkerThread::create(name, url, userAgent, settings,
     378                                               sourceCode, *this, *this, startMode, contentSecurityPolicy,
    370379                                               static_cast<WebCore::ContentSecurityPolicy::HeaderType>(policyType)));
    371380
  • trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp

    r121417 r121742  
    4040#include "Frame.h"
    4141#include "FrameLoaderClient.h"
     42#include "GroupSettings.h"
    4243#include "InspectorInstrumentation.h"
    4344#include "MessageEvent.h"
    4445#include "MessagePort.h"
    4546#include "MessagePortChannel.h"
     47#include "Page.h"
     48#include "PageGroup.h"
    4649#include "ScriptCallStack.h"
    4750#include "ScriptExecutionContext.h"
     
    8790void WebWorkerClientImpl::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
    8891{
    89     RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode,
     92    ASSERT(m_scriptExecutionContext->isDocument());
     93    Document* document = static_cast<Document*>(m_scriptExecutionContext.get());
     94    GroupSettings* settings = 0;
     95    if (document->page())
     96        settings = document->page()->group().groupSettings();
     97    RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, settings, sourceCode, *this, *this, startMode,
    9098                                                                         m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeader(),
    9199                                                                         m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeaderType());
Note: See TracChangeset for help on using the changeset viewer.