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

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
« no previous file with comments | « remoting/protocol/protocol_test_client.cc ('k') | remoting/protocol/session_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
93 // on the host before the connection is accepted, from 93 // called on the host before the connection is accepted, from
94 // ChromotocolServer::IncomingConnectionCallback. Ownership of |config| is 94 // ChromotocolServer::IncomingConnectionCallback.
95 // given to the connection. 95 virtual void set_config(const SessionConfig& config) = 0;
96 virtual void set_config(const SessionConfig* config) = 0;
97 96
98 // The raw auth tokens from the session-initiate, or session-accept stanzas. 97 // The raw auth tokens from the session-initiate, or session-accept stanzas.
99 virtual const std::string& initiator_token() = 0; 98 virtual const std::string& initiator_token() = 0;
100 virtual void set_initiator_token(const std::string& initiator_token) = 0; 99 virtual void set_initiator_token(const std::string& initiator_token) = 0;
101 virtual const std::string& receiver_token() = 0; 100 virtual const std::string& receiver_token() = 0;
102 virtual void set_receiver_token(const std::string& receiver_token) = 0; 101 virtual void set_receiver_token(const std::string& receiver_token) = 0;
103 102
104 // A shared secret to use to mutually-authenticate the SSL channels. 103 // A shared secret to use to mutually-authenticate the SSL channels.
105 virtual void set_shared_secret(const std::string& secret) = 0; 104 virtual void set_shared_secret(const std::string& secret) = 0;
106 virtual const std::string& shared_secret() = 0; 105 virtual const std::string& shared_secret() = 0;
107 106
108 // Closes connection. Callbacks are guaranteed not to be called 107 // Closes connection. Callbacks are guaranteed not to be called
109 // after this method returns. Must be called before the object is 108 // after this method returns. Must be called before the object is
110 // destroyed, unless the state is set to FAILED or CLOSED. 109 // destroyed, unless the state is set to FAILED or CLOSED.
111 virtual void Close() = 0; 110 virtual void Close() = 0;
112 111
113 private: 112 private:
114 DISALLOW_COPY_AND_ASSIGN(Session); 113 DISALLOW_COPY_AND_ASSIGN(Session);
115 }; 114 };
116 115
117 } // namespace protocol 116 } // namespace protocol
118 } // namespace remoting 117 } // namespace remoting
119 118
120 #endif // REMOTING_PROTOCOL_SESSION_H_ 119 #endif // REMOTING_PROTOCOL_SESSION_H_
OLDNEW
« no previous file with comments | « remoting/protocol/protocol_test_client.cc ('k') | remoting/protocol/session_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698