OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 // be called on. | 25 // be called on. |
26 // TODO(tommi): Almost all implementations of this function, need to know | 26 // TODO(tommi): Almost all implementations of this function, need to know |
27 // the current tick count. Consider passing it as an argument. It could | 27 // the current tick count. Consider passing it as an argument. It could |
28 // also improve the accuracy of when the next callback occurs since the | 28 // also improve the accuracy of when the next callback occurs since the |
29 // thread that calls Process() will also have it's tick count reference | 29 // thread that calls Process() will also have it's tick count reference |
30 // which might not match with what the implementations use. | 30 // which might not match with what the implementations use. |
31 virtual int64_t TimeUntilNextProcess() = 0; | 31 virtual int64_t TimeUntilNextProcess() = 0; |
32 | 32 |
33 // Process any pending tasks such as timeouts. | 33 // Process any pending tasks such as timeouts. |
34 // Called on a worker thread. | 34 // Called on a worker thread. |
35 virtual void Process() = 0; | 35 virtual int32_t Process() = 0; |
36 | 36 |
37 // This method is called when the module is attached to a *running* process | 37 // This method is called when the module is attached to a *running* process |
38 // thread or detached from one. In the case of detaching, |process_thread| | 38 // thread or detached from one. In the case of detaching, |process_thread| |
39 // will be nullptr. | 39 // will be nullptr. |
40 // | 40 // |
41 // This method will be called in the following cases: | 41 // This method will be called in the following cases: |
42 // | 42 // |
43 // * Non-null process_thread: | 43 // * Non-null process_thread: |
44 // * ProcessThread::RegisterModule() is called while the thread is running. | 44 // * ProcessThread::RegisterModule() is called while the thread is running. |
45 // * ProcessThread::Start() is called and RegisterModule has previously | 45 // * ProcessThread::Start() is called and RegisterModule has previously |
(...skipping 26 matching lines...) Expand all Loading... |
72 // When the reference count reaches 0 the object will self-destruct. | 72 // When the reference count reaches 0 the object will self-destruct. |
73 virtual int32_t Release() const = 0; | 73 virtual int32_t Release() const = 0; |
74 | 74 |
75 protected: | 75 protected: |
76 ~RefCountedModule() override = default; | 76 ~RefCountedModule() override = default; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace webrtc | 79 } // namespace webrtc |
80 | 80 |
81 #endif // WEBRTC_MODULES_INCLUDE_MODULE_H_ | 81 #endif // WEBRTC_MODULES_INCLUDE_MODULE_H_ |
OLD | NEW |