The US president says Google, Twitter and Facebook are “treading on very troubled territory”.