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

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

Issue 1785173002: Replace scoped_ptr with unique_ptr in webrtc/modules/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@up8
Patch Set: Created 4 years, 9 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
11 #ifndef WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_ 11 #ifndef WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_
12 #define WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_ 12 #define WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_
13 13
14 #include <list> 14 #include <list>
15 #include <memory>
15 #include <queue> 16 #include <queue>
16 17
17 #include "webrtc/base/criticalsection.h" 18 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/base/platform_thread.h" 19 #include "webrtc/base/platform_thread.h"
19 #include "webrtc/base/thread_checker.h" 20 #include "webrtc/base/thread_checker.h"
20 #include "webrtc/modules/utility/include/process_thread.h" 21 #include "webrtc/modules/utility/include/process_thread.h"
21 #include "webrtc/system_wrappers/include/event_wrapper.h" 22 #include "webrtc/system_wrappers/include/event_wrapper.h"
22 #include "webrtc/typedefs.h" 23 #include "webrtc/typedefs.h"
23 24
24 namespace webrtc { 25 namespace webrtc {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 63
63 // Warning: For some reason, if |lock_| comes immediately before |modules_| 64 // Warning: For some reason, if |lock_| comes immediately before |modules_|
64 // with the current class layout, we will start to have mysterious crashes 65 // with the current class layout, we will start to have mysterious crashes
65 // on Mac 10.9 debug. I (Tommi) suspect we're hitting some obscure alignemnt 66 // on Mac 10.9 debug. I (Tommi) suspect we're hitting some obscure alignemnt
66 // issues, but I haven't figured out what they are, if there are alignment 67 // issues, but I haven't figured out what they are, if there are alignment
67 // 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.
68 // So be careful with changing the layout. 69 // So be careful with changing the layout.
69 rtc::CriticalSection lock_; // Used to guard modules_, tasks_ and stop_. 70 rtc::CriticalSection lock_; // Used to guard modules_, tasks_ and stop_.
70 71
71 rtc::ThreadChecker thread_checker_; 72 rtc::ThreadChecker thread_checker_;
72 const rtc::scoped_ptr<EventWrapper> wake_up_; 73 const std::unique_ptr<EventWrapper> wake_up_;
73 // TODO(pbos): Remove scoped_ptr and stop recreating the thread. 74 // TODO(pbos): Remove unique_ptr and stop recreating the thread.
74 rtc::scoped_ptr<rtc::PlatformThread> thread_; 75 std::unique_ptr<rtc::PlatformThread> thread_;
75 76
76 ModuleList modules_; 77 ModuleList modules_;
77 // TODO(tommi): Support delayed tasks. 78 // TODO(tommi): Support delayed tasks.
78 std::queue<ProcessTask*> queue_; 79 std::queue<ProcessTask*> queue_;
79 bool stop_; 80 bool stop_;
80 const char* thread_name_; 81 const char* thread_name_;
81 }; 82 };
82 83
83 } // namespace webrtc 84 } // namespace webrtc
84 85
85 #endif // WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_ 86 #endif // WEBRTC_MODULES_UTILITY_SOURCE_PROCESS_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698