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" |
11 #include "base/debug/dump_without_crashing.h" | |
11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
15 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
18 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
19 #include "content/common/site_isolation_policy.h" | 20 #include "content/common/site_isolation_policy.h" |
20 #include "content/public/browser/child_process_data.h" | 21 #include "content/public/browser/child_process_data.h" |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
794 const storage::FileSystemURL& filesystem_url, | 795 const storage::FileSystemURL& filesystem_url, |
795 int permissions) { | 796 int permissions) { |
796 if (!filesystem_url.is_valid()) | 797 if (!filesystem_url.is_valid()) |
797 return false; | 798 return false; |
798 | 799 |
799 // If |filesystem_url.origin()| is not committable in this process, then this | 800 // 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 | 801 // page should not be able to place content in that origin via the filesystem |
801 // API either. | 802 // API either. |
802 if (!CanCommitURL(child_id, filesystem_url.origin())) { | 803 if (!CanCommitURL(child_id, filesystem_url.origin())) { |
803 UMA_HISTOGRAM_BOOLEAN("FileSystem.OriginFailedCanCommitURL", true); | 804 UMA_HISTOGRAM_BOOLEAN("FileSystem.OriginFailedCanCommitURL", true); |
805 // TODO(nick): Temporary instrumentation for https://crbug.com/654479. | |
806 base::debug::DumpWithoutCrashing(); | |
nasko
2016/10/10 21:45:09
Should we capture the filesystem_url contents expl
| |
804 return false; | 807 return false; |
805 } | 808 } |
806 | 809 |
807 if (filesystem_url.path().ReferencesParent()) | 810 if (filesystem_url.path().ReferencesParent()) |
808 return false; | 811 return false; |
809 | 812 |
810 // Any write access is disallowed on the root path. | 813 // Any write access is disallowed on the root path. |
811 if (storage::VirtualPath::IsRootPath(filesystem_url.path()) && | 814 if (storage::VirtualPath::IsRootPath(filesystem_url.path()) && |
812 (permissions & ~READ_FILE_GRANT)) { | 815 (permissions & ~READ_FILE_GRANT)) { |
813 return false; | 816 return false; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
976 base::AutoLock lock(lock_); | 979 base::AutoLock lock(lock_); |
977 | 980 |
978 SecurityStateMap::iterator state = security_state_.find(child_id); | 981 SecurityStateMap::iterator state = security_state_.find(child_id); |
979 if (state == security_state_.end()) | 982 if (state == security_state_.end()) |
980 return false; | 983 return false; |
981 | 984 |
982 return state->second->can_send_midi_sysex(); | 985 return state->second->can_send_midi_sysex(); |
983 } | 986 } |
984 | 987 |
985 } // namespace content | 988 } // namespace content |
OLD | NEW |