OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/image-encoders/ImageEncoderUtils.h" | 5 #include "platform/image-encoders/ImageEncoderUtils.h" |
6 | 6 |
7 #include "platform/Histogram.h" | 7 #include "platform/Histogram.h" |
8 #include "platform/network/mime/MIMETypeRegistry.h" | 8 #include "platform/network/mime/MIMETypeRegistry.h" |
9 #include "wtf/Threading.h" | 9 #include "platform/wtf/Threading.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 const char ImageEncoderUtils::kDefaultMimeType[] = "image/png"; | 13 const char ImageEncoderUtils::kDefaultMimeType[] = "image/png"; |
14 | 14 |
15 // This enum is used in a UMA histogram; the values should not be changed. | 15 // This enum is used in a UMA histogram; the values should not be changed. |
16 enum RequestedImageMimeType { | 16 enum RequestedImageMimeType { |
17 kRequestedImageMimeTypePng = 0, | 17 kRequestedImageMimeTypePng = 0, |
18 kRequestedImageMimeTypeJpeg = 1, | 18 kRequestedImageMimeTypeJpeg = 1, |
19 kRequestedImageMimeTypeWebp = 2, | 19 kRequestedImageMimeTypeWebp = 2, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this | 78 // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this |
79 // method to be used on a worker thread). | 79 // method to be used on a worker thread). |
80 if (!MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding( | 80 if (!MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding( |
81 lowercase_mime_type)) | 81 lowercase_mime_type)) |
82 lowercase_mime_type = kDefaultMimeType; | 82 lowercase_mime_type = kDefaultMimeType; |
83 return lowercase_mime_type; | 83 return lowercase_mime_type; |
84 } | 84 } |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
OLD | NEW |