Tech platforms could be forced to prevent illegal content from going viral, under more online safety measures proposed by Ofcom.