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

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

Issue 2775483003: Use public Service Manager Connector API in Blink (Closed)
Patch Set: . Created 3 years, 9 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 778123c4c0f18b5c890f697fc21be8c7402f908e..8ac3fcaeaa6aff5be5052e43db953f023d70b320 100644
--- a/third_party/WebKit/Source/platform/exported/Platform.cpp
+++ b/third_party/WebKit/Source/platform/exported/Platform.cpp
@@ -30,6 +30,8 @@
#include "public/platform/Platform.h"
+#include <memory>
+
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
#include "platform/Histogram.h"
@@ -39,13 +41,30 @@
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/GCTaskRunner.h"
#include "platform/instrumentation/tracing/MemoryCacheDumpProvider.h"
-#include "public/platform/Connector.h"
#include "public/platform/InterfaceProvider.h"
#include "public/platform/WebPrerenderingSupport.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "wtf/HashMap.h"
namespace blink {
+namespace {
+
+class DefaultConnector {
+ public:
+ DefaultConnector() {
+ service_manager::mojom::ConnectorRequest request;
+ m_connector = service_manager::Connector::Create(&request);
+ }
+
+ service_manager::Connector* get() { return m_connector.get(); }
+
+ private:
+ std::unique_ptr<service_manager::Connector> m_connector;
+};
+
+} // namespace
+
static Platform* s_platform = nullptr;
static GCTaskRunner* s_gcTaskRunner = nullptr;
@@ -120,8 +139,9 @@ WebThread* Platform::mainThread() const {
return m_mainThread;
}
-Connector* Platform::connector() {
- return Connector::getEmptyConnector();
+service_manager::Connector* Platform::connector() {
+ DEFINE_STATIC_LOCAL(DefaultConnector, connector, ());
+ return connector.get();
}
InterfaceProvider* Platform::interfaceProvider() {
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/exported/ServiceRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698