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 MOJO_EDK_SYSTEM_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_DISPATCHER_H_ |
6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_DISPATCHER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // being passed over a message pipe. | 290 // being passed over a message pipe. |
291 virtual void StartSerializeImplNoLock(Channel* channel, | 291 virtual void StartSerializeImplNoLock(Channel* channel, |
292 size_t* max_size, | 292 size_t* max_size, |
293 size_t* max_platform_handles); | 293 size_t* max_platform_handles); |
294 virtual bool EndSerializeAndCloseImplNoLock( | 294 virtual bool EndSerializeAndCloseImplNoLock( |
295 Channel* channel, | 295 Channel* channel, |
296 void* destination, | 296 void* destination, |
297 size_t* actual_size, | 297 size_t* actual_size, |
298 embedder::PlatformHandleVector* platform_handles); | 298 embedder::PlatformHandleVector* platform_handles); |
299 | 299 |
| 300 // This should be overridden to return true if/when there's an ongoing |
| 301 // operation (e.g., two-phase read/writes on data pipes) that should prevent a |
| 302 // handle from being sent over a message pipe (with status "busy"). |
| 303 virtual bool IsBusyNoLock() const; |
| 304 |
300 // Available to subclasses. (Note: Returns a non-const reference, just like | 305 // Available to subclasses. (Note: Returns a non-const reference, just like |
301 // |base::AutoLock|'s constructor takes a non-const reference.) | 306 // |base::AutoLock|'s constructor takes a non-const reference.) |
302 base::Lock& lock() const { return lock_; } | 307 base::Lock& lock() const { return lock_; } |
303 | 308 |
304 private: | 309 private: |
305 friend class DispatcherTransport; | 310 friend class DispatcherTransport; |
306 | 311 |
307 // This should be overridden to return true if/when there's an ongoing | |
308 // operation (e.g., two-phase read/writes on data pipes) that should prevent a | |
309 // handle from being sent over a message pipe (with status "busy"). | |
310 virtual bool IsBusyNoLock() const; | |
311 | |
312 // Closes the dispatcher. This must be done under lock, and unlike |Close()|, | 312 // Closes the dispatcher. This must be done under lock, and unlike |Close()|, |
313 // the dispatcher must not be closed already. (This is the "equivalent" of | 313 // the dispatcher must not be closed already. (This is the "equivalent" of |
314 // |CreateEquivalentDispatcherAndCloseNoLock()|, for situations where the | 314 // |CreateEquivalentDispatcherAndCloseNoLock()|, for situations where the |
315 // dispatcher must be disposed of instead of "transferred".) | 315 // dispatcher must be disposed of instead of "transferred".) |
316 void CloseNoLock(); | 316 void CloseNoLock(); |
317 | 317 |
318 // Creates an equivalent dispatcher -- representing the same resource as this | 318 // Creates an equivalent dispatcher -- representing the same resource as this |
319 // dispatcher -- and close (i.e., disable) this dispatcher. I.e., this | 319 // dispatcher -- and close (i.e., disable) this dispatcher. I.e., this |
320 // dispatcher will look as though it was closed, but the resource it | 320 // dispatcher will look as though it was closed, but the resource it |
321 // represents will be assigned to the new dispatcher. This must be called | 321 // represents will be assigned to the new dispatcher. This must be called |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 396 |
397 Dispatcher* dispatcher_; | 397 Dispatcher* dispatcher_; |
398 | 398 |
399 // Copy and assign allowed. | 399 // Copy and assign allowed. |
400 }; | 400 }; |
401 | 401 |
402 } // namespace system | 402 } // namespace system |
403 } // namespace mojo | 403 } // namespace mojo |
404 | 404 |
405 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ | 405 #endif // MOJO_EDK_SYSTEM_DISPATCHER_H_ |
OLD | NEW |