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

Unified Diff: Source/core/workers/WorkerThreadStartupData.h

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/WorkerMessagingProxy.cpp ('k') | Source/core/workers/WorkerThreadStartupData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThreadStartupData.h
diff --git a/Source/core/workers/WorkerThreadStartupData.h b/Source/core/workers/WorkerThreadStartupData.h
index 1e85c2cf55a91fbba0b5d7c0b64eb98c6aa25245..f92b17545562efa3b50e6c9038d5b122e85d84b0 100644
--- a/Source/core/workers/WorkerThreadStartupData.h
+++ b/Source/core/workers/WorkerThreadStartupData.h
@@ -47,9 +47,9 @@ class WorkerThreadStartupData FINAL : public NoBaseWillBeGarbageCollectedFinaliz
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
- static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
+ static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients)
{
- return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, workerClients));
+ return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, starterOrigin, workerClients));
}
~WorkerThreadStartupData();
@@ -60,12 +60,27 @@ public:
WorkerThreadStartMode m_startMode;
String m_contentSecurityPolicy;
ContentSecurityPolicyHeaderType m_contentSecurityPolicyType;
+
+ // The SecurityOrigin of the Document creating a Worker may have
+ // been configured with extra policy privileges when it was created
+ // (e.g., enforce path-based file:// origins.)
+ // To ensure that these are transferred to the origin of a new worker
+ // global scope, supply the Document's SecurityOrigin as the
+ // 'starter origin'.
+ //
+ // Ownership of this optional starter origin remain with the caller,
+ // and is assumed to stay alive until the new Worker thread has been
+ // initialized.
+ //
+ // See SecurityOrigin::transferPrivilegesFrom() for details on what
+ // privileges are transferred.
+ const SecurityOrigin* m_starterOrigin;
OwnPtrWillBeMember<WorkerClients> m_workerClients;
void trace(Visitor*);
private:
- WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, PassOwnPtrWillBeRawPtr<WorkerClients>);
+ WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClients>);
};
} // namespace blink
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.cpp ('k') | Source/core/workers/WorkerThreadStartupData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698