Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
index f1aff24f70f0195ec8f20ae6326178d8892c8647..71c83104e397736e7214f911b59faa32001ca352 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
@@ -204,6 +204,11 @@ void FrameLoader::init() |
m_provisionalDocumentLoader->startLoadingMainResource(); |
m_frame->document()->cancelParsing(); |
m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument); |
+ // Self-suspend if created in an already deferred Page. Note that both |
+ // startLoadingMainResource() and cancelParsing() may have already detached |
+ // the frame, since they both fire JS events. |
+ if (m_frame->page() && m_frame->page()->defersLoading()) |
+ setDefersLoading(true); |
takeObjectSnapshot(); |
} |