| 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/dbus/privet_daemon_manager_client.h" | 5 #include "chromeos/dbus/privet_daemon_manager_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include "base/bind.h" | 10 #include "base/bind.h" |
| 8 #include "base/location.h" | 11 #include "base/location.h" |
| 9 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 11 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 12 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 13 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| 14 #include "dbus/bus.h" | 18 #include "dbus/bus.h" |
| 15 #include "dbus/message.h" | 19 #include "dbus/message.h" |
| 16 #include "dbus/object_manager.h" | 20 #include "dbus/object_manager.h" |
| 17 #include "dbus/object_proxy.h" | 21 #include "dbus/object_proxy.h" |
| 18 | 22 |
| 19 namespace chromeos { | 23 namespace chromeos { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (field_reader.GetDataSignature() == "s") { | 217 if (field_reader.GetDataSignature() == "s") { |
| 214 std::string string_value; | 218 std::string string_value; |
| 215 if (!field_reader.PopString(&string_value)) | 219 if (!field_reader.PopString(&string_value)) |
| 216 return false; | 220 return false; |
| 217 if (key == kPairingInfoSessionIdProperty) { | 221 if (key == kPairingInfoSessionIdProperty) { |
| 218 value_.set_session_id(string_value); | 222 value_.set_session_id(string_value); |
| 219 } else if (key == kPairingInfoModeProperty) { | 223 } else if (key == kPairingInfoModeProperty) { |
| 220 value_.set_mode(string_value); | 224 value_.set_mode(string_value); |
| 221 } | 225 } |
| 222 } else if (field_reader.GetDataSignature() == "ay") { | 226 } else if (field_reader.GetDataSignature() == "ay") { |
| 223 const uint8* bytes = nullptr; | 227 const uint8_t* bytes = nullptr; |
| 224 size_t length = 0; | 228 size_t length = 0; |
| 225 if (!field_reader.PopArrayOfBytes(&bytes, &length)) | 229 if (!field_reader.PopArrayOfBytes(&bytes, &length)) |
| 226 return false; | 230 return false; |
| 227 if (key == kPairingInfoCodeProperty) | 231 if (key == kPairingInfoCodeProperty) |
| 228 value_.set_code(bytes, length); | 232 value_.set_code(bytes, length); |
| 229 } | 233 } |
| 230 } | 234 } |
| 231 return true; | 235 return true; |
| 232 } | 236 } |
| 233 | 237 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 274 |
| 271 PrivetDaemonManagerClient::~PrivetDaemonManagerClient() { | 275 PrivetDaemonManagerClient::~PrivetDaemonManagerClient() { |
| 272 } | 276 } |
| 273 | 277 |
| 274 // static | 278 // static |
| 275 PrivetDaemonManagerClient* PrivetDaemonManagerClient::Create() { | 279 PrivetDaemonManagerClient* PrivetDaemonManagerClient::Create() { |
| 276 return new PrivetDaemonManagerClientImpl(); | 280 return new PrivetDaemonManagerClientImpl(); |
| 277 } | 281 } |
| 278 | 282 |
| 279 } // namespace chromeos | 283 } // namespace chromeos |
| OLD | NEW |