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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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<CustomElementCallbackQueue>> Element CallbackQueueMap; 50 typedef HeapHashMap<Member<Element>, Member<CustomElementCallbackQueue>> Element CallbackQueueMap;
51 51
52 static ElementCallbackQueueMap& callbackQueues() 52 static ElementCallbackQueueMap& callbackQueues()
53 { 53 {
54 DEFINE_STATIC_LOCAL(Persistent<ElementCallbackQueueMap>, map, (new ElementCa llbackQueueMap())); 54 DEFINE_STATIC_LOCAL(ElementCallbackQueueMap, map, (new ElementCallbackQueueM ap));
55 return *map; 55 return map;
56 } 56 }
57 57
58 static CustomElementCallbackQueue& ensureCallbackQueue(RawPtr<Element> element) 58 static CustomElementCallbackQueue& ensureCallbackQueue(RawPtr<Element> element)
59 { 59 {
60 ElementCallbackQueueMap::ValueType* it = callbackQueues().add(element.get(), nullptr).storedValue; 60 ElementCallbackQueueMap::ValueType* it = callbackQueues().add(element.get(), nullptr).storedValue;
61 if (!it->value) 61 if (!it->value)
62 it->value = CustomElementCallbackQueue::create(element); 62 it->value = CustomElementCallbackQueue::create(element);
63 return *it->value.get(); 63 return *it->value.get();
64 } 64 }
65 65
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 callbackQueues().clear(); 145 callbackQueues().clear();
146 } 146 }
147 147
148 void CustomElementScheduler::microtaskDispatcherDidFinish() 148 void CustomElementScheduler::microtaskDispatcherDidFinish()
149 { 149 {
150 ASSERT(!CustomElementProcessingStack::inCallbackDeliveryScope()); 150 ASSERT(!CustomElementProcessingStack::inCallbackDeliveryScope());
151 callbackQueues().clear(); 151 callbackQueues().clear();
152 } 152 }
153 153
154 } // namespace blink 154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698