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

Side by Side Diff: chrome/browser/upgrade_detector_impl.cc

Issue 634583003: Simplify VersionInfo code, avoid hitting sandbox IPC constantly on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux include Created 6 years, 2 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/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/chrome_common.gypi » ('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/browser/upgrade_detector_impl.h" 5 #include "chrome/browser/upgrade_detector_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/build_time.h" 10 #include "base/build_time.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 void UpgradeDetectorImpl::DetectUpgradeTask( 308 void UpgradeDetectorImpl::DetectUpgradeTask(
309 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) { 309 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) {
310 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 310 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
311 311
312 Version critical_update; 312 Version critical_update;
313 Version installed_version = 313 Version installed_version =
314 GetCurrentlyInstalledVersionImpl(&critical_update); 314 GetCurrentlyInstalledVersionImpl(&critical_update);
315 315
316 // Get the version of the currently *running* instance of Chrome. 316 // Get the version of the currently *running* instance of Chrome.
317 chrome::VersionInfo version_info; 317 chrome::VersionInfo version_info;
318 if (!version_info.is_valid()) {
319 NOTREACHED() << "Failed to get current file version";
320 return;
321 }
322 Version running_version(version_info.Version()); 318 Version running_version(version_info.Version());
323 if (!running_version.IsValid()) { 319 if (!running_version.IsValid()) {
324 NOTREACHED(); 320 NOTREACHED();
325 return; 321 return;
326 } 322 }
327 323
328 // |installed_version| may be NULL when the user downgrades on Linux (by 324 // |installed_version| may be NULL when the user downgrades on Linux (by
329 // switching from dev to beta channel, for example). The user needs a 325 // switching from dev to beta channel, for example). The user needs a
330 // restart in this case as well. See http://crbug.com/46547 326 // restart in this case as well. See http://crbug.com/46547
331 if (!installed_version.IsValid() || 327 if (!installed_version.IsValid() ||
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 508
513 // static 509 // static
514 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 510 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
515 return Singleton<UpgradeDetectorImpl>::get(); 511 return Singleton<UpgradeDetectorImpl>::get();
516 } 512 }
517 513
518 // static 514 // static
519 UpgradeDetector* UpgradeDetector::GetInstance() { 515 UpgradeDetector* UpgradeDetector::GetInstance() {
520 return UpgradeDetectorImpl::GetInstance(); 516 return UpgradeDetectorImpl::GetInstance();
521 } 517 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698