Chromium Code Reviews

Side by Side Diff: Source/core/workers/WorkerThreadStartupData.h

Issue 1100413004: workers: Move ownership of WebThread from WorkerThread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...)
36 #include "core/frame/csp/ContentSecurityPolicy.h" 36 #include "core/frame/csp/ContentSecurityPolicy.h"
37 #include "core/workers/WorkerClients.h" 37 #include "core/workers/WorkerClients.h"
38 #include "core/workers/WorkerThread.h" 38 #include "core/workers/WorkerThread.h"
39 #include "platform/network/ContentSecurityPolicyParsers.h" 39 #include "platform/network/ContentSecurityPolicyParsers.h"
40 #include "platform/weborigin/KURL.h" 40 #include "platform/weborigin/KURL.h"
41 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
42 #include "wtf/Noncopyable.h" 42 #include "wtf/Noncopyable.h"
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class WebThreadSupportingGC;
46 class WorkerClients; 47 class WorkerClients;
47 48
48 class CORE_EXPORT WorkerThreadStartupData final { 49 class CORE_EXPORT WorkerThreadStartupData final {
49 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); 50 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData);
50 WTF_MAKE_FAST_ALLOCATED(WorkerThreadStartupData); 51 WTF_MAKE_FAST_ALLOCATED(WorkerThreadStartupData);
51 public: 52 public:
52 static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, con st String& userAgent, const String& sourceCode, PassOwnPtr<Vector<char>> cachedM etaData, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, C ontentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients, V8CacheOptio ns v8CacheOptions = V8CacheOptionsDefault) 53 static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, con st String& userAgent, const String& sourceCode, PassOwnPtr<Vector<char>> cachedM etaData, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, C ontentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients, V8CacheOptio ns v8CacheOptions = V8CacheOptionsDefault)
53 { 54 {
54 return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, source Code, cachedMetaData, startMode, contentSecurityPolicy, contentSecurityPolicyTyp e, starterOrigin, workerClients, v8CacheOptions)); 55 return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, source Code, cachedMetaData, startMode, contentSecurityPolicy, contentSecurityPolicyTyp e, starterOrigin, workerClients, v8CacheOptions));
55 } 56 }
(...skipping 27 matching lines...)
83 // a new worker context, but ownership of it and this WorkerThreadStartupDat a 84 // a new worker context, but ownership of it and this WorkerThreadStartupDat a
84 // structure is passed along to the new worker thread, where it is finalized . 85 // structure is passed along to the new worker thread, where it is finalized .
85 // 86 //
86 // Hence, CrossThreadPersistent<> is required to allow finalization 87 // Hence, CrossThreadPersistent<> is required to allow finalization
87 // to happen on a thread different than the thread creating the 88 // to happen on a thread different than the thread creating the
88 // persistent reference. 89 // persistent reference.
89 OwnPtrWillBeCrossThreadPersistent<WorkerClients> m_workerClients; 90 OwnPtrWillBeCrossThreadPersistent<WorkerClients> m_workerClients;
90 91
91 V8CacheOptions m_v8CacheOptions; 92 V8CacheOptions m_v8CacheOptions;
92 93
94 WebThreadSupportingGC* m_thread;
95
93 private: 96 private:
94 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons t String& sourceCode, PassOwnPtr<Vector<char>> cachedMetaData, WorkerThreadStart Mode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType conte ntSecurityPolicyType, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClient s>, V8CacheOptions); 97 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons t String& sourceCode, PassOwnPtr<Vector<char>> cachedMetaData, WorkerThreadStart Mode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType conte ntSecurityPolicyType, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClient s>, V8CacheOptions);
95 }; 98 };
96 99
97 } // namespace blink 100 } // namespace blink
98 101
99 #endif // WorkerThreadStartupData_h 102 #endif // WorkerThreadStartupData_h
OLDNEW

Powered by Google App Engine