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

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

Issue 2065913003: Allow prolonged CanvasAsyncBlobCreator lifetime, avoid indirect leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/canvas/CanvasAsyncBlobCreator.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/CoreExport.h" 5 #include "core/CoreExport.h"
6 #include "core/dom/DOMTypedArray.h" 6 #include "core/dom/DOMTypedArray.h"
7 #include "core/fileapi/BlobCallback.h" 7 #include "core/fileapi/BlobCallback.h"
8 #include "platform/geometry/IntSize.h" 8 #include "platform/geometry/IntSize.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "wtf/OwnPtr.h" 10 #include "wtf/OwnPtr.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 virtual void createBlobAndInvokeCallback(); 57 virtual void createBlobAndInvokeCallback();
58 virtual void createNullAndInvokeCallback(); 58 virtual void createNullAndInvokeCallback();
59 59
60 void initiatePngEncoding(double deadlineSeconds); 60 void initiatePngEncoding(double deadlineSeconds);
61 void initiateJpegEncoding(const double& quality, double deadlineSeconds); 61 void initiateJpegEncoding(const double& quality, double deadlineSeconds);
62 IdleTaskStatus m_idleTaskStatus; 62 IdleTaskStatus m_idleTaskStatus;
63 63
64 private: 64 private:
65 friend class CanvasAsyncBlobCreatorTest; 65 friend class CanvasAsyncBlobCreatorTest;
66 66
67 void dispose();
68
67 OwnPtr<PNGImageEncoderState> m_pngEncoderState; 69 OwnPtr<PNGImageEncoderState> m_pngEncoderState;
68 OwnPtr<JPEGImageEncoderState> m_jpegEncoderState; 70 OwnPtr<JPEGImageEncoderState> m_jpegEncoderState;
69 Member<DOMUint8ClampedArray> m_data; 71 Member<DOMUint8ClampedArray> m_data;
70 OwnPtr<Vector<unsigned char>> m_encodedImage; 72 OwnPtr<Vector<unsigned char>> m_encodedImage;
71 int m_numRowsCompleted; 73 int m_numRowsCompleted;
72 74
73 const IntSize m_size; 75 const IntSize m_size;
74 size_t m_pixelRowStride; 76 size_t m_pixelRowStride;
75 const MimeType m_mimeType; 77 const MimeType m_mimeType;
76 Member<BlobCallback> m_callback; 78 Member<BlobCallback> m_callback;
77 79
78 // PNG 80 // PNG
79 bool initializePngStruct(); 81 bool initializePngStruct();
80 void encodeRowsPngOnMainThread(); // Similar to idleEncodeRowsPng without de adline 82 void encodeRowsPngOnMainThread(); // Similar to idleEncodeRowsPng without de adline
81 83
82 // JPEG 84 // JPEG
83 bool initializeJpegStruct(double quality); 85 bool initializeJpegStruct(double quality);
84 void encodeRowsJpegOnMainThread(); // Similar to idleEncodeRowsJpeg without deadline 86 void encodeRowsJpegOnMainThread(); // Similar to idleEncodeRowsJpeg without deadline
85 87
86 // WEBP 88 // WEBP
87 void encodeImageOnEncoderThread(double quality); 89 void encodeImageOnEncoderThread(double quality);
88 90
89 void idleTaskStartTimeoutEvent(double quality); 91 void idleTaskStartTimeoutEvent(double quality);
90 void idleTaskCompleteTimeoutEvent(); 92 void idleTaskCompleteTimeoutEvent();
91 }; 93 };
92 94
93 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698