本文整理汇总了C++中StreamListeners::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ StreamListeners::Clear方法的具体用法?C++ StreamListeners::Clear怎么用?C++ StreamListeners::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamListeners
的用法示例。
在下文中一共展示了StreamListeners::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindowListeners
void
MediaManager::OnNavigation(uint64_t aWindowID)
{
NS_ASSERTION(NS_IsMainThread(), "OnNavigation called off main thread");
// Invalidate this window. The runnables check this value before making
// a call to content.
// This is safe since we're on main-thread, and the windowlist can only
// be added to from the main-thread
StreamListeners* listeners = GetWindowListeners(aWindowID);
if (!listeners) {
return;
}
uint32_t length = listeners->Length();
for (uint32_t i = 0; i < length; i++) {
nsRefPtr<GetUserMediaCallbackMediaStreamListener> listener =
listeners->ElementAt(i);
listener->Invalidate();
listener->Remove();
}
listeners->Clear();
GetActiveWindows()->Remove(aWindowID);
}
示例2:
void
MediaManager::OnNavigation(PRUint64 aWindowID)
{
// Invalidate this window. The runnables check this value before making
// a call to content.
StreamListeners* listeners = mActiveWindows.Get(aWindowID);
if (!listeners) {
return;
}
PRUint32 length = listeners->Length();
for (PRUint32 i = 0; i < length; i++) {
nsRefPtr<GetUserMediaCallbackMediaStreamListener> listener =
listeners->ElementAt(i);
listener->Invalidate();
listener = nsnull;
}
listeners->Clear();
mActiveWindows.Remove(aWindowID);
}