| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 void ChildProcessSecurityPolicyImpl::RevokeReadRawCookies(int child_id) { | 573 void ChildProcessSecurityPolicyImpl::RevokeReadRawCookies(int child_id) { |
| 574 base::AutoLock lock(lock_); | 574 base::AutoLock lock(lock_); |
| 575 | 575 |
| 576 SecurityStateMap::iterator state = security_state_.find(child_id); | 576 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 577 if (state == security_state_.end()) | 577 if (state == security_state_.end()) |
| 578 return; | 578 return; |
| 579 | 579 |
| 580 state->second->RevokeReadRawCookies(); | 580 state->second->RevokeReadRawCookies(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 bool ChildProcessSecurityPolicyImpl::CanLoadPage( | 583 bool ChildProcessSecurityPolicyImpl::CanLoadPage(int child_id, |
| 584 int child_id, | 584 const GURL& url, |
| 585 const GURL& url, | 585 ResourceType resource_type) { |
| 586 ResourceType::Type resource_type) { | |
| 587 // If --site-per-process flag is passed, we should enforce | 586 // If --site-per-process flag is passed, we should enforce |
| 588 // stronger security restrictions on page navigation. | 587 // stronger security restrictions on page navigation. |
| 589 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && | 588 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && |
| 590 ResourceType::IsFrame(resource_type)) { | 589 IsResourceTypeFrame(resource_type)) { |
| 591 // TODO(nasko): Do the proper check for site-per-process, once | 590 // TODO(nasko): Do the proper check for site-per-process, once |
| 592 // out-of-process iframes is ready to go. | 591 // out-of-process iframes is ready to go. |
| 593 return true; | 592 return true; |
| 594 } | 593 } |
| 595 return true; | 594 return true; |
| 596 } | 595 } |
| 597 | 596 |
| 598 bool ChildProcessSecurityPolicyImpl::CanRequestURL( | 597 bool ChildProcessSecurityPolicyImpl::CanRequestURL( |
| 599 int child_id, const GURL& url) { | 598 int child_id, const GURL& url) { |
| 600 if (!url.is_valid()) | 599 if (!url.is_valid()) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 base::AutoLock lock(lock_); | 883 base::AutoLock lock(lock_); |
| 885 | 884 |
| 886 SecurityStateMap::iterator state = security_state_.find(child_id); | 885 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 887 if (state == security_state_.end()) | 886 if (state == security_state_.end()) |
| 888 return false; | 887 return false; |
| 889 | 888 |
| 890 return state->second->can_send_midi_sysex(); | 889 return state->second->can_send_midi_sysex(); |
| 891 } | 890 } |
| 892 | 891 |
| 893 } // namespace content | 892 } // namespace content |
| OLD | NEW |