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

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

Issue 2393133005: Call LocalDOMWindow::clearDocument when a frame gets detached
Patch Set: temp Created 4 years 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 468
469 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) { 469 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) {
470 return document() ? document()->mediaQueryMatcher().matchMedia(media) 470 return document() ? document()->mediaQueryMatcher().matchMedia(media)
471 : nullptr; 471 : nullptr;
472 } 472 }
473 473
474 void LocalDOMWindow::frameDestroyed() { 474 void LocalDOMWindow::frameDestroyed() {
475 for (const auto& domWindowProperty : m_properties) 475 for (const auto& domWindowProperty : m_properties)
476 domWindowProperty->frameDestroyed(); 476 domWindowProperty->frameDestroyed();
477 477
478 clearDocument();
478 resetLocation(); 479 resetLocation();
479 m_properties.clear(); 480 m_properties.clear();
480 removeAllEventListeners(); 481 removeAllEventListeners();
481 m_frame = nullptr; 482 m_frame = nullptr;
482 } 483 }
483 484
484 void LocalDOMWindow::registerProperty(DOMWindowProperty* property) { 485 void LocalDOMWindow::registerProperty(DOMWindowProperty* property) {
485 m_properties.add(property); 486 m_properties.add(property);
486 } 487 }
487 488
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 1564
1564 LocalFrame* LocalDOMWindow::frame() const { 1565 LocalFrame* LocalDOMWindow::frame() const {
1565 // If the LocalDOMWindow still has a frame reference, that frame must point 1566 // If the LocalDOMWindow still has a frame reference, that frame must point
1566 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1567 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1567 // where script execution leaks between different LocalDOMWindows. 1568 // where script execution leaks between different LocalDOMWindows.
1568 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1569 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1569 return m_frame; 1570 return m_frame;
1570 } 1571 }
1571 1572
1572 } // namespace blink 1573 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698