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

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

Issue 1868763002: Remove URLRequest::IsHandledProtocol and IsHandledURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finish removing URLRequest::IsHandledProtocol() Created 4 years, 8 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
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698