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

Side by Side Diff: include/core/SkTypes.h

Issue 226183018: SkNonCopyable should be used with private inheritance. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: name resolution Created 6 years, 8 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 | « include/core/SkTInternalLList.h ('k') | include/gpu/GrBackendEffectFactory.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkTypes_DEFINED 8 #ifndef SkTypes_DEFINED
9 #define SkTypes_DEFINED 9 #define SkTypes_DEFINED
10 10
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 SkAutoFree(const SkAutoFree&); 479 SkAutoFree(const SkAutoFree&);
480 SkAutoFree& operator=(const SkAutoFree&); 480 SkAutoFree& operator=(const SkAutoFree&);
481 }; 481 };
482 #define SkAutoFree(...) SK_REQUIRE_LOCAL_VAR(SkAutoFree) 482 #define SkAutoFree(...) SK_REQUIRE_LOCAL_VAR(SkAutoFree)
483 483
484 /** 484 /**
485 * Manage an allocated block of heap memory. This object is the sole manager of 485 * Manage an allocated block of heap memory. This object is the sole manager of
486 * the lifetime of the block, so the caller must not call sk_free() or delete 486 * the lifetime of the block, so the caller must not call sk_free() or delete
487 * on the block, unless detach() was called. 487 * on the block, unless detach() was called.
488 */ 488 */
489 class SkAutoMalloc : public SkNoncopyable { 489 class SkAutoMalloc : SkNoncopyable {
490 public: 490 public:
491 explicit SkAutoMalloc(size_t size = 0) { 491 explicit SkAutoMalloc(size_t size = 0) {
492 fPtr = size ? sk_malloc_throw(size) : NULL; 492 fPtr = size ? sk_malloc_throw(size) : NULL;
493 fSize = size; 493 fSize = size;
494 } 494 }
495 495
496 ~SkAutoMalloc() { 496 ~SkAutoMalloc() {
497 sk_free(fPtr); 497 sk_free(fPtr);
498 } 498 }
499 499
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 private: 651 private:
652 void* fPtr; 652 void* fPtr;
653 size_t fSize; // can be larger than the requested size (see kReuse) 653 size_t fSize; // can be larger than the requested size (see kReuse)
654 uint32_t fStorage[(kSize + 3) >> 2]; 654 uint32_t fStorage[(kSize + 3) >> 2];
655 }; 655 };
656 // Can't guard the constructor because it's a template class. 656 // Can't guard the constructor because it's a template class.
657 657
658 #endif /* C++ */ 658 #endif /* C++ */
659 659
660 #endif 660 #endif
OLDNEW
« no previous file with comments | « include/core/SkTInternalLList.h ('k') | include/gpu/GrBackendEffectFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698