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

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

Issue 494133002: Append "Callback" to each value of enum CallbackType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/custom/CustomElementLifecycleCallbacks.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dom/custom/CustomElementSyncMicrotaskQueue.h" 44 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h"
45 #include "core/html/imports/HTMLImportChild.h" 45 #include "core/html/imports/HTMLImportChild.h"
46 #include "core/html/imports/HTMLImportsController.h" 46 #include "core/html/imports/HTMLImportsController.h"
47 47
48 namespace blink { 48 namespace blink {
49 49
50 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementScheduler) 50 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementScheduler)
51 51
52 void CustomElementScheduler::scheduleCallback(PassRefPtr<CustomElementLifecycleC allbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, CustomElementLifec ycleCallbacks::CallbackType type) 52 void CustomElementScheduler::scheduleCallback(PassRefPtr<CustomElementLifecycleC allbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, CustomElementLifec ycleCallbacks::CallbackType type)
53 { 53 {
54 ASSERT(type != CustomElementLifecycleCallbacks::AttributeChanged); 54 ASSERT(type != CustomElementLifecycleCallbacks::AttributeChangedCallback);
55 55
56 if (!callbacks->hasCallback(type)) 56 if (!callbacks->hasCallback(type))
57 return; 57 return;
58 58
59 CustomElementCallbackQueue& queue = instance().schedule(element); 59 CustomElementCallbackQueue& queue = instance().schedule(element);
60 queue.append(CustomElementCallbackInvocation::createInvocation(callbacks, ty pe)); 60 queue.append(CustomElementCallbackInvocation::createInvocation(callbacks, ty pe));
61 } 61 }
62 62
63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE lementLifecycleCallbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, co nst AtomicString& name, const AtomicString& oldValue, const AtomicString& newVal ue) 63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE lementLifecycleCallbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, co nst AtomicString& name, const AtomicString& oldValue, const AtomicString& newVal ue)
64 { 64 {
65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange d)) 65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange dCallback))
66 return; 66 return;
67 67
68 CustomElementCallbackQueue& queue = instance().schedule(element); 68 CustomElementCallbackQueue& queue = instance().schedule(element);
69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati on(callbacks, name, oldValue, newValue)); 69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati on(callbacks, name, oldValue, newValue));
70 } 70 }
71 71
72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtrWillBeRawPtr< CustomElementRegistrationContext> context, PassRefPtrWillBeRawPtr<Element> eleme nt, const CustomElementDescriptor& descriptor) 72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtrWillBeRawPtr< CustomElementRegistrationContext> context, PassRefPtrWillBeRawPtr<Element> eleme nt, const CustomElementDescriptor& descriptor)
73 { 73 {
74 if (CustomElementCallbackDispatcher::inCallbackDeliveryScope()) { 74 if (CustomElementCallbackDispatcher::inCallbackDeliveryScope()) {
75 context->resolve(element.get(), descriptor); 75 context->resolve(element.get(), descriptor);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 void CustomElementScheduler::trace(Visitor* visitor) 159 void CustomElementScheduler::trace(Visitor* visitor)
160 { 160 {
161 #if ENABLE(OILPAN) 161 #if ENABLE(OILPAN)
162 visitor->trace(m_elementCallbackQueueMap); 162 visitor->trace(m_elementCallbackQueueMap);
163 #endif 163 #endif
164 } 164 }
165 165
166 } // namespace blink 166 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/custom/CustomElementLifecycleCallbacks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698