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

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

Issue 1233453011: Revert of Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 !base::EndsWith(xmpp_server_config_.username, 199 !base::EndsWith(xmpp_server_config_.username,
200 std::string("@") + required_host_domain_, 200 std::string("@") + required_host_domain_, false)) {
201 base::CompareCase::INSENSITIVE_ASCII)) {
202 SetState(kInvalidDomainError, ""); 201 SetState(kInvalidDomainError, "");
203 return; 202 return;
204 } 203 }
205 204
206 // Generate a key pair for the Host to use. 205 // Generate a key pair for the Host to use.
207 // TODO(wez): Move this to the worker thread. 206 // TODO(wez): Move this to the worker thread.
208 host_key_pair_ = RsaKeyPair::Generate(); 207 host_key_pair_ = RsaKeyPair::Generate();
209 208
210 // Create XMPP connection. 209 // Create XMPP connection.
211 scoped_ptr<SignalStrategy> signal_strategy( 210 scoped_ptr<SignalStrategy> signal_strategy(
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( 532 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory(
534 new It2MeConfirmationDialogFactory()); 533 new It2MeConfirmationDialogFactory());
535 scoped_ptr<PolicyWatcher> policy_watcher = 534 scoped_ptr<PolicyWatcher> policy_watcher =
536 PolicyWatcher::Create(policy_service_, context->file_task_runner()); 535 PolicyWatcher::Create(policy_service_, context->file_task_runner());
537 return new It2MeHost(context.Pass(), policy_watcher.Pass(), 536 return new It2MeHost(context.Pass(), policy_watcher.Pass(),
538 confirmation_dialog_factory.Pass(), 537 confirmation_dialog_factory.Pass(),
539 observer, xmpp_server_config, directory_bot_jid); 538 observer, xmpp_server_config, directory_bot_jid);
540 } 539 }
541 540
542 } // namespace remoting 541 } // 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