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

Side by Side Diff: include/core/SkRefCnt.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
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | src/pdf/SkPDFGraphicState.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 SkRefCnt_DEFINED 10 #ifndef SkRefCnt_DEFINED
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 * Called when the ref count goes to 0. 100 * Called when the ref count goes to 0.
101 */ 101 */
102 virtual void internal_dispose() const { 102 virtual void internal_dispose() const {
103 this->internal_dispose_restore_refcnt_to_1(); 103 this->internal_dispose_restore_refcnt_to_1();
104 SkDELETE(this); 104 SkDELETE(this);
105 } 105 }
106 106
107 friend class SkWeakRefCnt; 107 friend class SkWeakRefCnt;
108 friend class GrTexture; // to allow GrTexture's internal_dispose to 108 friend class GrTexture; // to allow GrTexture's internal_dispose to
109 // call SkRefCnt's & directly set fRefCnt (to 1) 109 // call SkRefCnt's & directly set fRefCnt (to 1)
110 friend class SkPDFObject; // To allow SkPDFObject to unwind recursive
111 // destructors on heap instead of stack,
112 // avoiding stack overflow.
110 113
111 mutable int32_t fRefCnt; 114 mutable int32_t fRefCnt;
112 115
113 typedef SkNoncopyable INHERITED; 116 typedef SkNoncopyable INHERITED;
114 }; 117 };
115 118
116 /////////////////////////////////////////////////////////////////////////////// 119 ///////////////////////////////////////////////////////////////////////////////
117 120
118 /** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for 121 /** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for
119 null in on each side of the assignment, and ensuring that ref() is called 122 null in on each side of the assignment, and ensuring that ref() is called
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 typedef T* SkRefPtr::*unspecified_bool_type; 258 typedef T* SkRefPtr::*unspecified_bool_type;
256 operator unspecified_bool_type() const { 259 operator unspecified_bool_type() const {
257 return fObj ? &SkRefPtr::fObj : NULL; 260 return fObj ? &SkRefPtr::fObj : NULL;
258 } 261 }
259 262
260 private: 263 private:
261 T* fObj; 264 T* fObj;
262 }; 265 };
263 266
264 #endif 267 #endif
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | src/pdf/SkPDFGraphicState.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698