blob: 58f7df1569c24027aa22add42381c8558f51e7bc [file] [log] [blame]
Iman Saboori125797922022-11-15 03:35:341// Copyright 2022 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_PRELOADING_PRECONNECTOR_H_
6#define CONTENT_BROWSER_PRELOADING_PRECONNECTOR_H_
7
8#include "content/common/content_export.h"
9#include "content/public/browser/anchor_element_preconnect_delegate.h"
10#include "url/gurl.h"
11
12namespace content {
13
14class RenderFrameHost;
15
16// Handles heuristics based preconnects.
17// TODO(isaboori): Implement the preconnect logic directly in content/browser
18// and remove the delegate.
19class CONTENT_EXPORT Preconnector {
20 public:
21 Preconnector() = delete;
Johanna9fe85f2023-01-17 10:15:4322 explicit Preconnector(RenderFrameHost& render_frame_host);
Iman Saboori125797922022-11-15 03:35:3423 ~Preconnector();
24
25 void MaybePreconnect(const GURL& url);
26
27 private:
28 std::unique_ptr<AnchorElementPreconnectDelegate> preconnect_delegate_;
29};
30
31} // namespace content
32
33#endif // CONTENT_BROWSER_PRELOADING_PRECONNECTOR_H_