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

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

Issue 16988003: Revert "Extract ContextLifecycleNotifier from ScriptExecutionContext." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/DocumentLifecycleObserver.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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 636
637 m_markers->detach(); 637 m_markers->detach();
638 638
639 m_cssCanvasElements.clear(); 639 m_cssCanvasElements.clear();
640 640
641 // FIXME: consider using ActiveDOMObject. 641 // FIXME: consider using ActiveDOMObject.
642 if (m_scriptedAnimationController) 642 if (m_scriptedAnimationController)
643 m_scriptedAnimationController->clearDocumentPointer(); 643 m_scriptedAnimationController->clearDocumentPointer();
644 m_scriptedAnimationController.clear(); 644 m_scriptedAnimationController.clear();
645 645
646 lifecycleNotifier()->notifyDocumentWasDisposed(); 646 if (m_lifecycleNotifier)
647 m_lifecycleNotifier->notifyDocumentWasDisposed();
647 } 648 }
648 649
649 Element* Document::getElementById(const AtomicString& id) const 650 Element* Document::getElementById(const AtomicString& id) const
650 { 651 {
651 return TreeScope::getElementById(id); 652 return TreeScope::getElementById(id);
652 } 653 }
653 654
654 Element* Document::getElementByAccessKey(const String& key) 655 Element* Document::getElementByAccessKey(const String& key)
655 { 656 {
656 if (key.isEmpty()) 657 if (key.isEmpty())
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 // us. However, this violates Node::detach() semantics, as it's never 1995 // us. However, this violates Node::detach() semantics, as it's never
1995 // possible to re-attach. Eventually Document::detach() should be renamed, 1996 // possible to re-attach. Eventually Document::detach() should be renamed,
1996 // or this setting of the frame to 0 could be made explicit in each of the 1997 // or this setting of the frame to 0 could be made explicit in each of the
1997 // callers of Document::detach(). 1998 // callers of Document::detach().
1998 m_frame = 0; 1999 m_frame = 0;
1999 m_renderArena.clear(); 2000 m_renderArena.clear();
2000 2001
2001 if (m_mediaQueryMatcher) 2002 if (m_mediaQueryMatcher)
2002 m_mediaQueryMatcher->documentDestroyed(); 2003 m_mediaQueryMatcher->documentDestroyed();
2003 2004
2004 lifecycleNotifier()->notifyDocumentWasDetached(); 2005 if (m_lifecycleNotifier)
2006 m_lifecycleNotifier->notifyDocumentWasDetached();
2005 } 2007 }
2006 2008
2007 void Document::prepareForDestruction() 2009 void Document::prepareForDestruction()
2008 { 2010 {
2009 disconnectDescendantFrames(); 2011 disconnectDescendantFrames();
2010 if (DOMWindow* window = this->domWindow()) 2012 if (DOMWindow* window = this->domWindow())
2011 window->willDetachDocumentFromFrame(); 2013 window->willDetachDocumentFromFrame();
2012 detach(); 2014 detach();
2013 } 2015 }
2014 2016
(...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after
5217 if (!frame() || !frame()->page()) 5219 if (!frame() || !frame()->page())
5218 return; 5220 return;
5219 5221
5220 Vector<RefPtr<Element> > associatedFormControls; 5222 Vector<RefPtr<Element> > associatedFormControls;
5221 copyToVector(m_associatedFormControls, associatedFormControls); 5223 copyToVector(m_associatedFormControls, associatedFormControls);
5222 5224
5223 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols); 5225 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols);
5224 m_associatedFormControls.clear(); 5226 m_associatedFormControls.clear();
5225 } 5227 }
5226 5228
5227 PassOwnPtr<ContextLifecycleNotifier> Document::createLifecycleNotifier() 5229 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer)
5228 { 5230 {
5229 return DocumentLifecycleNotifier::create(this); 5231 if (!m_lifecycleNotifier)
5230 } 5232 m_lifecycleNotifier = DocumentLifecycleNotifier::create();
5231 5233 m_lifecycleNotifier->addObserver(observer);
5232 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5233 {
5234 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5235 } 5234 }
5236 5235
5237 } // namespace WebCore 5236 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentLifecycleObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698