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

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

Issue 1487343002: Set credentials mode "same-origin" when crossOrigin=anonymous is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/TextTrackLoader.h ('k') | 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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 if (m_state == Finished && m_cueParser) 99 if (m_state == Finished && m_cueParser)
100 m_cueParser->flush(); 100 m_cueParser->flush();
101 101
102 if (!m_cueLoadTimer.isActive()) 102 if (!m_cueLoadTimer.isActive())
103 m_cueLoadTimer.startOneShot(0, BLINK_FROM_HERE); 103 m_cueLoadTimer.startOneShot(0, BLINK_FROM_HERE);
104 104
105 cancelLoad(); 105 cancelLoad();
106 } 106 }
107 107
108 bool TextTrackLoader::load(const KURL& url, const AtomicString& crossOriginMode) 108 bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi n)
109 { 109 {
110 cancelLoad(); 110 cancelLoad();
111 111
112 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI nitiatorTypeNames::texttrack); 112 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI nitiatorTypeNames::texttrack);
113 113
114 if (!crossOriginMode.isNull()) { 114 if (crossOrigin != CrossOriginAttributeNotSet) {
115 cueRequest.setCrossOriginAccessControl(document().securityOrigin(), cros sOriginMode); 115 cueRequest.setCrossOriginAccessControl(document().securityOrigin(), cros sOrigin);
116 } else if (!document().securityOrigin()->canRequestNoSuborigin(url)) { 116 } else if (!document().securityOrigin()->canRequestNoSuborigin(url)) {
117 // Text track elements without 'crossorigin' set on the parent are "No C ORS"; report error if not same-origin. 117 // Text track elements without 'crossorigin' set on the parent are "No C ORS"; report error if not same-origin.
118 corsPolicyPreventedLoad(document().securityOrigin(), url); 118 corsPolicyPreventedLoad(document().securityOrigin(), url);
119 return false; 119 return false;
120 } 120 }
121 121
122 ResourceFetcher* fetcher = document().fetcher(); 122 ResourceFetcher* fetcher = document().fetcher();
123 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); 123 setResource(RawResource::fetchTextTrack(cueRequest, fetcher));
124 return resource(); 124 return resource();
125 } 125 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 m_cueParser->getNewRegions(outputRegions); 164 m_cueParser->getNewRegions(outputRegions);
165 } 165 }
166 166
167 DEFINE_TRACE(TextTrackLoader) 167 DEFINE_TRACE(TextTrackLoader)
168 { 168 {
169 visitor->trace(m_cueParser); 169 visitor->trace(m_cueParser);
170 visitor->trace(m_document); 170 visitor->trace(m_document);
171 } 171 }
172 172
173 } 173 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/TextTrackLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698