Added utility method to process content in pipeline.

* This eliminates repetitive code from a few places and might be
  useful for future patches as well.

Change-Id: I383ed253a2fa20c1b7429689d17cde176751e29a
Merge "Added utility method to process content in pipeline."