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

Unified Diff: content/browser/child_process_security_policy_impl.cc

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/child_process_security_policy_impl.cc
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index 68f4e81fbef0c73f41b93147023c8a7bb8841c6c..4a2c6b56a40bbc1e78860d3a81aa283460fbd1d4 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -890,4 +890,18 @@ bool ChildProcessSecurityPolicyImpl::CanSendMidiSysExMessage(int child_id) {
return state->second->can_send_midi_sysex();
}
+bool ChildProcessSecurityPolicyImpl::CanRegisterServiceWorker(
Tom Sepez 2014/06/17 17:43:19 These don't have to live in CPSP because they don'
+ const GURL& document_url,
+ const GURL& pattern,
+ const GURL& script_url) {
+ return document_url.GetOrigin() == pattern.GetOrigin() &&
+ document_url.GetOrigin() == script_url.GetOrigin();
michaeln 2014/06/17 23:50:30 These same-origin checks are not a matter of 'poli
+}
+
+bool ChildProcessSecurityPolicyImpl::CanUnregisterServiceWorker(
+ const GURL& document_url,
+ const GURL& pattern) {
+ return document_url.GetOrigin() == pattern.GetOrigin();
+}
+
} // namespace content
« no previous file with comments | « content/browser/child_process_security_policy_impl.h ('k') | content/browser/service_worker/service_worker_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698