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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp

Issue 2694283003: Annotate ScriptWrappable-embedding singletons.
Patch Set: add XPathValue singleton Created 3 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/html/imports/HTMLImportChild.h" 44 #include "core/html/imports/HTMLImportChild.h"
45 #include "core/html/imports/HTMLImportsController.h" 45 #include "core/html/imports/HTMLImportsController.h"
46 46
47 namespace blink { 47 namespace blink {
48 48
49 // FIXME: Consider moving the element's callback queue to ElementRareData. 49 // FIXME: Consider moving the element's callback queue to ElementRareData.
50 typedef HeapHashMap<Member<Element>, Member<V0CustomElementCallbackQueue>> 50 typedef HeapHashMap<Member<Element>, Member<V0CustomElementCallbackQueue>>
51 ElementCallbackQueueMap; 51 ElementCallbackQueueMap;
52 52
53 static ElementCallbackQueueMap& callbackQueues() { 53 static ElementCallbackQueueMap& callbackQueues() {
54 ALLOW_UNSAFE_SINGLETON()
54 DEFINE_STATIC_LOCAL(ElementCallbackQueueMap, map, 55 DEFINE_STATIC_LOCAL(ElementCallbackQueueMap, map,
55 (new ElementCallbackQueueMap)); 56 (new ElementCallbackQueueMap));
56 return map; 57 return map;
57 } 58 }
58 59
59 static V0CustomElementCallbackQueue& ensureCallbackQueue(Element* element) { 60 static V0CustomElementCallbackQueue& ensureCallbackQueue(Element* element) {
60 ElementCallbackQueueMap::ValueType* it = 61 ElementCallbackQueueMap::ValueType* it =
61 callbackQueues().insert(element, nullptr).storedValue; 62 callbackQueues().insert(element, nullptr).storedValue;
62 if (!it->value) 63 if (!it->value)
63 it->value = V0CustomElementCallbackQueue::create(element); 64 it->value = V0CustomElementCallbackQueue::create(element);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (V0CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty()) 161 if (V0CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty())
161 callbackQueues().clear(); 162 callbackQueues().clear();
162 } 163 }
163 164
164 void V0CustomElementScheduler::microtaskDispatcherDidFinish() { 165 void V0CustomElementScheduler::microtaskDispatcherDidFinish() {
165 DCHECK(!V0CustomElementProcessingStack::inCallbackDeliveryScope()); 166 DCHECK(!V0CustomElementProcessingStack::inCallbackDeliveryScope());
166 callbackQueues().clear(); 167 callbackQueues().clear();
167 } 168 }
168 169
169 } // namespace blink 170 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698