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

Side by Side Diff: chrome/common/service_process_util_mac.mm

Issue 109673004: Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the hea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « chrome/common/service_process_util.cc ('k') | chrome/installer/setup/install.h » ('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 "chrome/common/service_process_util_posix.h" 5 #include "chrome/common/service_process_util_posix.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <launch.h> 8 #include <launch.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 base::FileDescriptor fd(socket, false); 196 base::FileDescriptor fd(socket, false);
197 return IPC::ChannelHandle(std::string(), fd); 197 return IPC::ChannelHandle(std::string(), fd);
198 } 198 }
199 199
200 bool CheckServiceProcessReady() { 200 bool CheckServiceProcessReady() {
201 std::string version; 201 std::string version;
202 pid_t pid; 202 pid_t pid;
203 if (!GetServiceProcessData(&version, &pid)) { 203 if (!GetServiceProcessData(&version, &pid)) {
204 return false; 204 return false;
205 } 205 }
206 base::Version service_version(version); 206 Version service_version(version);
207 bool ready = true; 207 bool ready = true;
208 if (!service_version.IsValid()) { 208 if (!service_version.IsValid()) {
209 ready = false; 209 ready = false;
210 } else { 210 } else {
211 chrome::VersionInfo version_info; 211 chrome::VersionInfo version_info;
212 if (!version_info.is_valid()) { 212 if (!version_info.is_valid()) {
213 // Our own version is invalid. This is an error case. Pretend that we 213 // Our own version is invalid. This is an error case. Pretend that we
214 // are out of date. 214 // are out of date.
215 NOTREACHED(); 215 NOTREACHED();
216 ready = true; 216 ready = true;
217 } 217 }
218 else { 218 else {
219 base::Version running_version(version_info.Version()); 219 Version running_version(version_info.Version());
220 if (!running_version.IsValid()) { 220 if (!running_version.IsValid()) {
221 // Our own version is invalid. This is an error case. Pretend that we 221 // Our own version is invalid. This is an error case. Pretend that we
222 // are out of date. 222 // are out of date.
223 NOTREACHED(); 223 NOTREACHED();
224 ready = true; 224 ready = true;
225 } else if (running_version.CompareTo(service_version) > 0) { 225 } else if (running_version.CompareTo(service_version) > 0) {
226 ready = false; 226 ready = false;
227 } else { 227 } else {
228 ready = true; 228 ready = true;
229 } 229 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 CFErrorRef err = NULL; 442 CFErrorRef err = NULL;
443 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { 443 if (!Launchd::GetInstance()->RemoveJob(label, &err)) {
444 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err); 444 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err);
445 DLOG(ERROR) << "RemoveJob " << err; 445 DLOG(ERROR) << "RemoveJob " << err;
446 // Exiting with zero, so launchd doesn't restart the process. 446 // Exiting with zero, so launchd doesn't restart the process.
447 exit(0); 447 exit(0);
448 } 448 }
449 } 449 }
450 } 450 }
451 } 451 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util.cc ('k') | chrome/installer/setup/install.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698