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

Side by Side Diff: remoting/host/remoting_me2me_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 | « remoting/host/it2me/it2me_host.cc ('k') | third_party/zlib/google/zip_reader.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 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 // If the user does not have a Google email, their client JID will not be 1089 // If the user does not have a Google email, their client JID will not be
1090 // based on their email. In that case, the username/host domain policies 1090 // based on their email. In that case, the username/host domain policies
1091 // would be meaningless, since there is no way to check that the JID 1091 // would be meaningless, since there is no way to check that the JID
1092 // trying to connect actually corresponds to the owner email in question. 1092 // trying to connect actually corresponds to the owner email in question.
1093 if (host_owner_ != host_owner_email_) { 1093 if (host_owner_ != host_owner_email_) {
1094 LOG(ERROR) << "The username and host domain policies cannot be enabled " 1094 LOG(ERROR) << "The username and host domain policies cannot be enabled "
1095 << "for accounts with a non-Google email."; 1095 << "for accounts with a non-Google email.";
1096 ShutdownHost(kInvalidHostDomainExitCode); 1096 ShutdownHost(kInvalidHostDomainExitCode);
1097 } 1097 }
1098 1098
1099 if (!base::EndsWith(host_owner_, std::string("@") + host_domain_, 1099 if (!base::EndsWith(host_owner_, std::string("@") + host_domain_, false)) {
1100 base::CompareCase::INSENSITIVE_ASCII)) {
1101 LOG(ERROR) << "The host domain does not match the policy."; 1100 LOG(ERROR) << "The host domain does not match the policy.";
1102 ShutdownHost(kInvalidHostDomainExitCode); 1101 ShutdownHost(kInvalidHostDomainExitCode);
1103 } 1102 }
1104 } 1103 }
1105 } 1104 }
1106 1105
1107 bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) { 1106 bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) {
1108 // Returns true if the host has to be restarted after this policy update. 1107 // Returns true if the host has to be restarted after this policy update.
1109 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); 1108 DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
1110 1109
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); 1650 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds));
1652 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); 1651 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog);
1653 1652
1654 // Run the main (also UI) message loop until the host no longer needs it. 1653 // Run the main (also UI) message loop until the host no longer needs it.
1655 message_loop.Run(); 1654 message_loop.Run();
1656 1655
1657 return exit_code; 1656 return exit_code;
1658 } 1657 }
1659 1658
1660 } // namespace remoting 1659 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/it2me/it2me_host.cc ('k') | third_party/zlib/google/zip_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698