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

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

Issue 2440163002: Cleanup WebMIMERegistry implementation and fix LinkLoader behavior (Closed)
Patch Set: minor fix Created 4 years, 2 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 case Resource::Raw: 228 case Resource::Raw:
229 m_linkPreloadResourceClient = 229 m_linkPreloadResourceClient =
230 LinkPreloadRawResourceClient::create(this, toRawResource(resource)); 230 LinkPreloadRawResourceClient::create(this, toRawResource(resource));
231 break; 231 break;
232 default: 232 default:
233 NOTREACHED(); 233 NOTREACHED();
234 } 234 }
235 } 235 }
236 236
237 static bool isSupportedType(Resource::Type resourceType, 237 static bool isSupportedType(Resource::Type resourceType,
238 const String& mimeType) { 238 const String& mimeType) {
kinuko 2016/10/21 17:32:55 looks like this could take mime parameters so we m
239 if (mimeType.isEmpty()) 239 if (mimeType.isEmpty())
240 return true; 240 return true;
241 switch (resourceType) { 241 switch (resourceType) {
242 case Resource::Image: 242 case Resource::Image:
243 return MIMETypeRegistry::isSupportedImagePrefixedMIMEType(mimeType); 243 return MIMETypeRegistry::isSupportedImagePrefixedMIMEType(mimeType);
244 case Resource::Script: 244 case Resource::Script:
245 return MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType); 245 return MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType);
246 case Resource::CSSStyleSheet: 246 case Resource::CSSStyleSheet:
247 return MIMETypeRegistry::isSupportedStyleSheetMIMEType(mimeType); 247 return MIMETypeRegistry::isSupportedStyleSheetMIMEType(mimeType);
248 case Resource::Font: 248 case Resource::Font:
249 return MIMETypeRegistry::isSupportedFontMIMEType(mimeType); 249 return MIMETypeRegistry::isSupportedFontMIMEType(mimeType);
250 case Resource::Media: 250 case Resource::Media:
251 return MIMETypeRegistry::isSupportedMediaSourceMIMEType(mimeType, 251 return MIMETypeRegistry::isSupportedMediaMIMEType(mimeType, String());
252 String());
253 case Resource::TextTrack: 252 case Resource::TextTrack:
254 return MIMETypeRegistry::isSupportedTextTrackMIMEType(mimeType); 253 return MIMETypeRegistry::isSupportedTextTrackMIMEType(mimeType);
255 case Resource::Raw: 254 case Resource::Raw:
256 return true; 255 return true;
257 default: 256 default:
258 NOTREACHED(); 257 NOTREACHED();
259 } 258 }
260 return false; 259 return false;
261 } 260 }
262 261
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 461
463 DEFINE_TRACE(LinkLoader) { 462 DEFINE_TRACE(LinkLoader) {
464 visitor->trace(m_client); 463 visitor->trace(m_client);
465 visitor->trace(m_prerender); 464 visitor->trace(m_prerender);
466 visitor->trace(m_linkPreloadResourceClient); 465 visitor->trace(m_linkPreloadResourceClient);
467 ResourceOwner<Resource, ResourceClient>::trace(visitor); 466 ResourceOwner<Resource, ResourceClient>::trace(visitor);
468 PrerenderClient::trace(visitor); 467 PrerenderClient::trace(visitor);
469 } 468 }
470 469
471 } // namespace blink 470 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.cc ('k') | third_party/WebKit/Source/platform/MIMETypeRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698