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

Unified Diff: third_party/WebKit/Source/platform/exported/Platform.cpp

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use unique_ptr to avoid memory leaks in unit tests Created 4 years, 6 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: third_party/WebKit/Source/platform/exported/Platform.cpp
diff --git a/third_party/WebKit/Source/platform/exported/Platform.cpp b/third_party/WebKit/Source/platform/exported/Platform.cpp
index 171c4a82b06dfb2e01edf7da300feb2e1910271a..ac0c05d2f91b1892f968c968c8e06495468a7d8d 100644
--- a/third_party/WebKit/Source/platform/exported/Platform.cpp
+++ b/third_party/WebKit/Source/platform/exported/Platform.cpp
@@ -33,6 +33,7 @@
#include "platform/Histogram.h"
#include "platform/MemoryCacheDumpProvider.h"
#include "platform/PartitionAllocMemoryDumpProvider.h"
+#include "platform/PlatformMojoInterface.h"
#include "platform/fonts/FontCacheMemoryDumpProvider.h"
#include "platform/graphics/CompositorFactory.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
@@ -40,6 +41,7 @@
#include "public/platform/Platform.h"
#include "public/platform/ServiceRegistry.h"
#include "public/platform/WebPrerenderingSupport.h"
+#include "public/platform/WebPrescientNetworking.h"
#include "wtf/HashMap.h"
#include "wtf/OwnPtr.h"
@@ -51,6 +53,11 @@ static GCTaskRunner* s_gcTaskRunner = nullptr;
Platform::Platform()
: m_mainThread(0)
+ , m_mojoInterface(nullptr)
kinuko 2016/06/16 05:39:58 shouldn't need this
Charlie Harrison 2016/06/16 11:00:20 Done.
+{
+}
+
+Platform::~Platform()
kinuko 2016/06/16 05:39:58 = default works?
Charlie Harrison 2016/06/16 11:00:20 Done.
{
}
@@ -97,11 +104,13 @@ void Platform::initialize(Platform* platform)
}
CompositorFactory::initializeDefault();
+ s_platform->m_mojoInterface.reset(new PlatformMojoInterface);
}
void Platform::shutdown()
kinuko 2016/06/16 05:39:58 should we clear mojoInterface here?
Charlie Harrison 2016/06/16 21:31:22 Done.
{
ASSERT(isMainThread());
+
CompositorFactory::shutdown();
if (s_platform->m_mainThread) {
@@ -150,4 +159,20 @@ ServiceRegistry* Platform::serviceRegistry()
return ServiceRegistry::getEmptyServiceRegistry();
}
+void Platform::preconnect(const KURL& url, bool credentialsFlag, int numConnections)
kinuko 2016/06/16 05:39:58 Do we need to expose methods for each of these? J
Charlie Harrison 2016/06/16 11:00:20 SGTM. Done.
+{
+ m_mojoInterface->resourceHintsHandlerHost()->Preconnect(url, credentialsFlag, numConnections);
+}
+
+void Platform::preresolve(const KURL& url)
+{
+ m_mojoInterface->resourceHintsHandlerHost()->Preresolve(url);
+}
+
+void Platform::speculativePreresolve(const KURL& url)
+{
+ if (WebPrescientNetworking* prescientNetworking = Platform::current()->prescientNetworking())
+ prescientNetworking->prefetchDNS(url.host());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698