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

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

Issue 669603002: Reland: Refactor Script(Loader|Runner): don't access Resources all over the place... (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test update Created 6 years, 2 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
« no previous file with comments | « Source/core/dom/ScriptRunner.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptRunner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698