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

Side by Side Diff: third_party/WebKit/Source/core/html/imports/HTMLImportTreeRoot.cpp

Issue 2837763003: Reland "Move most of FrameLoader::CheckCompleted() to Document" (Closed)
Patch Set: Fix comment typos 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/imports/HTMLImportTreeRoot.h" 5 #include "core/html/imports/HTMLImportTreeRoot.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/StyleEngine.h" 8 #include "core/dom/StyleEngine.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/html/imports/HTMLImportChild.h" 10 #include "core/html/imports/HTMLImportChild.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 document_->GetStyleEngine().HaveScriptBlockingStylesheetsLoaded(); 44 document_->GetStyleEngine().HaveScriptBlockingStylesheetsLoaded();
45 } 45 }
46 46
47 void HTMLImportTreeRoot::StateWillChange() { 47 void HTMLImportTreeRoot::StateWillChange() {
48 ScheduleRecalcState(); 48 ScheduleRecalcState();
49 } 49 }
50 50
51 void HTMLImportTreeRoot::StateDidChange() { 51 void HTMLImportTreeRoot::StateDidChange() {
52 HTMLImport::StateDidChange(); 52 HTMLImport::StateDidChange();
53 53
54 if (!GetState().IsReady()) 54 if (GetState().IsReady())
55 return; 55 document_->CheckCompleted();
56 if (LocalFrame* frame = document_->GetFrame())
57 frame->Loader().CheckCompleted();
58 } 56 }
59 57
60 void HTMLImportTreeRoot::ScheduleRecalcState() { 58 void HTMLImportTreeRoot::ScheduleRecalcState() {
61 DCHECK(document_); 59 DCHECK(document_);
62 if (recalc_timer_.IsActive() || !document_->IsActive()) 60 if (recalc_timer_.IsActive() || !document_->IsActive())
63 return; 61 return;
64 recalc_timer_.StartOneShot(0, BLINK_FROM_HERE); 62 recalc_timer_.StartOneShot(0, BLINK_FROM_HERE);
65 } 63 }
66 64
67 HTMLImportChild* HTMLImportTreeRoot::Add(HTMLImportChild* child) { 65 HTMLImportChild* HTMLImportTreeRoot::Add(HTMLImportChild* child) {
(...skipping 15 matching lines...) Expand all
83 HTMLImport::RecalcTreeState(this); 81 HTMLImport::RecalcTreeState(this);
84 } 82 }
85 83
86 DEFINE_TRACE(HTMLImportTreeRoot) { 84 DEFINE_TRACE(HTMLImportTreeRoot) {
87 visitor->Trace(document_); 85 visitor->Trace(document_);
88 visitor->Trace(imports_); 86 visitor->Trace(imports_);
89 HTMLImport::Trace(visitor); 87 HTMLImport::Trace(visitor);
90 } 88 }
91 89
92 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698