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

Side by Side Diff: mojo/shell/public/cpp/lib/connector_impl.cc

Issue 1781913003: Capability Classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@45class
Patch Set: . Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "mojo/shell/public/cpp/lib/connector_impl.h" 5 #include "mojo/shell/public/cpp/lib/connector_impl.h"
6 6
7 #include "mojo/shell/public/cpp/identity.h" 7 #include "mojo/shell/public/cpp/identity.h"
8 #include "mojo/shell/public/cpp/lib/connection_impl.h" 8 #include "mojo/shell/public/cpp/lib/connection_impl.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 thread_checker_.reset(new base::ThreadChecker); 42 thread_checker_.reset(new base::ThreadChecker);
43 } 43 }
44 DCHECK(thread_checker_->CalledOnValidThread()); 44 DCHECK(thread_checker_->CalledOnValidThread());
45 45
46 DCHECK(params); 46 DCHECK(params);
47 // We allow all interfaces on outgoing connections since we are presumably in 47 // We allow all interfaces on outgoing connections since we are presumably in
48 // a position to know who we're talking to. 48 // a position to know who we're talking to.
49 // TODO(beng): We should filter outgoing interfaces also. The shell must pass 49 // TODO(beng): We should filter outgoing interfaces also. The shell must pass
50 // the manifest CapabilityFilter to the ShellConnection via 50 // the manifest CapabilityFilter to the ShellConnection via
51 // Initialize(), it can be used here. 51 // Initialize(), it can be used here.
52 std::set<std::string> allowed; 52 CapabilityRequest request;
53 allowed.insert("*"); 53 request.interfaces.insert("*");
54 shell::mojom::InterfaceProviderPtr local_interfaces; 54 shell::mojom::InterfaceProviderPtr local_interfaces;
55 shell::mojom::InterfaceProviderRequest local_request = 55 shell::mojom::InterfaceProviderRequest local_request =
56 GetProxy(&local_interfaces); 56 GetProxy(&local_interfaces);
57 shell::mojom::InterfaceProviderPtr remote_interfaces; 57 shell::mojom::InterfaceProviderPtr remote_interfaces;
58 shell::mojom::InterfaceProviderRequest remote_request = 58 shell::mojom::InterfaceProviderRequest remote_request =
59 GetProxy(&remote_interfaces); 59 GetProxy(&remote_interfaces);
60 scoped_ptr<internal::ConnectionImpl> registry(new internal::ConnectionImpl( 60 scoped_ptr<internal::ConnectionImpl> registry(new internal::ConnectionImpl(
61 params->target().name(), params->target(), 61 params->target().name(), params->target(),
62 shell::mojom::kInvalidInstanceID, std::move(remote_interfaces), 62 shell::mojom::kInvalidInstanceID, std::move(remote_interfaces),
63 std::move(local_request), allowed, Connection::State::PENDING)); 63 std::move(local_request), request, Connection::State::PENDING));
64 64
65 shell::mojom::ShellClientFactoryPtr shell_client_factory; 65 shell::mojom::ShellClientFactoryPtr shell_client_factory;
66 shell::mojom::PIDReceiverRequest pid_receiver_request; 66 shell::mojom::PIDReceiverRequest pid_receiver_request;
67 params->TakeClientProcessConnection(&shell_client_factory, 67 params->TakeClientProcessConnection(&shell_client_factory,
68 &pid_receiver_request); 68 &pid_receiver_request);
69 shell::mojom::ClientProcessConnectionPtr client_process_connection; 69 shell::mojom::ClientProcessConnectionPtr client_process_connection;
70 if (shell_client_factory.is_bound() && pid_receiver_request.is_pending()) { 70 if (shell_client_factory.is_bound() && pid_receiver_request.is_pending()) {
71 client_process_connection = shell::mojom::ClientProcessConnection::New(); 71 client_process_connection = shell::mojom::ClientProcessConnection::New();
72 client_process_connection->shell_client_factory = 72 client_process_connection->shell_client_factory =
73 shell_client_factory.PassInterface().PassHandle(); 73 shell_client_factory.PassInterface().PassHandle();
(...skipping 13 matching lines...) Expand all
87 } 87 }
88 88
89 scoped_ptr<Connector> ConnectorImpl::Clone() { 89 scoped_ptr<Connector> ConnectorImpl::Clone() {
90 shell::mojom::ConnectorPtr connector; 90 shell::mojom::ConnectorPtr connector;
91 connector_->Clone(GetProxy(&connector)); 91 connector_->Clone(GetProxy(&connector));
92 return make_scoped_ptr( 92 return make_scoped_ptr(
93 new ConnectorImpl(connector.PassInterface())); 93 new ConnectorImpl(connector.PassInterface()));
94 } 94 }
95 95
96 } // namespace mojo 96 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/lib/connection_impl.cc ('k') | mojo/shell/public/cpp/lib/shell_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698