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

Side by Side Diff: remoting/host/it2me/it2me_host.cc

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « pdf/document_loader.cc ('k') | remoting/host/remoting_me2me_host.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/it2me/it2me_host.h" 5 #include "remoting/host/it2me/it2me_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 void It2MeHost::FinishConnect() { 189 void It2MeHost::FinishConnect() {
190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); 190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
191 191
192 if (state_ != kStarting) { 192 if (state_ != kStarting) {
193 // Host has been stopped while we were fetching policy. 193 // Host has been stopped while we were fetching policy.
194 return; 194 return;
195 } 195 }
196 196
197 // Check the host domain policy. 197 // Check the host domain policy.
198 if (!required_host_domain_.empty() && 198 if (!required_host_domain_.empty() &&
199 !EndsWith(xmpp_server_config_.username, 199 !base::EndsWith(xmpp_server_config_.username,
200 std::string("@") + required_host_domain_, false)) { 200 std::string("@") + required_host_domain_, false)) {
201 SetState(kInvalidDomainError); 201 SetState(kInvalidDomainError);
202 return; 202 return;
203 } 203 }
204 204
205 // Generate a key pair for the Host to use. 205 // Generate a key pair for the Host to use.
206 // TODO(wez): Move this to the worker thread. 206 // TODO(wez): Move this to the worker thread.
207 host_key_pair_ = RsaKeyPair::Generate(); 207 host_key_pair_ = RsaKeyPair::Generate();
208 208
209 // Create XMPP connection. 209 // Create XMPP connection.
210 scoped_ptr<SignalStrategy> signal_strategy( 210 scoped_ptr<SignalStrategy> signal_strategy(
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( 530 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory(
531 new It2MeConfirmationDialogFactory()); 531 new It2MeConfirmationDialogFactory());
532 scoped_ptr<PolicyWatcher> policy_watcher = 532 scoped_ptr<PolicyWatcher> policy_watcher =
533 PolicyWatcher::Create(policy_service_, context->file_task_runner()); 533 PolicyWatcher::Create(policy_service_, context->file_task_runner());
534 return new It2MeHost(context.Pass(), policy_watcher.Pass(), 534 return new It2MeHost(context.Pass(), policy_watcher.Pass(),
535 confirmation_dialog_factory.Pass(), 535 confirmation_dialog_factory.Pass(),
536 observer, xmpp_server_config, directory_bot_jid); 536 observer, xmpp_server_config, directory_bot_jid);
537 } 537 }
538 538
539 } // namespace remoting 539 } // namespace remoting
OLDNEW
« no previous file with comments | « pdf/document_loader.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698