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

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp

Issue 1985703003: Add isUnique check to isSameSchemeHostPort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change check rather than comment Created 4 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 { 524 {
525 if (port < 0 || port > MaxAllowedPort) 525 if (port < 0 || port > MaxAllowedPort)
526 return createUnique(); 526 return createUnique();
527 String decodedHost = decodeURLEscapeSequences(host); 527 String decodedHost = decodeURLEscapeSequences(host);
528 String portPart = port ? ":" + String::number(port) : String(); 528 String portPart = port ? ":" + String::number(port) : String();
529 return create(KURL(KURL(), protocol + "://" + host + portPart + "/")); 529 return create(KURL(KURL(), protocol + "://" + host + portPart + "/"));
530 } 530 }
531 531
532 bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const 532 bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const
533 { 533 {
534 if (this != other && (isUnique() || other->isUnique()))
jww 2016/06/02 20:49:56 IMO, if would simpler to first have a check: if
Marijn Kruisselbrink 2016/06/02 21:18:53 Done. Assuming that that was indeed a bug in the i
535 return false;
536
534 if (m_host != other->m_host) 537 if (m_host != other->m_host)
535 return false; 538 return false;
536 539
537 if (m_protocol != other->m_protocol) 540 if (m_protocol != other->m_protocol)
538 return false; 541 return false;
539 542
540 if (m_port != other->m_port) 543 if (m_port != other->m_port)
541 return false; 544 return false;
542 545
543 if (isLocal() && !passesFileCheck(other)) 546 if (isLocal() && !passesFileCheck(other))
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin; 578 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin;
576 } 579 }
577 580
578 void SecurityOrigin::setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOrigin PotentiallyTrustworthy) 581 void SecurityOrigin::setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOrigin PotentiallyTrustworthy)
579 { 582 {
580 ASSERT(!isUniqueOriginPotentiallyTrustworthy || isUnique()); 583 ASSERT(!isUniqueOriginPotentiallyTrustworthy || isUnique());
581 m_isUniqueOriginPotentiallyTrustworthy = isUniqueOriginPotentiallyTrustworth y; 584 m_isUniqueOriginPotentiallyTrustworthy = isUniqueOriginPotentiallyTrustworth y;
582 } 585 }
583 586
584 } // namespace blink 587 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698