Make additional PPB APIs require ppapi::PERMISSION_SOCKET.

TCPServerSocketPrivate, TCPSocketPrivate, and UDPSocketPrivate now
require this permission in addition to a whitelisted site/URL.

Tidy code a bit while at it:
- use early returns
- use std::make_unique<>
- pull a redundant permission check

Bug: 950005
Change-Id: I6c24c39bf55c08fd538da62d1dc3a8a58610be2d
Reviewed-by: Bill Budge <>
Commit-Queue: Tom Sepez <>
Cr-Original-Commit-Position: refs/heads/master@{#649205}
Cr-Mirrored-Commit: 6ea3532930ab636c1dc84c966640bf8292093592
2 files changed