Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef MEDIA_ENGINE_WRAPPER_H_
6 #define MEDIA_ENGINE_WRAPPER_H_
8 #include <mozilla/Scoped.h>
12 namespace mozilla
13 {
14 /**
15 * A Custom scoped template to release a resoure of Type T
16 * with a function of Type F
17 * ScopedCustomReleasePtr<webrtc::VoENetwork> ptr =
18 * webrtc::VoENetwork->GetInterface(voiceEngine);
19 *
20 */
21 template<typename T>
22 struct ScopedCustomReleaseTraits0 : public ScopedFreePtrTraits<T>
23 {
24 static void release(T* ptr)
25 {
26 if(ptr)
27 {
28 (ptr)->Release();
29 }
30 }
31 };
33 SCOPED_TEMPLATE(ScopedCustomReleasePtr, ScopedCustomReleaseTraits0)
34 }//namespace
37 #endif