| 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 return true; |
| 824 } |
| 822 return state->second->CanAccessDataForOrigin(gurl); | 825 return state->second->CanAccessDataForOrigin(gurl); |
| 823 } | 826 } |
| 824 | 827 |
| 825 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, | 828 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, |
| 826 const GURL& gurl) { | 829 const GURL& gurl) { |
| 827 // "gurl" can be currently empty in some cases, such as file://blah. | 830 // "gurl" can be currently empty in some cases, such as file://blah. |
| 828 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); | 831 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); |
| 829 base::AutoLock lock(lock_); | 832 base::AutoLock lock(lock_); |
| 830 SecurityStateMap::iterator state = security_state_.find(child_id); | 833 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 831 DCHECK(state != security_state_.end()); | 834 DCHECK(state != security_state_.end()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 base::AutoLock lock(lock_); | 870 base::AutoLock lock(lock_); |
| 868 | 871 |
| 869 SecurityStateMap::iterator state = security_state_.find(child_id); | 872 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 870 if (state == security_state_.end()) | 873 if (state == security_state_.end()) |
| 871 return false; | 874 return false; |
| 872 | 875 |
| 873 return state->second->can_send_midi_sysex(); | 876 return state->second->can_send_midi_sysex(); |
| 874 } | 877 } |
| 875 | 878 |
| 876 } // namespace content | 879 } // namespace content |
| OLD | NEW |