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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 499
500 bool BlinkPlatformImpl::isReservedIPAddress( 500 bool BlinkPlatformImpl::isReservedIPAddress(
501 const blink::WebString& host) const { 501 const blink::WebString& host) const {
502 net::IPAddressNumber address; 502 net::IPAddressNumber address;
503 if (!net::ParseURLHostnameToNumber(host.utf8(), &address)) 503 if (!net::ParseURLHostnameToNumber(host.utf8(), &address))
504 return false; 504 return false;
505 return net::IsIPAddressReserved(address); 505 return net::IsIPAddressReserved(address);
506 } 506 }
507 507
508 bool BlinkPlatformImpl::portAllowed(const blink::WebURL& url) const {
509 GURL gurl = GURL(url);
510 int port = gurl.IntPort();
511 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.
512 return true;
513 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.
514 if (gurl.SchemeIs("ftp")) {
515 return net::IsPortAllowedByFtp(port)
516 || 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.
517 }
518 return net::IsPortAllowedByDefault(port)
519 || net::IsPortAllowedByOverride(port);
520 }
521 return true;
522 }
523
508 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) { 524 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) {
509 WebThreadImpl* thread = new WebThreadImpl(name); 525 WebThreadImpl* thread = new WebThreadImpl(name);
510 thread->TaskRunner()->PostTask( 526 thread->TaskRunner()->PostTask(
511 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, 527 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS,
512 base::Unretained(this), thread)); 528 base::Unretained(this), thread));
513 return thread; 529 return thread;
514 } 530 }
515 531
516 blink::WebThread* BlinkPlatformImpl::currentThread() { 532 blink::WebThread* BlinkPlatformImpl::currentThread() {
517 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); 533 return static_cast<blink::WebThread*>(current_thread_slot_.Get());
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1337 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1322 static_cast<ui::DomCode>(dom_code))); 1338 static_cast<ui::DomCode>(dom_code)));
1323 } 1339 }
1324 1340
1325 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1341 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1326 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1342 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1327 code.utf8().data())); 1343 code.utf8().data()));
1328 } 1344 }
1329 1345
1330 } // namespace content 1346 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698