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" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 // A view-source URL is allowed if the child process is permitted to | 611 // A view-source URL is allowed if the child process is permitted to |
612 // request the embedded URL. Careful to avoid pointless recursion. | 612 // request the embedded URL. Careful to avoid pointless recursion. |
613 GURL child_url(url.GetContent()); | 613 GURL child_url(url.GetContent()); |
614 if (child_url.SchemeIs(kViewSourceScheme) && | 614 if (child_url.SchemeIs(kViewSourceScheme) && |
615 url.SchemeIs(kViewSourceScheme)) | 615 url.SchemeIs(kViewSourceScheme)) |
616 return false; | 616 return false; |
617 | 617 |
618 return CanRequestURL(child_id, child_url); | 618 return CanRequestURL(child_id, child_url); |
619 } | 619 } |
620 | 620 |
621 if (base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL)) | 621 if (LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL)) |
622 return true; // Every child process can request <about:blank>. | 622 return true; // Every child process can request <about:blank>. |
623 | 623 |
624 // URLs like <about:memory> and <about:crash> shouldn't be requestable by | 624 // URLs like <about:memory> and <about:crash> shouldn't be requestable by |
625 // any child process. Also, this case covers <javascript:...>, which should | 625 // any child process. Also, this case covers <javascript:...>, which should |
626 // be handled internally by the process and not kicked up to the browser. | 626 // be handled internally by the process and not kicked up to the browser. |
627 return false; | 627 return false; |
628 } | 628 } |
629 | 629 |
630 if (!GetContentClient()->browser()->IsHandledURL(url) && | 630 if (!GetContentClient()->browser()->IsHandledURL(url) && |
631 !net::URLRequest::IsHandledURL(url)) { | 631 !net::URLRequest::IsHandledURL(url)) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 base::AutoLock lock(lock_); | 885 base::AutoLock lock(lock_); |
886 | 886 |
887 SecurityStateMap::iterator state = security_state_.find(child_id); | 887 SecurityStateMap::iterator state = security_state_.find(child_id); |
888 if (state == security_state_.end()) | 888 if (state == security_state_.end()) |
889 return false; | 889 return false; |
890 | 890 |
891 return state->second->can_send_midi_sysex(); | 891 return state->second->can_send_midi_sysex(); |
892 } | 892 } |
893 | 893 |
894 } // namespace content | 894 } // namespace content |
OLD | NEW |