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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerThreadStartupData.cpp

Issue 2171563002: Add WorkerSettings to expose certain flag values in WorkerGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 4 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 unified diff | Download patch
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 18 matching lines...) Expand all
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698