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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 int child_id, | 793 int child_id, |
794 const storage::FileSystemURL& filesystem_url, | 794 const storage::FileSystemURL& filesystem_url, |
795 int permissions) { | 795 int permissions) { |
796 if (!filesystem_url.is_valid()) | 796 if (!filesystem_url.is_valid()) |
797 return false; | 797 return false; |
798 | 798 |
799 // If |filesystem_url.origin()| is not committable in this process, then this | 799 // If |filesystem_url.origin()| is not committable in this process, then this |
800 // page should not be able to place content in that origin via the filesystem | 800 // page should not be able to place content in that origin via the filesystem |
801 // API either. | 801 // API either. |
802 if (!CanCommitURL(child_id, filesystem_url.origin())) { | 802 if (!CanCommitURL(child_id, filesystem_url.origin())) { |
| 803 CHECK(false); |
803 UMA_HISTOGRAM_BOOLEAN("FileSystem.OriginFailedCanCommitURL", true); | 804 UMA_HISTOGRAM_BOOLEAN("FileSystem.OriginFailedCanCommitURL", true); |
804 return false; | 805 return false; |
805 } | 806 } |
806 | 807 |
807 if (filesystem_url.path().ReferencesParent()) | 808 if (filesystem_url.path().ReferencesParent()) |
808 return false; | 809 return false; |
809 | 810 |
810 // Any write access is disallowed on the root path. | 811 // Any write access is disallowed on the root path. |
811 if (storage::VirtualPath::IsRootPath(filesystem_url.path()) && | 812 if (storage::VirtualPath::IsRootPath(filesystem_url.path()) && |
812 (permissions & ~READ_FILE_GRANT)) { | 813 (permissions & ~READ_FILE_GRANT)) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 base::AutoLock lock(lock_); | 977 base::AutoLock lock(lock_); |
977 | 978 |
978 SecurityStateMap::iterator state = security_state_.find(child_id); | 979 SecurityStateMap::iterator state = security_state_.find(child_id); |
979 if (state == security_state_.end()) | 980 if (state == security_state_.end()) |
980 return false; | 981 return false; |
981 | 982 |
982 return state->second->can_send_midi_sysex(); | 983 return state->second->can_send_midi_sysex(); |
983 } | 984 } |
984 | 985 |
985 } // namespace content | 986 } // namespace content |
OLD | NEW |