Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 unsigned removedContexts = 0; 216 unsigned removedContexts = 0;
217 while (activeContexts().size() >= maxGLContexts && 217 while (activeContexts().size() >= maxGLContexts &&
218 removedContexts < maxGLContexts) { 218 removedContexts < maxGLContexts) {
219 forciblyLoseOldestContext( 219 forciblyLoseOldestContext(
220 "WARNING: Too many active WebGL contexts. Oldest context will be " 220 "WARNING: Too many active WebGL contexts. Oldest context will be "
221 "lost."); 221 "lost.");
222 removedContexts++; 222 removedContexts++;
223 } 223 }
224 224
225 ASSERT(!context->isContextLost()); 225 ASSERT(!context->isContextLost());
226 activeContexts().add(context); 226 activeContexts().insert(context);
227 } 227 }
228 228
229 void WebGLRenderingContextBase::deactivateContext( 229 void WebGLRenderingContextBase::deactivateContext(
230 WebGLRenderingContextBase* context) { 230 WebGLRenderingContextBase* context) {
231 activeContexts().remove(context); 231 activeContexts().remove(context);
232 } 232 }
233 233
234 void WebGLRenderingContextBase::addToEvictedList( 234 void WebGLRenderingContextBase::addToEvictedList(
235 WebGLRenderingContextBase* context) { 235 WebGLRenderingContextBase* context) {
236 static int generation = 0; 236 static int generation = 0;
(...skipping 7601 matching lines...) Expand 10 before | Expand all | Expand 10 after
7838 7838
7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7840 HTMLCanvasElementOrOffscreenCanvas& result) const { 7840 HTMLCanvasElementOrOffscreenCanvas& result) const {
7841 if (canvas()) 7841 if (canvas())
7842 result.setHTMLCanvasElement(canvas()); 7842 result.setHTMLCanvasElement(canvas());
7843 else 7843 else
7844 result.setOffscreenCanvas(offscreenCanvas()); 7844 result.setOffscreenCanvas(offscreenCanvas());
7845 } 7845 }
7846 7846
7847 } // namespace blink 7847 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698