Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1134)

Unified Diff: Source/core/workers/WorkerThreadStartupData.h

Issue 1041053005: Oilpan: fix WorkerThreadStartupData finalization handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comment clarifying use of CrossThreadPersistent<> Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/workers/WorkerThread.cpp ('k') | Source/core/workers/WorkerThreadStartupData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThreadStartupData.h
diff --git a/Source/core/workers/WorkerThreadStartupData.h b/Source/core/workers/WorkerThreadStartupData.h
index 5506bc110b43f575a4e2c42b883f0458f4c11723..36c5d22f7ee769559a4f1d730a32948d70dbaa37 100644
--- a/Source/core/workers/WorkerThreadStartupData.h
+++ b/Source/core/workers/WorkerThreadStartupData.h
@@ -45,13 +45,13 @@ namespace blink {
class WorkerClients;
-class CORE_EXPORT WorkerThreadStartupData final : public NoBaseWillBeGarbageCollectedFinalized<WorkerThreadStartupData> {
+class CORE_EXPORT WorkerThreadStartupData final {
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WorkerThreadStartupData);
+ WTF_MAKE_FAST_ALLOCATED(WorkerThreadStartupData);
public:
- static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, PassOwnPtr<Vector<char>> cachedMetaData, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients, V8CacheOptions v8CacheOptions = V8CacheOptionsDefault)
+ static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, PassOwnPtr<Vector<char>> cachedMetaData, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients, V8CacheOptions v8CacheOptions = V8CacheOptionsDefault)
{
- return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, cachedMetaData, startMode, contentSecurityPolicy, contentSecurityPolicyType, starterOrigin, workerClients, v8CacheOptions));
+ return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, cachedMetaData, startMode, contentSecurityPolicy, contentSecurityPolicyType, starterOrigin, workerClients, v8CacheOptions));
}
~WorkerThreadStartupData();
@@ -78,11 +78,17 @@ public:
// See SecurityOrigin::transferPrivilegesFrom() for details on what
// privileges are transferred.
const SecurityOrigin* m_starterOrigin;
- OwnPtrWillBeMember<WorkerClients> m_workerClients;
- V8CacheOptions m_v8CacheOptions;
+ // This object is created and initialized on the thread creating
+ // a new worker context, but ownership of it and this WorkerThreadStartupData
+ // structure is passed along to the new worker thread, where it is finalized.
+ //
+ // Hence, CrossThreadPersistent<> is required to allow finalization
+ // to happen on a thread different than the thread creating the
+ // persistent reference.
+ OwnPtrWillBeCrossThreadPersistent<WorkerClients> m_workerClients;
- DECLARE_TRACE();
+ V8CacheOptions m_v8CacheOptions;
private:
WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, PassOwnPtr<Vector<char>> cachedMetaData, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClients>, V8CacheOptions);
« no previous file with comments | « Source/core/workers/WorkerThread.cpp ('k') | Source/core/workers/WorkerThreadStartupData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698