| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 15 matching lines...) Expand all Loading... |
| 26 static SessionManager* GetInstance(); | 26 static SessionManager* GetInstance(); |
| 27 | 27 |
| 28 std::string GetAddress(); | 28 std::string GetAddress(); |
| 29 | 29 |
| 30 void Add(Session* session); | 30 void Add(Session* session); |
| 31 bool Remove(const std::string& id); | 31 bool Remove(const std::string& id); |
| 32 bool Has(const std::string& id) const; | 32 bool Has(const std::string& id) const; |
| 33 | 33 |
| 34 Session* GetSession(const std::string& id) const; | 34 Session* GetSession(const std::string& id) const; |
| 35 | 35 |
| 36 void set_port(const std::string& port); | 36 void SetPort(const std::string& port); |
| 37 void SetChromeDir(const FilePath& chrome_dir); |
| 38 void SetScreenshotOnError(bool screenshot); |
| 39 void SetUrlBase(const std::string& url_base); |
| 37 | 40 |
| 38 void set_url_base(const std::string& url_base); | 41 FilePath ChromeDir() const; |
| 39 std::string url_base() const; | 42 std::string UrlBase() const; |
| 40 | 43 bool ScreenshotOnError() const; |
| 41 void set_chrome_dir(const FilePath& chrome_dir); | |
| 42 FilePath chrome_dir() const; | |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 SessionManager(); | 46 SessionManager(); |
| 46 ~SessionManager(); | 47 ~SessionManager(); |
| 47 friend struct DefaultSingletonTraits<SessionManager>; | 48 friend struct DefaultSingletonTraits<SessionManager>; |
| 48 | 49 |
| 49 std::map<std::string, Session*> map_; | 50 std::map<std::string, Session*> map_; |
| 50 mutable base::Lock map_lock_; | 51 mutable base::Lock map_lock_; |
| 51 std::string port_; | 52 std::string port_; |
| 52 std::string url_base_; | 53 std::string url_base_; |
| 53 FilePath chrome_dir_; | 54 FilePath chrome_dir_; |
| 55 bool screenshot_on_error_; |
| 54 | 56 |
| 55 DISALLOW_COPY_AND_ASSIGN(SessionManager); | 57 DISALLOW_COPY_AND_ASSIGN(SessionManager); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace webdriver | 60 } // namespace webdriver |
| 59 | 61 |
| 60 #endif // CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ | 62 #endif // CHROME_TEST_WEBDRIVER_SESSION_MANAGER_H_ |
| OLD | NEW |