Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: content/browser/child_process_security_policy_impl.cc

Issue 1945173003: ChildProcessSecurityPolicy::CanAccessDataForOrigin workaround to suppress bad kills (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove NOTREACHED() Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 SecurityStateMap::iterator state = security_state_.find(child_id); 810 SecurityStateMap::iterator state = security_state_.find(child_id);
811 if (state == security_state_.end()) 811 if (state == security_state_.end())
812 return false; 812 return false;
813 return state->second->HasPermissionsForFile(file, permissions); 813 return state->second->HasPermissionsForFile(file, permissions);
814 } 814 }
815 815
816 bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(int child_id, 816 bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(int child_id,
817 const GURL& gurl) { 817 const GURL& gurl) {
818 base::AutoLock lock(lock_); 818 base::AutoLock lock(lock_);
819 SecurityStateMap::iterator state = security_state_.find(child_id); 819 SecurityStateMap::iterator state = security_state_.find(child_id);
820 if (state == security_state_.end()) 820 if (state == security_state_.end()) {
821 return false; 821 // TODO(nick): Returning true instead of false here is a temporary
822 // workaround for https://crbug.com/600441
823 return true;
824 }
822 return state->second->CanAccessDataForOrigin(gurl); 825 return state->second->CanAccessDataForOrigin(gurl);
823 } 826 }
824 827
825 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, 828 void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id,
826 const GURL& gurl) { 829 const GURL& gurl) {
827 // "gurl" can be currently empty in some cases, such as file://blah. 830 // "gurl" can be currently empty in some cases, such as file://blah.
828 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); 831 DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl);
829 base::AutoLock lock(lock_); 832 base::AutoLock lock(lock_);
830 SecurityStateMap::iterator state = security_state_.find(child_id); 833 SecurityStateMap::iterator state = security_state_.find(child_id);
831 DCHECK(state != security_state_.end()); 834 DCHECK(state != security_state_.end());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 base::AutoLock lock(lock_); 870 base::AutoLock lock(lock_);
868 871
869 SecurityStateMap::iterator state = security_state_.find(child_id); 872 SecurityStateMap::iterator state = security_state_.find(child_id);
870 if (state == security_state_.end()) 873 if (state == security_state_.end())
871 return false; 874 return false;
872 875
873 return state->second->can_send_midi_sysex(); 876 return state->second->can_send_midi_sysex();
874 } 877 }
875 878
876 } // namespace content 879 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/webrtc_identity_service_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698