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

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

Issue 594803002: Transfer SecurityOrigin overrides to Workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename transferPrivileges() to transferPrivilegesFrom() over security origins Created 6 years, 2 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 | Annotate | Revision Log
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "modules/serviceworkers/ServiceWorkerThread.h" 48 #include "modules/serviceworkers/ServiceWorkerThread.h"
49 #include "platform/network/ResourceRequest.h" 49 #include "platform/network/ResourceRequest.h"
50 #include "platform/weborigin/KURL.h" 50 #include "platform/weborigin/KURL.h"
51 #include "public/platform/WebURL.h" 51 #include "public/platform/WebURL.h"
52 #include "wtf/CurrentTime.h" 52 #include "wtf/CurrentTime.h"
53 53
54 namespace blink { 54 namespace blink {
55 55
56 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat e(ServiceWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> s tartupData) 56 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat e(ServiceWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> s tartupData)
57 { 57 {
58 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t hread, monotonicallyIncreasingTime(), startupData->m_workerClients.release())); 58 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t hread, monotonicallyIncreasingTime(), startupData->m_starterOrigin, startupData- >m_workerClients.release()));
59 59
60 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity Policy, startupData->m_contentSecurityPolicyType); 60 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity Policy, startupData->m_contentSecurityPolicyType);
61 61
62 return context.release(); 62 return context.release();
63 } 63 }
64 64
65 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, PassOwnPtrWillBeRaw Ptr<WorkerClients> workerClients) 65 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String & userAgent, ServiceWorkerThread* thread, double timeOrigin, const SecurityOrigi n* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
66 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, workerClients) 66 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke rClients)
67 , m_fetchManager(adoptPtr(new FetchManager(this))) 67 , m_fetchManager(adoptPtr(new FetchManager(this)))
68 { 68 {
69 } 69 }
70 70
71 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() 71 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope()
72 { 72 {
73 } 73 }
74 74
75 void ServiceWorkerGlobalScope::stopFetch() 75 void ServiceWorkerGlobalScope::stopFetch()
76 { 76 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe fPtrWillBeRawPtr<ScriptCallStack> callStack) 190 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe fPtrWillBeRawPtr<ScriptCallStack> callStack)
191 { 191 {
192 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack); 192 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack);
193 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber); 193 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber);
194 consoleMessage->setScriptId(scriptId); 194 consoleMessage->setScriptId(scriptId);
195 consoleMessage->setCallStack(callStack); 195 consoleMessage->setCallStack(callStack);
196 addMessageToWorkerConsole(consoleMessage.release()); 196 addMessageToWorkerConsole(consoleMessage.release());
197 } 197 }
198 198
199 } // namespace blink 199 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | Source/platform/weborigin/SecurityOrigin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698