Merge logic for SameDomainOrHost for GURLs and Origins

Previously, we used to just call:
SameDomainOrHost(origin1.GetURL(), origin2.GetURL())

This isn't necessary, as we have all the information in the Origin itself.
Additionally, GetURL() isn't free. We do a bunch of string copies,
allocations, and some non-cheap policy decisions.

This patch moves GURL::HostIsIPAddress logic to url_util, and reuses
that code for both GURLs and Origins.

BUG=664174,348655

Review-Url: https://codereview.chromium.org/2562813003
Cr-Commit-Position: refs/heads/master@{#439287}
4 files changed