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

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

Issue 9240033: Use scoped_ptr<>.Pass() to pass ownership in the remoting protocol code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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_JINGLE_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_
6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "net/base/completion_callback.h" 10 #include "net/base/completion_callback.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 private: 45 private:
46 friend class JingleDatagramConnector; 46 friend class JingleDatagramConnector;
47 friend class JingleSessionManager; 47 friend class JingleSessionManager;
48 friend class JingleStreamConnector; 48 friend class JingleStreamConnector;
49 49
50 typedef std::map<std::string, JingleChannelConnector*> ChannelConnectorsMap; 50 typedef std::map<std::string, JingleChannelConnector*> ChannelConnectorsMap;
51 51
52 // Takes ownership of |authenticator|. 52 // Takes ownership of |authenticator|.
53 JingleSession(JingleSessionManager* jingle_session_manager, 53 JingleSession(JingleSessionManager* jingle_session_manager,
54 cricket::Session* cricket_session, 54 cricket::Session* cricket_session,
55 Authenticator* authenticator); 55 scoped_ptr<Authenticator> authenticator);
56 virtual ~JingleSession(); 56 virtual ~JingleSession();
57 57
58 // Called by JingleSessionManager. 58 // Called by JingleSessionManager.
59 void set_candidate_config(const CandidateSessionConfig* candidate_config); 59 void set_candidate_config(
60 scoped_ptr<CandidateSessionConfig> candidate_config);
60 61
61 // Sends session-initiate for new session. 62 // Sends session-initiate for new session.
62 void SendSessionInitiate(); 63 void SendSessionInitiate();
63 64
64 // Close all the channels and terminate the session. |result| 65 // Close all the channels and terminate the session. |result|
65 // defines error code that should returned to currently opened 66 // defines error code that should returned to currently opened
66 // channels. |error| specified new value for error(). 67 // channels. |error| specified new value for error().
67 void CloseInternal(int result, Error error); 68 void CloseInternal(int result, Error error);
68 69
69 bool HasSession(cricket::Session* cricket_session); 70 bool HasSession(cricket::Session* cricket_session);
(...skipping 30 matching lines...) Expand all
100 // Called by JingleChannelConnector when it has finished connecting 101 // Called by JingleChannelConnector when it has finished connecting
101 // the channel, to remove itself from the table of pending connectors. The 102 // the channel, to remove itself from the table of pending connectors. The
102 // connector assumes responsibility for destroying itself after this call. 103 // connector assumes responsibility for destroying itself after this call.
103 void OnChannelConnectorFinished(const std::string& name, 104 void OnChannelConnectorFinished(const std::string& name,
104 JingleChannelConnector* connector); 105 JingleChannelConnector* connector);
105 106
106 const cricket::ContentInfo* GetContentInfo() const; 107 const cricket::ContentInfo* GetContentInfo() const;
107 108
108 void SetState(State new_state); 109 void SetState(State new_state);
109 110
110 static cricket::SessionDescription* CreateSessionDescription( 111 static cricket::SessionDescription* CreateSessionDescription(
Wez 2012/01/19 03:18:17 Should the return-value be scoped_ptr<> managed as
Sergey Ulanov 2012/01/19 20:11:42 Done, but I don't think this provides any benefits
Wez 2012/01/19 23:23:41 It really just keeps the interface consistent, and
111 const CandidateSessionConfig* candidate_config, 112 scoped_ptr<CandidateSessionConfig> candidate_config,
112 const buzz::XmlElement* authenticator_message); 113 scoped_ptr<buzz::XmlElement> authenticator_message);
113 114
114 // JingleSessionManager that created this session. Guaranteed to 115 // JingleSessionManager that created this session. Guaranteed to
115 // exist throughout the lifetime of the session. 116 // exist throughout the lifetime of the session.
116 JingleSessionManager* jingle_session_manager_; 117 JingleSessionManager* jingle_session_manager_;
117 118
118 scoped_ptr<Authenticator> authenticator_; 119 scoped_ptr<Authenticator> authenticator_;
119 120
120 State state_; 121 State state_;
121 StateChangeCallback state_change_callback_; 122 StateChangeCallback state_change_callback_;
122 123
(...skipping 25 matching lines...) Expand all
148 base::WeakPtrFactory<JingleSession> weak_factory_; 149 base::WeakPtrFactory<JingleSession> weak_factory_;
149 150
150 DISALLOW_COPY_AND_ASSIGN(JingleSession); 151 DISALLOW_COPY_AND_ASSIGN(JingleSession);
151 }; 152 };
152 153
153 } // namespace protocol 154 } // namespace protocol
154 155
155 } // namespace remoting 156 } // namespace remoting
156 157
157 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ 158 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698