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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2279703002: Add a scoped context object for synchronous CE creation (Closed)
Patch Set: Clean up Created 4 years, 3 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 326
327 void LocalDOMWindow::acceptLanguagesChanged() 327 void LocalDOMWindow::acceptLanguagesChanged()
328 { 328 {
329 if (m_navigator) 329 if (m_navigator)
330 m_navigator->setLanguagesChanged(); 330 m_navigator->setLanguagesChanged();
331 331
332 dispatchEvent(Event::create(EventTypeNames::languagechange)); 332 dispatchEvent(Event::create(EventTypeNames::languagechange));
333 } 333 }
334 334
335 void LocalDOMWindow::setCustomElementCreationContext(Document* context)
336 {
337 m_customElementCreationContext = context;
338 }
339
340 Document* LocalDOMWindow::customElementCreationContext() const
341 {
342 return m_customElementCreationContext;
343 }
344
335 Document* LocalDOMWindow::createDocument(const String& mimeType, const DocumentI nit& init, bool forceXHTML) 345 Document* LocalDOMWindow::createDocument(const String& mimeType, const DocumentI nit& init, bool forceXHTML)
336 { 346 {
337 Document* document = nullptr; 347 Document* document = nullptr;
338 if (forceXHTML) { 348 if (forceXHTML) {
339 // This is a hack for XSLTProcessor. See XSLTProcessor::createDocumentFr omSource(). 349 // This is a hack for XSLTProcessor. See XSLTProcessor::createDocumentFr omSource().
340 document = Document::create(init); 350 document = Document::create(init);
341 } else { 351 } else {
342 document = DOMImplementation::createDocument(mimeType, init, init.frame( ) ? init.frame()->inViewSourceMode() : false); 352 document = DOMImplementation::createDocument(mimeType, init, init.frame( ) ? init.frame()->inViewSourceMode() : false);
343 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins )) 353 if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins ))
344 document = SinkDocument::create(init); 354 document = SinkDocument::create(init);
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 visitor->trace(m_statusbar); 1537 visitor->trace(m_statusbar);
1528 visitor->trace(m_toolbar); 1538 visitor->trace(m_toolbar);
1529 visitor->trace(m_navigator); 1539 visitor->trace(m_navigator);
1530 visitor->trace(m_media); 1540 visitor->trace(m_media);
1531 visitor->trace(m_customElements); 1541 visitor->trace(m_customElements);
1532 visitor->trace(m_applicationCache); 1542 visitor->trace(m_applicationCache);
1533 visitor->trace(m_eventQueue); 1543 visitor->trace(m_eventQueue);
1534 visitor->trace(m_postMessageTimers); 1544 visitor->trace(m_postMessageTimers);
1535 visitor->trace(m_visualViewport); 1545 visitor->trace(m_visualViewport);
1536 visitor->trace(m_eventListenerObservers); 1546 visitor->trace(m_eventListenerObservers);
1547 visitor->trace(m_customElementCreationContext);
1537 DOMWindow::trace(visitor); 1548 DOMWindow::trace(visitor);
1538 Supplementable<LocalDOMWindow>::trace(visitor); 1549 Supplementable<LocalDOMWindow>::trace(visitor);
1539 } 1550 }
1540 1551
1541 LocalFrame* LocalDOMWindow::frame() const 1552 LocalFrame* LocalDOMWindow::frame() const
1542 { 1553 {
1543 // If the LocalDOMWindow still has a frame reference, that frame must point 1554 // If the LocalDOMWindow still has a frame reference, that frame must point
1544 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1555 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1545 // where script execution leaks between different LocalDOMWindows. 1556 // where script execution leaks between different LocalDOMWindows.
1546 if (m_frameObserver->frame()) 1557 if (m_frameObserver->frame())
1547 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1558 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1548 return m_frameObserver->frame(); 1559 return m_frameObserver->frame();
1549 } 1560 }
1550 1561
1551 } // namespace blink 1562 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698