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

Side by Side Diff: remoting/host/host_experiment_session_plugin.cc

Issue 2586133002: [Chromoting] Implement HostExperimentSessionPlugin (Closed)
Patch Set: Update implementation to match SessionPlugin Created 3 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/host/host_experiment_session_plugin.h"
6
7 #include "remoting/base/constants.h"
8 #include "remoting/host/host_attributes.h"
9
10 namespace remoting {
11
12 using buzz::QName;
13 using buzz::XmlElement;
14
15 std::unique_ptr<XmlElement> HostExperimentSessionPlugin::GetNextMessage() {
16 if (attributes_sent_) {
17 return nullptr;
18 }
19 attributes_sent_ = true;
20 std::unique_ptr<XmlElement> attributes(
21 new XmlElement(QName(kChromotingXmlNamespace, "host-attributes")));
22 attributes->SetBodyText(GetHostAttributes());
23 return attributes;
24 }
25
26 void HostExperimentSessionPlugin::OnIncomingMessage(
27 const XmlElement& attachments) {
28 if (!configuration_.empty()) {
Sergey Ulanov 2017/01/05 20:45:06 I suggest adding a separate flag to indicate that
Hzj_jie 2017/01/05 23:37:27 Done.
29 return;
30 }
31
32 const XmlElement* configuration = attachments.FirstNamed(
33 QName(kChromotingXmlNamespace, "host-configuration"));
34 if (!configuration) {
35 return;
36 }
37
38 configuration_ = configuration->BodyText();
39 }
40
41 const std::string& HostExperimentSessionPlugin::configuration() const {
42 return configuration_;
43 }
44
45 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698