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

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

Issue 2533683002: Move the code in ResourceFetcher handling calls from WebURLLoaderImpl to ResourceLoader (Closed)
Patch Set: Fix test Created 4 years 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 /* 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 } 564 }
565 565
566 bool SecurityOrigin::isSameSchemeHostPortAndSuborigin( 566 bool SecurityOrigin::isSameSchemeHostPortAndSuborigin(
567 const SecurityOrigin* other) const { 567 const SecurityOrigin* other) const {
568 bool sameSuborigins = 568 bool sameSuborigins =
569 (hasSuborigin() == other->hasSuborigin()) && 569 (hasSuborigin() == other->hasSuborigin()) &&
570 (!hasSuborigin() || (suborigin()->name() == other->suborigin()->name())); 570 (!hasSuborigin() || (suborigin()->name() == other->suborigin()->name()));
571 return isSameSchemeHostPort(other) && sameSuborigins; 571 return isSameSchemeHostPort(other) && sameSuborigins;
572 } 572 }
573 573
574 bool SecurityOrigin::areSameSchemeHostPort(const KURL& a, const KURL& b) {
575 RefPtr<SecurityOrigin> originA = SecurityOrigin::create(a);
576 RefPtr<SecurityOrigin> originB = SecurityOrigin::create(b);
577 return originB->isSameSchemeHostPort(originA.get());
578 }
579
574 const KURL& SecurityOrigin::urlWithUniqueSecurityOrigin() { 580 const KURL& SecurityOrigin::urlWithUniqueSecurityOrigin() {
575 ASSERT(isMainThread()); 581 ASSERT(isMainThread());
576 DEFINE_STATIC_LOCAL(const KURL, uniqueSecurityOriginURL, 582 DEFINE_STATIC_LOCAL(const KURL, uniqueSecurityOriginURL,
577 (ParsedURLString, "data:,")); 583 (ParsedURLString, "data:,"));
578 return uniqueSecurityOriginURL; 584 return uniqueSecurityOriginURL;
579 } 585 }
580 586
581 std::unique_ptr<SecurityOrigin::PrivilegeData> 587 std::unique_ptr<SecurityOrigin::PrivilegeData>
582 SecurityOrigin::createPrivilegeData() const { 588 SecurityOrigin::createPrivilegeData() const {
583 std::unique_ptr<PrivilegeData> privilegeData = 589 std::unique_ptr<PrivilegeData> privilegeData =
(...skipping 28 matching lines...) Expand all
612 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost); 618 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost);
613 } else { 619 } else {
614 *success = url::CanonicalizeHost(host.characters16(), 620 *success = url::CanonicalizeHost(host.characters16(),
615 url::Component(0, host.length()), 621 url::Component(0, host.length()),
616 &canonOutput, &outHost); 622 &canonOutput, &outHost);
617 } 623 }
618 return String::fromUTF8(canonOutput.data(), canonOutput.length()); 624 return String::fromUTF8(canonOutput.data(), canonOutput.length());
619 } 625 }
620 626
621 } // namespace blink 627 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698