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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2332023002: Correctly set requestor origin for worker initiated requests. (Closed)
Patch Set: Created 4 years, 3 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 746
747 if (request.firstPartyForCookies().isNull()) { 747 if (request.firstPartyForCookies().isNull()) {
748 request.setFirstPartyForCookies(m_document 748 request.setFirstPartyForCookies(m_document
749 ? m_document->firstPartyForCookies() 749 ? m_document->firstPartyForCookies()
750 : SecurityOrigin::urlWithUniqueSecurityOrigin()); 750 : SecurityOrigin::urlWithUniqueSecurityOrigin());
751 } 751 }
752 752
753 // Subresource requests inherit their requestor origin from |m_document| dir ectly. 753 // Subresource requests inherit their requestor origin from |m_document| dir ectly.
754 // Top-level and nested frame types are taken care of in 'FrameLoadRequest() '. 754 // Top-level and nested frame types are taken care of in 'FrameLoadRequest() '.
755 // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'. 755 // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'.
756 if (request.frameType() == WebURLRequest::FrameTypeNone && !request.requesto rOrigin()) { 756 //
757 // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to
758 // initialize itself with a `nullptr` initiator so that this can be a simple
759 // `isNull()` check. https://crbug.com/625969
760 if (request.frameType() == WebURLRequest::FrameTypeNone && request.requestor Origin()->isUnique()) {
757 request.setRequestorOrigin(m_document->isSandboxed(SandboxOrigin) 761 request.setRequestorOrigin(m_document->isSandboxed(SandboxOrigin)
758 ? SecurityOrigin::create(m_document->url()) 762 ? SecurityOrigin::create(m_document->url())
759 : m_document->getSecurityOrigin()); 763 : m_document->getSecurityOrigin());
760 } 764 }
761 } 765 }
762 766
763 MHTMLArchive* FrameFetchContext::archive() const 767 MHTMLArchive* FrameFetchContext::archive() const
764 { 768 {
765 ASSERT(!isMainFrame()); 769 ASSERT(!isMainFrame());
766 // TODO(nasko): How should this work with OOPIF? 770 // TODO(nasko): How should this work with OOPIF?
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 } 835 }
832 836
833 DEFINE_TRACE(FrameFetchContext) 837 DEFINE_TRACE(FrameFetchContext)
834 { 838 {
835 visitor->trace(m_document); 839 visitor->trace(m_document);
836 visitor->trace(m_documentLoader); 840 visitor->trace(m_documentLoader);
837 FetchContext::trace(visitor); 841 FetchContext::trace(visitor);
838 } 842 }
839 843
840 } // namespace blink 844 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698