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

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

Issue 1760523004: CORS-RFC1918: Teach Workers about address spaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 namespace blink { 66 namespace blink {
67 67
68 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat e(ServiceWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData) 68 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat e(ServiceWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData)
69 { 69 {
70 // Note: startupData is finalized on return. After the relevant parts has be en 70 // Note: startupData is finalized on return. After the relevant parts has be en
71 // passed along to the created 'context'. 71 // passed along to the created 'context'.
72 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t hread, monotonicallyIncreasingTime(), startupData->m_starterOriginPrivilegeData. release(), startupData->m_workerClients.release())); 72 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t hread, monotonicallyIncreasingTime(), startupData->m_starterOriginPrivilegeData. release(), startupData->m_workerClients.release()));
73 73
74 context->setV8CacheOptions(startupData->m_v8CacheOptions); 74 context->setV8CacheOptions(startupData->m_v8CacheOptions);
75 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders); 75 context->applyContentSecurityPolicyFromVector(*startupData->m_contentSecurit yPolicyHeaders);
76 context->setAddressSpace(startupData->m_addressSpace);
76 77
77 return context.release(); 78 return context.release();
78 } 79 }
79 80
80 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<Security Origin::PrivilegeData> starterOriginPrivilegeData, PassOwnPtrWillBeRawPtr<Worker Clients> workerClients) 81 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtr<Security Origin::PrivilegeData> starterOriginPrivilegeData, PassOwnPtrWillBeRawPtr<Worker Clients> workerClients)
81 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOriginPrivile geData, workerClients) 82 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOriginPrivile geData, workerClients)
82 , m_didEvaluateScript(false) 83 , m_didEvaluateScript(false)
83 , m_hadErrorInTopLevelEventHandler(false) 84 , m_hadErrorInTopLevelEventHandler(false)
84 , m_eventNestingLevel(0) 85 , m_eventNestingLevel(0)
85 , m_scriptCount(0) 86 , m_scriptCount(0)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 222 }
222 223
223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize) 224 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize)
224 { 225 {
225 ++m_scriptCount; 226 ++m_scriptCount;
226 m_scriptTotalSize += scriptSize; 227 m_scriptTotalSize += scriptSize;
227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; 228 m_scriptCachedMetadataTotalSize += cachedMetadataSize;
228 } 229 }
229 230
230 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698