Copyright (c) 2009-2011, Mozilla Foundation and contributors