33 #include <nsAutoPtr.h>
40 static PRLogModuleInfo * MediacoreEvent() {
41 static PRLogModuleInfo* gMediacoreEvent = PR_NewLogModule(
"sbMediacoreEvent");
42 return gMediacoreEvent;
45 #define TRACE(args) PR_LOG(MediacoreEvent() , PR_LOG_DEBUG, args)
46 #define LOG(args) PR_LOG(MediacoreEvent() , PR_LOG_WARN, args)
58 , mDispatched(PR_FALSE)
62 TRACE((
"sbMediacoreEvent[0x%x] - Created",
this));
67 TRACE((
"sbMediacoreEvent[0x%x] - Destroyed",
this));
72 nsAutoLock::DestroyLock(
mLock);
82 TRACE((
"sbMediacoreEvent[0x%x] - Init",
this));
84 mLock = nsAutoLock::NewLock(
"sbMediacoreEvent::mLock");
85 NS_ENSURE_TRUE(
mLock, NS_ERROR_OUT_OF_MEMORY);
98 TRACE((
"sbMediacoreEvent[0x%x] - SetTarget",
this));
100 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
101 NS_ENSURE_ARG_POINTER(aTarget);
103 nsAutoLock lock(
mLock);
112 TRACE((
"sbMediacoreEvent[0x%x] - Dispatch",
this));
114 nsAutoLock lock(
mLock);
121 TRACE((
"sbMediacoreEvent[0x%x] - WasDispatched",
this));
123 nsAutoLock lock(
mLock);
128 sbMediacoreEvent::GetType(PRUint32 *aType)
130 TRACE((
"sbMediacoreEvent[0x%x] - GetType",
this));
132 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
133 nsAutoLock lock(
mLock);
143 TRACE((
"sbMediacoreEvent[0x%x] - GetError",
this));
145 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
146 nsAutoLock lock(
mLock);
148 NS_IF_ADDREF(*aError =
mError);
154 sbMediacoreEvent::GetData(nsIVariant * *
aData)
156 TRACE((
"sbMediacoreEvent[0x%x] - GetData",
this));
158 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
159 nsAutoLock lock(
mLock);
161 NS_IF_ADDREF(*aData =
mData);
169 TRACE((
"sbMediacoreEvent[0x%x] - GetOrigin",
this));
171 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
172 nsAutoLock lock(
mLock);
174 NS_IF_ADDREF(*aOrigin =
mOrigin);
182 TRACE((
"sbMediacoreEvent[0x%x] - GetTarget",
this));
184 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
185 nsAutoLock lock(
mLock);
187 NS_IF_ADDREF(*aTarget =
mTarget);
201 NS_ENSURE_TRUE(
event, NS_ERROR_OUT_OF_MEMORY);
203 rv =
event->Init(aType, aError, aData, aOrigin);
204 NS_ENSURE_SUCCESS(rv, rv);
206 NS_IF_ADDREF(*retval =
event);
_updateTextAndScrollDataForFrame aData