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

Side by Side Diff: remoting/protocol/protocol_mock_objects.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 | « remoting/protocol/protocol_mock_objects.h ('k') | remoting/protocol/pseudotcp_adapter.h » ('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 (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/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 MockSessionManager::MockSessionManager() {} 48 MockSessionManager::MockSessionManager() {}
49 49
50 MockSessionManager::~MockSessionManager() {} 50 MockSessionManager::~MockSessionManager() {}
51 51
52 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { 52 MockPairingRegistryDelegate::MockPairingRegistryDelegate() {
53 } 53 }
54 54
55 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { 55 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() {
56 } 56 }
57 57
58 scoped_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() { 58 std::unique_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() {
59 scoped_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().release());
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;
(...skipping 14 matching lines...) Expand all
84 pairings_[pairing.client_id()] = pairing; 84 pairings_[pairing.client_id()] = pairing;
85 return true; 85 return true;
86 } 86 }
87 87
88 bool MockPairingRegistryDelegate::Delete(const std::string& client_id) { 88 bool MockPairingRegistryDelegate::Delete(const std::string& client_id) {
89 pairings_.erase(client_id); 89 pairings_.erase(client_id);
90 return true; 90 return true;
91 } 91 }
92 92
93 SynchronousPairingRegistry::SynchronousPairingRegistry( 93 SynchronousPairingRegistry::SynchronousPairingRegistry(
94 scoped_ptr<Delegate> delegate) 94 std::unique_ptr<Delegate> delegate)
95 : PairingRegistry(base::ThreadTaskRunnerHandle::Get(), 95 : PairingRegistry(base::ThreadTaskRunnerHandle::Get(),
96 std::move(delegate)) {} 96 std::move(delegate)) {}
97 SynchronousPairingRegistry::~SynchronousPairingRegistry() {} 97 SynchronousPairingRegistry::~SynchronousPairingRegistry() {}
98 98
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
OLDNEW
« no previous file with comments | « remoting/protocol/protocol_mock_objects.h ('k') | remoting/protocol/pseudotcp_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698