1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // A Preconnect instance maintains state while a TCP/IP connection is made, and 6 // and then released into the pool of available connections for future use. 7 8 #ifndef CHROME_BROWSER_NET_PRECONNECT_H_ 9 #define CHROME_BROWSER_NET_PRECONNECT_H_ 10 #pragma once 11 12 #include "chrome/browser/net/url_info.h" 13 14 class GURL; 15 16 namespace chrome_browser_net { 17 18 // Try to preconnect. Typically motivated by OMNIBOX to reach search service. 19 // |count| may be used to request more than one connection be established in 20 // parallel. 21 void PreconnectOnUIThread(const GURL& url, 22 UrlInfo::ResolutionMotivation motivation, 23 int count); 24 25 // Try to preconnect. Typically used by predictor when a subresource probably 26 // needs a connection. |count| may be used to request more than one connection 27 // be established in parallel. 28 void PreconnectOnIOThread(const GURL& url, 29 UrlInfo::ResolutionMotivation motivation, 30 int count); 31 32 } // namespace chrome_browser_net 33 34 #endif // CHROME_BROWSER_NET_PRECONNECT_H_ 35