| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 if (IsWebSafeScheme(url.scheme())) | 646 if (IsWebSafeScheme(url.scheme())) |
| 647 return true; | 647 return true; |
| 648 | 648 |
| 649 // If the process can commit the URL, it can request it. | 649 // If the process can commit the URL, it can request it. |
| 650 if (CanCommitURL(child_id, url)) | 650 if (CanCommitURL(child_id, url)) |
| 651 return true; | 651 return true; |
| 652 | 652 |
| 653 // Also allow URLs destined for ShellExecute and not the browser itself. | 653 // Also allow URLs destined for ShellExecute and not the browser itself. |
| 654 return !GetContentClient()->browser()->IsHandledURL(url) && | 654 return !GetContentClient()->browser()->IsHandledURL(url); |
| 655 !net::URLRequest::IsHandledURL(url); | |
| 656 } | 655 } |
| 657 | 656 |
| 658 bool ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id, | 657 bool ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id, |
| 659 const GURL& url) { | 658 const GURL& url) { |
| 660 if (!url.is_valid()) | 659 if (!url.is_valid()) |
| 661 return false; // Can't commit invalid URLs. | 660 return false; // Can't commit invalid URLs. |
| 662 | 661 |
| 663 // Of all the pseudo schemes, only about:blank is allowed to commit. | 662 // Of all the pseudo schemes, only about:blank is allowed to commit. |
| 664 if (IsPseudoScheme(url.scheme())) | 663 if (IsPseudoScheme(url.scheme())) |
| 665 return base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL); | 664 return base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 base::AutoLock lock(lock_); | 978 base::AutoLock lock(lock_); |
| 980 | 979 |
| 981 SecurityStateMap::iterator state = security_state_.find(child_id); | 980 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 982 if (state == security_state_.end()) | 981 if (state == security_state_.end()) |
| 983 return false; | 982 return false; |
| 984 | 983 |
| 985 return state->second->can_send_midi_sysex(); | 984 return state->second->can_send_midi_sysex(); |
| 986 } | 985 } |
| 987 | 986 |
| 988 } // namespace content | 987 } // namespace content |
| OLD | NEW |