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

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

Issue 1754453002: Change preload's as values audio/video to media (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and test alignment 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, DebugMessageLevel, 164 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, DebugMessageLevel,
165 String("Preconnect CORS setting is ") + String((crossOrigin == CrossOriginAttributeAnonymous) ? "anonymous" : "use-credentials"))); 165 String("Preconnect CORS setting is ") + String((crossOrigin == CrossOriginAttributeAnonymous) ? "anonymous" : "use-credentials")));
166 } 166 }
167 } 167 }
168 networkHintsInterface.preconnectHost(href, crossOrigin); 168 networkHintsInterface.preconnectHost(href, crossOrigin);
169 } 169 }
170 } 170 }
171 171
172 bool LinkLoader::getResourceTypeFromAsAttribute(const String& as, Resource::Type & type) 172 bool LinkLoader::getResourceTypeFromAsAttribute(const String& as, Resource::Type & type)
173 { 173 {
174 if (equalIgnoringCase(as, "image")) { 174 ASSERT(as.lower() == as);
Nate Chapin 2016/03/10 22:49:05 Was this always true?
Yoav Weiss 2016/03/10 23:12:12 Yes, it was (embarrassingly)
175 if (as == "image") {
175 type = Resource::Image; 176 type = Resource::Image;
176 } else if (equalIgnoringCase(as, "script")) { 177 } else if (as == "script") {
177 type = Resource::Script; 178 type = Resource::Script;
178 } else if (equalIgnoringCase(as, "style")) { 179 } else if (as == "style") {
179 type = Resource::CSSStyleSheet; 180 type = Resource::CSSStyleSheet;
180 } else if (equalIgnoringCase(as, "audio") || equalIgnoringCase(as, "video")) { 181 } else if (as == "media") {
181 type = Resource::Media; 182 type = Resource::Media;
182 } else if (equalIgnoringCase(as, "font")) { 183 } else if (as == "font") {
183 type = Resource::Font; 184 type = Resource::Font;
184 } else if (equalIgnoringCase(as, "track")) { 185 } else if (as == "track") {
185 type = Resource::TextTrack; 186 type = Resource::TextTrack;
186 } else { 187 } else {
187 type = Resource::LinkPreload; 188 type = Resource::LinkPreload;
188 if (!as.isEmpty()) 189 if (!as.isEmpty())
189 return false; 190 return false;
190 } 191 }
191 return true; 192 return true;
192 } 193 }
193 194
194 void LinkLoader::createLinkPreloadResourceClient(Resource* resource) 195 void LinkLoader::createLinkPreloadResourceClient(Resource* resource)
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 375
375 DEFINE_TRACE(LinkLoader) 376 DEFINE_TRACE(LinkLoader)
376 { 377 {
377 visitor->trace(m_client); 378 visitor->trace(m_client);
378 visitor->trace(m_prerender); 379 visitor->trace(m_prerender);
379 visitor->trace(m_linkPreloadResourceClient); 380 visitor->trace(m_linkPreloadResourceClient);
380 ResourceOwner<Resource, ResourceClient>::trace(visitor); 381 ResourceOwner<Resource, ResourceClient>::trace(visitor);
381 } 382 }
382 383
383 } // namespace blink 384 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698