Change method implementation of size to use the new proto base classes including collections.