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

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

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "remoting/protocol/video_stream.h" 9 #include "remoting/protocol/video_stream.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { 53 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() {
54 } 54 }
55 55
56 scoped_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() { 56 scoped_ptr<base::ListValue> MockPairingRegistryDelegate::LoadAll() {
57 scoped_ptr<base::ListValue> result(new base::ListValue()); 57 scoped_ptr<base::ListValue> result(new base::ListValue());
58 for (Pairings::const_iterator i = pairings_.begin(); i != pairings_.end(); 58 for (Pairings::const_iterator i = pairings_.begin(); i != pairings_.end();
59 ++i) { 59 ++i) {
60 result->Append(i->second.ToValue().release()); 60 result->Append(i->second.ToValue().release());
61 } 61 }
62 return result.Pass(); 62 return result;
63 } 63 }
64 64
65 bool MockPairingRegistryDelegate::DeleteAll() { 65 bool MockPairingRegistryDelegate::DeleteAll() {
66 pairings_.clear(); 66 pairings_.clear();
67 return true; 67 return true;
68 } 68 }
69 69
70 protocol::PairingRegistry::Pairing MockPairingRegistryDelegate::Load( 70 protocol::PairingRegistry::Pairing MockPairingRegistryDelegate::Load(
71 const std::string& client_id) { 71 const std::string& client_id) {
72 Pairings::const_iterator i = pairings_.find(client_id); 72 Pairings::const_iterator i = pairings_.find(client_id);
(...skipping 10 matching lines...) Expand all
83 return true; 83 return true;
84 } 84 }
85 85
86 bool MockPairingRegistryDelegate::Delete(const std::string& client_id) { 86 bool MockPairingRegistryDelegate::Delete(const std::string& client_id) {
87 pairings_.erase(client_id); 87 pairings_.erase(client_id);
88 return true; 88 return true;
89 } 89 }
90 90
91 SynchronousPairingRegistry::SynchronousPairingRegistry( 91 SynchronousPairingRegistry::SynchronousPairingRegistry(
92 scoped_ptr<Delegate> delegate) 92 scoped_ptr<Delegate> delegate)
93 : PairingRegistry(base::ThreadTaskRunnerHandle::Get(), delegate.Pass()) { 93 : PairingRegistry(base::ThreadTaskRunnerHandle::Get(),
94 } 94 std::move(delegate)) {}
95 95 SynchronousPairingRegistry::~SynchronousPairingRegistry() {}
96 SynchronousPairingRegistry::~SynchronousPairingRegistry() {
97 }
98 96
99 void SynchronousPairingRegistry::PostTask( 97 void SynchronousPairingRegistry::PostTask(
100 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 98 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
101 const tracked_objects::Location& from_here, 99 const tracked_objects::Location& from_here,
102 const base::Closure& task) { 100 const base::Closure& task) {
103 DCHECK(task_runner->BelongsToCurrentThread()); 101 DCHECK(task_runner->BelongsToCurrentThread());
104 task.Run(); 102 task.Run();
105 } 103 }
106 104
107 } // namespace protocol 105 } // namespace protocol
108 } // namespace remoting 106 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698