Inherit CSP when self-navigating to local-scheme URL

As the linked bug example shows, we should inherit CSP when we navigate
to a local-scheme URL (even if we are in a main browsing context).

Bug: 799747
Change-Id: I8413aa8e8049461ebcf0ffbf7b04c41d1340af02
Reviewed-on: https://chromium-review.googlesource.com/c/1234337
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597889}
void DocumentLoader::UpdateNavigationTimings(
    base::TimeTicks navigation_start_time,
    base::TimeTicks redirect_start_time,
    base::TimeTicks redirect_end_time,
    base::TimeTicks fetch_start_time,
    base::TimeTicks input_start_time) {
  if (!input_start_time.is_null()) {
    GetTiming().SetInputStart(input_start_time);
  }

  if (navigation_start_time.is_null()) {
    GetTiming().SetNavigationStart(CurrentTimeTicks());
    return;
  }

  GetTiming().SetNavigationStart(navigation_start_time);
  if (!redirect_start_time.is_null()) {
    GetTiming().SetRedirectStart(redirect_start_time);
    GetTiming().SetRedirectEnd(redirect_end_time);
  }
  if (!fetch_start_time.is_null()) {
    DCHECK(!navigation_start_time.is_null());
    GetTiming().SetFetchStart(fetch_start_time);
  }
}

void DocumentLoader::UpdateNavigationTimings(
    base::TimeTicks navigation_start_time,
    base::TimeTicks redirect_start_time,
    base::TimeTicks redirect_end_time,
    base::TimeTicks fetch_start_time,
    base::TimeTicks input_start_time) {
  if (!input_start_time.is_null()) {
    GetTiming().SetInputStart(input_start_time);
  }

  if (navigation_start_time.is_null()) {
    GetTiming().SetNavigationStart(CurrentTimeTicks());
    return;
  }

  GetTiming().SetNavigationStart(navigation_start_time);
  if (!redirect_start_time.is_null()) {
    GetTiming().SetRedirectStart(redirect_start_time);
    GetTiming().SetRedirectEnd(redirect_end_time);
  }
  if (!fetch_start_time.is_null()) {
    DCHECK(!navigation_start_time.is_null());
    GetTiming().SetFetchStart(fetch_start_time);
  }
}
