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

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

Issue 2258263002: Consistently use namespaced base::Version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased against master. Created 4 years, 3 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 | « chrome/common/service_process_util.cc ('k') | components/variations/processed_study.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 #import <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 #include <launch.h> 6 #include <launch.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 base::FileDescriptor fd(socket, false); 190 base::FileDescriptor fd(socket, false);
191 return IPC::ChannelHandle(std::string(), fd); 191 return IPC::ChannelHandle(std::string(), fd);
192 } 192 }
193 193
194 bool CheckServiceProcessReady() { 194 bool CheckServiceProcessReady() {
195 std::string version; 195 std::string version;
196 pid_t pid; 196 pid_t pid;
197 if (!GetServiceProcessData(&version, &pid)) { 197 if (!GetServiceProcessData(&version, &pid)) {
198 return false; 198 return false;
199 } 199 }
200 Version service_version(version); 200 base::Version service_version(version);
201 bool ready = true; 201 bool ready = true;
202 if (!service_version.IsValid()) { 202 if (!service_version.IsValid()) {
203 ready = false; 203 ready = false;
204 } else { 204 } else {
205 Version running_version(version_info::GetVersionNumber()); 205 base::Version running_version(version_info::GetVersionNumber());
206 if (!running_version.IsValid()) { 206 if (!running_version.IsValid()) {
207 // Our own version is invalid. This is an error case. Pretend that we 207 // Our own version is invalid. This is an error case. Pretend that we
208 // are out of date. 208 // are out of date.
209 NOTREACHED(); 209 NOTREACHED();
210 ready = true; 210 ready = true;
211 } else if (running_version.CompareTo(service_version) > 0) { 211 } else if (running_version.CompareTo(service_version) > 0) {
212 ready = false; 212 ready = false;
213 } else { 213 } else {
214 ready = true; 214 ready = true;
215 } 215 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 CFErrorRef err = NULL; 430 CFErrorRef err = NULL;
431 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { 431 if (!Launchd::GetInstance()->RemoveJob(label, &err)) {
432 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err); 432 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err);
433 DLOG(ERROR) << "RemoveJob " << err; 433 DLOG(ERROR) << "RemoveJob " << err;
434 // Exiting with zero, so launchd doesn't restart the process. 434 // Exiting with zero, so launchd doesn't restart the process.
435 exit(0); 435 exit(0);
436 } 436 }
437 } 437 }
438 } 438 }
439 } 439 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util.cc ('k') | components/variations/processed_study.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698