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: Source/core/loader/TextTrackLoader.cpp

Issue 59453002: Add a flushing mechanism for the WebVTTParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Even more binary 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 | « Source/core/html/track/WebVTTParser.cpp ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (!m_crossOriginMode.isNull() 102 if (!m_crossOriginMode.isNull()
103 && !m_document.securityOrigin()->canRequest(resource->response().url()) 103 && !m_document.securityOrigin()->canRequest(resource->response().url())
104 && !resource->passesAccessControlCheck(m_document.securityOrigin())) { 104 && !resource->passesAccessControlCheck(m_document.securityOrigin())) {
105 105
106 corsPolicyPreventedLoad(); 106 corsPolicyPreventedLoad();
107 } 107 }
108 108
109 if (m_state != Failed) 109 if (m_state != Failed)
110 m_state = resource->errorOccurred() ? Failed : Finished; 110 m_state = resource->errorOccurred() ? Failed : Finished;
111 111
112 if (m_state == Finished && m_cueParser)
113 m_cueParser->flush();
114
112 if (!m_cueLoadTimer.isActive()) 115 if (!m_cueLoadTimer.isActive())
113 m_cueLoadTimer.startOneShot(0); 116 m_cueLoadTimer.startOneShot(0);
114 117
115 cancelLoad(); 118 cancelLoad();
116 } 119 }
117 120
118 bool TextTrackLoader::load(const KURL& url, const String& crossOriginMode) 121 bool TextTrackLoader::load(const KURL& url, const String& crossOriginMode)
119 { 122 {
120 cancelLoad(); 123 cancelLoad();
121 124
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 178 }
176 179
177 void TextTrackLoader::getNewRegions(Vector<RefPtr<VTTRegion> >& outputRegions) 180 void TextTrackLoader::getNewRegions(Vector<RefPtr<VTTRegion> >& outputRegions)
178 { 181 {
179 ASSERT(m_cueParser); 182 ASSERT(m_cueParser);
180 if (m_cueParser) 183 if (m_cueParser)
181 m_cueParser->getNewRegions(outputRegions); 184 m_cueParser->getNewRegions(outputRegions);
182 } 185 }
183 186
184 } 187 }
OLDNEW
« no previous file with comments | « Source/core/html/track/WebVTTParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698