chromium/chrome/browser/ssl/typed_navigation_upgrade_throttle.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ssl/typed_navigation_upgrade_throttle.h"

#include "base/check_op.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/security_interstitials/core/omnibox_https_upgrade_metrics.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "ui/base/page_transition_types.h"
#include "url/url_constants.h"

Event;
kEventHistogram;

namespace {

// Delay before falling back to the HTTP URL.
// This can be changed in tests.
// - If the HTTPS load finishes successfully during this time, the timer is
//   cleared and no more work is done.
// - Otherwise, a new navigation to the the fallback HTTP URL is started.
constexpr base::FeatureParam<base::TimeDelta> kFallbackDelay{};

int g_https_port_for_testing =;

// Used to compute the fallback URL from the https URL.
int g_http_port_for_testing =;

void RecordUMA(Event event) {}

GURL GetHttpUrl(const GURL& url, int http_fallback_port_for_testing) {}

}  // namespace

// static
std::unique_ptr<content::NavigationThrottle>
TypedNavigationUpgradeThrottle::MaybeCreateThrottleFor(
    content::NavigationHandle* handle) {}

// static
bool TypedNavigationUpgradeThrottle::IsNavigationUsingHttpsAsDefaultScheme(
    content::NavigationHandle* handle) {}

TypedNavigationUpgradeThrottle::~TypedNavigationUpgradeThrottle() = default;

content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillStartRequest() {}

content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillFailRequest() {}

content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillRedirectRequest() {}

content::NavigationThrottle::ThrottleCheckResult
TypedNavigationUpgradeThrottle::WillProcessResponse() {}

const char* TypedNavigationUpgradeThrottle::GetNameForLogging() {}

// static
int TypedNavigationUpgradeThrottle::GetHttpsPortForTesting() {}

// static
void TypedNavigationUpgradeThrottle::SetHttpsPortForTesting(
    int https_port_for_testing) {}

// static
void TypedNavigationUpgradeThrottle::SetHttpPortForTesting(
    int http_port_for_testing) {}

TypedNavigationUpgradeThrottle::TypedNavigationUpgradeThrottle(
    content::NavigationHandle* handle)
    :{}

void TypedNavigationUpgradeThrottle::OnHttpsLoadTimeout() {}

void TypedNavigationUpgradeThrottle::FallbackToHttp(bool stop_navigation) {}