OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SETUP_NATIVE_MESSAGING_HOST_H_ | 5 #ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ |
6 #define REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ | 6 #define REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // not afterwards), so it needs to be destroyed before other members of this | 131 // not afterwards), so it needs to be destroyed before other members of this |
132 // class (except for |weak_factory_|). | 132 // class (except for |weak_factory_|). |
133 scoped_ptr<remoting::DaemonController> daemon_controller_; | 133 scoped_ptr<remoting::DaemonController> daemon_controller_; |
134 | 134 |
135 // Used to load and update the paired clients for this host. | 135 // Used to load and update the paired clients for this host. |
136 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 136 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
137 | 137 |
138 // Used to exchange the service account authorization code for credentials. | 138 // Used to exchange the service account authorization code for credentials. |
139 scoped_ptr<OAuthClient> oauth_client_; | 139 scoped_ptr<OAuthClient> oauth_client_; |
140 | 140 |
| 141 // Keeps track of pending requests. Used to delay shutdown until all responses |
| 142 // have been sent. |
| 143 int pending_requests_; |
| 144 |
| 145 // True if Shutdown() has been called. |
| 146 bool shutdown_; |
| 147 |
141 base::WeakPtrFactory<NativeMessagingHost> weak_factory_; | 148 base::WeakPtrFactory<NativeMessagingHost> weak_factory_; |
142 | 149 |
143 DISALLOW_COPY_AND_ASSIGN(NativeMessagingHost); | 150 DISALLOW_COPY_AND_ASSIGN(NativeMessagingHost); |
144 }; | 151 }; |
145 | 152 |
146 // Creates a NativeMessagingHost instance, attaches it to stdin/stdout and runs | 153 // Creates a NativeMessagingHost instance, attaches it to stdin/stdout and runs |
147 // the message loop until NativeMessagingHost signals shutdown. | 154 // the message loop until NativeMessagingHost signals shutdown. |
148 int NativeMessagingHostMain(); | 155 int NativeMessagingHostMain(); |
149 | 156 |
150 } // namespace remoting | 157 } // namespace remoting |
151 | 158 |
152 #endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ | 159 #endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ |
OLD | NEW |