Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 605 // any child process. Also, this case covers <javascript:...>, which should | 605 // any child process. Also, this case covers <javascript:...>, which should |
| 606 // be handled internally by the process and not kicked up to the browser. | 606 // be handled internally by the process and not kicked up to the browser. |
| 607 return false; | 607 return false; |
| 608 } | 608 } |
| 609 | 609 |
| 610 // If the process can commit the URL, it can request it. | 610 // If the process can commit the URL, it can request it. |
| 611 if (CanCommitURL(child_id, url)) | 611 if (CanCommitURL(child_id, url)) |
| 612 return true; | 612 return true; |
| 613 | 613 |
| 614 // Also allow URLs destined for ShellExecute and not the browser itself. | 614 // Also allow URLs destined for ShellExecute and not the browser itself. |
| 615 return !GetContentClient()->browser()->IsHandledURL(url) && | 615 return !GetContentClient()->browser()->IsHandledURL(url); |
|
Charlie Reis
2016/04/28 21:45:35
This seems like it depends on the content/ embedde
mgersh
2016/04/28 22:30:13
Can you point me to an explanation of what the sec
Charlie Reis
2016/04/29 00:14:44
For reference, CanRequestURL is used in ResourceDi
mmenke
2016/04/29 00:27:24
If we're on the IOTHread, we could call url_reques
mmenke
2016/04/29 00:32:15
Should also note that doesn't work for all consume
| |
| 616 !net::URLRequest::IsHandledURL(url); | |
| 617 } | 616 } |
| 618 | 617 |
| 619 bool ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id, | 618 bool ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id, |
| 620 const GURL& url) { | 619 const GURL& url) { |
| 621 if (!url.is_valid()) | 620 if (!url.is_valid()) |
| 622 return false; // Can't commit invalid URLs. | 621 return false; // Can't commit invalid URLs. |
| 623 | 622 |
| 624 // Of all the pseudo schemes, only about:blank is allowed to commit. | 623 // Of all the pseudo schemes, only about:blank is allowed to commit. |
| 625 if (IsPseudoScheme(url.scheme())) | 624 if (IsPseudoScheme(url.scheme())) |
| 626 return base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL); | 625 return base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 867 base::AutoLock lock(lock_); | 866 base::AutoLock lock(lock_); |
| 868 | 867 |
| 869 SecurityStateMap::iterator state = security_state_.find(child_id); | 868 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 870 if (state == security_state_.end()) | 869 if (state == security_state_.end()) |
| 871 return false; | 870 return false; |
| 872 | 871 |
| 873 return state->second->can_send_midi_sysex(); | 872 return state->second->can_send_midi_sysex(); |
| 874 } | 873 } |
| 875 | 874 |
| 876 } // namespace content | 875 } // namespace content |
| OLD | NEW |