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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.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, 7 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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 void LocalDOMWindow::cancelIdleCallback(int id) 1322 void LocalDOMWindow::cancelIdleCallback(int id)
1323 { 1323 {
1324 if (Document* document = this->document()) 1324 if (Document* document = this->document())
1325 document->cancelIdleCallback(id); 1325 document->cancelIdleCallback(id);
1326 } 1326 }
1327 1327
1328 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState) const 1328 CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState) const
1329 { 1329 {
1330 if (!scriptState->world().isMainWorld()) 1330 if (!scriptState->world().isMainWorld())
1331 return nullptr; 1331 return nullptr;
1332 return customElements();
1333 }
1334
1335 CustomElementsRegistry* LocalDOMWindow::customElements() const
1336 {
1332 if (!m_customElements) 1337 if (!m_customElements)
1333 m_customElements = CustomElementsRegistry::create(scriptState, document( )->registrationContext()); 1338 m_customElements = CustomElementsRegistry::create(document()->registrati onContext());
1334 return m_customElements.get(); 1339 return m_customElements;
1335 } 1340 }
1336 1341
1337 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere dEventListener& registeredListener) 1342 void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere dEventListener& registeredListener)
1338 { 1343 {
1339 DOMWindow::addedEventListener(eventType, registeredListener); 1344 DOMWindow::addedEventListener(eventType, registeredListener);
1340 if (frame() && frame()->host()) 1345 if (frame() && frame()->host())
1341 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype, registeredListener.options()); 1346 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype, registeredListener.options());
1342 1347
1343 if (Document* document = this->document()) 1348 if (Document* document = this->document())
1344 document->addListenerTypeIfNeeded(eventType); 1349 document->addListenerTypeIfNeeded(eventType);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 { 1536 {
1532 // If the LocalDOMWindow still has a frame reference, that frame must point 1537 // If the LocalDOMWindow still has a frame reference, that frame must point
1533 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1538 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1534 // where script execution leaks between different LocalDOMWindows. 1539 // where script execution leaks between different LocalDOMWindows.
1535 if (m_frameObserver->frame()) 1540 if (m_frameObserver->frame())
1536 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1541 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1537 return m_frameObserver->frame(); 1542 return m_frameObserver->frame();
1538 } 1543 }
1539 1544
1540 } // namespace blink 1545 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698