// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PREDICTORS_PRECONNECT_MANAGER_H_ #define CHROME_BROWSER_PREDICTORS_PRECONNECT_MANAGER_H_ #include <list> #include <map> #include <memory> #include <string> #include <vector> #include "base/containers/id_map.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "chrome/browser/predictors/proxy_lookup_client_impl.h" #include "chrome/browser/predictors/resolve_host_client_impl.h" #include "chrome/browser/predictors/resource_prefetch_predictor.h" #include "net/base/network_anonymization_key.h" #include "url/gurl.h" namespace content { class BrowserContext; } namespace network { namespace mojom { class NetworkContext; } } // namespace network namespace predictors { struct PreconnectRequest; struct PreconnectedRequestStats { … }; struct PreconnectStats { … }; // Stores the status of all preconnects associated with a given |url|. struct PreresolveInfo { … }; // Stores all data need for running a preresolve and a subsequent optional // preconnect for a |url|. struct PreresolveJob { … }; // PreconnectManager is responsible for preresolving and preconnecting to // origins based on the input list of URLs. // - The input list of URLs is associated with a main frame url that can be // used for cancelling. // - Limits the total number of preresolves in flight. // - Preresolves an URL before preconnecting to it to have a better control on // number of speculative dns requests in flight. // - When stopped, waits for the pending preresolve requests to finish without // issuing preconnects for them. // - All methods of the class must be called on the UI thread. class PreconnectManager { … }; } // namespace predictors #endif // CHROME_BROWSER_PREDICTORS_PRECONNECT_MANAGER_H_