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

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

Issue 625583002: Properly suspend HTMLDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: better way to call m_parserScheduler->resume Created 6 years, 1 month 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 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 InspectorCounters::incrementCounter(InspectorCounters::DocumentCounter); 542 InspectorCounters::incrementCounter(InspectorCounters::DocumentCounter);
543 543
544 m_lifecycle.advanceTo(DocumentLifecycle::Inactive); 544 m_lifecycle.advanceTo(DocumentLifecycle::Inactive);
545 545
546 // Since CSSFontSelector requires Document::m_fetcher and StyleEngine owns 546 // Since CSSFontSelector requires Document::m_fetcher and StyleEngine owns
547 // CSSFontSelector, need to initialize m_styleEngine after initializing 547 // CSSFontSelector, need to initialize m_styleEngine after initializing
548 // m_fetcher. 548 // m_fetcher.
549 m_styleEngine = StyleEngine::create(*this); 549 m_styleEngine = StyleEngine::create(*this);
550 550
551 // The parent's parser should be suspended together with all the other objec ts,
552 // else this new Document would have a new ExecutionContext which suspended state
553 // would not match the one from the parent, and could start loading resource s
554 // ignoring the defersLoading flag.
555 ASSERT(!parentDocument() || !parentDocument()->activeDOMObjectsAreSuspended( ));
556
551 #ifndef NDEBUG 557 #ifndef NDEBUG
552 liveDocumentSet().add(this); 558 liveDocumentSet().add(this);
553 #endif 559 #endif
554 } 560 }
555 561
556 Document::~Document() 562 Document::~Document()
557 { 563 {
558 ASSERT(!renderView()); 564 ASSERT(!renderView());
559 ASSERT(!parentTreeScope()); 565 ASSERT(!parentTreeScope());
560 #if !ENABLE(OILPAN) 566 #if !ENABLE(OILPAN)
(...skipping 5288 matching lines...) Expand 10 before | Expand all | Expand 10 after
5849 #ifndef NDEBUG 5855 #ifndef NDEBUG
5850 using namespace blink; 5856 using namespace blink;
5851 void showLiveDocumentInstances() 5857 void showLiveDocumentInstances()
5852 { 5858 {
5853 WeakDocumentSet& set = liveDocumentSet(); 5859 WeakDocumentSet& set = liveDocumentSet();
5854 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5860 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5855 for (Document* document : set) 5861 for (Document* document : set)
5856 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5862 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5857 } 5863 }
5858 #endif 5864 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698