| OLD | NEW |
| 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 "chromeos/network/firewall_hole.h" | 5 #include "chromeos/network/firewall_hole.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #include <utility> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/location.h" | 13 #include "base/location.h" |
| 13 #include "base/threading/worker_pool.h" | 14 #include "base/threading/worker_pool.h" |
| 14 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
| 15 #include "chromeos/dbus/permission_broker_client.h" | 16 #include "chromeos/dbus/permission_broker_client.h" |
| 16 #include "dbus/file_descriptor.h" | 17 #include "dbus/file_descriptor.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 133 } |
| 133 | 134 |
| 134 void FirewallHole::PortAccessGranted(PortType type, | 135 void FirewallHole::PortAccessGranted(PortType type, |
| 135 uint16_t port, | 136 uint16_t port, |
| 136 const std::string& interface, | 137 const std::string& interface, |
| 137 dbus::ScopedFileDescriptor lifeline_fd, | 138 dbus::ScopedFileDescriptor lifeline_fd, |
| 138 const FirewallHole::OpenCallback& callback, | 139 const FirewallHole::OpenCallback& callback, |
| 139 bool success) { | 140 bool success) { |
| 140 if (success) { | 141 if (success) { |
| 141 callback.Run(make_scoped_ptr( | 142 callback.Run(make_scoped_ptr( |
| 142 new FirewallHole(type, port, interface, lifeline_fd.Pass()))); | 143 new FirewallHole(type, port, interface, std::move(lifeline_fd)))); |
| 143 } else { | 144 } else { |
| 144 callback.Run(nullptr); | 145 callback.Run(nullptr); |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 | 148 |
| 148 FirewallHole::FirewallHole(PortType type, | 149 FirewallHole::FirewallHole(PortType type, |
| 149 uint16_t port, | 150 uint16_t port, |
| 150 const std::string& interface, | 151 const std::string& interface, |
| 151 dbus::ScopedFileDescriptor lifeline_fd) | 152 dbus::ScopedFileDescriptor lifeline_fd) |
| 152 : type_(type), | 153 : type_(type), |
| 153 port_(port), | 154 port_(port), |
| 154 interface_(interface), | 155 interface_(interface), |
| 155 lifeline_fd_(lifeline_fd.Pass()) { | 156 lifeline_fd_(std::move(lifeline_fd)) {} |
| 156 } | |
| 157 | 157 |
| 158 } // namespace chromeos | 158 } // namespace chromeos |
| OLD | NEW |