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

Side by Side Diff: Source/core/html/parser/HTMLDocumentParser.cpp

Issue 26129005: Rewrite Text node attaching to not be N^2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Seems to actually work Created 7 years, 2 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 | Annotate | Revision Log
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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 ASSERT(token().isUninitialized()); 550 ASSERT(token().isUninitialized());
551 } 551 }
552 552
553 // Ensure we haven't been totally deref'ed after pumping. Any caller of this 553 // Ensure we haven't been totally deref'ed after pumping. Any caller of this
554 // function should be holding a RefPtr to this to ensure we weren't deleted. 554 // function should be holding a RefPtr to this to ensure we weren't deleted.
555 ASSERT(refCount() >= 1); 555 ASSERT(refCount() >= 1);
556 556
557 if (isStopped()) 557 if (isStopped())
558 return; 558 return;
559 559
560 if (mode == ForceSynchronous)
561 m_treeBuilder->flush();
abarth-chromium 2013/10/11 18:54:04 Don't you need to check if (isStopped()) ret
562
560 if (session.needsYield) 563 if (session.needsYield)
561 m_parserScheduler->scheduleForResume(); 564 m_parserScheduler->scheduleForResume();
562 565
563 if (isWaitingForScripts()) { 566 if (isWaitingForScripts()) {
564 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState); 567 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
565 if (!m_preloadScanner) { 568 if (!m_preloadScanner) {
566 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url(), document()->devicePixelRatio())); 569 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url(), document()->devicePixelRatio()));
567 m_preloadScanner->appendToEnd(m_input.current()); 570 m_preloadScanner->appendToEnd(m_input.current());
568 } 571 }
569 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL()); 572 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 m_parserScheduler->suspend(); 960 m_parserScheduler->suspend();
958 } 961 }
959 962
960 void HTMLDocumentParser::resumeScheduledTasks() 963 void HTMLDocumentParser::resumeScheduledTasks()
961 { 964 {
962 if (m_parserScheduler) 965 if (m_parserScheduler)
963 m_parserScheduler->resume(); 966 m_parserScheduler->resume();
964 } 967 }
965 968
966 } 969 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698