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

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

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: applied review comments Created 5 years, 2 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
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic eSize, int* msaaSampleCount); 208 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic eSize, int* msaaSampleCount);
209 void createImageBuffer(); 209 void createImageBuffer();
210 void createImageBufferInternal(PassOwnPtr<ImageBufferSurface> externalSurfac e); 210 void createImageBufferInternal(PassOwnPtr<ImageBufferSurface> externalSurfac e);
211 bool shouldUseDisplayList(const IntSize& deviceSize); 211 bool shouldUseDisplayList(const IntSize& deviceSize);
212 212
213 void setSurfaceSize(const IntSize&); 213 void setSurfaceSize(const IntSize&);
214 214
215 bool paintsIntoCanvasBuffer() const; 215 bool paintsIntoCanvasBuffer() const;
216 216
217 ImageData* toImageData(SourceDrawingBuffer) const; 217 ImageData* toImageData(SourceDrawingBuffer, ExceptionState&) const;
218 String toDataURLInternal(const String& mimeType, const double& quality, Sour ceDrawingBuffer) const; 218 String toDataURLInternal(const String& mimeType, const double& quality, Sour ceDrawingBuffer, ExceptionState&) const;
219 219
220 static void encodeImageAsync(DOMUint8ClampedArray* imagedata, IntSize imageS ize, FileCallback*, const String& mimeType, double quality); 220 static void encodeImageAsync(DOMUint8ClampedArray* imagedata, IntSize imageS ize, FileCallback*, const String& mimeType, double quality);
221 static void createBlobAndCall(PassOwnPtr<Vector<char>> encodedImage, const S tring& mimeType, FileCallback*); 221 static void createBlobAndCall(PassOwnPtr<Vector<char>> encodedImage, const S tring& mimeType, FileCallback*);
222 222
223 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; 223 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers;
224 224
225 IntSize m_size; 225 IntSize m_size;
226 226
227 OwnPtrWillBeMember<CanvasRenderingContext> m_context; 227 OwnPtrWillBeMember<CanvasRenderingContext> m_context;
228 228
(...skipping 10 matching lines...) Expand all
239 mutable bool m_didFailToCreateImageBuffer; 239 mutable bool m_didFailToCreateImageBuffer;
240 bool m_imageBufferIsClear; 240 bool m_imageBufferIsClear;
241 OwnPtr<ImageBuffer> m_imageBuffer; 241 OwnPtr<ImageBuffer> m_imageBuffer;
242 242
243 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 243 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
244 }; 244 };
245 245
246 } // namespace blink 246 } // namespace blink
247 247
248 #endif // HTMLCanvasElement_h 248 #endif // HTMLCanvasElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698