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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/csspaint/PaintWorkletGlobalScope.h" 5 #include "modules/csspaint/PaintWorkletGlobalScope.h"
6 6
7 #include "bindings/core/v8/V8BindingMacros.h" 7 #include "bindings/core/v8/V8BindingMacros.h"
8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
9 #include "core/CSSPropertyNames.h" 9 #include "core/CSSPropertyNames.h"
10 #include "core/css/CSSSyntaxDescriptor.h" 10 #include "core/css/CSSSyntaxDescriptor.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 v8::Local<v8::Function> paint = v8::Local<v8::Function>::Cast(paintValue); 183 v8::Local<v8::Function> paint = v8::Local<v8::Function>::Cast(paintValue);
184 184
185 CSSPaintDefinition* definition = CSSPaintDefinition::create( 185 CSSPaintDefinition* definition = CSSPaintDefinition::create(
186 scriptController()->getScriptState(), constructor, paint, 186 scriptController()->getScriptState(), constructor, paint,
187 nativeInvalidationProperties, customInvalidationProperties, 187 nativeInvalidationProperties, customInvalidationProperties,
188 inputArgumentTypes, hasAlpha); 188 inputArgumentTypes, hasAlpha);
189 m_paintDefinitions.set(name, definition); 189 m_paintDefinitions.set(name, definition);
190 190
191 // Set the definition on any pending generators. 191 // Set the definition on any pending generators.
192 GeneratorHashSet* set = m_pendingGenerators.get(name); 192 GeneratorHashSet* set = m_pendingGenerators.at(name);
193 if (set) { 193 if (set) {
194 for (const auto& generator : *set) { 194 for (const auto& generator : *set) {
195 if (generator) { 195 if (generator) {
196 generator->setDefinition(definition); 196 generator->setDefinition(definition);
197 } 197 }
198 } 198 }
199 } 199 }
200 m_pendingGenerators.erase(name); 200 m_pendingGenerators.erase(name);
201 } 201 }
202 202
203 CSSPaintDefinition* PaintWorkletGlobalScope::findDefinition( 203 CSSPaintDefinition* PaintWorkletGlobalScope::findDefinition(
204 const String& name) { 204 const String& name) {
205 return m_paintDefinitions.get(name); 205 return m_paintDefinitions.at(name);
206 } 206 }
207 207
208 void PaintWorkletGlobalScope::addPendingGenerator( 208 void PaintWorkletGlobalScope::addPendingGenerator(
209 const String& name, 209 const String& name,
210 CSSPaintImageGeneratorImpl* generator) { 210 CSSPaintImageGeneratorImpl* generator) {
211 Member<GeneratorHashSet>& set = 211 Member<GeneratorHashSet>& set =
212 m_pendingGenerators.insert(name, nullptr).storedValue->value; 212 m_pendingGenerators.insert(name, nullptr).storedValue->value;
213 if (!set) 213 if (!set)
214 set = new GeneratorHashSet; 214 set = new GeneratorHashSet;
215 set->insert(generator); 215 set->insert(generator);
216 } 216 }
217 217
218 DEFINE_TRACE(PaintWorkletGlobalScope) { 218 DEFINE_TRACE(PaintWorkletGlobalScope) {
219 visitor->trace(m_paintDefinitions); 219 visitor->trace(m_paintDefinitions);
220 visitor->trace(m_pendingGenerators); 220 visitor->trace(m_pendingGenerators);
221 MainThreadWorkletGlobalScope::trace(visitor); 221 MainThreadWorkletGlobalScope::trace(visitor);
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp ('k') | third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698