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

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

Issue 521363002: Make XHR use the background HTML parser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix compile Created 6 years, 3 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 { 737 {
738 ASSERT(!isStopped()); 738 ASSERT(!isStopped());
739 ASSERT(shouldUseThreading()); 739 ASSERT(shouldUseThreading());
740 ASSERT(!m_haveBackgroundParser); 740 ASSERT(!m_haveBackgroundParser);
741 m_haveBackgroundParser = true; 741 m_haveBackgroundParser = true;
742 742
743 RefPtr<WeakReference<BackgroundHTMLParser> > reference = WeakReference<Backg roundHTMLParser>::createUnbound(); 743 RefPtr<WeakReference<BackgroundHTMLParser> > reference = WeakReference<Backg roundHTMLParser>::createUnbound();
744 m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference); 744 m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference);
745 745
746 // TODO(oysteine): Disabled due to crbug.com/398076 until a full fix can be implemented. 746 // TODO(oysteine): Disabled due to crbug.com/398076 until a full fix can be implemented.
747 if (RuntimeEnabledFeatures::threadedParserDataReceiverEnabled()) 747 if (RuntimeEnabledFeatures::threadedParserDataReceiverEnabled()) {
748 document()->loader()->attachThreadedDataReceiver(adoptPtr(new ParserData Receiver(m_backgroundParser))); 748 if (DocumentLoader* loader = document()->loader())
749 loader->attachThreadedDataReceiver(adoptPtr(new ParserDataReceiver(m _backgroundParser)));
750 }
749 751
750 OwnPtr<BackgroundHTMLParser::Configuration> config = adoptPtr(new Background HTMLParser::Configuration); 752 OwnPtr<BackgroundHTMLParser::Configuration> config = adoptPtr(new Background HTMLParser::Configuration);
751 config->options = m_options; 753 config->options = m_options;
752 config->parser = m_weakFactory.createWeakPtr(); 754 config->parser = m_weakFactory.createWeakPtr();
753 config->xssAuditor = adoptPtr(new XSSAuditor); 755 config->xssAuditor = adoptPtr(new XSSAuditor);
754 config->xssAuditor->init(document(), &m_xssAuditorDelegate); 756 config->xssAuditor->init(document(), &m_xssAuditorDelegate);
755 config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url(). copy(), createMediaValues(document()))); 757 config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url(). copy(), createMediaValues(document())));
756 config->decoder = takeDecoder(); 758 config->decoder = takeDecoder();
757 759
758 ASSERT(config->xssAuditor->isSafeToSendToAnotherThread()); 760 ASSERT(config->xssAuditor->isSafeToSendToAnotherThread());
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) 1074 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder)
1073 { 1075 {
1074 ASSERT(decoder); 1076 ASSERT(decoder);
1075 DecodedDataDocumentParser::setDecoder(decoder); 1077 DecodedDataDocumentParser::setDecoder(decoder);
1076 1078
1077 if (m_haveBackgroundParser) 1079 if (m_haveBackgroundParser)
1078 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco der, m_backgroundParser, takeDecoder())); 1080 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco der, m_backgroundParser, takeDecoder()));
1079 } 1081 }
1080 1082
1081 } 1083 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLParserOptions.cpp » ('j') | Source/core/inspector/DOMPatchSupport.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698