Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/webdriver-server/session.h
2867 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
17
// Abstract class defining a session for the WebDriver server. Subclasses
18
// must implement methods to initialize, shutdown, and execute commands.
19
20
#ifndef WEBDRIVER_SERVER_SESSION_H_
21
#define WEBDRIVER_SERVER_SESSION_H_
22
23
#include <string>
24
25
namespace webdriver {
26
27
class Session {
28
public:
29
Session(void) {}
30
virtual ~Session(void) {}
31
32
virtual void Initialize(void* init_params) = 0;
33
virtual void ShutDown(void) = 0;
34
virtual bool ExecuteCommand(const std::string& serialized_command,
35
std::string* serialized_response) = 0;
36
37
//std::string session_id(void) const { return this->session_id_; }
38
39
protected:
40
void set_session_id(const std::string& id) { this->session_id_ = id; }
41
42
private:
43
// The unique ID of the session.
44
std::string session_id_;
45
46
DISALLOW_COPY_AND_ASSIGN(Session);
47
};
48
49
} // namespace webdriver
50
51
#endif // WEBDRIVER_SERVER_SESSION_H_
52
53