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

Unified Diff: remoting/jingle_glue/log_to_server.cc

Issue 390983003: Remove remoting/jingle_glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/log_to_server.h ('k') | remoting/jingle_glue/log_to_server_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/log_to_server.cc
diff --git a/remoting/jingle_glue/log_to_server.cc b/remoting/jingle_glue/log_to_server.cc
deleted file mode 100644
index ed9d308f3e36723ce2dfd70ec6159e382d4db375..0000000000000000000000000000000000000000
--- a/remoting/jingle_glue/log_to_server.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/jingle_glue/log_to_server.h"
-
-#include "remoting/base/constants.h"
-#include "remoting/jingle_glue/iq_sender.h"
-#include "remoting/jingle_glue/signal_strategy.h"
-#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
-#include "third_party/libjingle/source/talk/xmpp/constants.h"
-
-using buzz::QName;
-using buzz::XmlElement;
-
-namespace remoting {
-
-LogToServer::LogToServer(ServerLogEntry::Mode mode,
- SignalStrategy* signal_strategy,
- const std::string& directory_bot_jid)
- : mode_(mode),
- signal_strategy_(signal_strategy),
- directory_bot_jid_(directory_bot_jid) {
- signal_strategy_->AddListener(this);
-}
-
-LogToServer::~LogToServer() {
- signal_strategy_->RemoveListener(this);
-}
-
-void LogToServer::OnSignalStrategyStateChange(SignalStrategy::State state) {
- DCHECK(CalledOnValidThread());
-
- if (state == SignalStrategy::CONNECTED) {
- iq_sender_.reset(new IqSender(signal_strategy_));
- SendPendingEntries();
- } else if (state == SignalStrategy::DISCONNECTED) {
- iq_sender_.reset();
- }
-}
-
-bool LogToServer::OnSignalStrategyIncomingStanza(
- const buzz::XmlElement* stanza) {
- return false;
-}
-
-void LogToServer::Log(const ServerLogEntry& entry) {
- pending_entries_.push_back(entry);
- SendPendingEntries();
-}
-
-void LogToServer::SendPendingEntries() {
- if (iq_sender_ == NULL) {
- return;
- }
- if (pending_entries_.empty()) {
- return;
- }
- // Make one stanza containing all the pending entries.
- scoped_ptr<XmlElement> stanza(ServerLogEntry::MakeStanza());
- while (!pending_entries_.empty()) {
- ServerLogEntry& entry = pending_entries_.front();
- stanza->AddElement(entry.ToStanza().release());
- pending_entries_.pop_front();
- }
- // Send the stanza to the server.
- scoped_ptr<IqRequest> req = iq_sender_->SendIq(
- buzz::STR_SET, directory_bot_jid_, stanza.Pass(),
- IqSender::ReplyCallback());
- // We ignore any response, so let the IqRequest be destroyed.
- return;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/jingle_glue/log_to_server.h ('k') | remoting/jingle_glue/log_to_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698