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

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: Flush for foriegn content also Created 7 years, 1 month 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 // There should only be PendingText left since the tree-builder always flush es
561 // the task queue before returning. In case that ever changes, crash.
562 if (mode == ForceSynchronous)
563 m_treeBuilder->flush();
564 RELEASE_ASSERT(!isStopped());
565
560 if (session.needsYield) 566 if (session.needsYield)
561 m_parserScheduler->scheduleForResume(); 567 m_parserScheduler->scheduleForResume();
562 568
563 if (isWaitingForScripts()) { 569 if (isWaitingForScripts()) {
564 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState); 570 ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
565 if (!m_preloadScanner) { 571 if (!m_preloadScanner) {
566 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url(), document()->devicePixelRatio())); 572 m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, docume nt()->url(), document()->devicePixelRatio()));
567 m_preloadScanner->appendToEnd(m_input.current()); 573 m_preloadScanner->appendToEnd(m_input.current());
568 } 574 }
569 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL()); 575 m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 m_parserScheduler->suspend(); 965 m_parserScheduler->suspend();
960 } 966 }
961 967
962 void HTMLDocumentParser::resumeScheduledTasks() 968 void HTMLDocumentParser::resumeScheduledTasks()
963 { 969 {
964 if (m_parserScheduler) 970 if (m_parserScheduler)
965 m_parserScheduler->resume(); 971 m_parserScheduler->resume();
966 } 972 }
967 973
968 } 974 }
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLConstructionSite.cpp ('k') | Source/core/html/parser/HTMLTreeBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698