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

Unified Diff: remoting/protocol/pepper_session.cc

Issue 8432009: Refactor IqRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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
Index: remoting/protocol/pepper_session.cc
diff --git a/remoting/protocol/pepper_session.cc b/remoting/protocol/pepper_session.cc
index 5e971bd2e4beb4722fbffb4a310032f49cb53940..6d8757cddabe1145430f90de31bbbadb7b68b6c4 100644
--- a/remoting/protocol/pepper_session.cc
+++ b/remoting/protocol/pepper_session.cc
@@ -9,7 +9,7 @@
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "remoting/base/constants.h"
-#include "remoting/jingle_glue/iq_request.h"
+#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/protocol/content_description.h"
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/pepper_session_manager.h"
@@ -81,10 +81,10 @@ void PepperSession::StartConnection(
message.from = session_manager_->local_jid_;
message.description.reset(
new ContentDescription(candidate_config_->Clone(), initiator_token_, ""));
- initiate_request_.reset(session_manager_->CreateIqRequest());
- initiate_request_->set_callback(base::Bind(
- &PepperSession::OnSessionInitiateResponse, base::Unretained(this)));
- initiate_request_->SendIq(message.ToXml());
+ initiate_request_.reset(session_manager_->iq_sender()->SendIq(
+ message.ToXml(),
+ base::Bind(&PepperSession::OnSessionInitiateResponse,
+ base::Unretained(this))));
SetState(CONNECTING);
}
@@ -196,9 +196,9 @@ void PepperSession::Close() {
// Send session-terminate message.
JingleMessage message(peer_jid_, JingleMessage::SESSION_TERMINATE,
session_id_);
- scoped_ptr<IqRequest> terminate_request(
- session_manager_->CreateIqRequest());
- terminate_request->SendIq(message.ToXml());
+ scoped_ptr<IqRequest> terminate_request(
+ session_manager_->iq_sender()->SendIq(
+ message.ToXml(), IqSender::ReplyCallback()));
}
CloseInternal(false);
@@ -330,8 +330,8 @@ void PepperSession::OnDeleteChannel(PepperChannel* channel) {
void PepperSession::SendTransportInfo() {
JingleMessage message(peer_jid_, JingleMessage::TRANSPORT_INFO, session_id_);
message.candidates.swap(pending_candidates_);
- scoped_ptr<IqRequest> request(session_manager_->CreateIqRequest());
- request->SendIq(message.ToXml());
+ scoped_ptr<IqRequest> request(session_manager_->iq_sender()->SendIq(
+ message.ToXml(), IqSender::ReplyCallback()));
}
void PepperSession::CreateChannels() {

Powered by Google App Engine
This is Rietveld 408576698