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

Side by Side Diff: webrtc/modules/utility/source/process_thread_impl.h

Issue 2016043003: Change ProcessThread's task type to be the one from TaskQueue. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Work around issue with STL on Windows Created 4 years, 6 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 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 15 matching lines...) Expand all
26 26
27 class ProcessThreadImpl : public ProcessThread { 27 class ProcessThreadImpl : public ProcessThread {
28 public: 28 public:
29 explicit ProcessThreadImpl(const char* thread_name); 29 explicit ProcessThreadImpl(const char* thread_name);
30 ~ProcessThreadImpl() override; 30 ~ProcessThreadImpl() override;
31 31
32 void Start() override; 32 void Start() override;
33 void Stop() override; 33 void Stop() override;
34 34
35 void WakeUp(Module* module) override; 35 void WakeUp(Module* module) override;
36 void PostTask(std::unique_ptr<ProcessTask> task) override; 36 void PostTask(std::unique_ptr<rtc::QueuedTask> task) override;
37 37
38 void RegisterModule(Module* module) override; 38 void RegisterModule(Module* module) override;
39 void DeRegisterModule(Module* module) override; 39 void DeRegisterModule(Module* module) override;
40 40
41 protected: 41 protected:
42 static bool Run(void* obj); 42 static bool Run(void* obj);
43 bool Process(); 43 bool Process();
44 44
45 private: 45 private:
46 struct ModuleCallback { 46 struct ModuleCallback {
(...skipping 21 matching lines...) Expand all
68 // requirements for mutexes on Mac or if there's something else to it. 68 // requirements for mutexes on Mac or if there's something else to it.
69 // So be careful with changing the layout. 69 // So be careful with changing the layout.
70 rtc::CriticalSection lock_; // Used to guard modules_, tasks_ and stop_. 70 rtc::CriticalSection lock_; // Used to guard modules_, tasks_ and stop_.
71 71
72 rtc::ThreadChecker thread_checker_; 72 rtc::ThreadChecker thread_checker_;
73 const std::unique_ptr<EventWrapper> wake_up_; 73 const std::unique_ptr<EventWrapper> wake_up_;
74 // TODO(pbos): Remove unique_ptr and stop recreating the thread. 74 // TODO(pbos): Remove unique_ptr and stop recreating the thread.
75 std::unique_ptr<rtc::PlatformThread> thread_; 75 std::unique_ptr<rtc::PlatformThread> thread_;
76 76
77 ModuleList modules_; 77 ModuleList modules_;
78 // TODO(tommi): Support delayed tasks. 78 std::queue<rtc::QueuedTask*> queue_;
79 std::queue<ProcessTask*> queue_;
80 bool stop_; 79 bool stop_;
81 const char* thread_name_; 80 const char* thread_name_;
82 }; 81 };
83 82
84 } // namespace webrtc 83 } // namespace webrtc
85 84
86 #endif // WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_ 85 #endif // WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698