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

Side by Side Diff: remoting/protocol/session.h

Issue 7796026: Pass SessionConfig by reference instead of pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
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 REMOTING_PROTOCOL_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_SESSION_H_
6 #define REMOTING_PROTOCOL_SESSION_H_ 6 #define REMOTING_PROTOCOL_SESSION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // JID of the other side. 80 // JID of the other side.
81 virtual const std::string& jid() = 0; 81 virtual const std::string& jid() = 0;
82 82
83 // Configuration of the protocol that was sent or received in the 83 // Configuration of the protocol that was sent or received in the
84 // session-initiate jingle message. Returned pointer is valid until 84 // session-initiate jingle message. Returned pointer is valid until
85 // connection is closed. 85 // connection is closed.
86 virtual const CandidateSessionConfig* candidate_config() = 0; 86 virtual const CandidateSessionConfig* candidate_config() = 0;
87 87
88 // Protocol configuration. Can be called only after session has been accepted. 88 // Protocol configuration. Can be called only after session has been accepted.
89 // Returned pointer is valid until connection is closed. 89 // Returned pointer is valid until connection is closed.
90 virtual const SessionConfig* config() = 0; 90 virtual const SessionConfig& config() = 0;
91 91
92 // Set protocol configuration for an incoming session. Must be called 92 // Set protocol configuration for an incoming session. Must be called
93 // on the host before the connection is accepted, from 93 // on the host before the connection is accepted, from
94 // ChromotocolServer::IncomingConnectionCallback. Ownership of |config| is 94 // ChromotocolServer::IncomingConnectionCallback. Ownership of |config| is
Wez 2011/09/10 01:04:29 nit: This comment is out-of-date; consider updatin
Sergey Ulanov 2011/09/10 06:45:58 Done.
95 // given to the connection. 95 // given to the connection.
96 virtual void set_config(const SessionConfig* config) = 0; 96 virtual void set_config(const SessionConfig& config) = 0;
97 97
98 // The raw auth tokens from the session-initiate, or session-accept stanzas. 98 // The raw auth tokens from the session-initiate, or session-accept stanzas.
99 virtual const std::string& initiator_token() = 0; 99 virtual const std::string& initiator_token() = 0;
100 virtual void set_initiator_token(const std::string& initiator_token) = 0; 100 virtual void set_initiator_token(const std::string& initiator_token) = 0;
101 virtual const std::string& receiver_token() = 0; 101 virtual const std::string& receiver_token() = 0;
102 virtual void set_receiver_token(const std::string& receiver_token) = 0; 102 virtual void set_receiver_token(const std::string& receiver_token) = 0;
103 103
104 // A shared secret to use to mutually-authenticate the SSL channels. 104 // A shared secret to use to mutually-authenticate the SSL channels.
105 virtual void set_shared_secret(const std::string& secret) = 0; 105 virtual void set_shared_secret(const std::string& secret) = 0;
106 virtual const std::string& shared_secret() = 0; 106 virtual const std::string& shared_secret() = 0;
107 107
108 // Closes connection. Callbacks are guaranteed not to be called 108 // Closes connection. Callbacks are guaranteed not to be called
109 // after this method returns. Must be called before the object is 109 // after this method returns. Must be called before the object is
110 // destroyed, unless the state is set to FAILED or CLOSED. 110 // destroyed, unless the state is set to FAILED or CLOSED.
111 virtual void Close() = 0; 111 virtual void Close() = 0;
112 112
113 private: 113 private:
114 DISALLOW_COPY_AND_ASSIGN(Session); 114 DISALLOW_COPY_AND_ASSIGN(Session);
115 }; 115 };
116 116
117 } // namespace protocol 117 } // namespace protocol
118 } // namespace remoting 118 } // namespace remoting
119 119
120 #endif // REMOTING_PROTOCOL_SESSION_H_ 120 #endif // REMOTING_PROTOCOL_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698