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

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

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/LinkLoader.cpp ('k') | Source/core/svg/SVGFEImageElement.cpp » ('j') | 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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/loader/TextTrackLoader.h" 28 #include "core/loader/TextTrackLoader.h"
29 29
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/fetch/FetchInitiatorTypeNames.h" 31 #include "core/fetch/FetchInitiatorTypeNames.h"
32 #include "core/fetch/FetchRequest.h" 32 #include "core/fetch/FetchRequest.h"
33 #include "core/fetch/RawResource.h"
33 #include "core/fetch/ResourceFetcher.h" 34 #include "core/fetch/ResourceFetcher.h"
34 #include "core/inspector/ConsoleMessage.h" 35 #include "core/inspector/ConsoleMessage.h"
35 #include "platform/Logging.h" 36 #include "platform/Logging.h"
36 #include "platform/SharedBuffer.h" 37 #include "platform/SharedBuffer.h"
37 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient& client, Document& docume nt) 42 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient& client, Document& docume nt)
42 : m_client(client) 43 : m_client(client)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 113
113 if (!crossOriginMode.isNull()) { 114 if (!crossOriginMode.isNull()) {
114 cueRequest.setCrossOriginAccessControl(document().securityOrigin(), cros sOriginMode); 115 cueRequest.setCrossOriginAccessControl(document().securityOrigin(), cros sOriginMode);
115 } else if (!document().securityOrigin()->canRequest(url)) { 116 } else if (!document().securityOrigin()->canRequest(url)) {
116 // 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.
117 corsPolicyPreventedLoad(document().securityOrigin(), url); 118 corsPolicyPreventedLoad(document().securityOrigin(), url);
118 return false; 119 return false;
119 } 120 }
120 121
121 ResourceFetcher* fetcher = document().fetcher(); 122 ResourceFetcher* fetcher = document().fetcher();
122 setResource(fetcher->fetchTextTrack(cueRequest)); 123 setResource(RawResource::fetchTextTrack(cueRequest, fetcher));
123 return resource(); 124 return resource();
124 } 125 }
125 126
126 void TextTrackLoader::newCuesParsed() 127 void TextTrackLoader::newCuesParsed()
127 { 128 {
128 if (m_cueLoadTimer.isActive()) 129 if (m_cueLoadTimer.isActive())
129 return; 130 return;
130 131
131 m_newCuesAvailable = true; 132 m_newCuesAvailable = true;
132 m_cueLoadTimer.startOneShot(0, FROM_HERE); 133 m_cueLoadTimer.startOneShot(0, FROM_HERE);
(...skipping 30 matching lines...) Expand all
163 m_cueParser->getNewRegions(outputRegions); 164 m_cueParser->getNewRegions(outputRegions);
164 } 165 }
165 166
166 DEFINE_TRACE(TextTrackLoader) 167 DEFINE_TRACE(TextTrackLoader)
167 { 168 {
168 visitor->trace(m_cueParser); 169 visitor->trace(m_cueParser);
169 visitor->trace(m_document); 170 visitor->trace(m_document);
170 } 171 }
171 172
172 } 173 }
OLDNEW
« no previous file with comments | « Source/core/loader/LinkLoader.cpp ('k') | Source/core/svg/SVGFEImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698