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

Side by Side Diff: chrome/test/webdriver/webdriver_session_manager.h

Issue 23526047: Delete old chromedriver code, and remove mongoose webserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_MANAGER_H_
6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_MANAGER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/files/file_path.h"
12 #include "base/memory/singleton.h"
13 #include "base/synchronization/lock.h"
14
15 namespace webdriver {
16
17 class Session;
18
19 // Session manager keeps track of all of the session that are currently
20 // running on the machine under test. With webdriver the user is allowed
21 // multiple instances of the browser on the same machine. So 2 sessions
22 // open would mean you would have 2 instances of chrome running under
23 // their own profiles.
24 class SessionManager {
25 public:
26 // Returns the singleton instance.
27 static SessionManager* GetInstance();
28
29 void Add(Session* session);
30 bool Remove(const std::string& id);
31 bool Has(const std::string& id) const;
32
33 Session* GetSession(const std::string& id) const;
34
35 void set_port(const std::string& port);
36
37 void set_url_base(const std::string& url_base);
38 std::string url_base() const;
39
40 private:
41 SessionManager();
42 ~SessionManager();
43 friend struct DefaultSingletonTraits<SessionManager>;
44
45 std::map<std::string, Session*> map_;
46 mutable base::Lock map_lock_;
47 std::string port_;
48 std::string url_base_;
49
50 DISALLOW_COPY_AND_ASSIGN(SessionManager);
51 };
52
53 } // namespace webdriver
54
55 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_session.cc ('k') | chrome/test/webdriver/webdriver_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698