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