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

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2643063002: Refactor Blink's ServiceConnector and add ability to mock in layout tests (Closed)
Patch Set: Fix build 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
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_blink_platform_impl.cc
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index d6acf4dced355e2a82e60643bb66079611ee9842..3781be88b76069b1db59a0fa029e53cd8f5a9ede 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -42,6 +42,7 @@
#include "content/common/frame_messages.h"
#include "content/common/render_process_messages.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/service_manager_connection.h"
#include "content/public/common/webplugininfo.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/media_stream_utils.h"
@@ -78,6 +79,7 @@
#include "media/blink/webcontentdecryptionmodule_impl.h"
#include "media/filters/stream_parser_factory.h"
#include "ppapi/features/features.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
#include "storage/common/database/database_identifier.h"
@@ -249,6 +251,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
loading_task_runner_(renderer_scheduler->LoadingTaskRunner()),
web_scrollbar_behavior_(new WebScrollbarBehaviorImpl),
renderer_scheduler_(renderer_scheduler),
+ blink_connector_(new BlinkConnectorImpl(nullptr)),
blink_interface_provider_(new BlinkInterfaceProviderImpl(connector)) {
#if !defined(OS_ANDROID) && !defined(OS_WIN)
if (g_sandbox_enabled && sandboxEnabled()) {
@@ -260,6 +263,10 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
// RenderThread may not exist in some tests.
if (RenderThreadImpl::current()) {
+ blink_connector_->SetConnector(RenderThreadImpl::current()
+ ->GetServiceManagerConnection()
+ ->GetConnector()
+ ->Clone());
sync_message_filter_ = RenderThreadImpl::current()->sync_message_filter();
thread_safe_sender_ = RenderThreadImpl::current()->thread_safe_sender();
quota_message_filter_ = RenderThreadImpl::current()->quota_message_filter();
@@ -1151,6 +1158,10 @@ void RendererBlinkPlatformImpl::SetPlatformEventObserverForTesting(
platform_event_observers_.AddWithID(std::move(observer), type);
}
+BlinkConnectorImpl* RendererBlinkPlatformImpl::connector() {
+ return blink_connector_.get();
+}
+
blink::InterfaceProvider* RendererBlinkPlatformImpl::interfaceProvider() {
return blink_interface_provider_.get();
}
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698