| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 if (child_url.SchemeIs(kViewSourceScheme) && | 595 if (child_url.SchemeIs(kViewSourceScheme) && |
| 596 url.SchemeIs(kViewSourceScheme)) | 596 url.SchemeIs(kViewSourceScheme)) |
| 597 return false; | 597 return false; |
| 598 | 598 |
| 599 return CanRequestURL(child_id, child_url); | 599 return CanRequestURL(child_id, child_url); |
| 600 } | 600 } |
| 601 | 601 |
| 602 if (base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL)) | 602 if (base::LowerCaseEqualsASCII(url.spec(), url::kAboutBlankURL)) |
| 603 return true; // Every child process can request <about:blank>. | 603 return true; // Every child process can request <about:blank>. |
| 604 | 604 |
| 605 // URLs like <about:memory> and <about:crash> shouldn't be requestable by | 605 // URLs like <about:version> and <about:crash> shouldn't be requestable by |
| 606 // any child process. Also, this case covers <javascript:...>, which should | 606 // any child process. Also, this case covers <javascript:...>, which should |
| 607 // be handled internally by the process and not kicked up to the browser. | 607 // be handled internally by the process and not kicked up to the browser. |
| 608 return false; | 608 return false; |
| 609 } | 609 } |
| 610 | 610 |
| 611 // If the process can commit the URL, it can request it. | 611 // If the process can commit the URL, it can request it. |
| 612 if (CanCommitURL(child_id, url)) | 612 if (CanCommitURL(child_id, url)) |
| 613 return true; | 613 return true; |
| 614 | 614 |
| 615 // Also allow URLs destined for ShellExecute and not the browser itself. | 615 // Also allow URLs destined for ShellExecute and not the browser itself. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 base::AutoLock lock(lock_); | 868 base::AutoLock lock(lock_); |
| 869 | 869 |
| 870 SecurityStateMap::iterator state = security_state_.find(child_id); | 870 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 871 if (state == security_state_.end()) | 871 if (state == security_state_.end()) |
| 872 return false; | 872 return false; |
| 873 | 873 |
| 874 return state->second->can_send_midi_sysex(); | 874 return state->second->can_send_midi_sysex(); |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace content | 877 } // namespace content |
| OLD | NEW |