Javier Mascherano has pledged his long-term future to Barcelona, after agreeing a new four-year deal at the Catalan club.