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

Side by Side Diff: remoting/jingle_glue/javascript_signal_strategy.cc

Issue 10378110: Verify that xmpp_login specified in the config matches auth token. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « remoting/jingle_glue/javascript_signal_strategy.h ('k') | remoting/jingle_glue/mock_objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/jingle_glue/javascript_signal_strategy.h" 5 #include "remoting/jingle_glue/javascript_signal_strategy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 29 matching lines...) Expand all
40 void JavascriptSignalStrategy::Disconnect() { 40 void JavascriptSignalStrategy::Disconnect() {
41 DCHECK(CalledOnValidThread()); 41 DCHECK(CalledOnValidThread());
42 42
43 if (xmpp_proxy_) 43 if (xmpp_proxy_)
44 xmpp_proxy_->DetachCallback(); 44 xmpp_proxy_->DetachCallback();
45 FOR_EACH_OBSERVER(Listener, listeners_, 45 FOR_EACH_OBSERVER(Listener, listeners_,
46 OnSignalStrategyStateChange(DISCONNECTED)); 46 OnSignalStrategyStateChange(DISCONNECTED));
47 } 47 }
48 48
49 SignalStrategy::State JavascriptSignalStrategy::GetState() const { 49 SignalStrategy::State JavascriptSignalStrategy::GetState() const {
50 DCHECK(CalledOnValidThread());
50 // TODO(sergeyu): Extend XmppProxy to provide status of the 51 // TODO(sergeyu): Extend XmppProxy to provide status of the
51 // connection. 52 // connection.
52 return CONNECTED; 53 return CONNECTED;
53 } 54 }
54 55
56 SignalStrategy::Error JavascriptSignalStrategy::GetError() const {
57 DCHECK(CalledOnValidThread());
58 // TODO(sergeyu): Extend XmppProxy to provide status of the
59 // connection.
60 return OK;
61 }
62
55 std::string JavascriptSignalStrategy::GetLocalJid() const { 63 std::string JavascriptSignalStrategy::GetLocalJid() const {
64 DCHECK(CalledOnValidThread());
56 return local_jid_; 65 return local_jid_;
57 } 66 }
58 67
59 void JavascriptSignalStrategy::AddListener(Listener* listener) { 68 void JavascriptSignalStrategy::AddListener(Listener* listener) {
60 DCHECK(CalledOnValidThread()); 69 DCHECK(CalledOnValidThread());
61 listeners_.AddObserver(listener); 70 listeners_.AddObserver(listener);
62 } 71 }
63 72
64 void JavascriptSignalStrategy::RemoveListener(Listener* listener) { 73 void JavascriptSignalStrategy::RemoveListener(Listener* listener) {
65 DCHECK(CalledOnValidThread()); 74 DCHECK(CalledOnValidThread());
(...skipping 22 matching lines...) Expand all
88 97
89 ObserverListBase<Listener>::Iterator it(listeners_); 98 ObserverListBase<Listener>::Iterator it(listeners_);
90 Listener* listener; 99 Listener* listener;
91 while ((listener = it.GetNext()) != NULL) { 100 while ((listener = it.GetNext()) != NULL) {
92 if (listener->OnSignalStrategyIncomingStanza(stanza.get())) 101 if (listener->OnSignalStrategyIncomingStanza(stanza.get()))
93 break; 102 break;
94 } 103 }
95 } 104 }
96 105
97 } // namespace remoting 106 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/jingle_glue/javascript_signal_strategy.h ('k') | remoting/jingle_glue/mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698