Assert that thread-safe reference counting is used with
cross-thread NewRunnableMethod.

This assertion caught such an error in VisitedLinkMaster!

My approach, modify RunnableMethodTraits<T> to assert that
when ReleaseCallee happens on a different thread from
RetainCallee that the type supports thread-safe reference
counting.  I do this by adding a static method to both
RefCounted<T> and RefCountedThreadSafe<T>.

This results in a little ugliness in cases where people
implement AddRef and Release by hand (to make the no-ops).
There may be a nicer way to deal with those few cases.

R=brettw
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/251012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27379 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 13f383ff5fc8ff095501794d4ce758f0067ff9b5
5 files changed
tree: f47e0b02c33ddcbf3dd7afa3ce1d69fb22be7d02
  1. base/
  2. build/
  3. ipc/
  4. testing/