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

Side by Side Diff: chrome/installer/setup/setup_singleton.cc

Issue 2333853002: Support --delete-old-versions in setup.exe. (Closed)
Patch Set: self-review Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/installer/setup/setup_singleton.h" 5 #include "chrome/installer/setup/setup_singleton.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 installer_state->Initialize(command_line, master_preferences, 85 installer_state->Initialize(command_line, master_preferences,
86 *original_state); 86 *original_state);
87 87
88 RecordSetupSingletonAcquisitionResultHistogram( 88 RecordSetupSingletonAcquisitionResultHistogram(
89 SETUP_SINGLETON_ACQUISITION_SUCCESS); 89 SETUP_SINGLETON_ACQUISITION_SUCCESS);
90 return setup_singleton; 90 return setup_singleton;
91 } 91 }
92 92
93 SetupSingleton::~SetupSingleton() = default; 93 SetupSingleton::~SetupSingleton() = default;
94 94
95 bool SetupSingleton::WaitForInterrupt(const base::TimeDelta& max_time) { 95 bool SetupSingleton::WaitForInterrupt(const base::TimeDelta& max_time) const {
96 const bool exit_event_signaled = exit_event_.TimedWait(max_time); 96 const bool exit_event_signaled = exit_event_.TimedWait(max_time);
97 return exit_event_signaled; 97 return exit_event_signaled;
98 } 98 }
99 99
100 SetupSingleton::ScopedHoldMutex::ScopedHoldMutex() = default; 100 SetupSingleton::ScopedHoldMutex::ScopedHoldMutex() = default;
101 101
102 SetupSingleton::ScopedHoldMutex::~ScopedHoldMutex() { 102 SetupSingleton::ScopedHoldMutex::~ScopedHoldMutex() {
103 if (mutex_ != INVALID_HANDLE_VALUE) 103 if (mutex_ != INVALID_HANDLE_VALUE)
104 ::ReleaseMutex(mutex_); 104 ::ReleaseMutex(mutex_);
105 } 105 }
(...skipping 23 matching lines...) Expand all
129 exit_event_(base::win::ScopedHandle(::CreateEvent( 129 exit_event_(base::win::ScopedHandle(::CreateEvent(
130 nullptr, 130 nullptr,
131 TRUE, 131 TRUE,
132 FALSE, 132 FALSE,
133 (L"Global\\ChromeSetupExitEvent_" + sync_primitive_name_suffix) 133 (L"Global\\ChromeSetupExitEvent_" + sync_primitive_name_suffix)
134 .c_str()))) { 134 .c_str()))) {
135 DCHECK(setup_mutex_.IsValid()); 135 DCHECK(setup_mutex_.IsValid());
136 } 136 }
137 137
138 } // namespace installer 138 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698