| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); | 47 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); |
| 48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 49 public: | 49 public: |
| 50 static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& sc
riptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMod
e startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderTyp
e contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWill
BeRawPtr<WorkerClients> workerClients) | 50 static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& sc
riptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMod
e startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderTyp
e contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWill
BeRawPtr<WorkerClients> workerClients) |
| 51 { | 51 { |
| 52 return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAge
nt, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, sta
rterOrigin, workerClients)); | 52 return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAge
nt, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, sta
rterOrigin, workerClients)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 ~WorkerThreadStartupData(); | 55 ~WorkerThreadStartupData(); |
| 56 | 56 |
| 57 // FIXME: public fields prefixed with m_? Lame? |
| 57 KURL m_scriptURL; | 58 KURL m_scriptURL; |
| 58 String m_userAgent; | 59 String m_userAgent; |
| 59 String m_sourceCode; | 60 String m_sourceCode; |
| 60 WorkerThreadStartMode m_startMode; | 61 WorkerThreadStartMode m_startMode; |
| 61 String m_contentSecurityPolicy; | 62 String m_contentSecurityPolicy; |
| 62 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType; | 63 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType; |
| 63 | 64 |
| 64 // The SecurityOrigin of the Document creating a Worker may have | 65 // The SecurityOrigin of the Document creating a Worker may have |
| 65 // been configured with extra policy privileges when it was created | 66 // been configured with extra policy privileges when it was created |
| 66 // (e.g., enforce path-based file:// origins.) | 67 // (e.g., enforce path-based file:// origins.) |
| 67 // To ensure that these are transferred to the origin of a new worker | 68 // To ensure that these are transferred to the origin of a new worker |
| 68 // global scope, supply the Document's SecurityOrigin as the | 69 // global scope, supply the Document's SecurityOrigin as the |
| 69 // 'starter origin'. | 70 // 'starter origin'. |
| 70 // | 71 // |
| 71 // Ownership of this optional starter origin remain with the caller, | 72 // Ownership of this optional starter origin remain with the caller, |
| 72 // and is assumed to stay alive until the new Worker thread has been | 73 // and is assumed to stay alive until the new Worker thread has been |
| 73 // initialized. | 74 // initialized. |
| 74 // | 75 // |
| 75 // See SecurityOrigin::transferPrivilegesFrom() for details on what | 76 // See SecurityOrigin::transferPrivilegesFrom() for details on what |
| 76 // privileges are transferred. | 77 // privileges are transferred. |
| 77 const SecurityOrigin* m_starterOrigin; | 78 const SecurityOrigin* m_starterOrigin; |
| 78 OwnPtrWillBeMember<WorkerClients> m_workerClients; | 79 OwnPtrWillBeMember<WorkerClients> m_workerClients; |
| 80 int m_compositorId; |
| 79 | 81 |
| 80 void trace(Visitor*); | 82 void trace(Visitor*); |
| 81 | 83 |
| 82 private: | 84 private: |
| 83 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons
t String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy
, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigi
n*, PassOwnPtrWillBeRawPtr<WorkerClients>); | 85 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons
t String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy
, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigi
n*, PassOwnPtrWillBeRawPtr<WorkerClients>); |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 } // namespace blink | 88 } // namespace blink |
| 87 | 89 |
| 88 #endif // WorkerThreadStartupData_h | 90 #endif // WorkerThreadStartupData_h |
| OLD | NEW |