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

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

Issue 2323143002: Correctly set requestor origin for worker initiated requests. (Closed)
Patch Set: rebase 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 744
745 if (request.firstPartyForCookies().isNull()) { 745 if (request.firstPartyForCookies().isNull()) {
746 request.setFirstPartyForCookies(m_document 746 request.setFirstPartyForCookies(m_document
747 ? m_document->firstPartyForCookies() 747 ? m_document->firstPartyForCookies()
748 : SecurityOrigin::urlWithUniqueSecurityOrigin()); 748 : SecurityOrigin::urlWithUniqueSecurityOrigin());
749 } 749 }
750 750
751 // Subresource requests inherit their requestor origin from |m_document| dir ectly. 751 // Subresource requests inherit their requestor origin from |m_document| dir ectly.
752 // Top-level and nested frame types are taken care of in 'FrameLoadRequest() '. 752 // Top-level and nested frame types are taken care of in 'FrameLoadRequest() '.
753 // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'. 753 // Auxiliary frame types in 'createWindow()' and 'FrameLoader::load'.
754 if (request.frameType() == WebURLRequest::FrameTypeNone && !request.requesto rOrigin()) { 754 //
755 // TODO(mkwst): It would be cleaner to adjust blink::ResourceRequest to
756 // initialize itself with a `nullptr` initiator so that this can be a simple
757 // `isNull()` check. https://crbug.com/625969
758 if (request.frameType() == WebURLRequest::FrameTypeNone && request.requestor Origin()->isUnique()) {
755 request.setRequestorOrigin(m_document->isSandboxed(SandboxOrigin) 759 request.setRequestorOrigin(m_document->isSandboxed(SandboxOrigin)
756 ? SecurityOrigin::create(m_document->url()) 760 ? SecurityOrigin::create(m_document->url())
757 : m_document->getSecurityOrigin()); 761 : m_document->getSecurityOrigin());
758 } 762 }
759 } 763 }
760 764
761 MHTMLArchive* FrameFetchContext::archive() const 765 MHTMLArchive* FrameFetchContext::archive() const
762 { 766 {
763 ASSERT(!isMainFrame()); 767 ASSERT(!isMainFrame());
764 // TODO(nasko): How should this work with OOPIF? 768 // TODO(nasko): How should this work with OOPIF?
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 } 833 }
830 834
831 DEFINE_TRACE(FrameFetchContext) 835 DEFINE_TRACE(FrameFetchContext)
832 { 836 {
833 visitor->trace(m_document); 837 visitor->trace(m_document);
834 visitor->trace(m_documentLoader); 838 visitor->trace(m_documentLoader);
835 FetchContext::trace(visitor); 839 FetchContext::trace(visitor);
836 } 840 }
837 841
838 } // namespace blink 842 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698