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

Unified Diff: remoting/protocol/fake_session.cc

Issue 2615113005: [Chromoting] Use HostExperimentSessionPlugin in host (Closed)
Patch Set: Resolve review comments Created 3 years, 10 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/protocol/fake_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_session.cc
diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc
index 56cbd51b1e5390eaa074aae26744b188fe1d3b43..0ed08daa29c450672d9bb212d45e2d6ca8fcea55 100644
--- a/remoting/protocol/fake_session.cc
+++ b/remoting/protocol/fake_session.cc
@@ -6,6 +6,7 @@
#include "base/location.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "remoting/protocol/fake_authenticator.h"
#include "remoting/protocol/session_plugin.h"
@@ -104,9 +105,24 @@ void FakeSession::ProcessTransportInfo(
transport_->ProcessTransportInfo(transport_info.get());
}
-// TODO(zijiehe): Supports SessionPlugin in FakeSession.
void FakeSession::AddPlugin(SessionPlugin* plugin) {
- NOTIMPLEMENTED();
+ DCHECK(plugin);
+ for (const auto& message : attachments_) {
+ if (message) {
+ JingleMessage jingle_message;
+ jingle_message.AddAttachment(
+ base::MakeUnique<buzz::XmlElement>(*message));
+ plugin->OnIncomingMessage(*(jingle_message.attachments));
+ }
+ }
+}
+
+void FakeSession::SetAttachment(size_t round,
+ std::unique_ptr<buzz::XmlElement> attachment) {
+ while (attachments_.size() <= round) {
+ attachments_.emplace_back();
+ }
+ attachments_[round] = std::move(attachment);
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/fake_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698