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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 HTMLParserReentryPermit* reentry_permit, | 155 HTMLParserReentryPermit* reentry_permit, |
156 Document* document, | 156 Document* document, |
157 HTMLParserScriptRunnerHost* host) | 157 HTMLParserScriptRunnerHost* host) |
158 : reentry_permit_(reentry_permit), | 158 : reentry_permit_(reentry_permit), |
159 document_(document), | 159 document_(document), |
160 host_(host), | 160 host_(host), |
161 parser_blocking_script_(nullptr) { | 161 parser_blocking_script_(nullptr) { |
162 DCHECK(host_); | 162 DCHECK(host_); |
163 } | 163 } |
164 | 164 |
165 HTMLParserScriptRunner::~HTMLParserScriptRunner() { | 165 HTMLParserScriptRunner::~HTMLParserScriptRunner() {} |
166 // Verify that detach() has been called. | |
167 DCHECK(!document_); | |
168 } | |
169 | 166 |
170 void HTMLParserScriptRunner::Detach() { | 167 void HTMLParserScriptRunner::Detach() { |
171 if (!document_) | 168 if (!document_) |
172 return; | 169 return; |
173 | 170 |
174 if (parser_blocking_script_) | 171 if (parser_blocking_script_) |
175 parser_blocking_script_->Dispose(); | 172 parser_blocking_script_->Dispose(); |
176 parser_blocking_script_ = nullptr; | 173 parser_blocking_script_ = nullptr; |
177 | 174 |
178 while (!scripts_to_execute_after_parsing_.IsEmpty()) { | 175 while (!scripts_to_execute_after_parsing_.IsEmpty()) { |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 | 677 |
681 DEFINE_TRACE(HTMLParserScriptRunner) { | 678 DEFINE_TRACE(HTMLParserScriptRunner) { |
682 visitor->Trace(document_); | 679 visitor->Trace(document_); |
683 visitor->Trace(host_); | 680 visitor->Trace(host_); |
684 visitor->Trace(parser_blocking_script_); | 681 visitor->Trace(parser_blocking_script_); |
685 visitor->Trace(scripts_to_execute_after_parsing_); | 682 visitor->Trace(scripts_to_execute_after_parsing_); |
686 PendingScriptClient::Trace(visitor); | 683 PendingScriptClient::Trace(visitor); |
687 } | 684 } |
688 | 685 |
689 } // namespace blink | 686 } // namespace blink |
OLD | NEW |