910e62b5创建于 1月15日历史提交
// 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.

#ifndef CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_
#define CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_

#include "content/common/content_export.h"
#include "content/public/browser/client_hints_controller_delegate.h"
#include "net/http/http_request_headers.h"

namespace content {

class BrowserContext;
class FrameTreeNode;

// Adds client hints headers for a prefetch navigation that is not associated
// with a frame. It must be a main frame navigation.
CONTENT_EXPORT void AddClientHintsHeadersToPrefetchNavigation(
    const url::Origin& origin,
    net::HttpRequestHeaders* headers,
    BrowserContext* context,
    ClientHintsControllerDelegate* delegate,
    bool is_ua_override_on,
    FrameTreeNode* ftn_for_devtools_override);

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class AcceptCHFrameRestart {
  kFramePresent = 0,
  kNavigationRestarted = 1,
  kRedirectOverflow = 2,
  kMaxValue = kRedirectOverflow,
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_