OLD | NEW |
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 <functional> | 7 #include <functional> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 installer_state->Initialize(command_line, master_preferences, | 119 installer_state->Initialize(command_line, master_preferences, |
120 *original_state); | 120 *original_state); |
121 | 121 |
122 RecordSetupSingletonAcquisitionResultHistogram( | 122 RecordSetupSingletonAcquisitionResultHistogram( |
123 SETUP_SINGLETON_ACQUISITION_SUCCESS); | 123 SETUP_SINGLETON_ACQUISITION_SUCCESS); |
124 return setup_singleton; | 124 return setup_singleton; |
125 } | 125 } |
126 | 126 |
127 SetupSingleton::~SetupSingleton() = default; | 127 SetupSingleton::~SetupSingleton() = default; |
128 | 128 |
129 bool SetupSingleton::WaitForInterrupt(const base::TimeDelta& max_time) { | 129 bool SetupSingleton::WaitForInterrupt(const base::TimeDelta& max_time) const { |
130 const bool exit_event_signaled = exit_event_.TimedWait(max_time); | 130 const bool exit_event_signaled = exit_event_.TimedWait(max_time); |
131 return exit_event_signaled; | 131 return exit_event_signaled; |
132 } | 132 } |
133 | 133 |
134 SetupSingleton::ScopedHoldMutex::ScopedHoldMutex() = default; | 134 SetupSingleton::ScopedHoldMutex::ScopedHoldMutex() = default; |
135 | 135 |
136 SetupSingleton::ScopedHoldMutex::~ScopedHoldMutex() { | 136 SetupSingleton::ScopedHoldMutex::~ScopedHoldMutex() { |
137 if (mutex_ != INVALID_HANDLE_VALUE) | 137 if (mutex_ != INVALID_HANDLE_VALUE) |
138 ::ReleaseMutex(mutex_); | 138 ::ReleaseMutex(mutex_); |
139 } | 139 } |
(...skipping 15 matching lines...) Expand all Loading... |
155 return false; | 155 return false; |
156 } | 156 } |
157 | 157 |
158 SetupSingleton::SetupSingleton(base::win::ScopedHandle setup_mutex, | 158 SetupSingleton::SetupSingleton(base::win::ScopedHandle setup_mutex, |
159 base::win::ScopedHandle exit_event) | 159 base::win::ScopedHandle exit_event) |
160 : setup_mutex_(std::move(setup_mutex)), exit_event_(std::move(exit_event)) { | 160 : setup_mutex_(std::move(setup_mutex)), exit_event_(std::move(exit_event)) { |
161 DCHECK(setup_mutex_.IsValid()); | 161 DCHECK(setup_mutex_.IsValid()); |
162 } | 162 } |
163 | 163 |
164 } // namespace installer | 164 } // namespace installer |
OLD | NEW |