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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentParser.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 19 matching lines...) Expand all
30 #include "core/html/parser/TextResourceDecoder.h" 30 #include "core/html/parser/TextResourceDecoder.h"
31 #include "wtf/Assertions.h" 31 #include "wtf/Assertions.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 DocumentParser::DocumentParser(Document* document) 35 DocumentParser::DocumentParser(Document* document)
36 : m_state(ParsingState) 36 : m_state(ParsingState)
37 , m_documentWasLoadedAsPartOfNavigation(false) 37 , m_documentWasLoadedAsPartOfNavigation(false)
38 , m_document(document) 38 , m_document(document)
39 { 39 {
40 ASSERT(document); 40 DCHECK(document);
41 } 41 }
42 42
43 DocumentParser::~DocumentParser() 43 DocumentParser::~DocumentParser()
44 { 44 {
45 #if !ENABLE(OILPAN) 45 #if !ENABLE(OILPAN)
46 // Document is expected to call detach() before releasing its ref. 46 // Document is expected to call detach() before releasing its ref.
47 // This ASSERT is slightly awkward for parsers with a fragment case 47 // This ASSERT is slightly awkward for parsers with a fragment case
48 // as there is no Document to release the ref. 48 // as there is no Document to release the ref.
49 ASSERT(!m_document); 49 DCHECK(!m_document);
50 #endif 50 #endif
51 } 51 }
52 52
53 DEFINE_TRACE(DocumentParser) 53 DEFINE_TRACE(DocumentParser)
54 { 54 {
55 visitor->trace(m_document); 55 visitor->trace(m_document);
56 visitor->trace(m_clients); 56 visitor->trace(m_clients);
57 } 57 }
58 58
59 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>) 59 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>)
60 { 60 {
61 ASSERT_NOT_REACHED(); 61 ASSERT_NOT_REACHED();
62 } 62 }
63 63
64 TextResourceDecoder* DocumentParser::decoder() 64 TextResourceDecoder* DocumentParser::decoder()
65 { 65 {
66 return nullptr; 66 return nullptr;
67 } 67 }
68 68
69 void DocumentParser::prepareToStopParsing() 69 void DocumentParser::prepareToStopParsing()
70 { 70 {
71 ASSERT(m_state == ParsingState); 71 DCHECK_EQ(m_state, ParsingState);
72 m_state = StoppingState; 72 m_state = StoppingState;
73 } 73 }
74 74
75 void DocumentParser::stopParsing() 75 void DocumentParser::stopParsing()
76 { 76 {
77 m_state = StoppedState; 77 m_state = StoppedState;
78 78
79 // Clients may be removed while in the loop. Make a snapshot for iteration. 79 // Clients may be removed while in the loop. Make a snapshot for iteration.
80 HeapVector<Member<DocumentParserClient>> clientsSnapshot; 80 HeapVector<Member<DocumentParserClient>> clientsSnapshot;
81 copyToVector(m_clients, clientsSnapshot); 81 copyToVector(m_clients, clientsSnapshot);
(...skipping 24 matching lines...) Expand all
106 { 106 {
107 m_clients.add(client); 107 m_clients.add(client);
108 } 108 }
109 109
110 void DocumentParser::removeClient(DocumentParserClient* client) 110 void DocumentParser::removeClient(DocumentParserClient* client)
111 { 111 {
112 m_clients.remove(client); 112 m_clients.remove(client);
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentParser.h ('k') | third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698