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

Unified Diff: remoting/protocol/authenticator.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/protocol/authenticator.cc » ('j') | remoting/protocol/jingle_session.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/authenticator.h
diff --git a/remoting/protocol/authenticator.h b/remoting/protocol/authenticator.h
index b79fe78a7ca4fefcb86b646775f7ec55fe2908d4..1a0931aeb35a2808d99e1669ca0bef33d8c8638d 100644
--- a/remoting/protocol/authenticator.h
+++ b/remoting/protocol/authenticator.h
@@ -7,6 +7,8 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
+
namespace buzz {
class XmlElement;
} // namespace buzz
@@ -57,7 +59,7 @@ class Authenticator {
static bool IsAuthenticatorMessage(const buzz::XmlElement* message);
// Creates an empty Authenticator message, owned by the caller.
- static buzz::XmlElement* CreateEmptyAuthenticatorMessage();
+ static scoped_ptr<buzz::XmlElement> CreateEmptyAuthenticatorMessage();
// Finds Authenticator message among child elements of |message|, or
// returns NULL otherwise.
@@ -77,12 +79,12 @@ class Authenticator {
// Must be called when in MESSAGE_READY state. Returns next
// authentication message that needs to be sent to the peer.
- virtual buzz::XmlElement* GetNextMessage() = 0;
+ virtual scoped_ptr<buzz::XmlElement> GetNextMessage() = 0;
- // Creates new authenticator for a channel. Caller must take
- // ownership of the result. Can be called only in the ACCEPTED
- // state.
- virtual ChannelAuthenticator* CreateChannelAuthenticator() const = 0;
+ // Creates new authenticator for a channel. Can be called only in
+ // the ACCEPTED state.
+ virtual scoped_ptr<ChannelAuthenticator>
+ CreateChannelAuthenticator() const = 0;
};
// Factory for Authenticator instances.
@@ -99,7 +101,7 @@ class AuthenticatorFactory {
// if the |first_message| is invalid and the session should be
// rejected. ProcessMessage() should be called with |first_message|
// for the result of this method.
- virtual Authenticator* CreateAuthenticator(
+ virtual scoped_ptr<Authenticator> CreateAuthenticator(
const std::string& remote_jid,
const buzz::XmlElement* first_message) = 0;
};
« no previous file with comments | « no previous file | remoting/protocol/authenticator.cc » ('j') | remoting/protocol/jingle_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698