Implement strict origin isolation for trial.

This CL does a simple implementation of strict origin isolation to
enable a trial to determine the effects of such a policy on browser
performance.

Bug: 902399
Change-Id: I8c0354338a3292c0476adbe920d85d507859221f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584466
Commit-Queue: James MacLean <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Cr-Commit-Position: refs/heads/master@{#656163}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 703409b..5469110 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -485,6 +485,9 @@
   if (src_origin.scheme() != dest_origin.scheme())
     return false;
 
+  if (SiteIsolationPolicy::IsStrictOriginIsolationEnabled())
+    return src_origin == dest_origin;
+
   if (!net::registry_controlled_domains::SameDomainOrHost(
           src_origin, dest_origin,
           net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
@@ -574,6 +577,9 @@
   // situation where site URL of file://localhost/ would mismatch Blink's origin
   // (which ignores the hostname in this case - see https://crbug.com/776160).
   if (!origin.host().empty() && origin.scheme() != url::kFileScheme) {
+    if (SiteIsolationPolicy::IsStrictOriginIsolationEnabled())
+      return origin.GetURL();
+
     GURL site_url(GetSiteForOrigin(origin));
 
     // Isolated origins should use the full origin as their site URL. A