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

Unified Diff: Source/core/html/HTMLImport.cpp

Issue 131043003: [import] Refactoring: Get rid of HTMLImport::isProcessing() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed an extra blank line Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLImport.h ('k') | Source/core/html/HTMLImportChild.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImport.cpp
diff --git a/Source/core/html/HTMLImport.cpp b/Source/core/html/HTMLImport.cpp
index f28c8fd256640fd3f2f86428f2dd6c6d753bfd55..b500511750976a6e770184945ad10db77cd65911 100644
--- a/Source/core/html/HTMLImport.cpp
+++ b/Source/core/html/HTMLImport.cpp
@@ -136,7 +136,7 @@ void HTMLImport::didUnblockFromRunningScript()
void HTMLImport::didBecomeReady()
{
- ASSERT(!isProcessing());
+ ASSERT(isDone());
}
void HTMLImport::didUnblockFromCreatingDocument()
@@ -159,7 +159,15 @@ void HTMLImport::loaderDidFinish()
inline bool HTMLImport::isBlockingFollowersFromRunningScript() const
{
- return (isBlockedFromRunningScript() || isProcessing()) && isCreatedByParser();
+ if (!isCreatedByParser())
+ return false;
+ if (isBlockedFromRunningScript())
+ return true;
+ // Blocking here can result dead lock if the node doesn't own loader and has shared loader.
+ // Because the shared loader can point its ascendant and forms a cycle.
+ if (!ownsLoader())
+ return false;
+ return !isDone();
}
inline bool HTMLImport::isBlockingFollowersFromCreatingDocument() const
@@ -181,7 +189,7 @@ bool HTMLImport::unblock(HTMLImport* import)
}
import->unblockFromRunningScript();
- if (!import->isProcessing())
+ if (import->isDone())
import->becomeReady();
return !import->isBlockingFollowersFromRunningScript();
« no previous file with comments | « Source/core/html/HTMLImport.h ('k') | Source/core/html/HTMLImportChild.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698