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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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 * Copyright (C) 2011, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2014 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 RefPtr<StringImpl> m_characters; 213 RefPtr<StringImpl> m_characters;
214 unsigned m_current; 214 unsigned m_current;
215 unsigned m_end; 215 unsigned m_end;
216 }; 216 };
217 217
218 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, 218 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser,
219 Document& document, 219 Document& document,
220 ParserContentPolicy parserContentPolicy, 220 ParserContentPolicy parserContentPolicy,
221 const HTMLParserOptions& options) 221 const HTMLParserOptions& options)
222 : m_framesetOk(true), 222 : m_framesetOk(true),
223 #if ENABLE(ASSERT)
224 m_isAttached(true),
225 #endif
226 m_tree(parser->reentryPermit(), document, parserContentPolicy), 223 m_tree(parser->reentryPermit(), document, parserContentPolicy),
227 m_insertionMode(InitialMode), 224 m_insertionMode(InitialMode),
228 m_originalInsertionMode(InitialMode), 225 m_originalInsertionMode(InitialMode),
229 m_shouldSkipLeadingNewline(false), 226 m_shouldSkipLeadingNewline(false),
230 m_parser(parser), 227 m_parser(parser),
231 m_scriptToProcessStartPosition(uninitializedPositionValue1()), 228 m_scriptToProcessStartPosition(uninitializedPositionValue1()),
232 m_options(options) { 229 m_options(options) {
233 } 230 }
234 231
235 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, 232 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 273 }
277 274
278 DEFINE_TRACE(HTMLTreeBuilder) { 275 DEFINE_TRACE(HTMLTreeBuilder) {
279 visitor->trace(m_fragmentContext); 276 visitor->trace(m_fragmentContext);
280 visitor->trace(m_tree); 277 visitor->trace(m_tree);
281 visitor->trace(m_parser); 278 visitor->trace(m_parser);
282 visitor->trace(m_scriptToProcess); 279 visitor->trace(m_scriptToProcess);
283 } 280 }
284 281
285 void HTMLTreeBuilder::detach() { 282 void HTMLTreeBuilder::detach() {
286 #if ENABLE(ASSERT) 283 #if DCHECK_IS_ON()
287 // This call makes little sense in fragment mode, but for consistency 284 // This call makes little sense in fragment mode, but for consistency
288 // DocumentParser expects detach() to always be called before it's destroyed. 285 // DocumentParser expects detach() to always be called before it's destroyed.
289 m_isAttached = false; 286 m_isAttached = false;
290 #endif 287 #endif
291 // HTMLConstructionSite might be on the callstack when detach() is called 288 // HTMLConstructionSite might be on the callstack when detach() is called
292 // otherwise we'd just call m_tree.clear() here instead. 289 // otherwise we'd just call m_tree.clear() here instead.
293 m_tree.detach(); 290 m_tree.detach();
294 } 291 }
295 292
296 Element* HTMLTreeBuilder::takeScriptToProcess( 293 Element* HTMLTreeBuilder::takeScriptToProcess(
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 DEFINE_STRINGIFY(AfterFramesetMode) 2755 DEFINE_STRINGIFY(AfterFramesetMode)
2759 DEFINE_STRINGIFY(AfterAfterBodyMode) 2756 DEFINE_STRINGIFY(AfterAfterBodyMode)
2760 DEFINE_STRINGIFY(AfterAfterFramesetMode) 2757 DEFINE_STRINGIFY(AfterAfterFramesetMode)
2761 #undef DEFINE_STRINGIFY 2758 #undef DEFINE_STRINGIFY
2762 } 2759 }
2763 return "<unknown>"; 2760 return "<unknown>";
2764 } 2761 }
2765 #endif 2762 #endif
2766 2763
2767 } // namespace blink 2764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698