FrameLoadRequest should reuse origin instead of recreating it.

FrameLoadRequest is currently constructing the requestor origin from
the URL of the requestor document. However, constructing origins based
on URL is a lossy process and does not preserve precursor origin
information.
Since the requestor document is already passed in as a parameter, the
origin of the document should be used directly. This CL changes that.

It also fixes a bug in the GetDownloadPolicy method where origin
comparison is assigned to a boolean incorrectly.

Bug: 632514, 882053
Change-Id: Ibb386ef7ecddc0b5dcc5b9e2b83f7b5215fdc1e9
Reviewed-on: https://chromium-review.googlesource.com/c/1378587
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616889}
4 files changed