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

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: fix comment 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
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 65%
copy from Source/Platform/chromium/public/WebGraphicsContext3DProvider.h
copy to Source/Platform/chromium/public/WebPrescientNetworking.h
index dba2216773526377c53b27a9d6830bce0c25fc48..c5a961a8f011194404bb0a82dce0c6057f01ec38 100644
--- a/Source/Platform/chromium/public/WebGraphicsContext3DProvider.h
+++ b/Source/Platform/chromium/public/WebPrescientNetworking.h
@@ -28,24 +28,33 @@
* 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 {
-public:
- virtual ~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,
+};
- virtual WebGraphicsContext3D* context3d() = 0;
- virtual GrContext* grContext() = 0;
+class WebPrescientNetworking {
+public:
+ // 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) { }
};
abarth-chromium 2013/05/14 06:38:47 You might also need a virtual destructor to make s
kouhei (in TOK) 2013/05/14 07:25:14 Done.
} // namespace WebKit
-#endif
+#endif // WebPrescientNetworking_h
« Source/Platform/chromium/public/Platform.h ('K') | « Source/Platform/chromium/public/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698