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

Side by Side Diff: chrome/common/service_process_util_win.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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 (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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class ServiceProcessTerminateMonitor 51 class ServiceProcessTerminateMonitor
52 : public base::win::ObjectWatcher::Delegate { 52 : public base::win::ObjectWatcher::Delegate {
53 public: 53 public:
54 explicit ServiceProcessTerminateMonitor(const base::Closure& terminate_task) 54 explicit ServiceProcessTerminateMonitor(const base::Closure& terminate_task)
55 : terminate_task_(terminate_task) { 55 : terminate_task_(terminate_task) {
56 } 56 }
57 void Start() { 57 void Start() {
58 base::string16 event_name = GetServiceProcessTerminateEventName(); 58 base::string16 event_name = GetServiceProcessTerminateEventName();
59 DCHECK(event_name.length() <= MAX_PATH); 59 DCHECK(event_name.length() <= MAX_PATH);
60 terminate_event_.Set(CreateEvent(NULL, TRUE, FALSE, event_name.c_str())); 60 terminate_event_.Set(CreateEvent(NULL, TRUE, FALSE, event_name.c_str()));
61 watcher_.StartWatching(terminate_event_.Get(), this); 61 watcher_.StartWatching(terminate_event_.Get(), this, false);
62 } 62 }
63 63
64 // base::ObjectWatcher::Delegate implementation. 64 // base::ObjectWatcher::Delegate implementation.
65 void OnObjectSignaled(HANDLE object) override { 65 void OnObjectSignaled(HANDLE object) override {
66 if (!terminate_task_.is_null()) { 66 if (!terminate_task_.is_null()) {
67 terminate_task_.Run(); 67 terminate_task_.Run();
68 terminate_task_.Reset(); 68 terminate_task_.Reset();
69 } 69 }
70 } 70 }
71 71
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 HKEY_CURRENT_USER, 167 HKEY_CURRENT_USER,
168 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); 168 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey()));
169 return base::win::RemoveCommandFromAutoRun( 169 return base::win::RemoveCommandFromAutoRun(
170 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); 170 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey()));
171 } 171 }
172 172
173 void ServiceProcessState::TearDownState() { 173 void ServiceProcessState::TearDownState() {
174 delete state_; 174 delete state_;
175 state_ = NULL; 175 state_ = NULL;
176 } 176 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698