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

Unified Diff: Source/core/platform/network/Preconnect.cpp

Issue 14746002: Add WebPrescientNetworking to trigger preconnect from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits 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/core/platform/network/Preconnect.cpp
diff --git a/Source/core/page/RuntimeEnabledFeaturesCustom.cpp b/Source/core/platform/network/Preconnect.cpp
similarity index 78%
copy from Source/core/page/RuntimeEnabledFeaturesCustom.cpp
copy to Source/core/platform/network/Preconnect.cpp
index 2df390c281f06a8f6ea2157ba8be109616028eb0..7de8c3fc831b8c7c04d766866f310c7ab7b4ecd2 100644
--- a/Source/core/page/RuntimeEnabledFeaturesCustom.cpp
+++ b/Source/core/platform/network/Preconnect.cpp
@@ -29,21 +29,20 @@
*/
#include "config.h"
-#include "RuntimeEnabledFeatures.h"
+#include "core/platform/network/Preconnect.h"
-#include "core/platform/graphics/MediaPlayer.h"
-#include "core/workers/SharedWorkerRepository.h"
+#include <public/Platform.h>
+#include <public/WebURL.h>
+#include <public/WebPrerenderingSupport.h>
namespace WebCore {
-bool RuntimeEnabledFeatures::mediaEnabled()
+void preconnect(const KURL& url, PreconnectMotivation motivation)
{
- return MediaPlayer::isAvailable();
+ WebKit::WebPrerenderingSupport* platform = WebKit::WebPrerenderingSupport::current();
+ if (!platform)
+ return;
+ platform->preconnect(WebKit::WebURL(url), static_cast<WebKit::WebPreconnectMotivation>(motivation));
}
-bool RuntimeEnabledFeatures::sharedWorkerEnabled()
-{
- return SharedWorkerRepository::isAvailable();
}
-
-} // namespace WebCore
« Source/core/platform/network/Preconnect.h ('K') | « Source/core/platform/network/Preconnect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698