2025-07-29 11:00:54 -04:00
|
|
|
// Copyright (c) 2025 Microsoft, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_PRECONNECT_MANAGER_DELEGATE_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_ELECTRON_PRECONNECT_MANAGER_DELEGATE_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "base/memory/weak_ptr.h"
|
2025-08-11 14:01:08 -06:00
|
|
|
#include "content/public/browser/preconnect_manager.h"
|
2025-07-29 11:00:54 -04:00
|
|
|
|
|
|
|
class GURL;
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
class ElectronPreconnectManagerDelegate
|
2025-08-11 14:01:08 -06:00
|
|
|
: public content::PreconnectManager::Delegate {
|
2025-07-29 11:00:54 -04:00
|
|
|
public:
|
|
|
|
ElectronPreconnectManagerDelegate();
|
|
|
|
~ElectronPreconnectManagerDelegate() override;
|
|
|
|
|
|
|
|
// disable copy
|
|
|
|
ElectronPreconnectManagerDelegate(const ElectronPreconnectManagerDelegate&) =
|
|
|
|
delete;
|
|
|
|
ElectronPreconnectManagerDelegate& operator=(
|
|
|
|
const ElectronPreconnectManagerDelegate&) = delete;
|
|
|
|
|
2025-08-11 14:01:08 -06:00
|
|
|
// content::PreconnectManager::Delegate
|
2025-07-29 11:00:54 -04:00
|
|
|
void PreconnectInitiated(const GURL& url,
|
|
|
|
const GURL& preconnect_url) override {}
|
|
|
|
void PreconnectFinished(
|
2025-08-11 14:01:08 -06:00
|
|
|
std::unique_ptr<content::PreconnectStats> stats) override {}
|
2025-07-29 11:00:54 -04:00
|
|
|
bool IsPreconnectEnabled() override;
|
|
|
|
|
|
|
|
base::WeakPtr<ElectronPreconnectManagerDelegate> GetWeakPtr() {
|
|
|
|
return weak_factory_.GetWeakPtr();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
base::WeakPtrFactory<ElectronPreconnectManagerDelegate> weak_factory_{this};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
|
|
|
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_PRECONNECT_MANAGER_DELEGATE_H_
|