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

Side by Side Diff: Source/platform/graphics/BitmapImage.h

Issue 1242263011: Record UMA stats for Blink decoded image types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved logic to BitmapImage to avoid double counting for ICO/CUR 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 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * Copyright (C) 2008-2009 Torch Mobile, Inc. 4 * Copyright (C) 2008-2009 Torch Mobile, Inc.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 23 matching lines...) Expand all
34 #include "platform/graphics/Image.h" 34 #include "platform/graphics/Image.h"
35 #include "platform/graphics/ImageAnimationPolicy.h" 35 #include "platform/graphics/ImageAnimationPolicy.h"
36 #include "platform/graphics/ImageOrientation.h" 36 #include "platform/graphics/ImageOrientation.h"
37 #include "platform/graphics/ImageSource.h" 37 #include "platform/graphics/ImageSource.h"
38 #include "platform/image-decoders/ImageAnimation.h" 38 #include "platform/image-decoders/ImageAnimation.h"
39 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
40 #include "wtf/OwnPtr.h" 40 #include "wtf/OwnPtr.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 enum DecodedImageType {
45 // These values are histogrammed over time; do not change their ordinal
Noel Gordon 2015/08/01 02:33:06 We should move this into its own file, similar to
urvang 2015/08/04 20:21:17 Can you explain why this is necessary? - Other enu
46 // values. When deleting an image type, replace it with a dummy value;
47 // when adding an image type, do so at the bottom (and update DecodedImageTy peMax).
48 // Also, this enum should be in sync with the 'DecodedImageType' enum in
49 // tools/metrics/histograms/histograms.xml
Noel Gordon 2015/08/01 02:33:06 tools/metrics/histograms/histograms.xml -> src/too
urvang 2015/08/04 20:21:16 In code search, "tools/metrics/histograms/histogra
50 ImageUnknown = 0,
51 ImageJPEG,
52 ImagePNG,
53 ImageGIF,
54 ImageWebP,
55 ImageICO,
56 ImageBMP,
57
58 DecodedImageTypeMax = ImageBMP // Must equal the last "real" image type abov e.
Noel Gordon 2015/08/01 02:33:06 nit: abbv DecodedImageTypeMax. Rename it to LastD
urvang 2015/08/04 20:21:16 Done.
59 };
60
44 template <typename T> class Timer; 61 template <typename T> class Timer;
45 62
46 class PLATFORM_EXPORT BitmapImage final : public Image { 63 class PLATFORM_EXPORT BitmapImage final : public Image {
47 friend class GeneratedImage; 64 friend class GeneratedImage;
48 friend class CrossfadeGeneratedImage; 65 friend class CrossfadeGeneratedImage;
49 friend class GradientGeneratedImage; 66 friend class GradientGeneratedImage;
50 friend class GraphicsContext; 67 friend class GraphicsContext;
51 public: 68 public:
52 static PassRefPtr<BitmapImage> create(const SkBitmap&, ImageObserver* = 0); 69 static PassRefPtr<BitmapImage> create(const SkBitmap&, ImageObserver* = 0);
53 70
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the fi rst image frame yet from ImageIO. 208 bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the fi rst image frame yet from ImageIO.
192 mutable bool m_hasUniformFrameSize : 1; 209 mutable bool m_hasUniformFrameSize : 1;
193 mutable bool m_haveFrameCount : 1; 210 mutable bool m_haveFrameCount : 1;
194 }; 211 };
195 212
196 DEFINE_IMAGE_TYPE_CASTS(BitmapImage); 213 DEFINE_IMAGE_TYPE_CASTS(BitmapImage);
197 214
198 } // namespace blink 215 } // namespace blink
199 216
200 #endif 217 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/BitmapImage.cpp » ('j') | Source/platform/graphics/BitmapImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698