Changeset 122463 in webkit
- Timestamp:
- Jul 12, 2012 8:38:14 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122458 r122463 1 2012-07-12 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: ASSERT hit calling open from callback in Worker 4 https://bugs.webkit.org/show_bug.cgi?id=90832 5 6 Reviewed by Kentaro Hara. 7 8 Call IDBFactory.open() twice from a worker - once from the initial worker 9 script evaluation, and once in a callback after the worker thread data 10 has been purged. 11 12 * storage/indexeddb/open-twice-workers-expected.txt: Added. 13 * storage/indexeddb/open-twice-workers.html: Added. 14 * storage/indexeddb/resources/open-twice.js: Added. 15 (test): 16 (openAnother): 17 1 18 2012-07-12 Kristóf Kosztyó <kkristof@inf.u-szeged.hu> 2 19 -
trunk/Source/WebCore/ChangeLog
r122462 r122463 1 2012-07-12 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: ASSERT hit calling open from callback in Worker 4 https://bugs.webkit.org/show_bug.cgi?id=90832 5 6 Reviewed by Kentaro Hara. 7 8 GroupSettings are used to provide the backing store path in some 9 ports. Accessing those settings from a Worker was added, but the 10 access referenced thread startup data that is cleared before the 11 run loop, so an IDBFactory.open() call executed asynchronously 12 would dereference a null pointer. Plumb the settings startup 13 data into the context itself, like all of the other properties. 14 15 Test: storage/indexeddb/open-twice-workers.html 16 17 * Modules/indexeddb/IDBFactory.cpp: 18 (WebCore::IDBFactory::open): 19 * workers/DedicatedWorkerContext.cpp: 20 (WebCore::DedicatedWorkerContext::DedicatedWorkerContext): 21 * workers/DedicatedWorkerContext.h: 22 (WebCore::DedicatedWorkerContext::create): 23 (DedicatedWorkerContext): 24 * workers/DedicatedWorkerThread.cpp: 25 (WebCore::DedicatedWorkerThread::createWorkerContext): 26 * workers/DedicatedWorkerThread.h: 27 (DedicatedWorkerThread): 28 * workers/SharedWorkerContext.cpp: 29 (WebCore::SharedWorkerContext::SharedWorkerContext): 30 * workers/SharedWorkerContext.h: 31 (WebCore::SharedWorkerContext::create): 32 (SharedWorkerContext): 33 * workers/SharedWorkerThread.cpp: 34 (WebCore::SharedWorkerThread::createWorkerContext): 35 * workers/SharedWorkerThread.h: 36 (SharedWorkerThread): 37 * workers/WorkerContext.cpp: 38 (WebCore::WorkerContext::WorkerContext): 39 * workers/WorkerContext.h: 40 (WebCore::WorkerContext::groupSettings): 41 (WorkerContext): 42 * workers/WorkerThread.cpp: 43 (WebCore::WorkerThread::workerThread): 44 * workers/WorkerThread.h: 45 (WorkerThread): 46 1 47 2012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 48 -
trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
r121742 r122463 101 101 RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0); 102 102 WorkerContext* workerContext = static_cast<WorkerContext*>(context); 103 GroupSettings* groupSettings = workerContext->thread()->groupSettings();103 const GroupSettings* groupSettings = workerContext->groupSettings(); 104 104 m_backend->openFromWorker(name, request.get(), context->securityOrigin(), workerContext, groupSettings ? groupSettings->indexedDBDatabasePath() : String()); 105 105 return request; -
trunk/Source/WebCore/workers/DedicatedWorkerContext.cpp
r104329 r122463 42 42 namespace WebCore { 43 43 44 DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)45 : WorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType)44 DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 45 : WorkerContext(url, userAgent, settings, thread, contentSecurityPolicy, contentSecurityPolicyType) 46 46 { 47 47 } -
trunk/Source/WebCore/workers/DedicatedWorkerContext.h
r104329 r122463 45 45 public: 46 46 typedef WorkerContext Base; 47 static PassRefPtr<DedicatedWorkerContext> create(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)47 static PassRefPtr<DedicatedWorkerContext> create(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 48 48 { 49 return adoptRef(new DedicatedWorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType));49 return adoptRef(new DedicatedWorkerContext(url, userAgent, settings, thread, contentSecurityPolicy, contentSecurityPolicyType)); 50 50 } 51 51 … … 67 67 DedicatedWorkerThread* thread(); 68 68 private: 69 DedicatedWorkerContext(const KURL&, const String& userAgent, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);69 DedicatedWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); 70 70 }; 71 71 -
trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp
r121742 r122463 55 55 } 56 56 57 PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)57 PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 58 58 { 59 return DedicatedWorkerContext::create(url, userAgent, this, contentSecurityPolicy, contentSecurityPolicyType);59 return DedicatedWorkerContext::create(url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType); 60 60 } 61 61 -
trunk/Source/WebCore/workers/DedicatedWorkerThread.h
r121742 r122463 47 47 48 48 protected: 49 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);49 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); 50 50 virtual void runEventLoop(); 51 51 -
trunk/Source/WebCore/workers/SharedWorkerContext.cpp
r104803 r122463 51 51 } 52 52 53 SharedWorkerContext::SharedWorkerContext(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)54 : WorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType)53 SharedWorkerContext::SharedWorkerContext(const String& name, const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 54 : WorkerContext(url, userAgent, settings, thread, contentSecurityPolicy, contentSecurityPolicyType) 55 55 , m_name(name) 56 56 { -
trunk/Source/WebCore/workers/SharedWorkerContext.h
r104803 r122463 45 45 public: 46 46 typedef WorkerContext Base; 47 static PassRefPtr<SharedWorkerContext> create(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)47 static PassRefPtr<SharedWorkerContext> create(const String& name, const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 48 48 { 49 return adoptRef(new SharedWorkerContext(name, url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType));49 return adoptRef(new SharedWorkerContext(name, url, userAgent, settings, thread, contentSecurityPolicy, contentSecurityPolicyType)); 50 50 } 51 51 virtual ~SharedWorkerContext(); … … 62 62 SharedWorkerThread* thread(); 63 63 private: 64 SharedWorkerContext(const String& name, const KURL&, const String& , SharedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);64 SharedWorkerContext(const String& name, const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, SharedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); 65 65 66 66 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>); -
trunk/Source/WebCore/workers/SharedWorkerThread.cpp
r121742 r122463 54 54 } 55 55 56 PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)56 PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 57 57 { 58 return SharedWorkerContext::create(m_name, url, userAgent, this, contentSecurityPolicy, contentSecurityPolicyType);58 return SharedWorkerContext::create(m_name, url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType); 59 59 } 60 60 -
trunk/Source/WebCore/workers/SharedWorkerThread.h
r121742 r122463 44 44 45 45 protected: 46 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& , const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);46 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); 47 47 48 48 private: -
trunk/Source/WebCore/workers/WorkerContext.cpp
r111969 r122463 86 86 }; 87 87 88 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread, const String& policy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)88 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, WorkerThread* thread, const String& policy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) 89 89 : m_url(url) 90 90 , m_userAgent(userAgent) 91 , m_groupSettings(settings) 91 92 , m_script(adoptPtr(new WorkerScriptController(this))) 92 93 , m_thread(thread) -
trunk/Source/WebCore/workers/WorkerContext.h
r111969 r122463 34 34 #include "EventNames.h" 35 35 #include "EventTarget.h" 36 #include "GroupSettings.h" 36 37 #include "ScriptExecutionContext.h" 37 38 #include "WorkerEventQueue.h" … … 69 70 KURL completeURL(const String&) const; 70 71 72 const GroupSettings* groupSettings() { return m_groupSettings.get(); } 71 73 virtual String userAgent(const KURL&) const; 72 74 … … 138 140 139 141 protected: 140 WorkerContext(const KURL&, const String& , WorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);142 WorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, WorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); 141 143 142 144 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>); … … 161 163 KURL m_url; 162 164 String m_userAgent; 165 OwnPtr<GroupSettings> m_groupSettings; 163 166 164 167 mutable RefPtr<WorkerLocation> m_location; -
trunk/Source/WebCore/workers/WorkerThread.cpp
r121742 r122463 147 147 { 148 148 MutexLocker lock(m_threadCreationMutex); 149 m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_ contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType);149 m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_groupSettings.release(), m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType); 150 150 151 151 if (m_runLoop.terminated()) { … … 194 194 } 195 195 196 GroupSettings* WorkerThread::groupSettings()197 {198 return m_startupData->m_groupSettings.get();199 }200 201 196 class WorkerThreadShutdownFinishTask : public ScriptExecutionContext::Task { 202 197 public: -
trunk/Source/WebCore/workers/WorkerThread.h
r121742 r122463 63 63 // Number of active worker threads. 64 64 static unsigned workerThreadCount(); 65 GroupSettings* groupSettings();66 65 67 66 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) … … 74 73 75 74 // Factory method for creating a new worker context for the thread. 76 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType) = 0;75 virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType) = 0; 77 76 78 77 // Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
Note: See TracChangeset
for help on using the changeset viewer.