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

Side by Side Diff: Source/platform/MIMETypeRegistry.cpp

Issue 1302423004: Support lossy and lossless <canvas>.toDataURL for webp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing. Created 5 years, 3 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
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/platform/graphics/ImageBuffer.h » ('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) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool MIMETypeRegistry::isSupportedImagePrefixedMIMEType(const String& mimeType) 80 bool MIMETypeRegistry::isSupportedImagePrefixedMIMEType(const String& mimeType)
81 { 81 {
82 return Platform::current()->mimeRegistry()->supportsImagePrefixedMIMEType(mi meType.lower()) 82 return Platform::current()->mimeRegistry()->supportsImagePrefixedMIMEType(mi meType.lower())
83 != WebMimeRegistry::IsNotSupported; 83 != WebMimeRegistry::IsNotSupported;
84 } 84 }
85 85
86 bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeTyp e) 86 bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeTyp e)
87 { 87 {
88 if (equalIgnoringCase(mimeType, "image/jpeg") || equalIgnoringCase(mimeType, "image/png")) 88 if (equalIgnoringCase(mimeType, "image/jpeg") || equalIgnoringCase(mimeType, "image/png"))
89 return true; 89 return true;
90 if (equalIgnoringCase(mimeType, "image/webp")) 90 if (equalIgnoringCase(mimeType, "image/webp") || equalIgnoringCase(mimeType, "image/webp.ll"))
91 return true; 91 return true;
92 return false; 92 return false;
93 } 93 }
94 94
95 bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType) 95 bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType)
96 { 96 {
97 return Platform::current()->mimeRegistry()->supportsJavaScriptMIMEType(mimeT ype.lower()) 97 return Platform::current()->mimeRegistry()->supportsJavaScriptMIMEType(mimeT ype.lower())
98 != WebMimeRegistry::IsNotSupported; 98 != WebMimeRegistry::IsNotSupported;
99 } 99 }
100 100
(...skipping 14 matching lines...) Expand all
115 // Since this set is very limited and is likely to remain so we won't bother with the overhead 115 // Since this set is very limited and is likely to remain so we won't bother with the overhead
116 // of using a hash set. 116 // of using a hash set.
117 // Any of the MIME types below may be followed by any number of specific ver sions of the JVM, 117 // Any of the MIME types below may be followed by any number of specific ver sions of the JVM,
118 // which is why we use startsWith() 118 // which is why we use startsWith()
119 return mimeType.startsWith("application/x-java-applet", TextCaseInsensitive) 119 return mimeType.startsWith("application/x-java-applet", TextCaseInsensitive)
120 || mimeType.startsWith("application/x-java-bean", TextCaseInsensitive) 120 || mimeType.startsWith("application/x-java-bean", TextCaseInsensitive)
121 || mimeType.startsWith("application/x-java-vm", TextCaseInsensitive); 121 || mimeType.startsWith("application/x-java-vm", TextCaseInsensitive);
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/platform/graphics/ImageBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698