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

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

Issue 2285253003: Move TopDocumentRootScrollerController to a separate object on FrameHost (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 ? m_frame->localDOMWindow()->maybeCustomElements() 484 ? m_frame->localDOMWindow()->maybeCustomElements()
485 : nullptr; 485 : nullptr;
486 if (registry && m_registrationContext) 486 if (registry && m_registrationContext)
487 registry->entangle(m_registrationContext); 487 registry->entangle(m_registrationContext);
488 } else if (m_importsController) { 488 } else if (m_importsController) {
489 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); 489 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this);
490 } else { 490 } else {
491 m_fetcher = ResourceFetcher::create(nullptr); 491 m_fetcher = ResourceFetcher::create(nullptr);
492 } 492 }
493 493
494 // TODO(bokan): This will probably blow up if we don't have an m_frame here 494 m_rootScrollerController = RootScrollerController::create(*this);
495 // since we'll assume a child RootScrollerController. crbug.com/505516.
496 m_rootScrollerController = isInMainFrame()
497 ? TopDocumentRootScrollerController::create(*this)
498 : RootScrollerController::create(*this);
499 495
500 // We depend on the url getting immediately set in subframes, but we 496 // We depend on the url getting immediately set in subframes, but we
501 // also depend on the url NOT getting immediately set in opened windows. 497 // also depend on the url NOT getting immediately set in opened windows.
502 // See fast/dom/early-frame-url.html 498 // See fast/dom/early-frame-url.html
503 // and fast/dom/location-new-window-no-crash.html, respectively. 499 // and fast/dom/location-new-window-no-crash.html, respectively.
504 // FIXME: Can/should we unify this behavior? 500 // FIXME: Can/should we unify this behavior?
505 if (initializer.shouldSetURL()) 501 if (initializer.shouldSetURL())
506 setURL(initializer.url()); 502 setURL(initializer.url());
507 503
508 initSecurityContext(initializer); 504 initSecurityContext(initializer);
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 2153
2158 // The TextAutosizer can't update layout view info while the Document is det ached, so update now in case anything changed. 2154 // The TextAutosizer can't update layout view info while the Document is det ached, so update now in case anything changed.
2159 if (TextAutosizer* autosizer = textAutosizer()) 2155 if (TextAutosizer* autosizer = textAutosizer())
2160 autosizer->updatePageInfo(); 2156 autosizer->updatePageInfo();
2161 2157
2162 m_frame->selection().documentAttached(this); 2158 m_frame->selection().documentAttached(this);
2163 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); 2159 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean);
2164 2160
2165 if (view()) 2161 if (view())
2166 view()->didAttachDocument(); 2162 view()->didAttachDocument();
2167
2168 // Needs to be called after view()->didAttachDocument().
2169 m_rootScrollerController->didAttachDocument();
2170 } 2163 }
2171 2164
2172 void Document::shutdown() 2165 void Document::shutdown()
2173 { 2166 {
2174 TRACE_EVENT0("blink", "Document::shutdown"); 2167 TRACE_EVENT0("blink", "Document::shutdown");
2175 RELEASE_ASSERT(!m_frame || m_frame->tree().childCount() == 0); 2168 RELEASE_ASSERT(!m_frame || m_frame->tree().childCount() == 0);
2176 if (!isActive()) 2169 if (!isActive())
2177 return; 2170 return;
2178 2171
2179 // Frame navigation can cause a new Document to be attached. Don't allow tha t, since that will 2172 // Frame navigation can cause a new Document to be attached. Don't allow tha t, since that will
(...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after
6093 } 6086 }
6094 6087
6095 void showLiveDocumentInstances() 6088 void showLiveDocumentInstances()
6096 { 6089 {
6097 WeakDocumentSet& set = liveDocumentSet(); 6090 WeakDocumentSet& set = liveDocumentSet();
6098 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6091 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6099 for (Document* document : set) 6092 for (Document* document : set)
6100 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6093 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6101 } 6094 }
6102 #endif 6095 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698