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

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

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address yhirano's comments Created 3 years, 8 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
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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 return "#document"; 1625 return "#document";
1626 } 1626 }
1627 1627
1628 Node::NodeType Document::getNodeType() const { 1628 Node::NodeType Document::getNodeType() const {
1629 return kDocumentNode; 1629 return kDocumentNode;
1630 } 1630 }
1631 1631
1632 FormController& Document::formController() { 1632 FormController& Document::formController() {
1633 if (!m_formController) { 1633 if (!m_formController) {
1634 m_formController = FormController::create(); 1634 m_formController = FormController::create();
1635 if (m_frame && m_frame->loader().currentItem() && 1635 HistoryItem* historyItem = loader() ? loader()->historyItem() : nullptr;
1636 m_frame->loader().currentItem()->isCurrentDocument(this)) 1636 if (historyItem)
1637 m_frame->loader().currentItem()->setDocumentState( 1637 historyItem->setDocumentState(m_formController->formElementsState());
1638 m_formController->formElementsState());
1639 } 1638 }
1640 return *m_formController; 1639 return *m_formController;
1641 } 1640 }
1642 1641
1643 DocumentState* Document::formElementsState() const { 1642 DocumentState* Document::formElementsState() const {
1644 if (!m_formController) 1643 if (!m_formController)
1645 return 0; 1644 return 0;
1646 return m_formController->formElementsState(); 1645 return m_formController->formElementsState();
1647 } 1646 }
1648 1647
(...skipping 5020 matching lines...) Expand 10 before | Expand all | Expand 10 after
6669 } 6668 }
6670 6669
6671 void showLiveDocumentInstances() { 6670 void showLiveDocumentInstances() {
6672 WeakDocumentSet& set = liveDocumentSet(); 6671 WeakDocumentSet& set = liveDocumentSet();
6673 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6672 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6674 for (blink::Document* document : set) 6673 for (blink::Document* document : set)
6675 fprintf(stderr, "- Document %p URL: %s\n", document, 6674 fprintf(stderr, "- Document %p URL: %s\n", document,
6676 document->url().getString().utf8().data()); 6675 document->url().getString().utf8().data());
6677 } 6676 }
6678 #endif 6677 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698