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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "content/browser/plugin_process_host.h" | 14 #include "content/browser/plugin_process_host.h" |
15 #include "content/browser/site_instance_impl.h" | 15 #include "content/browser/site_instance_impl.h" |
16 #include "content/public/browser/child_process_data.h" | 16 #include "content/public/browser/child_process_data.h" |
17 #include "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" |
18 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
19 #include "content/public/common/bindings_policy.h" | 19 #include "content/public/common/bindings_policy.h" |
20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
21 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
22 #include "net/base/filename_util.h" | 22 #include "net/base/filename_util.h" |
| 23 #include "net/base/url_constants.h" |
23 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
25 #include "webkit/browser/fileapi/file_permission_policy.h" | 26 #include "webkit/browser/fileapi/file_permission_policy.h" |
26 #include "webkit/browser/fileapi/file_system_url.h" | 27 #include "webkit/browser/fileapi/file_system_url.h" |
27 #include "webkit/browser/fileapi/isolated_context.h" | 28 #include "webkit/browser/fileapi/isolated_context.h" |
28 #include "webkit/common/fileapi/file_system_util.h" | 29 #include "webkit/common/fileapi/file_system_util.h" |
29 | 30 |
30 namespace content { | 31 namespace content { |
31 | 32 |
32 namespace { | 33 namespace { |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 GURL origin_lock_; | 302 GURL origin_lock_; |
302 | 303 |
303 // The set of isolated filesystems the child process is permitted to access. | 304 // The set of isolated filesystems the child process is permitted to access. |
304 FileSystemMap filesystem_permissions_; | 305 FileSystemMap filesystem_permissions_; |
305 | 306 |
306 DISALLOW_COPY_AND_ASSIGN(SecurityState); | 307 DISALLOW_COPY_AND_ASSIGN(SecurityState); |
307 }; | 308 }; |
308 | 309 |
309 ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() { | 310 ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() { |
310 // We know about these schemes and believe them to be safe. | 311 // We know about these schemes and believe them to be safe. |
311 RegisterWebSafeScheme(kHttpScheme); | 312 RegisterWebSafeScheme(net::kHttpScheme); |
312 RegisterWebSafeScheme(kHttpsScheme); | 313 RegisterWebSafeScheme(net::kHttpsScheme); |
313 RegisterWebSafeScheme(kFtpScheme); | 314 RegisterWebSafeScheme(kFtpScheme); |
314 RegisterWebSafeScheme(kDataScheme); | 315 RegisterWebSafeScheme(kDataScheme); |
315 RegisterWebSafeScheme("feed"); | 316 RegisterWebSafeScheme("feed"); |
316 RegisterWebSafeScheme(kBlobScheme); | 317 RegisterWebSafeScheme(kBlobScheme); |
317 RegisterWebSafeScheme(kFileSystemScheme); | 318 RegisterWebSafeScheme(kFileSystemScheme); |
318 | 319 |
319 // We know about the following pseudo schemes and treat them specially. | 320 // We know about the following pseudo schemes and treat them specially. |
320 RegisterPseudoScheme(kAboutScheme); | 321 RegisterPseudoScheme(kAboutScheme); |
321 RegisterPseudoScheme(kJavaScriptScheme); | 322 RegisterPseudoScheme(kJavaScriptScheme); |
322 RegisterPseudoScheme(kViewSourceScheme); | 323 RegisterPseudoScheme(kViewSourceScheme); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 base::AutoLock lock(lock_); | 886 base::AutoLock lock(lock_); |
886 | 887 |
887 SecurityStateMap::iterator state = security_state_.find(child_id); | 888 SecurityStateMap::iterator state = security_state_.find(child_id); |
888 if (state == security_state_.end()) | 889 if (state == security_state_.end()) |
889 return false; | 890 return false; |
890 | 891 |
891 return state->second->can_send_midi_sysex(); | 892 return state->second->can_send_midi_sysex(); |
892 } | 893 } |
893 | 894 |
894 } // namespace content | 895 } // namespace content |
OLD | NEW |