Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 27 matching lines...) Expand all Loading... | |
| 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 WorkerClients; | 46 class WorkerClients; |
| 47 | 47 |
| 48 class CORE_EXPORT WorkerThreadStartupData final : public NoBaseWillBeGarbageColl ectedFinalized<WorkerThreadStartupData> { | 48 class CORE_EXPORT WorkerThreadStartupData final { |
| 49 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); | 49 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); |
| 50 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WorkerThreadStartupData); | 50 WTF_MAKE_FAST_ALLOCATED(WorkerThreadStartupData); |
| 51 public: | 51 public: |
| 52 static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& sc riptURL, const String& userAgent, const String& sourceCode, PassOwnPtr<Vector<ch ar>> cachedMetaData, WorkerThreadStartMode startMode, const String& contentSecur ityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const Secu rityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients, V8CacheOptions v8CacheOptions = V8CacheOptionsDefault) | 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 { | 53 { |
| 54 return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAge nt, sourceCode, cachedMetaData, startMode, contentSecurityPolicy, contentSecurit yPolicyType, starterOrigin, workerClients, v8CacheOptions)); | 54 return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, source Code, cachedMetaData, startMode, contentSecurityPolicy, contentSecurityPolicyTyp e, starterOrigin, workerClients, v8CacheOptions)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 ~WorkerThreadStartupData(); | 57 ~WorkerThreadStartupData(); |
| 58 | 58 |
| 59 KURL m_scriptURL; | 59 KURL m_scriptURL; |
| 60 String m_userAgent; | 60 String m_userAgent; |
| 61 String m_sourceCode; | 61 String m_sourceCode; |
| 62 OwnPtr<Vector<char>> m_cachedMetaData; | 62 OwnPtr<Vector<char>> m_cachedMetaData; |
| 63 WorkerThreadStartMode m_startMode; | 63 WorkerThreadStartMode m_startMode; |
| 64 String m_contentSecurityPolicy; | 64 String m_contentSecurityPolicy; |
| 65 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType; | 65 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType; |
| 66 | 66 |
| 67 // The SecurityOrigin of the Document creating a Worker may have | 67 // The SecurityOrigin of the Document creating a Worker may have |
| 68 // been configured with extra policy privileges when it was created | 68 // been configured with extra policy privileges when it was created |
| 69 // (e.g., enforce path-based file:// origins.) | 69 // (e.g., enforce path-based file:// origins.) |
| 70 // To ensure that these are transferred to the origin of a new worker | 70 // To ensure that these are transferred to the origin of a new worker |
| 71 // global scope, supply the Document's SecurityOrigin as the | 71 // global scope, supply the Document's SecurityOrigin as the |
| 72 // 'starter origin'. | 72 // 'starter origin'. |
| 73 // | 73 // |
| 74 // Ownership of this optional starter origin remain with the caller, | 74 // Ownership of this optional starter origin remain with the caller, |
| 75 // and is assumed to stay alive until the new Worker thread has been | 75 // and is assumed to stay alive until the new Worker thread has been |
| 76 // initialized. | 76 // initialized. |
| 77 // | 77 // |
| 78 // See SecurityOrigin::transferPrivilegesFrom() for details on what | 78 // See SecurityOrigin::transferPrivilegesFrom() for details on what |
| 79 // privileges are transferred. | 79 // privileges are transferred. |
| 80 const SecurityOrigin* m_starterOrigin; | 80 const SecurityOrigin* m_starterOrigin; |
| 81 OwnPtrWillBeMember<WorkerClients> m_workerClients; | 81 |
|
haraken
2015/03/31 23:29:33
Add a comment and mention that this needs to be a
sof
2015/04/01 08:05:10
Done, better be very clear about such matters.
| |
| 82 OwnPtrWillBeCrossThreadPersistent<WorkerClients> m_workerClients; | |
| 82 | 83 |
| 83 V8CacheOptions m_v8CacheOptions; | 84 V8CacheOptions m_v8CacheOptions; |
| 84 | 85 |
| 85 DECLARE_TRACE(); | |
| 86 | |
| 87 private: | 86 private: |
| 88 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); | 87 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); |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 } // namespace blink | 90 } // namespace blink |
| 92 | 91 |
| 93 #endif // WorkerThreadStartupData_h | 92 #endif // WorkerThreadStartupData_h |
| OLD | NEW |