| OLD | NEW |
| 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 #ifndef REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ | 5 #ifndef REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
| 6 #define REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ | 6 #define REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 9 #include "base/callback.h" | 10 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 14 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 15 #include "base/win/object_watcher.h" | 17 #include "base/win/object_watcher.h" |
| 16 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
| 17 #include "net/base/backoff_entry.h" | 19 #include "net/base/backoff_entry.h" |
| 18 | 20 |
| 19 namespace base { | 21 namespace base { |
| 20 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void OnProcessLaunched(base::win::ScopedHandle worker_process); | 89 void OnProcessLaunched(base::win::ScopedHandle worker_process); |
| 88 | 90 |
| 89 // Called when a fatal error occurs (i.e. a failed process launch). | 91 // Called when a fatal error occurs (i.e. a failed process launch). |
| 90 // The delegate must guarantee that no other notifications are delivered once | 92 // The delegate must guarantee that no other notifications are delivered once |
| 91 // OnFatalError() has been called. | 93 // OnFatalError() has been called. |
| 92 void OnFatalError(); | 94 void OnFatalError(); |
| 93 | 95 |
| 94 // Mirrors methods of IPC::Listener to be invoked by |Delegate|. |Delegate| | 96 // Mirrors methods of IPC::Listener to be invoked by |Delegate|. |Delegate| |
| 95 // has to validate |peer_pid| if necessary. | 97 // has to validate |peer_pid| if necessary. |
| 96 bool OnMessageReceived(const IPC::Message& message); | 98 bool OnMessageReceived(const IPC::Message& message); |
| 97 void OnChannelConnected(int32 peer_pid); | 99 void OnChannelConnected(int32_t peer_pid); |
| 98 void OnChannelError(); | 100 void OnChannelError(); |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 friend class WorkerProcessLauncherTest; | 103 friend class WorkerProcessLauncherTest; |
| 102 | 104 |
| 103 // base::win::ObjectWatcher::Delegate implementation used to watch for | 105 // base::win::ObjectWatcher::Delegate implementation used to watch for |
| 104 // the worker process exiting. | 106 // the worker process exiting. |
| 105 void OnObjectSignaled(HANDLE object) override; | 107 void OnObjectSignaled(HANDLE object) override; |
| 106 | 108 |
| 107 // Returns true when the object is being destroyed. | 109 // Returns true when the object is being destroyed. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 162 |
| 161 // The handle of the worker process, if launched. | 163 // The handle of the worker process, if launched. |
| 162 base::win::ScopedHandle worker_process_; | 164 base::win::ScopedHandle worker_process_; |
| 163 | 165 |
| 164 DISALLOW_COPY_AND_ASSIGN(WorkerProcessLauncher); | 166 DISALLOW_COPY_AND_ASSIGN(WorkerProcessLauncher); |
| 165 }; | 167 }; |
| 166 | 168 |
| 167 } // namespace remoting | 169 } // namespace remoting |
| 168 | 170 |
| 169 #endif // REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ | 171 #endif // REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
| OLD | NEW |