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

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: rebase Created 6 years 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 | Source/core/dom/ExecutionContext.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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 538
539 InspectorCounters::incrementCounter(InspectorCounters::DocumentCounter); 539 InspectorCounters::incrementCounter(InspectorCounters::DocumentCounter);
540 540
541 m_lifecycle.advanceTo(DocumentLifecycle::Inactive); 541 m_lifecycle.advanceTo(DocumentLifecycle::Inactive);
542 542
543 // Since CSSFontSelector requires Document::m_fetcher and StyleEngine owns 543 // Since CSSFontSelector requires Document::m_fetcher and StyleEngine owns
544 // CSSFontSelector, need to initialize m_styleEngine after initializing 544 // CSSFontSelector, need to initialize m_styleEngine after initializing
545 // m_fetcher. 545 // m_fetcher.
546 m_styleEngine = StyleEngine::create(*this); 546 m_styleEngine = StyleEngine::create(*this);
547 547
548 // The parent's parser should be suspended together with all the other objec ts,
549 // else this new Document would have a new ExecutionContext which suspended state
550 // would not match the one from the parent, and could start loading resource s
551 // ignoring the defersLoading flag.
552 ASSERT(!parentDocument() || !parentDocument()->activeDOMObjectsAreSuspended( ));
553
548 #ifndef NDEBUG 554 #ifndef NDEBUG
549 liveDocumentSet().add(this); 555 liveDocumentSet().add(this);
550 #endif 556 #endif
551 } 557 }
552 558
553 Document::~Document() 559 Document::~Document()
554 { 560 {
555 ASSERT(!renderView()); 561 ASSERT(!renderView());
556 ASSERT(!parentTreeScope()); 562 ASSERT(!parentTreeScope());
557 #if !ENABLE(OILPAN) 563 #if !ENABLE(OILPAN)
(...skipping 5259 matching lines...) Expand 10 before | Expand all | Expand 10 after
5817 #ifndef NDEBUG 5823 #ifndef NDEBUG
5818 using namespace blink; 5824 using namespace blink;
5819 void showLiveDocumentInstances() 5825 void showLiveDocumentInstances()
5820 { 5826 {
5821 WeakDocumentSet& set = liveDocumentSet(); 5827 WeakDocumentSet& set = liveDocumentSet();
5822 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5828 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5823 for (Document* document : set) 5829 for (Document* document : set)
5824 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5830 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5825 } 5831 }
5826 #endif 5832 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698