Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: Source/Platform/chromium/public/WebPrescientNetworking.h

Issue 14746002: Add WebPrescientNetworking to trigger preconnect from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add virtual d-tor Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/Platform/chromium/public/Platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/Platform/chromium/public/WebPrescientNetworking.h
diff --git a/Source/Platform/chromium/public/WebGraphicsContext3DProvider.h b/Source/Platform/chromium/public/WebPrescientNetworking.h
similarity index 64%
copy from Source/Platform/chromium/public/WebGraphicsContext3DProvider.h
copy to Source/Platform/chromium/public/WebPrescientNetworking.h
index dba2216773526377c53b27a9d6830bce0c25fc48..27fceea01da4f5c022f2f7b2d303ae3931897999 100644
--- a/Source/Platform/chromium/public/WebGraphicsContext3DProvider.h
+++ b/Source/Platform/chromium/public/WebPrescientNetworking.h
@@ -28,24 +28,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebGraphicsContext3DProvider_h
-#define WebGraphicsContext3DProvider_h
+#ifndef WebPrescientNetworking_h
+#define WebPrescientNetworking_h
#include "WebCommon.h"
-class GrContext;
-
namespace WebKit {
-class WebGraphicsContext3D;
-class WebGraphicsContext3DProvider {
+class WebURL;
+
+// FIXME: Passing preconnect motivation to the platform is layering vioration.
+// However, this is done temporarily to perform a Finch field trial to enable
+// preconnect in different triggers one at a time. This enum can be safely
+// removed after the field trial is done.
+enum WebPreconnectMotivation {
+ WebPreconnectMotivationLinkMouseDown,
+ WebPreconnectMotivationLinkMouseOver,
+ WebPreconnectMotivationLinkTapUnconfirmed,
+ WebPreconnectMotivationLinkTapDown,
+};
+
+class WebPrescientNetworking {
public:
- virtual ~WebGraphicsContext3DProvider() { }
+ virtual ~WebPrescientNetworking() { }
- virtual WebGraphicsContext3D* context3d() = 0;
- virtual GrContext* grContext() = 0;
+ // When a page navigation is speculated, preconnect is triggered to hide
+ // session initialization latency to the server providing the page resource.
+ virtual void preconnect(const WebURL&, WebPreconnectMotivation) { }
};
} // namespace WebKit
-#endif
+#endif // WebPrescientNetworking_h
« no previous file with comments | « Source/Platform/chromium/public/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698