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

Unified Diff: chrome/common/service_process_util.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/pepper_permission_util_unittest.cc ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util.cc
diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc
index f9a990a4ad8e862e80731d9f89af931f5b5ebdba..9bb3464ca8865b58d6f523880e24bbab1de3d90f 100644
--- a/chrome/common/service_process_util.cc
+++ b/chrome/common/service_process_util.cc
@@ -19,8 +19,8 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/chrome_version_info.h"
#include "components/cloud_devices/common/cloud_devices_switches.h"
+#include "components/version_info/version_info.h"
#include "content/public/common/content_paths.h"
#include "google_apis/gaia/gaia_switches.h"
#include "ui/base/ui_base_switches.h"
@@ -77,8 +77,7 @@ ServiceProcessRunningState GetServiceProcessRunningState(
return SERVICE_OLDER_VERSION_RUNNING;
// Get the version of the currently *running* instance of Chrome.
- chrome::VersionInfo version_info;
- Version running_version(version_info.Version());
+ Version running_version(version_info::GetVersionNumber());
if (!running_version.IsValid()) {
NOTREACHED() << "Failed to parse version info";
// Our own version is invalid. This is an error case. Pretend that we
@@ -102,8 +101,7 @@ ServiceProcessRunningState GetServiceProcessRunningState(
std::string GetServiceProcessScopedVersionedName(
const std::string& append_str) {
std::string versioned_str;
- chrome::VersionInfo version_info;
- versioned_str.append(version_info.Version());
+ versioned_str.append(version_info::GetVersionNumber());
versioned_str.append(append_str);
return GetServiceProcessScopedName(versioned_str);
}
@@ -235,11 +233,10 @@ bool ServiceProcessState::HandleOtherVersion() {
}
bool ServiceProcessState::CreateSharedData() {
- chrome::VersionInfo version_info;
- if (version_info.Version().length() >= kMaxVersionStringLength) {
- NOTREACHED() << "Version string length is << " <<
- version_info.Version().length() << "which is longer than" <<
- kMaxVersionStringLength;
+ if (version_info::GetVersionNumber().length() >= kMaxVersionStringLength) {
+ NOTREACHED() << "Version string length is << "
+ << version_info::GetVersionNumber().length()
+ << " which is longer than" << kMaxVersionStringLength;
return false;
}
@@ -261,8 +258,9 @@ bool ServiceProcessState::CreateSharedData() {
ServiceProcessSharedData* shared_data =
reinterpret_cast<ServiceProcessSharedData*>(
shared_mem_service_data->memory());
- memcpy(shared_data->service_process_version, version_info.Version().c_str(),
- version_info.Version().length());
+ memcpy(shared_data->service_process_version,
+ version_info::GetVersionNumber().c_str(),
+ version_info::GetVersionNumber().length());
shared_data->service_process_pid = base::GetCurrentProcId();
shared_mem_service_data_.reset(shared_mem_service_data.release());
return true;
« no previous file with comments | « chrome/common/pepper_permission_util_unittest.cc ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698