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

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

Issue 1801513003: Cross origin requests to same origin should match Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing CORS tests Created 4 years, 9 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 cancelLoad(); 103 cancelLoad();
104 } 104 }
105 105
106 bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi n) 106 bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi n)
107 { 107 {
108 cancelLoad(); 108 cancelLoad();
109 109
110 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI nitiatorTypeNames::texttrack); 110 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI nitiatorTypeNames::texttrack);
111 111
112 if (crossOrigin != CrossOriginAttributeNotSet) { 112 if (crossOrigin == CrossOriginAttributeNotSet && !document().getSecurityOrig in()->canRequestNoSuborigin(url)) {
113 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), c rossOrigin);
114 } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) {
115 // Text track elements without 'crossorigin' set on the parent are "No C ORS"; report error if not same-origin. 113 // Text track elements without 'crossorigin' set on the parent are "No C ORS"; report error if not same-origin.
116 corsPolicyPreventedLoad(document().getSecurityOrigin(), url); 114 corsPolicyPreventedLoad(document().getSecurityOrigin(), url);
117 return false; 115 return false;
118 } 116 }
117 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), cross Origin);
119 118
120 ResourceFetcher* fetcher = document().fetcher(); 119 ResourceFetcher* fetcher = document().fetcher();
121 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); 120 setResource(RawResource::fetchTextTrack(cueRequest, fetcher));
122 return resource(); 121 return resource();
123 } 122 }
124 123
125 void TextTrackLoader::newCuesParsed() 124 void TextTrackLoader::newCuesParsed()
126 { 125 {
127 if (m_cueLoadTimer.isActive()) 126 if (m_cueLoadTimer.isActive())
128 return; 127 return;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 162 }
164 163
165 DEFINE_TRACE(TextTrackLoader) 164 DEFINE_TRACE(TextTrackLoader)
166 { 165 {
167 visitor->trace(m_cueParser); 166 visitor->trace(m_cueParser);
168 visitor->trace(m_document); 167 visitor->trace(m_document);
169 ResourceOwner<RawResource>::trace(visitor); 168 ResourceOwner<RawResource>::trace(visitor);
170 } 169 }
171 170
172 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698