🤝 Use Origin class for canonically representing origins.

Constructing origins manually and storing them in Urls is error-prone
(eg the port could be missed out) and there are discrepancies in how
the origin could be formed (eg GURLUtils has a trailing '/' while
current manually formed origins don't). This is especially important as
origins are critical to security.

This CL creats an Origin class that offloads all the heavy lifting to
the well tested native origin class and allows the type system to
prevent the errors listed above.

Bug: 800422
Change-Id: I87759ea12a87f2b57bbdf40994d35ec468a43cff
Reviewed-on: https://chromium-review.googlesource.com/934289
Commit-Queue: Peter Conn <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#540825}
11 files changed