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

Side by Side 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 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 #include "content/browser/child_process_security_policy_impl.h" 5 #include "content/browser/child_process_security_policy_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 bool ChildProcessSecurityPolicyImpl::CanSendMidiSysExMessage(int child_id) { 883 bool ChildProcessSecurityPolicyImpl::CanSendMidiSysExMessage(int child_id) {
884 base::AutoLock lock(lock_); 884 base::AutoLock lock(lock_);
885 885
886 SecurityStateMap::iterator state = security_state_.find(child_id); 886 SecurityStateMap::iterator state = security_state_.find(child_id);
887 if (state == security_state_.end()) 887 if (state == security_state_.end())
888 return false; 888 return false;
889 889
890 return state->second->can_send_midi_sysex(); 890 return state->second->can_send_midi_sysex();
891 } 891 }
892 892
893 bool ChildProcessSecurityPolicyImpl::CanRegisterServiceWorker(
Tom Sepez 2014/06/17 17:43:19 These don't have to live in CPSP because they don'
894 const GURL& document_url,
895 const GURL& pattern,
896 const GURL& script_url) {
897 return document_url.GetOrigin() == pattern.GetOrigin() &&
898 document_url.GetOrigin() == script_url.GetOrigin();
michaeln 2014/06/17 23:50:30 These same-origin checks are not a matter of 'poli
899 }
900
901 bool ChildProcessSecurityPolicyImpl::CanUnregisterServiceWorker(
902 const GURL& document_url,
903 const GURL& pattern) {
904 return document_url.GetOrigin() == pattern.GetOrigin();
905 }
906
893 } // namespace content 907 } // namespace content
OLDNEW
« 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