OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |