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

Unified Diff: Source/core/workers/WorkerGlobalScope.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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerMessagingProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index 1b0ab0e1dc6c5f9512f79e679e53d5ad7063c30b..b9d97fe844cd665052990fcc4efc74421528a5eb 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -79,7 +79,7 @@ public:
virtual bool isCleanupTask() const { return true; }
};
-WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, WorkerThread* thread, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
+WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, WorkerThread* thread, double timeOrigin, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
: m_url(url)
, m_userAgent(userAgent)
, m_script(adoptPtr(new WorkerScriptController(*this)))
@@ -92,6 +92,9 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
, m_messageStorage(ConsoleMessageStorage::createForWorker(this))
{
setSecurityOrigin(SecurityOrigin::create(url));
+ if (starterOrigin)
+ securityOrigin()->transferPrivilegesFrom(*starterOrigin);
+
m_workerClients->reattachThread();
m_thread->setWorkerInspectorController(m_workerInspectorController.get());
}
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerMessagingProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698