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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 1233043003: 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_, false)) { 1099 if (!base::EndsWith(host_owner_, std::string("@") + host_domain_,
1100 base::CompareCase::INSENSITIVE_ASCII)) {
1100 LOG(ERROR) << "The host domain does not match the policy."; 1101 LOG(ERROR) << "The host domain does not match the policy.";
1101 ShutdownHost(kInvalidHostDomainExitCode); 1102 ShutdownHost(kInvalidHostDomainExitCode);
1102 } 1103 }
1103 } 1104 }
1104 } 1105 }
1105 1106
1106 bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) { 1107 bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) {
1107 // Returns true if the host has to be restarted after this policy update. 1108 // Returns true if the host has to be restarted after this policy update.
1108 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); 1109 DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
1109 1110
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); 1651 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds));
1651 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog); 1652 new HostProcess(context.Pass(), &exit_code, &shutdown_watchdog);
1652 1653
1653 // Run the main (also UI) message loop until the host no longer needs it. 1654 // Run the main (also UI) message loop until the host no longer needs it.
1654 message_loop.Run(); 1655 message_loop.Run();
1655 1656
1656 return exit_code; 1657 return exit_code;
1657 } 1658 }
1658 1659
1659 } // namespace remoting 1660 } // 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