OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/service_process_util.h" | 5 #include "chrome/common/service_process_util.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 DCHECK(event_name.length() <= MAX_PATH); | 60 DCHECK(event_name.length() <= MAX_PATH); |
61 terminate_event_.Set(CreateEvent(NULL, TRUE, FALSE, event_name.c_str())); | 61 terminate_event_.Set(CreateEvent(NULL, TRUE, FALSE, event_name.c_str())); |
62 watcher_.StartWatching(terminate_event_.Get(), this); | 62 watcher_.StartWatching(terminate_event_.Get(), this); |
63 } | 63 } |
64 | 64 |
65 // base::ObjectWatcher::Delegate implementation. | 65 // base::ObjectWatcher::Delegate implementation. |
66 virtual void OnObjectSignaled(HANDLE object) { | 66 virtual void OnObjectSignaled(HANDLE object) { |
67 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 67 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
68 tracked_objects::ScopedTracker tracking_profile( | 68 tracked_objects::ScopedTracker tracking_profile( |
69 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 69 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
70 "ServiceProcessTerminateMonitor_OnObjectSignaled")); | 70 "418183 ServiceProcessTerminateMonitor::OnObjectSignaled")); |
71 | 71 |
72 if (!terminate_task_.is_null()) { | 72 if (!terminate_task_.is_null()) { |
73 terminate_task_.Run(); | 73 terminate_task_.Run(); |
74 terminate_task_.Reset(); | 74 terminate_task_.Reset(); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 private: | 78 private: |
79 base::win::ScopedHandle terminate_event_; | 79 base::win::ScopedHandle terminate_event_; |
80 base::win::ObjectWatcher watcher_; | 80 base::win::ObjectWatcher watcher_; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 HKEY_CURRENT_USER, | 174 HKEY_CURRENT_USER, |
175 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); | 175 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); |
176 return base::win::RemoveCommandFromAutoRun( | 176 return base::win::RemoveCommandFromAutoRun( |
177 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); | 177 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); |
178 } | 178 } |
179 | 179 |
180 void ServiceProcessState::TearDownState() { | 180 void ServiceProcessState::TearDownState() { |
181 delete state_; | 181 delete state_; |
182 state_ = NULL; | 182 state_ = NULL; |
183 } | 183 } |
OLD | NEW |