Better handling of delegateFunctions

R=arv
BUG=

Review URL: https://codereview.appspot.com/13401044