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

Side by Side Diff: Source/platform/image-decoders/jpeg/JPEGImageDecoder.h

Issue 1242263011: Record UMA stats for Blink decoded image types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008-2009 Torch Mobile, Inc. 3 * Copyright (C) 2008-2009 Torch Mobile, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 bool outputScanlines(); 57 bool outputScanlines();
58 unsigned desiredScaleNumerator() const; 58 unsigned desiredScaleNumerator() const;
59 void complete(); 59 void complete();
60 60
61 void setOrientation(ImageOrientation orientation) { m_orientation = orientat ion; } 61 void setOrientation(ImageOrientation orientation) { m_orientation = orientat ion; }
62 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor Profile; } 62 void setHasColorProfile(bool hasColorProfile) { m_hasColorProfile = hasColor Profile; }
63 void setDecodedSize(unsigned width, unsigned height); 63 void setDecodedSize(unsigned width, unsigned height);
64 64
65 private: 65 private:
66 // ImageDecoder: 66 // ImageDecoder:
67 void decodeSize() override { decode(true); } 67 void decodeSize() override
68 {
69 decode(true);
70 reportStats(ImageJPEG);
71 }
68 void decode(size_t) override { decode(false); } 72 void decode(size_t) override { decode(false); }
69 73
70 // Decodes the image. If |onlySize| is true, stops decoding after 74 // Decodes the image. If |onlySize| is true, stops decoding after
71 // calculating the image size. If decoding fails but there is no more 75 // calculating the image size. If decoding fails but there is no more
72 // data coming, sets the "decode failure" flag. 76 // data coming, sets the "decode failure" flag.
73 void decode(bool onlySize); 77 void decode(bool onlySize);
74 78
75 OwnPtr<JPEGImageReader> m_reader; 79 OwnPtr<JPEGImageReader> m_reader;
76 OwnPtr<ImagePlanes> m_imagePlanes; 80 OwnPtr<ImagePlanes> m_imagePlanes;
77 IntSize m_decodedSize; 81 IntSize m_decodedSize;
78 bool m_hasColorProfile; 82 bool m_hasColorProfile;
79 }; 83 };
80 84
81 } // namespace blink 85 } // namespace blink
82 86
83 #endif 87 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698