| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/workers/WorkerThreadStartupData.h" | 31 #include "core/workers/WorkerThreadStartupData.h" |
| 32 | 32 |
| 33 #include "platform/network/ContentSecurityPolicyParsers.h" | 33 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 34 #include "wtf/PtrUtil.h" | 34 #include "wtf/PtrUtil.h" |
| 35 #include <memory> | 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const St
ring& userAgent, const String& sourceCode, std::unique_ptr<Vector<char>> cachedM
etaData, WorkerThreadStartMode startMode, const Vector<CSPHeaderAndType>* conten
tSecurityPolicyHeaders, const String& referrerPolicy, const SecurityOrigin* star
terOrigin, WorkerClients* workerClients, WebAddressSpace addressSpace, const Vec
tor<String>* originTrialTokens, V8CacheOptions v8CacheOptions) | 39 WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const St
ring& userAgent, const String& sourceCode, std::unique_ptr<Vector<char>> cachedM
etaData, WorkerThreadStartMode startMode, const Vector<CSPHeaderAndType>* conten
tSecurityPolicyHeaders, const String& referrerPolicy, const SecurityOrigin* star
terOrigin, WorkerClients* workerClients, WebAddressSpace addressSpace, const Vec
tor<String>* originTrialTokens, std::unique_ptr<WorkerSettings> workerSettings,
V8CacheOptions v8CacheOptions) |
| 40 : m_scriptURL(scriptURL.copy()) | 40 : m_scriptURL(scriptURL.copy()) |
| 41 , m_userAgent(userAgent.isolatedCopy()) | 41 , m_userAgent(userAgent.isolatedCopy()) |
| 42 , m_sourceCode(sourceCode.isolatedCopy()) | 42 , m_sourceCode(sourceCode.isolatedCopy()) |
| 43 , m_cachedMetaData(std::move(cachedMetaData)) | 43 , m_cachedMetaData(std::move(cachedMetaData)) |
| 44 , m_startMode(startMode) | 44 , m_startMode(startMode) |
| 45 , m_referrerPolicy(referrerPolicy.isolatedCopy()) | 45 , m_referrerPolicy(referrerPolicy.isolatedCopy()) |
| 46 , m_starterOriginPrivilegeData(starterOrigin ? starterOrigin->createPrivileg
eData() : nullptr) | 46 , m_starterOriginPrivilegeData(starterOrigin ? starterOrigin->createPrivileg
eData() : nullptr) |
| 47 , m_workerClients(workerClients) | 47 , m_workerClients(workerClients) |
| 48 , m_addressSpace(addressSpace) | 48 , m_addressSpace(addressSpace) |
| 49 , m_workerSettings(std::move(workerSettings)) |
| 49 , m_v8CacheOptions(v8CacheOptions) | 50 , m_v8CacheOptions(v8CacheOptions) |
| 50 { | 51 { |
| 51 m_contentSecurityPolicyHeaders = wrapUnique(new Vector<CSPHeaderAndType>()); | 52 m_contentSecurityPolicyHeaders = wrapUnique(new Vector<CSPHeaderAndType>()); |
| 52 if (contentSecurityPolicyHeaders) { | 53 if (contentSecurityPolicyHeaders) { |
| 53 for (const auto& header : *contentSecurityPolicyHeaders) { | 54 for (const auto& header : *contentSecurityPolicyHeaders) { |
| 54 CSPHeaderAndType copiedHeader(header.first.isolatedCopy(), header.se
cond); | 55 CSPHeaderAndType copiedHeader(header.first.isolatedCopy(), header.se
cond); |
| 55 m_contentSecurityPolicyHeaders->append(copiedHeader); | 56 m_contentSecurityPolicyHeaders->append(copiedHeader); |
| 56 } | 57 } |
| 57 } | 58 } |
| 58 | 59 |
| 59 m_originTrialTokens = std::unique_ptr<Vector<String>>(new Vector<String>()); | 60 m_originTrialTokens = std::unique_ptr<Vector<String>>(new Vector<String>()); |
| 60 if (originTrialTokens) { | 61 if (originTrialTokens) { |
| 61 for (const String& token : *originTrialTokens) | 62 for (const String& token : *originTrialTokens) |
| 62 m_originTrialTokens->append(token.isolatedCopy()); | 63 m_originTrialTokens->append(token.isolatedCopy()); |
| 63 } | 64 } |
| 64 } | 65 } |
| 65 | 66 |
| 66 WorkerThreadStartupData::~WorkerThreadStartupData() | 67 WorkerThreadStartupData::~WorkerThreadStartupData() |
| 67 { | 68 { |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace blink | 71 } // namespace blink |
| OLD | NEW |