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

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

Issue 11415134: Merge 135709 - Circular reference between Document and MediaQueryMatcher. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 m_styleSheetCollection.clear(); 649 m_styleSheetCollection.clear();
650 650
651 if (m_namedFlows) 651 if (m_namedFlows)
652 m_namedFlows->documentDestroyed(); 652 m_namedFlows->documentDestroyed();
653 653
654 if (m_elemSheet) 654 if (m_elemSheet)
655 m_elemSheet->clearOwnerNode(); 655 m_elemSheet->clearOwnerNode();
656 656
657 m_weakReference->clear(); 657 m_weakReference->clear();
658 658
659 if (m_mediaQueryMatcher)
660 m_mediaQueryMatcher->documentDestroyed();
661
662 clearStyleResolver(); // We need to destory CSSFontSelector before destroyin g m_cachedResourceLoader. 659 clearStyleResolver(); // We need to destory CSSFontSelector before destroyin g m_cachedResourceLoader.
663 660
664 // It's possible for multiple Documents to end up referencing the same Cache dResourceLoader (e.g., SVGImages 661 // It's possible for multiple Documents to end up referencing the same Cache dResourceLoader (e.g., SVGImages
665 // load the initial empty document and the SVGDocument with the same Documen tLoader). 662 // load the initial empty document and the SVGDocument with the same Documen tLoader).
666 if (m_cachedResourceLoader->document() == this) 663 if (m_cachedResourceLoader->document() == this)
667 m_cachedResourceLoader->setDocument(0); 664 m_cachedResourceLoader->setDocument(0);
668 m_cachedResourceLoader.clear(); 665 m_cachedResourceLoader.clear();
669 666
670 // We must call clearRareData() here since a Document class inherits TreeSco pe 667 // We must call clearRareData() here since a Document class inherits TreeSco pe
671 // as well as Node. See a comment on TreeScope.h for the reason. 668 // as well as Node. See a comment on TreeScope.h for the reason.
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 if (render) 2141 if (render)
2145 render->destroy(); 2142 render->destroy();
2146 2143
2147 // This is required, as our Frame might delete itself as soon as it detaches 2144 // This is required, as our Frame might delete itself as soon as it detaches
2148 // us. However, this violates Node::detach() semantics, as it's never 2145 // us. However, this violates Node::detach() semantics, as it's never
2149 // possible to re-attach. Eventually Document::detach() should be renamed, 2146 // possible to re-attach. Eventually Document::detach() should be renamed,
2150 // or this setting of the frame to 0 could be made explicit in each of the 2147 // or this setting of the frame to 0 could be made explicit in each of the
2151 // callers of Document::detach(). 2148 // callers of Document::detach().
2152 m_frame = 0; 2149 m_frame = 0;
2153 m_renderArena.clear(); 2150 m_renderArena.clear();
2151
2152 if (m_mediaQueryMatcher)
2153 m_mediaQueryMatcher->documentDestroyed();
2154 } 2154 }
2155 2155
2156 void Document::prepareForDestruction() 2156 void Document::prepareForDestruction()
2157 { 2157 {
2158 disconnectDescendantFrames(); 2158 disconnectDescendantFrames();
2159 if (DOMWindow* window = this->domWindow()) 2159 if (DOMWindow* window = this->domWindow())
2160 window->willDetachDocumentFromFrame(); 2160 window->willDetachDocumentFromFrame();
2161 detach(); 2161 detach();
2162 } 2162 }
2163 2163
(...skipping 3876 matching lines...) Expand 10 before | Expand all | Expand 10 after
6040 AtomicString localeKey = locale; 6040 AtomicString localeKey = locale;
6041 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled()) 6041 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled())
6042 localeKey = defaultLanguage(); 6042 localeKey = defaultLanguage();
6043 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr); 6043 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr);
6044 if (result.isNewEntry) 6044 if (result.isNewEntry)
6045 result.iterator->value = Locale::create(localeKey); 6045 result.iterator->value = Locale::create(localeKey);
6046 return *(result.iterator->value); 6046 return *(result.iterator->value);
6047 } 6047 }
6048 6048
6049 } // namespace WebCore 6049 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698