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

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

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Experiment to fix DCHECKing tests 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)
Nate Chapin 2017/03/27 21:02:01 This is the sole use of isCurrentDocument(), and d
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 5001 matching lines...) Expand 10 before | Expand all | Expand 10 after
6650 } 6649 }
6651 6650
6652 void showLiveDocumentInstances() { 6651 void showLiveDocumentInstances() {
6653 WeakDocumentSet& set = liveDocumentSet(); 6652 WeakDocumentSet& set = liveDocumentSet();
6654 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6653 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6655 for (blink::Document* document : set) 6654 for (blink::Document* document : set)
6656 fprintf(stderr, "- Document %p URL: %s\n", document, 6655 fprintf(stderr, "- Document %p URL: %s\n", document,
6657 document->url().getString().utf8().data()); 6656 document->url().getString().utf8().data());
6658 } 6657 }
6659 #endif 6658 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/History.cpp » ('j') | third_party/WebKit/Source/core/frame/History.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698