Chromium Code Reviews| 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 |