Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 #include "core/editing/FrameSelection.h" | 98 #include "core/editing/FrameSelection.h" |
| 99 #include "core/html/FormController.h" | 99 #include "core/html/FormController.h" |
| 100 #include "core/html/HTMLAllCollection.h" | 100 #include "core/html/HTMLAllCollection.h" |
| 101 #include "core/html/HTMLAnchorElement.h" | 101 #include "core/html/HTMLAnchorElement.h" |
| 102 #include "core/html/HTMLCanvasElement.h" | 102 #include "core/html/HTMLCanvasElement.h" |
| 103 #include "core/html/HTMLCollection.h" | 103 #include "core/html/HTMLCollection.h" |
| 104 #include "core/html/HTMLDocument.h" | 104 #include "core/html/HTMLDocument.h" |
| 105 #include "core/html/HTMLFrameOwnerElement.h" | 105 #include "core/html/HTMLFrameOwnerElement.h" |
| 106 #include "core/html/HTMLHeadElement.h" | 106 #include "core/html/HTMLHeadElement.h" |
| 107 #include "core/html/HTMLIFrameElement.h" | 107 #include "core/html/HTMLIFrameElement.h" |
| 108 #include "core/html/HTMLImportsController.h" | 108 #include "core/html/HTMLImport.h" |
| 109 #include "core/html/HTMLLinkElement.h" | 109 #include "core/html/HTMLLinkElement.h" |
| 110 #include "core/html/HTMLNameCollection.h" | 110 #include "core/html/HTMLNameCollection.h" |
| 111 #include "core/html/HTMLScriptElement.h" | 111 #include "core/html/HTMLScriptElement.h" |
| 112 #include "core/html/HTMLStyleElement.h" | 112 #include "core/html/HTMLStyleElement.h" |
| 113 #include "core/html/HTMLTitleElement.h" | 113 #include "core/html/HTMLTitleElement.h" |
| 114 #include "core/html/PluginDocument.h" | 114 #include "core/html/PluginDocument.h" |
| 115 #include "core/html/parser/HTMLDocumentParser.h" | 115 #include "core/html/parser/HTMLDocumentParser.h" |
| 116 #include "core/html/parser/HTMLParserIdioms.h" | 116 #include "core/html/parser/HTMLParserIdioms.h" |
| 117 #include "core/html/parser/NestingLevelIncrementer.h" | 117 #include "core/html/parser/NestingLevelIncrementer.h" |
| 118 #include "core/inspector/InspectorCounters.h" | 118 #include "core/inspector/InspectorCounters.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 , m_referrerPolicy(ReferrerPolicyDefault) | 434 , m_referrerPolicy(ReferrerPolicyDefault) |
| 435 , m_directionSetOnDocumentElement(false) | 435 , m_directionSetOnDocumentElement(false) |
| 436 , m_writingModeSetOnDocumentElement(false) | 436 , m_writingModeSetOnDocumentElement(false) |
| 437 , m_writeRecursionIsTooDeep(false) | 437 , m_writeRecursionIsTooDeep(false) |
| 438 , m_writeRecursionDepth(0) | 438 , m_writeRecursionDepth(0) |
| 439 , m_wheelEventHandlerCount(0) | 439 , m_wheelEventHandlerCount(0) |
| 440 , m_lastHandledUserGestureTimestamp(0) | 440 , m_lastHandledUserGestureTimestamp(0) |
| 441 , m_prerenderer(Prerenderer::create(this)) | 441 , m_prerenderer(Prerenderer::create(this)) |
| 442 , m_textAutosizer(TextAutosizer::create(this)) | 442 , m_textAutosizer(TextAutosizer::create(this)) |
| 443 , m_pendingTasksTimer(this, &Document::pendingTasksTimerFired) | 443 , m_pendingTasksTimer(this, &Document::pendingTasksTimerFired) |
| 444 , m_imports(0) | |
| 444 , m_scheduledTasksAreSuspended(false) | 445 , m_scheduledTasksAreSuspended(false) |
| 445 , m_sharedObjectPoolClearTimer(this, &Document::sharedObjectPoolClearTimerFi red) | 446 , m_sharedObjectPoolClearTimer(this, &Document::sharedObjectPoolClearTimerFi red) |
| 446 #ifndef NDEBUG | 447 #ifndef NDEBUG |
| 447 , m_didDispatchViewportPropertiesChanged(false) | 448 , m_didDispatchViewportPropertiesChanged(false) |
| 448 #endif | 449 #endif |
| 449 , m_timeline(DocumentTimeline::create(this)) | 450 , m_timeline(DocumentTimeline::create(this)) |
| 450 , m_templateDocumentHost(0) | 451 , m_templateDocumentHost(0) |
| 451 , m_fontloader(0) | 452 , m_fontloader(0) |
| 452 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) | 453 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) |
| 453 { | 454 { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 m_hoverNode = 0; | 579 m_hoverNode = 0; |
| 579 m_activeElement = 0; | 580 m_activeElement = 0; |
| 580 m_titleElement = 0; | 581 m_titleElement = 0; |
| 581 m_documentElement = 0; | 582 m_documentElement = 0; |
| 582 m_contextFeatures = ContextFeatures::defaultSwitch(); | 583 m_contextFeatures = ContextFeatures::defaultSwitch(); |
| 583 m_userActionElements.documentDidRemoveLastRef(); | 584 m_userActionElements.documentDidRemoveLastRef(); |
| 584 | 585 |
| 585 detachParser(); | 586 detachParser(); |
| 586 | 587 |
| 587 m_registry.clear(); | 588 m_registry.clear(); |
| 588 m_imports.clear(); | 589 m_imports = 0; |
|
dominicc (has gone to gerrit)
2013/07/11 03:26:48
How does this not leak?
| |
| 589 | 590 |
| 590 // removeDetachedChildren() doesn't always unregister IDs, | 591 // removeDetachedChildren() doesn't always unregister IDs, |
| 591 // so tear down scope information upfront to avoid having stale references i n the map. | 592 // so tear down scope information upfront to avoid having stale references i n the map. |
| 592 destroyTreeScopeData(); | 593 destroyTreeScopeData(); |
| 593 removeDetachedChildren(); | 594 removeDetachedChildren(); |
| 594 // removeDetachedChildren() can access FormController. | 595 // removeDetachedChildren() can access FormController. |
| 595 m_formController.clear(); | 596 m_formController.clear(); |
| 596 | 597 |
| 597 m_markers->detach(); | 598 m_markers->detach(); |
| 598 | 599 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 | 763 |
| 763 CustomElementRegistry* Document::ensureCustomElementRegistry() | 764 CustomElementRegistry* Document::ensureCustomElementRegistry() |
| 764 { | 765 { |
| 765 if (!m_registry) { | 766 if (!m_registry) { |
| 766 ASSERT(isHTMLDocument() || isXHTMLDocument()); | 767 ASSERT(isHTMLDocument() || isXHTMLDocument()); |
| 767 m_registry = adoptRef(new CustomElementRegistry()); | 768 m_registry = adoptRef(new CustomElementRegistry()); |
| 768 } | 769 } |
| 769 return m_registry.get(); | 770 return m_registry.get(); |
| 770 } | 771 } |
| 771 | 772 |
| 772 void Document::setImports(PassRefPtr<HTMLImportsController> imports) | 773 void Document::setImports(HTMLImport* imports) |
| 773 { | 774 { |
| 774 ASSERT(!m_imports); | 775 ASSERT(!m_imports || !imports); |
| 775 m_imports = imports; | 776 m_imports = imports; |
| 776 } | 777 } |
| 777 | 778 |
| 778 void Document::didLoadAllImports() | 779 void Document::didLoadAllImports() |
| 779 { | 780 { |
| 780 executeScriptsWaitingForResourcesIfNeeded(); | 781 executeScriptsWaitingForResourcesIfNeeded(); |
| 781 } | 782 } |
| 782 | 783 |
| 783 bool Document::haveImportsLoaded() const | 784 bool Document::haveImportsLoaded() const |
| 784 { | 785 { |
| 785 return !m_imports || m_imports->haveLoaded(); | 786 return !m_imports || m_imports->haveChildrenLoaded(); |
| 786 } | 787 } |
| 787 | 788 |
| 788 PassRefPtr<DocumentFragment> Document::createDocumentFragment() | 789 PassRefPtr<DocumentFragment> Document::createDocumentFragment() |
| 789 { | 790 { |
| 790 return DocumentFragment::create(document()); | 791 return DocumentFragment::create(document()); |
| 791 } | 792 } |
| 792 | 793 |
| 793 PassRefPtr<Text> Document::createTextNode(const String& data) | 794 PassRefPtr<Text> Document::createTextNode(const String& data) |
| 794 { | 795 { |
| 795 return Text::create(this, data); | 796 return Text::create(this, data); |
| (...skipping 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5141 { | 5142 { |
| 5142 return DocumentLifecycleNotifier::create(this); | 5143 return DocumentLifecycleNotifier::create(this); |
| 5143 } | 5144 } |
| 5144 | 5145 |
| 5145 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5146 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
| 5146 { | 5147 { |
| 5147 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); | 5148 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); |
| 5148 } | 5149 } |
| 5149 | 5150 |
| 5150 } // namespace WebCore | 5151 } // namespace WebCore |
| OLD | NEW |