Use scoped_ptr for these.

Change-Id: I9452950ad6a101c2b9299dca5ff6e1713cac774c