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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 ASSERT(!m_document); | 67 ASSERT(!m_document); |
68 #endif | 68 #endif |
69 } | 69 } |
70 | 70 |
71 void HTMLScriptRunner::detach() | 71 void HTMLScriptRunner::detach() |
72 { | 72 { |
73 if (!m_document) | 73 if (!m_document) |
74 return; | 74 return; |
75 | 75 |
76 m_parserBlockingScript.stopWatchingForLoad(this); | 76 m_parserBlockingScript.stopWatchingForLoad(this); |
| 77 m_parserBlockingScript.releaseElementAndClear(); |
77 | 78 |
78 while (!m_scriptsToExecuteAfterParsing.isEmpty()) { | 79 while (!m_scriptsToExecuteAfterParsing.isEmpty()) { |
79 PendingScript pendingScript = m_scriptsToExecuteAfterParsing.takeFirst()
; | 80 PendingScript pendingScript = m_scriptsToExecuteAfterParsing.takeFirst()
; |
80 pendingScript.stopWatchingForLoad(this); | 81 pendingScript.stopWatchingForLoad(this); |
| 82 pendingScript.releaseElementAndClear(); |
81 } | 83 } |
82 m_document = nullptr; | 84 m_document = nullptr; |
83 } | 85 } |
84 | 86 |
85 static KURL documentURLForScriptExecution(Document* document) | 87 static KURL documentURLForScriptExecution(Document* document) |
86 { | 88 { |
87 if (!document) | 89 if (!document) |
88 return KURL(); | 90 return KURL(); |
89 | 91 |
90 if (!document->frame()) { | 92 if (!document->frame()) { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 342 |
341 void HTMLScriptRunner::trace(Visitor* visitor) | 343 void HTMLScriptRunner::trace(Visitor* visitor) |
342 { | 344 { |
343 visitor->trace(m_document); | 345 visitor->trace(m_document); |
344 visitor->trace(m_host); | 346 visitor->trace(m_host); |
345 visitor->trace(m_parserBlockingScript); | 347 visitor->trace(m_parserBlockingScript); |
346 visitor->trace(m_scriptsToExecuteAfterParsing); | 348 visitor->trace(m_scriptsToExecuteAfterParsing); |
347 } | 349 } |
348 | 350 |
349 } | 351 } |
OLD | NEW |