OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ |
6 #define CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ | 6 #define CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 Session* GetSession(const std::string& id) const; | 34 Session* GetSession(const std::string& id) const; |
35 | 35 |
36 private: | 36 private: |
37 SessionManager() : addr_(""), port_(""), count_(0) {} | 37 SessionManager() : addr_(""), port_(""), count_(0) {} |
38 friend struct DefaultSingletonTraits<SessionManager>; | 38 friend struct DefaultSingletonTraits<SessionManager>; |
39 std::string GenerateSessionID(); | 39 std::string GenerateSessionID(); |
40 std::string IPLookup(const std::string& nic); | 40 std::string IPLookup(const std::string& nic); |
41 | 41 |
42 std::map<std::string, Session*> map_; | 42 std::map<std::string, Session*> map_; |
43 Lock session_generation_; | 43 base::Lock session_generation_; |
44 // Record the address and port for the HTTP 303 See other redirect. | 44 // Record the address and port for the HTTP 303 See other redirect. |
45 // We save the IP and Port of the machine chromedriver is running on since | 45 // We save the IP and Port of the machine chromedriver is running on since |
46 // a HTTP 303, see other, resdirect is sent after a successful creation of | 46 // a HTTP 303, see other, resdirect is sent after a successful creation of |
47 // a session, ie: http://172.22.41.105:8080/session/DFSSE453CV588 | 47 // a session, ie: http://172.22.41.105:8080/session/DFSSE453CV588 |
48 std::string addr_; | 48 std::string addr_; |
49 std::string port_; | 49 std::string port_; |
50 int count_; | 50 int count_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(SessionManager); | 52 DISALLOW_COPY_AND_ASSIGN(SessionManager); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace webdriver | 55 } // namespace webdriver |
56 | 56 |
57 #endif // CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ | 57 #endif // CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ |
58 | 58 |
OLD | NEW |