Google made last week 's announcement after it discovered that hacking attacks traced to mainland China had been directed at its security infrastructure and that of more than 30 other companies based in the United States .