| 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 prepareToStopParsing(); | 866 prepareToStopParsing(); |
| 867 } | 867 } |
| 868 | 868 |
| 869 void HTMLDocumentParser::finish() | 869 void HTMLDocumentParser::finish() |
| 870 { | 870 { |
| 871 // FIXME: We should ASSERT(!m_parserStopped) here, since it does not | 871 // FIXME: We should ASSERT(!m_parserStopped) here, since it does not |
| 872 // makes sense to call any methods on DocumentParser once it's been stopped. | 872 // makes sense to call any methods on DocumentParser once it's been stopped. |
| 873 // However, FrameLoader::stop calls DocumentParser::finish unconditionally. | 873 // However, FrameLoader::stop calls DocumentParser::finish unconditionally. |
| 874 | 874 |
| 875 // flush may ending up executing arbitrary script, and possibly detach the p
arser. | 875 // flush may ending up executing arbitrary script, and possibly detach the p
arser. |
| 876 RefPtr<HTMLDocumentParser> protect(this); | 876 RefPtrWillBeRawPtr<HTMLDocumentParser> protect(this); |
| 877 flush(); | 877 flush(); |
| 878 if (isDetached()) | 878 if (isDetached()) |
| 879 return; | 879 return; |
| 880 | 880 |
| 881 // Empty documents never got an append() call, and thus have never started | 881 // Empty documents never got an append() call, and thus have never started |
| 882 // a background parser. In those cases, we ignore shouldUseThreading() | 882 // a background parser. In those cases, we ignore shouldUseThreading() |
| 883 // and fall through to the non-threading case. | 883 // and fall through to the non-threading case. |
| 884 if (m_haveBackgroundParser) { | 884 if (m_haveBackgroundParser) { |
| 885 if (!m_input.haveSeenEndOfFile()) | 885 if (!m_input.haveSeenEndOfFile()) |
| 886 m_input.closeWithoutMarkingEndOfFile(); | 886 m_input.closeWithoutMarkingEndOfFile(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 1069 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
| 1070 { | 1070 { |
| 1071 ASSERT(decoder); | 1071 ASSERT(decoder); |
| 1072 DecodedDataDocumentParser::setDecoder(decoder); | 1072 DecodedDataDocumentParser::setDecoder(decoder); |
| 1073 | 1073 |
| 1074 if (m_haveBackgroundParser) | 1074 if (m_haveBackgroundParser) |
| 1075 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); | 1075 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 } | 1078 } |
| OLD | NEW |