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

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

Issue 7134023: Notify calling web-app when Host plugin becomes connected to a client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stop accepting connections once there is one active in Me2Mom. Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/heartbeat_sender.h" 5 #include "remoting/host/heartbeat_sender.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 &HeartbeatSender::DoSendStanza); 79 &HeartbeatSender::DoSendStanza);
80 } 80 }
81 81
82 void HeartbeatSender::OnSignallingDisconnected() { 82 void HeartbeatSender::OnSignallingDisconnected() {
83 DCHECK_EQ(MessageLoop::current(), message_loop_); 83 DCHECK_EQ(MessageLoop::current(), message_loop_);
84 DCHECK_EQ(state_, STARTED); 84 DCHECK_EQ(state_, STARTED);
85 state_ = STOPPED; 85 state_ = STOPPED;
86 request_.reset(NULL); 86 request_.reset(NULL);
87 } 87 }
88 88
89 void HeartbeatSender::OnAuthenticatedClientsChanged(int clients) {
90 }
91
89 void HeartbeatSender::OnShutdown() { 92 void HeartbeatSender::OnShutdown() {
90 } 93 }
91 94
92 void HeartbeatSender::DoSendStanza() { 95 void HeartbeatSender::DoSendStanza() {
93 DCHECK_EQ(MessageLoop::current(), message_loop_); 96 DCHECK_EQ(MessageLoop::current(), message_loop_);
94 DCHECK_EQ(state_, STARTED); 97 DCHECK_EQ(state_, STARTED);
95 98
96 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid; 99 VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid;
97 request_->SendIq(buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage()); 100 request_->SendIq(buzz::STR_SET, kChromotingBotJid, CreateHeartbeatMessage());
98 } 101 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str); 163 QName(kChromotingXmlNamespace, kSignatureTimeAttr), time_str);
161 164
162 std::string message = full_jid_ + ' ' + time_str; 165 std::string message = full_jid_ + ' ' + time_str;
163 std::string signature(key_pair_.GetSignature(message)); 166 std::string signature(key_pair_.GetSignature(message));
164 signature_tag->AddText(signature); 167 signature_tag->AddText(signature);
165 168
166 return signature_tag; 169 return signature_tag;
167 } 170 }
168 171
169 } // namespace remoting 172 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698