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

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

Issue 53213002: Handle resource fetch failure in TextTrackLoader::load (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@refTextTrackLoaderClient
Patch Set: Created 7 years, 1 month 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 | « no previous file | 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } else { 131 } else {
132 // Cross-origin resources that are not suitably CORS-enabled may not loa d. 132 // Cross-origin resources that are not suitably CORS-enabled may not loa d.
133 if (!m_document.securityOrigin()->canRequest(url)) { 133 if (!m_document.securityOrigin()->canRequest(url)) {
134 corsPolicyPreventedLoad(); 134 corsPolicyPreventedLoad();
135 return false; 135 return false;
136 } 136 }
137 } 137 }
138 138
139 ResourceFetcher* fetcher = m_document.fetcher(); 139 ResourceFetcher* fetcher = m_document.fetcher();
140 m_resource = fetcher->fetchRawResource(cueRequest); 140 m_resource = fetcher->fetchRawResource(cueRequest);
141 if (m_resource) 141 if (!m_resource)
142 m_resource->addClient(this); 142 return false;
143
144 m_resource->addClient(this);
philipj_slow 2013/10/30 20:01:51 Too many blank lines around here? http://www.chrom
Nate Chapin 2013/10/30 20:06:10 The rules on blank lines are pretty loose. I'd lea
philipj_slow 2013/10/30 20:13:57 I've always wanted to be like you, so I'll go with
143 145
144 m_client.cueLoadingStarted(this); 146 m_client.cueLoadingStarted(this);
145 147
146 return true; 148 return true;
147 } 149 }
148 150
149 void TextTrackLoader::newCuesParsed() 151 void TextTrackLoader::newCuesParsed()
150 { 152 {
151 if (m_cueLoadTimer.isActive()) 153 if (m_cueLoadTimer.isActive())
152 return; 154 return;
(...skipping 27 matching lines...) Expand all
180 } 182 }
181 183
182 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi ons) 184 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi ons)
183 { 185 {
184 ASSERT(m_cueParser); 186 ASSERT(m_cueParser);
185 if (m_cueParser) 187 if (m_cueParser)
186 m_cueParser->getNewRegions(outputRegions); 188 m_cueParser->getNewRegions(outputRegions);
187 } 189 }
188 } 190 }
189 191
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698