| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/protocol/protocol_mock_objects.h" | 5 #include "remoting/protocol/protocol_mock_objects.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { | 52 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { |
| 53 } | 53 } |
| 54 | 54 |
| 55 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { | 55 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::unique_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() { | 58 std::unique_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() { |
| 59 std::unique_ptr<base::ListValue> result(new base::ListValue()); | 59 std::unique_ptr<base::ListValue> result(new base::ListValue()); |
| 60 for (Pairings::const_iterator i = pairings_.begin(); i != pairings_.end(); | 60 for (Pairings::const_iterator i = pairings_.begin(); i != pairings_.end(); |
| 61 ++i) { | 61 ++i) { |
| 62 result->Append(i->second.ToValue().release()); | 62 result->Append(i->second.ToValue()); |
| 63 } | 63 } |
| 64 return result; | 64 return result; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool MockPairingRegistryDelegate::DeleteAll() { | 67 bool MockPairingRegistryDelegate::DeleteAll() { |
| 68 pairings_.clear(); | 68 pairings_.clear(); |
| 69 return true; | 69 return true; |
| 70 } | 70 } |
| 71 | 71 |
| 72 protocol::PairingRegistry::Pairing MockPairingRegistryDelegate::Load( | 72 protocol::PairingRegistry::Pairing MockPairingRegistryDelegate::Load( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 99 void SynchronousPairingRegistry::PostTask( | 99 void SynchronousPairingRegistry::PostTask( |
| 100 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 100 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 101 const tracked_objects::Location& from_here, | 101 const tracked_objects::Location& from_here, |
| 102 const base::Closure& task) { | 102 const base::Closure& task) { |
| 103 DCHECK(task_runner->BelongsToCurrentThread()); | 103 DCHECK(task_runner->BelongsToCurrentThread()); |
| 104 task.Run(); | 104 task.Run(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace protocol | 107 } // namespace protocol |
| 108 } // namespace remoting | 108 } // namespace remoting |
| OLD | NEW |