Proof of adoption in SkRecord::replace.
It used to be an unenforced requirement that callers take ownership of
the command which was replaced when calling SkRecord::replace. Now we
can enforce it, by splitting replace into two modes:
- T* replace(i): always destroys the existing command for you
- T* replace(i, proofOfAdoption): proofOfAdoption is checked to make
sure the caller has adopted the existing command before replacing it.
BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/248053008
git-svn-id: http://skia.googlecode.com/svn/trunk@14352 2bbb7eff-a529-9590-31e7-b0007b416f81
3 files changed