summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-20 05:30:31 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-20 05:30:31 +0000
commit52657f6d8188d091335f056c3c2a8bf0893fd99e (patch)
treec5f627bf2f72c66950366df6ea99f75e1fd0c7f8 /PRESUBMIT.py
parentf2068f96d7d4c14f3e10d5926eb49074d7e64f44 (diff)
downloadchromium_src-52657f6d8188d091335f056c3c2a8bf0893fd99e.zip
chromium_src-52657f6d8188d091335f056c3c2a8bf0893fd99e.tar.gz
chromium_src-52657f6d8188d091335f056c3c2a8bf0893fd99e.tar.bz2
Forbid unwanted Skia ref-counting containers
skia::RefPtr is the closest Chromium construct to scoped_refptr and also the safest Skia refcounting class. To avoid other people continually shooting themselves in the face mistaking SkRefPtr for skia::RefPtr (one of which refs the pointer you give it and the other doesn't), ban this in Chromium via global PRESUBMIT. The Skia team also prefers to keep the SkAutoTUnref template private (see discussion here: https://codereview.appspot.com/6849109/), so prefer SkRefPtr over that as well. Finally, SkAutoUnref and SkAutoRef are both templates that support SkRefPtr and SkAutoTUnref, so make sure these are unused as well. R=maruel@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/15063008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201029 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e61f385..3418265 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -160,6 +160,43 @@ _BANNED_CPP_FUNCTIONS = (
r"^net[\\\/]disk_cache[\\\/]cache_util\.cc$",
),
),
+ (
+ 'SkRefPtr',
+ (
+ 'The use of SkRefPtr is prohibited. ',
+ 'Please use skia::RefPtr instead.'
+ ),
+ True,
+ (),
+ ),
+ (
+ 'SkAutoRef',
+ (
+ 'The indirect use of SkRefPtr via SkAutoRef is prohibited. ',
+ 'Please use skia::RefPtr instead.'
+ ),
+ True,
+ (),
+ ),
+ (
+ 'SkAutoTUnref',
+ (
+ 'The use of SkAutoTUnref is dangerous because it implicitly ',
+ 'converts to a raw pointer. Please use skia::RefPtr instead.'
+ ),
+ True,
+ (),
+ ),
+ (
+ 'SkAutoUnref',
+ (
+ 'The indirect use of SkAutoTUnref through SkAutoUnref is dangerous ',
+ 'because it implicitly converts to a raw pointer. ',
+ 'Please use skia::RefPtr instead.'
+ ),
+ True,
+ (),
+ ),
)