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

Unified Diff: content/renderer/mus/render_widget_window_tree_client_factory.cc

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (Closed)
Patch Set: . Created 3 years, 8 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/public/test/mock_render_process_host.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mus/render_widget_window_tree_client_factory.cc
diff --git a/content/renderer/mus/render_widget_window_tree_client_factory.cc b/content/renderer/mus/render_widget_window_tree_client_factory.cc
index 6292da4926691d31929f4d4d8b86c772e84cdfce..210723bbe85448f813ddce37d3f2d87eb35a3dba 100644
--- a/content/renderer/mus/render_widget_window_tree_client_factory.cc
+++ b/content/renderer/mus/render_widget_window_tree_client_factory.cc
@@ -19,7 +19,6 @@
#include "content/renderer/mus/renderer_window_tree_client.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "services/service_manager/public/cpp/interface_factory.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/ui/public/interfaces/window_tree.mojom.h"
#include "url/gurl.h"
@@ -41,7 +40,7 @@ class RenderWidgetWindowTreeClientFactoryImpl
: public ConnectionFilter,
public mojom::RenderWidgetWindowTreeClientFactory {
public:
- RenderWidgetWindowTreeClientFactoryImpl() : weak_factory_(this) {
+ RenderWidgetWindowTreeClientFactoryImpl() {
main_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
}
@@ -49,13 +48,15 @@ class RenderWidgetWindowTreeClientFactoryImpl
private:
// ConnectionFilter implementation:
- bool OnConnect(const service_manager::Identity& remote_identity,
- service_manager::InterfaceRegistry* registry,
- service_manager::Connector* connector) override {
- registry->AddInterface(
- base::Bind(&RenderWidgetWindowTreeClientFactoryImpl::CreateFactory,
- weak_factory_.GetWeakPtr()));
- return true;
+ void OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle* interface_pipe,
+ service_manager::Connector* connector) override {
+ if (interface_name == mojom::RenderWidgetWindowTreeClientFactory::Name_) {
+ bindings_.AddBinding(
+ this, mojo::MakeRequest<mojom::RenderWidgetWindowTreeClientFactory>(
+ std::move(*interface_pipe)));
+ }
}
// mojom::RenderWidgetWindowTreeClientFactory implementation.
@@ -67,14 +68,8 @@ class RenderWidgetWindowTreeClientFactoryImpl
base::Passed(&request)));
}
- void CreateFactory(
- mojom::RenderWidgetWindowTreeClientFactoryRequest request) {
- bindings_.AddBinding(this, std::move(request));
- }
-
scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner_;
mojo::BindingSet<mojom::RenderWidgetWindowTreeClientFactory> bindings_;
- base::WeakPtrFactory<RenderWidgetWindowTreeClientFactoryImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetWindowTreeClientFactoryImpl);
};
« no previous file with comments | « content/public/test/mock_render_process_host.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698