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

Side by Side Diff: remoting/protocol/negotiating_authenticator_base.cc

Issue 16893002: Make the mapping from client id -> secret asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 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
« no previous file with comments | « no previous file | remoting/protocol/negotiating_authenticator_unittest.cc » ('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/protocol/negotiating_authenticator_base.h" 5 #include "remoting/protocol/negotiating_authenticator_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return rejection_reason_; 45 return rejection_reason_;
46 } 46 }
47 47
48 void NegotiatingAuthenticatorBase::ProcessMessageInternal( 48 void NegotiatingAuthenticatorBase::ProcessMessageInternal(
49 const buzz::XmlElement* message, 49 const buzz::XmlElement* message,
50 const base::Closure& resume_callback) { 50 const base::Closure& resume_callback) {
51 if (current_authenticator_->state() == WAITING_MESSAGE) { 51 if (current_authenticator_->state() == WAITING_MESSAGE) {
52 // If the message was not discarded and the authenticator is waiting for it, 52 // If the message was not discarded and the authenticator is waiting for it,
53 // give it to the underlying authenticator to process. 53 // give it to the underlying authenticator to process.
54 // |current_authenticator_| is owned, so Unretained() is safe here. 54 // |current_authenticator_| is owned, so Unretained() is safe here.
55 state_ = PROCESSING_MESSAGE;
55 current_authenticator_->ProcessMessage(message, base::Bind( 56 current_authenticator_->ProcessMessage(message, base::Bind(
56 &NegotiatingAuthenticatorBase::UpdateState, 57 &NegotiatingAuthenticatorBase::UpdateState,
57 base::Unretained(this), resume_callback)); 58 base::Unretained(this), resume_callback));
58 } else { 59 } else {
59 // Otherwise, just discard the message and run the callback. 60 // Otherwise, just discard the message and run the callback.
60 resume_callback.Run(); 61 resume_callback.Run();
61 } 62 }
62 } 63 }
63 64
64 void NegotiatingAuthenticatorBase::UpdateState( 65 void NegotiatingAuthenticatorBase::UpdateState(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 97 }
97 98
98 scoped_ptr<ChannelAuthenticator> 99 scoped_ptr<ChannelAuthenticator>
99 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const { 100 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const {
100 DCHECK_EQ(state(), ACCEPTED); 101 DCHECK_EQ(state(), ACCEPTED);
101 return current_authenticator_->CreateChannelAuthenticator(); 102 return current_authenticator_->CreateChannelAuthenticator();
102 } 103 }
103 104
104 } // namespace protocol 105 } // namespace protocol
105 } // namespace remoting 106 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/negotiating_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698