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

Side by Side Diff: src/pdf/SkPDFStream.h

Issue 12387086: Unwind PDFObject destructor calls into heap instead of stack. Notice: the order of the destructors … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkPDFStream_DEFINED 10 #ifndef SkPDFStream_DEFINED
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); 44 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect);
45 45
46 protected: 46 protected:
47 /* Create a PDF stream with no data. The setData method must be called to 47 /* Create a PDF stream with no data. The setData method must be called to
48 * set the data. 48 * set the data.
49 */ 49 */
50 SkPDFStream(); 50 SkPDFStream();
51 51
52 void setData(SkStream* stream); 52 void setData(SkStream* stream);
53 53
54 virtual void trasferPDFObjecsOwnership(SkTDArray<SkPDFObject*>* list) {
55 list->push(fSubstitute.detach());
56
57 INHERITED::trasferPDFObjecsOwnership(list);
58 }
59
54 private: 60 private:
55 enum State { 61 enum State {
56 kUnused_State, //!< The stream hasn't been requested yet. 62 kUnused_State, //!< The stream hasn't been requested yet.
57 kNoCompression_State, //!< The stream's been requested in an 63 kNoCompression_State, //!< The stream's been requested in an
58 // uncompressed form. 64 // uncompressed form.
59 kCompressed_State, //!< The stream's already been compressed. 65 kCompressed_State, //!< The stream's already been compressed.
60 }; 66 };
61 // Indicates what form (or if) the stream has been requested. 67 // Indicates what form (or if) the stream has been requested.
62 State fState; 68 State fState;
63 69
64 // TODO(vandebo): Use SkData (after removing deprecated constructor). 70 // TODO(vandebo): Use SkData (after removing deprecated constructor).
65 SkAutoTUnref<SkStream> fData; 71 SkAutoTUnref<SkStream> fData;
66 SkAutoTUnref<SkPDFStream> fSubstitute; 72 SkAutoTUnref<SkPDFStream> fSubstitute;
67 73
68 typedef SkPDFDict INHERITED; 74 typedef SkPDFDict INHERITED;
69 75
70 // Populate the stream dictionary. This method returns false if 76 // Populate the stream dictionary. This method returns false if
71 // fSubstitute should be used. 77 // fSubstitute should be used.
72 bool populate(SkPDFCatalog* catalog); 78 bool populate(SkPDFCatalog* catalog);
73 }; 79 };
74 80
75 #endif 81 #endif
OLDNEW
« include/core/SkRefCnt.h ('K') | « src/pdf/SkPDFGraphicState.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698