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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.h

Issue 1820813004: Add UMA to HTMLCanvasElement to track image formats usage of toDataURL/toBlob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes based on second feedback Created 4 years, 9 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 | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('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) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 setHeight(newSize.height()); 91 setHeight(newSize.height());
92 m_ignoreReset = false; 92 m_ignoreReset = false;
93 reset(); 93 reset();
94 } 94 }
95 95
96 // Called by Document::getCSSCanvasContext as well as above getContext(). 96 // Called by Document::getCSSCanvasContext as well as above getContext().
97 CanvasRenderingContext* getCanvasRenderingContext(const String&, const Canva sContextCreationAttributes&); 97 CanvasRenderingContext* getCanvasRenderingContext(const String&, const Canva sContextCreationAttributes&);
98 98
99 bool isPaintable() const; 99 bool isPaintable() const;
100 100
101 static String toEncodingMimeType(const String& mimeType); 101 enum RequestImageFunctionCallName {
Justin Novosad 2016/03/22 20:23:02 Naming nit, you can be more concise here: EncodeRe
102 ToDataURL = 0,
Justin Novosad 2016/03/22 20:23:02 EncodeReasonToDataURL
103 ToBlobCallback = 1,
104 NumberOfRequestedImageFunctionCallNames
105 };
106 static String toEncodingMimeType(const String& mimeType, const RequestImageF unctionCallName);
102 String toDataURL(const String& mimeType, const ScriptValue& qualityArgument, ExceptionState&) const; 107 String toDataURL(const String& mimeType, const ScriptValue& qualityArgument, ExceptionState&) const;
103 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con st { return toDataURL(mimeType, ScriptValue(), exceptionState); } 108 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con st { return toDataURL(mimeType, ScriptValue(), exceptionState); }
104 109
105 void toBlob(BlobCallback*, const String& mimeType, const ScriptValue& qualit yArgument, ExceptionState&); 110 void toBlob(BlobCallback*, const String& mimeType, const ScriptValue& qualit yArgument, ExceptionState&);
106 void toBlob(BlobCallback* callback, const String& mimeType, ExceptionState& exceptionState) { return toBlob(callback, mimeType, ScriptValue(), exceptionStat e); } 111 void toBlob(BlobCallback* callback, const String& mimeType, ExceptionState& exceptionState) { return toBlob(callback, mimeType, ScriptValue(), exceptionStat e); }
107 112
108 // Used for canvas capture. 113 // Used for canvas capture.
109 void addListener(CanvasDrawListener*); 114 void addListener(CanvasDrawListener*);
110 void removeListener(CanvasDrawListener*); 115 void removeListener(CanvasDrawListener*);
111 116
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 mutable bool m_didFailToCreateImageBuffer; 237 mutable bool m_didFailToCreateImageBuffer;
233 bool m_imageBufferIsClear; 238 bool m_imageBufferIsClear;
234 OwnPtr<ImageBuffer> m_imageBuffer; 239 OwnPtr<ImageBuffer> m_imageBuffer;
235 240
236 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 241 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
237 }; 242 };
238 243
239 } // namespace blink 244 } // namespace blink
240 245
241 #endif // HTMLCanvasElement_h 246 #endif // HTMLCanvasElement_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698