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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1036823003: Fix to respect --explicitly-allowed-ports command line option-Chromium Side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 2c71a251fcc9e844bf7babe5fd2bbfdc86288099..016e4ccd31ef21f8fc59f2304be42393eb8fdb74 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -505,6 +505,22 @@ bool BlinkPlatformImpl::isReservedIPAddress(
return net::IsIPAddressReserved(address);
}
+bool BlinkPlatformImpl::portAllowed(const blink::WebURL& url) const {
+ GURL gurl = GURL(url);
+ int port = gurl.IntPort();
+ if (gurl.SchemeIsFile())
eroman 2015/04/13 15:55:34 I think in the case of a file:// URL gurl.has_port
Paritosh Kumar 2015/04/14 14:50:35 Thanks. Done.
+ return true;
+ if (gurl.has_port()) {
eroman 2015/04/13 15:55:35 Let's move this earlier (before calling IntPort())
Paritosh Kumar 2015/04/14 14:50:35 Acknowledged.
+ if (gurl.SchemeIs("ftp")) {
+ return net::IsPortAllowedByFtp(port)
+ || net::IsPortAllowedByOverride(port);
tyoshino (SeeGerritForStatus) 2015/04/13 14:28:16 || and && are placed at the end of the previous li
Paritosh Kumar 2015/04/14 14:50:35 Acknowledged.
+ }
+ return net::IsPortAllowedByDefault(port)
+ || net::IsPortAllowedByOverride(port);
+ }
+ return true;
+}
+
blink::WebThread* BlinkPlatformImpl::createThread(const char* name) {
WebThreadImpl* thread = new WebThreadImpl(name);
thread->TaskRunner()->PostTask(

Powered by Google App Engine
This is Rietveld 408576698