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

Side by Side Diff: content/browser/child_process_security_policy_impl.h

Issue 334413004: Add URL origin checks for Service Worker (un)registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
7 7
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Register FileSystem type and permission policy which should be used 182 // Register FileSystem type and permission policy which should be used
183 // for the type. The |policy| must be a bitwise-or'd value of 183 // for the type. The |policy| must be a bitwise-or'd value of
184 // fileapi::FilePermissionPolicy. 184 // fileapi::FilePermissionPolicy.
185 void RegisterFileSystemPermissionPolicy( 185 void RegisterFileSystemPermissionPolicy(
186 fileapi::FileSystemType type, 186 fileapi::FileSystemType type,
187 int policy); 187 int policy);
188 188
189 // Returns true if sending system exclusive messages is allowed. 189 // Returns true if sending system exclusive messages is allowed.
190 bool CanSendMidiSysExMessage(int child_id); 190 bool CanSendMidiSysExMessage(int child_id);
191 191
192 // Returns true if the specified document can register or unregister a service
193 // worker from |script_url| for scope |pattern|.
194 bool CanRegisterServiceWorker(const GURL& document_url,
195 const GURL& pattern,
196 const GURL& script_url);
197 bool CanUnregisterServiceWorker(const GURL& document_url,
198 const GURL& pattern);
199
192 private: 200 private:
193 friend class ChildProcessSecurityPolicyInProcessBrowserTest; 201 friend class ChildProcessSecurityPolicyInProcessBrowserTest;
194 friend class ChildProcessSecurityPolicyTest; 202 friend class ChildProcessSecurityPolicyTest;
195 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, 203 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest,
196 NoLeak); 204 NoLeak);
197 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); 205 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions);
198 206
199 class SecurityState; 207 class SecurityState;
200 208
201 typedef std::set<std::string> SchemeSet; 209 typedef std::set<std::string> SchemeSet;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 WorkerToMainProcessMap worker_map_; 283 WorkerToMainProcessMap worker_map_;
276 284
277 FileSystemPermissionPolicyMap file_system_policy_map_; 285 FileSystemPermissionPolicyMap file_system_policy_map_;
278 286
279 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); 287 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl);
280 }; 288 };
281 289
282 } // namespace content 290 } // namespace content
283 291
284 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ 292 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698