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

Side by Side Diff: services/service_manager/connect_util.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/service_manager/connect_util.h" 5 #include "services/service_manager/connect_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "services/service_manager/connect_params.h" 10 #include "services/service_manager/connect_params.h"
11 #include "services/service_manager/service_manager.h" 11 #include "services/service_manager/service_manager.h"
12 12
13 namespace service_manager { 13 namespace service_manager {
14 14
15 mojo::ScopedMessagePipeHandle BindInterface( 15 mojo::ScopedMessagePipeHandle BindInterface(
16 ServiceManager* service_manager, 16 ServiceManager* service_manager,
17 const Identity& source, 17 const Identity& source,
18 const Identity& target, 18 const Identity& target,
19 const std::string& interface_name) { 19 const std::string& interface_name) {
20 mojom::InterfaceProviderPtr remote_interfaces;
21 std::unique_ptr<ConnectParams> params(new ConnectParams); 20 std::unique_ptr<ConnectParams> params(new ConnectParams);
22 params->set_source(source); 21 params->set_source(source);
23 params->set_target(target); 22 params->set_target(target);
24 params->set_remote_interfaces(mojo::MakeRequest(&remote_interfaces)); 23 mojo::MessagePipe pipe;
24 params->set_interface_request_info(interface_name, std::move(pipe.handle1));
25 service_manager->Connect(std::move(params)); 25 service_manager->Connect(std::move(params));
26 mojo::MessagePipe pipe;
27 remote_interfaces->GetInterface(interface_name, std::move(pipe.handle1));
28 return std::move(pipe.handle0); 26 return std::move(pipe.handle0);
29 } 27 }
30 28
31 } // namespace service_manager 29 } // namespace service_manager
OLDNEW
« no previous file with comments | « content/shell/browser/layout_test/layout_test_content_browser_client.cc ('k') | services/service_manager/service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698