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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementMicrotaskDispatcher.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/dom/custom/CustomElementMicrotaskDispatcher.h" 5 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
6 6
7 #include "bindings/core/v8/Microtask.h" 7 #include "bindings/core/v8/Microtask.h"
8 #include "core/dom/custom/CustomElementCallbackQueue.h" 8 #include "core/dom/custom/CustomElementCallbackQueue.h"
9 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" 9 #include "core/dom/custom/CustomElementMicrotaskImportStep.h"
10 #include "core/dom/custom/CustomElementProcessingStack.h" 10 #include "core/dom/custom/CustomElementProcessingStack.h"
11 #include "core/dom/custom/CustomElementScheduler.h" 11 #include "core/dom/custom/CustomElementScheduler.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0; 15 static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0;
16 16
17 CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher() 17 CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher()
18 : m_hasScheduledMicrotask(false) 18 : m_hasScheduledMicrotask(false)
19 , m_phase(Quiescent) 19 , m_phase(Quiescent)
20 { 20 {
21 } 21 }
22 22
23 CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance() 23 CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance()
24 { 24 {
25 DEFINE_STATIC_LOCAL(Persistent<CustomElementMicrotaskDispatcher>, instance, (new CustomElementMicrotaskDispatcher())); 25 DEFINE_STATIC_LOCAL(CustomElementMicrotaskDispatcher, instance, (new CustomE lementMicrotaskDispatcher));
26 return *instance; 26 return instance;
27 } 27 }
28 28
29 void CustomElementMicrotaskDispatcher::enqueue(CustomElementCallbackQueue* queue ) 29 void CustomElementMicrotaskDispatcher::enqueue(CustomElementCallbackQueue* queue )
30 { 30 {
31 ensureMicrotaskScheduledForElementQueue(); 31 ensureMicrotaskScheduledForElementQueue();
32 queue->setOwner(kMicrotaskQueueId); 32 queue->setOwner(kMicrotaskQueueId);
33 m_elements.append(queue); 33 m_elements.append(queue);
34 } 34 }
35 35
36 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduledForElementQueue() 36 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduledForElementQueue()
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 DEFINE_TRACE(CustomElementMicrotaskDispatcher) 81 DEFINE_TRACE(CustomElementMicrotaskDispatcher)
82 { 82 {
83 #if ENABLE(OILPAN) 83 #if ENABLE(OILPAN)
84 visitor->trace(m_elements); 84 visitor->trace(m_elements);
85 #endif 85 #endif
86 } 86 }
87 87
88 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698