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

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

Issue 1783303002: Revert of 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
« no previous file with comments | « mojo/shell/public/cpp/lib/connector_impl.cc ('k') | mojo/shell/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "mojo/public/cpp/bindings/interface_ptr.h" 8 #include "mojo/public/cpp/bindings/interface_ptr.h"
9 #include "mojo/shell/public/cpp/capabilities.h" 9 #include "mojo/shell/public/cpp/capabilities.h"
10 #include "mojo/shell/public/cpp/connector.h" 10 #include "mojo/shell/public/cpp/connector.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void ShellConnection::AcceptConnection( 48 void ShellConnection::AcceptConnection(
49 shell::mojom::IdentityPtr source, 49 shell::mojom::IdentityPtr source,
50 uint32_t source_id, 50 uint32_t source_id,
51 shell::mojom::InterfaceProviderRequest local_interfaces, 51 shell::mojom::InterfaceProviderRequest local_interfaces,
52 shell::mojom::InterfaceProviderPtr remote_interfaces, 52 shell::mojom::InterfaceProviderPtr remote_interfaces,
53 shell::mojom::CapabilityRequestPtr allowed_capabilities, 53 shell::mojom::CapabilityRequestPtr allowed_capabilities,
54 const String& name) { 54 const String& name) {
55 scoped_ptr<Connection> registry(new internal::ConnectionImpl( 55 scoped_ptr<Connection> registry(new internal::ConnectionImpl(
56 name, source.To<Identity>(), source_id, std::move(remote_interfaces), 56 name, source.To<Identity>(), source_id, std::move(remote_interfaces),
57 std::move(local_interfaces), 57 std::move(local_interfaces),
58 allowed_capabilities.To<CapabilityRequest>(), 58 allowed_capabilities->interfaces.To<std::set<std::string>>(),
59 Connection::State::CONNECTED)); 59 Connection::State::CONNECTED));
60 if (!client_->AcceptConnection(registry.get())) 60 if (!client_->AcceptConnection(registry.get()))
61 return; 61 return;
62 62
63 // TODO(beng): it appears we never prune this list. We should, when the 63 // TODO(beng): it appears we never prune this list. We should, when the
64 // connection's remote service provider pipe breaks. 64 // connection's remote service provider pipe breaks.
65 incoming_connections_.push_back(std::move(registry)); 65 incoming_connections_.push_back(std::move(registry));
66 } 66 }
67 67
68 //////////////////////////////////////////////////////////////////////////////// 68 ////////////////////////////////////////////////////////////////////////////////
69 // ShellConnection, private: 69 // ShellConnection, private:
70 70
71 void ShellConnection::OnConnectionError() { 71 void ShellConnection::OnConnectionError() {
72 // Note that the ShellClient doesn't technically have to quit now, it may live 72 // Note that the ShellClient doesn't technically have to quit now, it may live
73 // on to service existing connections. All existing Connectors however are 73 // on to service existing connections. All existing Connectors however are
74 // invalid. 74 // invalid.
75 client_->ShellConnectionLost(); 75 client_->ShellConnectionLost();
76 // We don't reset the connector as clients may have taken a raw pointer to it. 76 // We don't reset the connector as clients may have taken a raw pointer to it.
77 // Connect() will return nullptr if they try to connect to anything. 77 // Connect() will return nullptr if they try to connect to anything.
78 } 78 }
79 79
80 } // namespace mojo 80 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/lib/connector_impl.cc ('k') | mojo/shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698