Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 SecurityStateMap::iterator state = security_state_.find(child_id); | 810 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 811 if (state == security_state_.end()) | 811 if (state == security_state_.end()) |
| 812 return false; | 812 return false; |
| 813 return state->second->HasPermissionsForFile(file, permissions); | 813 return state->second->HasPermissionsForFile(file, permissions); |
| 814 } | 814 } |
| 815 | 815 |
| 816 bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(int child_id, | 816 bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(int child_id, |
| 817 const GURL& gurl) { | 817 const GURL& gurl) { |
| 818 base::AutoLock lock(lock_); | 818 base::AutoLock lock(lock_); |
| 819 SecurityStateMap::iterator state = security_state_.find(child_id); | 819 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 820 if (state == security_state_.end()) | 820 if (state == security_state_.end()) { |
| 821 return false; | 821 // TODO(nick): Returning true instead of false here is a temporary |
| 822 // workaround for https://crbug.com/600441 | |
| 823 NOTREACHED(); | |
|
Charlie Reis
2016/05/04 19:38:17
Let's remove the NOTREACHED. Looks like this is h
ncarter (slow)
2016/05/04 19:57:57
The test that hits it, also fails if we remove the
| |
| 824 return true; | |
| 825 } | |
| 822 return state->second->CanAccessDataForOrigin(gurl); | 826 return state->second->CanAccessDataForOrigin(gurl); |
| 823 } | 827 } |
| 824 | 828 |
| 825 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, | 829 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, |
| 826 const GURL& gurl) { | 830 const GURL& gurl) { |
| 827 // "gurl" can be currently empty in some cases, such as file://blah. | 831 // "gurl" can be currently empty in some cases, such as file://blah. |
| 828 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); | 832 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); |
| 829 base::AutoLock lock(lock_); | 833 base::AutoLock lock(lock_); |
| 830 SecurityStateMap::iterator state = security_state_.find(child_id); | 834 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 831 DCHECK(state != security_state_.end()); | 835 DCHECK(state != security_state_.end()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 867 base::AutoLock lock(lock_); | 871 base::AutoLock lock(lock_); |
| 868 | 872 |
| 869 SecurityStateMap::iterator state = security_state_.find(child_id); | 873 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 870 if (state == security_state_.end()) | 874 if (state == security_state_.end()) |
| 871 return false; | 875 return false; |
| 872 | 876 |
| 873 return state->second->can_send_midi_sysex(); | 877 return state->second->can_send_midi_sysex(); |
| 874 } | 878 } |
| 875 | 879 |
| 876 } // namespace content | 880 } // namespace content |
| OLD | NEW |