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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 16904002: Avoid leaking objects between isolated worlds via attribute event listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/EventListener.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 { 3445 {
3446 if (!m_ranges.isEmpty()) { 3446 if (!m_ranges.isEmpty()) {
3447 HashSet<Range*>::const_iterator end = m_ranges.end(); 3447 HashSet<Range*>::const_iterator end = m_ranges.end();
3448 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it) 3448 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it)
3449 (*it)->textNodeSplit(oldNode); 3449 (*it)->textNodeSplit(oldNode);
3450 } 3450 }
3451 3451
3452 // FIXME: This should update markers for spelling and grammar checking. 3452 // FIXME: This should update markers for spelling and grammar checking.
3453 } 3453 }
3454 3454
3455 void Document::setWindowAttributeEventListener(const AtomicString& eventType, Pa ssRefPtr<EventListener> listener) 3455 void Document::setWindowAttributeEventListener(const AtomicString& eventType, Pa ssRefPtr<EventListener> listener, DOMWrapperWorld* isolatedWorld)
3456 { 3456 {
3457 DOMWindow* domWindow = this->domWindow(); 3457 DOMWindow* domWindow = this->domWindow();
3458 if (!domWindow) 3458 if (!domWindow)
3459 return; 3459 return;
3460 domWindow->setAttributeEventListener(eventType, listener); 3460 domWindow->setAttributeEventListener(eventType, listener, isolatedWorld);
3461 } 3461 }
3462 3462
3463 EventListener* Document::getWindowAttributeEventListener(const AtomicString& eve ntType) 3463 EventListener* Document::getWindowAttributeEventListener(const AtomicString& eve ntType, DOMWrapperWorld* isolatedWorld)
3464 { 3464 {
3465 DOMWindow* domWindow = this->domWindow(); 3465 DOMWindow* domWindow = this->domWindow();
3466 if (!domWindow) 3466 if (!domWindow)
3467 return 0; 3467 return 0;
3468 return domWindow->getAttributeEventListener(eventType); 3468 return domWindow->getAttributeEventListener(eventType, isolatedWorld);
3469 } 3469 }
3470 3470
3471 void Document::dispatchWindowEvent(PassRefPtr<Event> event, PassRefPtr<EventTar get> target) 3471 void Document::dispatchWindowEvent(PassRefPtr<Event> event, PassRefPtr<EventTar get> target)
3472 { 3472 {
3473 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 3473 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
3474 DOMWindow* domWindow = this->domWindow(); 3474 DOMWindow* domWindow = this->domWindow();
3475 if (!domWindow) 3475 if (!domWindow)
3476 return; 3476 return;
3477 domWindow->dispatchEvent(event, target); 3477 domWindow->dispatchEvent(event, target);
3478 } 3478 }
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
5180 } 5180 }
5181 5181
5182 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer) 5182 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer)
5183 { 5183 {
5184 if (!m_lifecycleNotifier) 5184 if (!m_lifecycleNotifier)
5185 m_lifecycleNotifier = DocumentLifecycleNotifier::create(); 5185 m_lifecycleNotifier = DocumentLifecycleNotifier::create();
5186 m_lifecycleNotifier->addObserver(observer); 5186 m_lifecycleNotifier->addObserver(observer);
5187 } 5187 }
5188 5188
5189 } // namespace WebCore 5189 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/EventListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698