Bug 902426 - Do not allow duplicate entries in the CRC2D demotion list r=mattwoodrow

--HG--
extra : rebase_source : c7c344f2b88065f46c06c99fa0bf868367b6b9ab
This commit is contained in:
James Willcox 2013-08-09 17:19:21 -04:00
Родитель 5e0ba3b426
Коммит c11ce45a79
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -797,6 +797,10 @@ CanvasRenderingContext2D::DemoteOldestContextIfNecessary()
void
CanvasRenderingContext2D::AddDemotableContext(CanvasRenderingContext2D* context)
{
std::vector<CanvasRenderingContext2D*>::iterator iter = std::find(DemotableContexts().begin(), DemotableContexts().end(), context);
if (iter != DemotableContexts().end())
return;
DemotableContexts().push_back(context);
}