| 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 #ifndef UI_GFX_ICC_PROFILE_H_ | 5 #ifndef UI_GFX_ICC_PROFILE_H_ |
| 6 #define UI_GFX_ICC_PROFILE_H_ | 6 #define UI_GFX_ICC_PROFILE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "ui/gfx/color_space.h" | 12 #include "ui/gfx/color_space.h" |
| 13 | 13 |
| 14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
| 15 #include <CoreGraphics/CGColorSpace.h> | 15 #include <CoreGraphics/CGColorSpace.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); |
| 19 |
| 18 namespace gfx { | 20 namespace gfx { |
| 19 | 21 |
| 20 // Used to represent a full ICC profile, usually retrieved from a monitor. It | 22 // Used to represent a full ICC profile, usually retrieved from a monitor. It |
| 21 // can be lossily compressed into a ColorSpace object. This structure should | 23 // can be lossily compressed into a ColorSpace object. This structure should |
| 22 // only be sent from higher-privilege processes to lower-privilege processes, | 24 // only be sent from higher-privilege processes to lower-privilege processes, |
| 23 // as parsing this structure is not secure. | 25 // as parsing this structure is not secure. |
| 24 class GFX_EXPORT ICCProfile { | 26 class GFX_EXPORT ICCProfile { |
| 25 public: | 27 public: |
| 26 ICCProfile(); | 28 ICCProfile(); |
| 27 ICCProfile(ICCProfile&& other); | 29 ICCProfile(ICCProfile&& other); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static bool IsValidProfileLength(size_t length); | 64 static bool IsValidProfileLength(size_t length); |
| 63 | 65 |
| 64 bool valid_ = false; | 66 bool valid_ = false; |
| 65 std::vector<char> data_; | 67 std::vector<char> data_; |
| 66 | 68 |
| 67 // This globally identifies this ICC profile. It is used to look up this ICC | 69 // This globally identifies this ICC profile. It is used to look up this ICC |
| 68 // profile from a ColorSpace object created from it. | 70 // profile from a ColorSpace object created from it. |
| 69 uint64_t id_ = 0; | 71 uint64_t id_ = 0; |
| 70 | 72 |
| 71 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, BT709toSRGBICC); | 73 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, BT709toSRGBICC); |
| 74 friend int ::LLVMFuzzerTestOneInput(const uint8_t*, size_t); |
| 72 friend class ColorSpace; | 75 friend class ColorSpace; |
| 73 friend struct IPC::ParamTraits<gfx::ICCProfile>; | 76 friend struct IPC::ParamTraits<gfx::ICCProfile>; |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace gfx | 79 } // namespace gfx |
| 77 | 80 |
| 78 #endif // UI_GFX_ICC_PROFILE_H_ | 81 #endif // UI_GFX_ICC_PROFILE_H_ |
| OLD | NEW |