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

Unified Diff: remoting/jingle_glue/mock_objects.h

Issue 7744041: Use new callbacks in the IqRequest interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « remoting/jingle_glue/jingle_info_request.cc ('k') | remoting/jingle_glue/xmpp_iq_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/mock_objects.h
diff --git a/remoting/jingle_glue/mock_objects.h b/remoting/jingle_glue/mock_objects.h
index e32e203772c732789efb0168bd0847aee2a57972..6c93b0a6fc352875ca99adb212d3b0e01ec9a9e3 100644
--- a/remoting/jingle_glue/mock_objects.h
+++ b/remoting/jingle_glue/mock_objects.h
@@ -30,12 +30,12 @@ class MockIqRequest : public IqRequest {
MOCK_METHOD3(SendIq, void(const std::string& type,
const std::string& addressee,
buzz::XmlElement* iq_body));
- MOCK_METHOD1(set_callback, void(IqRequest::ReplyCallback*));
+ MOCK_METHOD1(set_callback, void(const IqRequest::ReplyCallback&));
// Ensure this takes ownership of the pointer, as the real IqRequest object
// would, to avoid memory-leak.
- void set_callback_hook(IqRequest::ReplyCallback* callback) {
- callback_.reset(callback);
+ void set_callback_hook(const IqRequest::ReplyCallback& callback) {
+ callback_ = callback;
}
void Init() {
@@ -44,10 +44,10 @@ class MockIqRequest : public IqRequest {
this, &MockIqRequest::set_callback_hook));
}
- IqRequest::ReplyCallback* callback() { return callback_.get(); }
+ ReplyCallback& callback() { return callback_; }
private:
- scoped_ptr<IqRequest::ReplyCallback> callback_;
+ ReplyCallback callback_;
};
} // namespace remoting
« no previous file with comments | « remoting/jingle_glue/jingle_info_request.cc ('k') | remoting/jingle_glue/xmpp_iq_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698