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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp

Issue 2003033004: Split custom element script use and move it into bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing CORE_EXPORT header. Created 4 years, 6 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 bool V8V0CustomElementLifecycleCallbacks::setBinding(PassOwnPtr<V0CustomElementB inding> binding) 126 bool V8V0CustomElementLifecycleCallbacks::setBinding(PassOwnPtr<V0CustomElementB inding> binding)
127 { 127 {
128 V8PerContextData* perContextData = creationContextData(); 128 V8PerContextData* perContextData = creationContextData();
129 if (!perContextData) 129 if (!perContextData)
130 return false; 130 return false;
131 131
132 // The context is responsible for keeping the prototype 132 // The context is responsible for keeping the prototype
133 // alive. This in turn keeps callbacks alive through hidden 133 // alive. This in turn keeps callbacks alive through hidden
134 // references; see CALLBACK_LIST(SET_HIDDEN_VALUE). 134 // references; see CALLBACK_LIST(SET_HIDDEN_VALUE).
135 perContextData->addCustomElementBinding(std::move(binding)); 135 perContextData->customElements()->v0AddBinding(std::move(binding));
136 return true; 136 return true;
137 } 137 }
138 138
139 void V8V0CustomElementLifecycleCallbacks::created(Element* element) 139 void V8V0CustomElementLifecycleCallbacks::created(Element* element)
140 { 140 {
141 // FIXME: callbacks while paused should be queued up for execution to 141 // FIXME: callbacks while paused should be queued up for execution to
142 // continue then be delivered in order rather than delivered immediately. 142 // continue then be delivered in order rather than delivered immediately.
143 // Bug 329665 tracks similar behavior for other synchronous events. 143 // Bug 329665 tracks similar behavior for other synchronous events.
144 if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStop ped()) 144 if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStop ped())
145 return; 145 return;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate); 241 ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate);
242 } 242 }
243 243
244 DEFINE_TRACE(V8V0CustomElementLifecycleCallbacks) 244 DEFINE_TRACE(V8V0CustomElementLifecycleCallbacks)
245 { 245 {
246 V0CustomElementLifecycleCallbacks::trace(visitor); 246 V0CustomElementLifecycleCallbacks::trace(visitor);
247 ContextLifecycleObserver::trace(visitor); 247 ContextLifecycleObserver::trace(visitor);
248 } 248 }
249 249
250 } // namespace blink 250 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698