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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 2086143006: Implement Referrer-Policy header for workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix shared worker path Created 4 years, 5 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 namespace blink { 68 namespace blink {
69 69
70 ServiceWorkerGlobalScope* ServiceWorkerGlobalScope::create(ServiceWorkerThread* thread, std::unique_ptr<WorkerThreadStartupData> startupData) 70 ServiceWorkerGlobalScope* ServiceWorkerGlobalScope::create(ServiceWorkerThread* thread, std::unique_ptr<WorkerThreadStartupData> startupData)
71 { 71 {
72 // Note: startupData is finalized on return. After the relevant parts has be en 72 // Note: startupData is finalized on return. After the relevant parts has be en
73 // passed along to the created 'context'. 73 // passed along to the created 'context'.
74 ServiceWorkerGlobalScope* context = new ServiceWorkerGlobalScope(startupData ->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(), std::move(startupData->m_starterOriginPrivilegeData), startupData->m_workerClien ts.release()); 74 ServiceWorkerGlobalScope* context = new ServiceWorkerGlobalScope(startupData ->m_scriptURL, startupData->m_userAgent, thread, monotonicallyIncreasingTime(), std::move(startupData->m_starterOriginPrivilegeData), startupData->m_workerClien ts.release());
75 75
76 context->setV8CacheOptions(startupData->m_v8CacheOptions); 76 context->setV8CacheOptions(startupData->m_v8CacheOptions);
77 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders); 77 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders);
78 if (!startupData->m_referrerPolicy.isNull())
79 context->parseAndSetReferrerPolicy(startupData->m_referrerPolicy);
78 context->setAddressSpace(startupData->m_addressSpace); 80 context->setAddressSpace(startupData->m_addressSpace);
79 OriginTrialContext::addTokens(context, startupData->m_originTrialTokens.get( )); 81 OriginTrialContext::addTokens(context, startupData->m_originTrialTokens.get( ));
80 82
81 return context; 83 return context;
82 } 84 }
83 85
84 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, std::unique_ptr<Sec urityOrigin::PrivilegeData> starterOriginPrivilegeData, WorkerClients* workerCli ents) 86 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, std::unique_ptr<Sec urityOrigin::PrivilegeData> starterOriginPrivilegeData, WorkerClients* workerCli ents)
85 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, std::move(starterOri ginPrivilegeData), workerClients) 87 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, std::move(starterOri ginPrivilegeData), workerClients)
86 , m_didEvaluateScript(false) 88 , m_didEvaluateScript(false)
87 , m_hadErrorInTopLevelEventHandler(false) 89 , m_hadErrorInTopLevelEventHandler(false)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 220 }
219 221
220 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize) 222 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize)
221 { 223 {
222 ++m_scriptCount; 224 ++m_scriptCount;
223 m_scriptTotalSize += scriptSize; 225 m_scriptTotalSize += scriptSize;
224 m_scriptCachedMetadataTotalSize += cachedMetadataSize; 226 m_scriptCachedMetadataTotalSize += cachedMetadataSize;
225 } 227 }
226 228
227 } // namespace blink 229 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698