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 "chrome/test/chromedriver/commands.h" | 5 #include "chrome/test/chromedriver/commands.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::unique_ptr<base::Value> value, | 86 std::unique_ptr<base::Value> value, |
87 const std::string& session_id) { | 87 const std::string& session_id) { |
88 if (!session_remaining_count) | 88 if (!session_remaining_count) |
89 return; | 89 return; |
90 | 90 |
91 (*session_remaining_count)--; | 91 (*session_remaining_count)--; |
92 | 92 |
93 std::unique_ptr<base::DictionaryValue> session(new base::DictionaryValue()); | 93 std::unique_ptr<base::DictionaryValue> session(new base::DictionaryValue()); |
94 session->Set("id", new base::StringValue(session_id)); | 94 session->Set("id", new base::StringValue(session_id)); |
95 session->Set("capabilities", value->DeepCopy()); | 95 session->Set("capabilities", value->DeepCopy()); |
96 session_list->Append(session.release()); | 96 session_list->Append(std::move(session)); |
97 | 97 |
98 if (!*session_remaining_count) { | 98 if (!*session_remaining_count) { |
99 all_get_session_func.Run(); | 99 all_get_session_func.Run(); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 void ExecuteGetSessions(const Command& session_capabilities_command, | 105 void ExecuteGetSessions(const Command& session_capabilities_command, |
106 SessionThreadMap* session_thread_map, | 106 SessionThreadMap* session_thread_map, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 319 } |
320 } | 320 } |
321 | 321 |
322 namespace internal { | 322 namespace internal { |
323 | 323 |
324 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 324 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
325 SetThreadLocalSession(base::WrapUnique(new Session(id))); | 325 SetThreadLocalSession(base::WrapUnique(new Session(id))); |
326 } | 326 } |
327 | 327 |
328 } // namespace internal | 328 } // namespace internal |
OLD | NEW |