sbTestMediacoreStressThreads.h
Go to the documentation of this file.
1 /* vim: set sw=2 :miv */
2 /*
3 //
4 // BEGIN SONGBIRD GPL
5 //
6 // This file is part of the Songbird web player.
7 //
8 // Copyright(c) 2005-2008 POTI, Inc.
9 // http://songbirdnest.com
10 //
11 // This file may be licensed under the terms of of the
12 // GNU General Public License Version 2 (the "GPL").
13 //
14 // Software distributed under the License is distributed
15 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
16 // express or implied. See the GPL for the specific language
17 // governing rights and limitations.
18 //
19 // You should have received a copy of the GPL along with this
20 // program. If not, go to http://www.gnu.org/licenses/gpl.html
21 // or write to the Free Software Foundation, Inc.,
22 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 //
24 // END SONGBIRD GPL
25 //
26 */
27 
28 #ifndef sbTestMediacoreStressThreads_h
29 #define sbTestMediacoreStressThreads_h
30 
31 #include <nsIRunnable.h>
32 #include <sbIMediacore.h>
33 #include <prmon.h>
34 #include <nsCOMArray.h>
35 #include <nsCOMPtr.h>
36 #include <nsIThread.h>
37 
39 #include <sbIMediacoreEventListener.h>
40 #include <sbIMediacoreEventTarget.h>
41 
42 /*
43  * event listener stress testing class this is the listener, target
44  * and thread runnable class that pretty much does everything
45  */
46 
47 class sbTestMediacoreStressThreads: public nsIRunnable,
48  public sbIMediacore,
51 
52 {
53 public:
55  NS_DECL_NSIRUNNABLE
56  NS_DECL_SBIMEDIACOREEVENTLISTENER
57  NS_DECL_SBIMEDIACORE
58  NS_DECL_SBIMEDIACOREEVENTTARGET
59 
61 
62 private:
63  ~sbTestMediacoreStressThreads();
64  void OnEvent();
65 
66 protected:
67  nsAutoPtr<sbBaseMediacoreEventTarget> mBaseEventTarget;
68  PRInt32 mCounter;
69  PRMonitor* mMonitor;
70  nsCOMArray<nsIThread> mThreads;
71 };
72 
73 #define SB_TEST_MEDIACORE_STRESS_THREADS_DESCRIPTION \
74  "Songbird Test Mediacore Stress Threads"
75 #define SB_TEST_MEDIACORE_STRESS_THREADS_CONTRACTID \
76  "@songbirdnest.com/mediacore/sbTestMediacoreStressThreads;1"
77 #define SB_TEST_MEDIACORE_STRESS_THREADS_CLASSNAME \
78  "sbTestMediacoreEventCreator"
79 
80 #define SB_TEST_MEDIACORE_STRESS_THREADS_CID \
81 { /* 77CF73E7-FC6B-458b-969A-97945F4160B7 */ \
82  0xa2c2010f, \
83  0xd87d, \
84  0x440d, \
85  { 0xbf, 0x2e, 0x74, 0x54, 0x2b, 0x9b, 0xeb, 0xea } \
86 }
87 
88 #endif
NS_DECL_ISUPPORTS NS_DECL_NSIRUNNABLE NS_DECL_SBIMEDIACOREEVENTLISTENER NS_DECL_SBIMEDIACORE NS_DECL_SBIMEDIACOREEVENTTARGET sbTestMediacoreStressThreads()
nsAutoPtr< sbBaseMediacoreEventTarget > mBaseEventTarget