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

Side by Side Diff: Source/core/workers/WorkerThreadStartupData.h

Issue 594803002: Transfer SecurityOrigin overrides to Workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop separate 'overrides' type and transfer-by-origin instead 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 29 matching lines...) Expand all
40 #include "wtf/Noncopyable.h" 40 #include "wtf/Noncopyable.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 class WorkerClients; 44 class WorkerClients;
45 45
46 class WorkerThreadStartupData FINAL : public NoBaseWillBeGarbageCollectedFinaliz ed<WorkerThreadStartupData> { 46 class WorkerThreadStartupData FINAL : public NoBaseWillBeGarbageCollectedFinaliz ed<WorkerThreadStartupData> {
47 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); 47 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData);
48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 48 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
49 public: 49 public:
50 static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& sc riptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMod e startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderTyp e contentSecurityPolicyType, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients ) 50 static PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> create(const KURL& sc riptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMod e startMode, const String& contentSecurityPolicy, ContentSecurityPolicyHeaderTyp e contentSecurityPolicyType, const SecurityOrigin* starterOrigin, PassOwnPtrWill BeRawPtr<WorkerClients> workerClients)
51 { 51 {
52 return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAge nt, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, wor kerClients)); 52 return adoptPtrWillBeNoop(new WorkerThreadStartupData(scriptURL, userAge nt, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, sta rterOrigin, workerClients));
53 } 53 }
54 54
55 ~WorkerThreadStartupData(); 55 ~WorkerThreadStartupData();
56 56
57 KURL m_scriptURL; 57 KURL m_scriptURL;
58 String m_userAgent; 58 String m_userAgent;
59 String m_sourceCode; 59 String m_sourceCode;
60 WorkerThreadStartMode m_startMode; 60 WorkerThreadStartMode m_startMode;
61 String m_contentSecurityPolicy; 61 String m_contentSecurityPolicy;
62 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType; 62 ContentSecurityPolicyHeaderType m_contentSecurityPolicyType;
63
64 // The SecurityOrigin of the Document creating a Worker may have
65 // been configured with extra policy privileges when it was created
66 // (e.g., enforce path-based file:// origins.)
67 // To have those be transferred to the origin of a new worker
Mike West 2014/09/29 07:37:22 Nit: How about "To ensure that these are transferr
sof 2014/09/29 09:42:28 Oh yes, forgot to mention ownership assumptions.
68 // global scope, supply the Document's SecurityOrigin as the
69 // 'starter origin'.
70 //
71 // See SecurityOrigin::transferPrivileges() for details
72 // on the privileges that are inherited/transferred.
73 const SecurityOrigin* m_starterOrigin;
63 OwnPtrWillBeMember<WorkerClients> m_workerClients; 74 OwnPtrWillBeMember<WorkerClients> m_workerClients;
64 75
65 void trace(Visitor*); 76 void trace(Visitor*);
66 77
67 private: 78 private:
68 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons t String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy , ContentSecurityPolicyHeaderType contentSecurityPolicyType, PassOwnPtrWillBeRaw Ptr<WorkerClients>); 79 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons t String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy , ContentSecurityPolicyHeaderType contentSecurityPolicyType, const SecurityOrigi n* parentOrigin, PassOwnPtrWillBeRawPtr<WorkerClients>);
Mike West 2014/09/29 07:37:22 s/parentOrigin/starterOrigin/. Or vice-versa, real
sof 2014/09/29 09:42:28 Oops, I decided not to go with 'parent origin' in
69 }; 80 };
70 81
71 } // namespace blink 82 } // namespace blink
72 83
73 #endif // WorkerThreadStartupData_h 84 #endif // WorkerThreadStartupData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698