chromium/content/browser/preloading/prerender/prerender_no_vary_search_hint_commit_deferring_condition.h

// Copyright 2024 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_BROWSER_PRELOADING_PRERENDER_PRERENDER_NO_VARY_SEARCH_HINT_COMMIT_DEFERRING_CONDITION_H_
#define CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NO_VARY_SEARCH_HINT_COMMIT_DEFERRING_CONDITION_H_

#include <memory>
#include <optional>

#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "content/browser/preloading/prerender/prerender_host.h"
#include "content/browser/renderer_host/navigation_type.h"
#include "content/common/content_export.h"
#include "content/public/browser/commit_deferring_condition.h"

namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace content {

class NavigationRequest;

// This CommitDeferringCondition waits until the prerender navigation receives
// the main page's headers from the server. After receiving the headers,
// we can check if the associated PrerenderHost's initial URL matches via
// No-Vary-Search header in the subsequent CommitDeferringConditions.
class CONTENT_EXPORT PrerenderNoVarySearchHintCommitDeferringCondition
    : public CommitDeferringCondition,
      public PrerenderHost::Observer {};

}  // namespace content

#endif  // CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NO_VARY_SEARCH_HINT_COMMIT_DEFERRING_CONDITION_H_