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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 789 return result; | 789 return result; |
| 790 } | 790 } |
| 791 | 791 |
| 792 bool ChildProcessSecurityPolicyImpl::HasPermissionsForFileSystemFile( | 792 bool ChildProcessSecurityPolicyImpl::HasPermissionsForFileSystemFile( |
| 793 int child_id, | 793 int child_id, |
| 794 const storage::FileSystemURL& url, | 794 const storage::FileSystemURL& url, |
| 795 int permissions) { | 795 int permissions) { |
| 796 if (!url.is_valid()) | 796 if (!url.is_valid()) |
| 797 return false; | 797 return false; |
| 798 | 798 |
| 799 // If |url.origin()| is not committable in this process, then this page | |
| 800 // should not be able to place content in that origin via the filesystem | |
| 801 // API either. | |
| 802 if (!CanCommitURL(child_id, url.origin())) | |
| 803 return false; | |
|
Charlie Reis
2016/10/04 22:19:04
Consider adding a UMA to detect if this is happeni
ncarter (slow)
2016/10/04 23:09:36
Done.
| |
| 804 | |
| 799 if (url.path().ReferencesParent()) | 805 if (url.path().ReferencesParent()) |
| 800 return false; | 806 return false; |
| 801 | 807 |
| 802 // Any write access is disallowed on the root path. | 808 // Any write access is disallowed on the root path. |
| 803 if (storage::VirtualPath::IsRootPath(url.path()) && | 809 if (storage::VirtualPath::IsRootPath(url.path()) && |
| 804 (permissions & ~READ_FILE_GRANT)) { | 810 (permissions & ~READ_FILE_GRANT)) { |
| 805 return false; | 811 return false; |
| 806 } | 812 } |
| 807 | 813 |
| 808 if (url.mount_type() == storage::kFileSystemTypeIsolated) { | 814 if (url.mount_type() == storage::kFileSystemTypeIsolated) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 963 base::AutoLock lock(lock_); | 969 base::AutoLock lock(lock_); |
| 964 | 970 |
| 965 SecurityStateMap::iterator state = security_state_.find(child_id); | 971 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 966 if (state == security_state_.end()) | 972 if (state == security_state_.end()) |
| 967 return false; | 973 return false; |
| 968 | 974 |
| 969 return state->second->can_send_midi_sysex(); | 975 return state->second->can_send_midi_sysex(); |
| 970 } | 976 } |
| 971 | 977 |
| 972 } // namespace content | 978 } // namespace content |
| OLD | NEW |