| OLD | NEW |
| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 6612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6623 if (reason <= would_load_reason_ || | 6623 if (reason <= would_load_reason_ || |
| 6624 !GetFrame()->Loader().StateMachine()->CommittedFirstRealDocumentLoad()) | 6624 !GetFrame()->Loader().StateMachine()->CommittedFirstRealDocumentLoad()) |
| 6625 return; | 6625 return; |
| 6626 for (int i = static_cast<int>(would_load_reason_) + 1; | 6626 for (int i = static_cast<int>(would_load_reason_) + 1; |
| 6627 i <= static_cast<int>(reason); ++i) | 6627 i <= static_cast<int>(reason); ++i) |
| 6628 RecordLoadReasonToHistogram(static_cast<WouldLoadReason>(i)); | 6628 RecordLoadReasonToHistogram(static_cast<WouldLoadReason>(i)); |
| 6629 would_load_reason_ = reason; | 6629 would_load_reason_ = reason; |
| 6630 } | 6630 } |
| 6631 | 6631 |
| 6632 DEFINE_TRACE_WRAPPERS(Document) { | 6632 DEFINE_TRACE_WRAPPERS(Document) { |
| 6633 // node_lists_ are traced in their corresponding NodeListsNodeData, keeping |
| 6634 // them only alive for live nodes. Otherwise we would keep lists of dead |
| 6635 // nodes alive that have not yet been invalidated. |
| 6633 visitor->TraceWrappers(imports_controller_); | 6636 visitor->TraceWrappers(imports_controller_); |
| 6634 visitor->TraceWrappers(implementation_); | 6637 visitor->TraceWrappers(implementation_); |
| 6635 visitor->TraceWrappers(style_sheet_list_); | 6638 visitor->TraceWrappers(style_sheet_list_); |
| 6636 visitor->TraceWrappers(style_engine_); | 6639 visitor->TraceWrappers(style_engine_); |
| 6637 for (int i = 0; i < kNumNodeListInvalidationTypes; ++i) { | |
| 6638 for (auto list : node_lists_[i]) { | |
| 6639 if (IsHTMLCollectionType(list->GetType())) { | |
| 6640 visitor->TraceWrappersWithManualWriteBarrier( | |
| 6641 static_cast<const HTMLCollection*>(list.Get())); | |
| 6642 } else { | |
| 6643 visitor->TraceWrappersWithManualWriteBarrier( | |
| 6644 static_cast<const LiveNodeList*>(list.Get())); | |
| 6645 } | |
| 6646 } | |
| 6647 } | |
| 6648 // Cannot trace in Supplementable<Document> as it is part of platform/ and | 6640 // Cannot trace in Supplementable<Document> as it is part of platform/ and |
| 6649 // thus cannot refer to ScriptWrappableVisitor. | 6641 // thus cannot refer to ScriptWrappableVisitor. |
| 6650 visitor->TraceWrappers( | 6642 visitor->TraceWrappers( |
| 6651 static_cast<FontFaceSet*>(Supplementable<Document>::supplements_.at( | 6643 static_cast<FontFaceSet*>(Supplementable<Document>::supplements_.at( |
| 6652 FontFaceSet::SupplementName()))); | 6644 FontFaceSet::SupplementName()))); |
| 6653 ContainerNode::TraceWrappers(visitor); | 6645 ContainerNode::TraceWrappers(visitor); |
| 6654 } | 6646 } |
| 6655 | 6647 |
| 6656 template class CORE_TEMPLATE_EXPORT Supplement<Document>; | 6648 template class CORE_TEMPLATE_EXPORT Supplement<Document>; |
| 6657 | 6649 |
| 6658 } // namespace blink | 6650 } // namespace blink |
| 6659 | 6651 |
| 6660 #ifndef NDEBUG | 6652 #ifndef NDEBUG |
| 6661 static WeakDocumentSet& liveDocumentSet() { | 6653 static WeakDocumentSet& liveDocumentSet() { |
| 6662 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); | 6654 DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); |
| 6663 return set; | 6655 return set; |
| 6664 } | 6656 } |
| 6665 | 6657 |
| 6666 void showLiveDocumentInstances() { | 6658 void showLiveDocumentInstances() { |
| 6667 WeakDocumentSet& set = liveDocumentSet(); | 6659 WeakDocumentSet& set = liveDocumentSet(); |
| 6668 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6660 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6669 for (blink::Document* document : set) | 6661 for (blink::Document* document : set) |
| 6670 fprintf(stderr, "- Document %p URL: %s\n", document, | 6662 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6671 document->Url().GetString().Utf8().Data()); | 6663 document->Url().GetString().Utf8().Data()); |
| 6672 } | 6664 } |
| 6673 #endif | 6665 #endif |
| OLD | NEW |