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

Side by Side Diff: Source/core/dom/ScriptLoader.cpp

Issue 660233002: Oilpan: move ScriptLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No detachment of ScriptLoaders when finalizing ScriptRunner 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/ScriptLoader.h ('k') | Source/core/dom/ScriptRunner.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ASSERT(m_element); 71 ASSERT(m_element);
72 if (parserInserted && element->document().scriptableDocumentParser() && !ele ment->document().isInDocumentWrite()) 72 if (parserInserted && element->document().scriptableDocumentParser() && !ele ment->document().isInDocumentWrite())
73 m_startLineNumber = element->document().scriptableDocumentParser()->line Number(); 73 m_startLineNumber = element->document().scriptableDocumentParser()->line Number();
74 } 74 }
75 75
76 ScriptLoader::~ScriptLoader() 76 ScriptLoader::~ScriptLoader()
77 { 77 {
78 m_pendingScript.stopWatchingForLoad(this); 78 m_pendingScript.stopWatchingForLoad(this);
79 } 79 }
80 80
81 void ScriptLoader::trace(Visitor* visitor)
82 {
83 visitor->trace(m_element);
84 visitor->trace(m_pendingScript);
85 }
86
81 void ScriptLoader::didNotifySubtreeInsertionsToDocument() 87 void ScriptLoader::didNotifySubtreeInsertionsToDocument()
82 { 88 {
83 if (!m_parserInserted) 89 if (!m_parserInserted)
84 prepareScript(); // FIXME: Provide a real starting line number here. 90 prepareScript(); // FIXME: Provide a real starting line number here.
85 } 91 }
86 92
87 void ScriptLoader::childrenChanged() 93 void ScriptLoader::childrenChanged()
88 { 94 {
89 if (!m_parserInserted && m_element->inDocument()) 95 if (!m_parserInserted && m_element->inDocument())
90 prepareScript(); // FIXME: Provide a real starting line number here. 96 prepareScript(); // FIXME: Provide a real starting line number here.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 contextDocument->popCurrentScript(); 371 contextDocument->popCurrentScript();
366 } 372 }
367 } 373 }
368 374
369 void ScriptLoader::execute() 375 void ScriptLoader::execute()
370 { 376 {
371 ASSERT(!m_willBeParserExecuted); 377 ASSERT(!m_willBeParserExecuted);
372 ASSERT(m_pendingScript.resource()); 378 ASSERT(m_pendingScript.resource());
373 bool errorOccurred = false; 379 bool errorOccurred = false;
374 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred); 380 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred);
375 RefPtr<Element> element = m_pendingScript.releaseElementAndClear(); 381 RefPtrWillBeRawPtr<Element> element = m_pendingScript.releaseElementAndClear ();
382 ALLOW_UNUSED_LOCAL(element);
376 if (errorOccurred) { 383 if (errorOccurred) {
377 dispatchErrorEvent(); 384 dispatchErrorEvent();
378 } else if (!m_resource->wasCanceled()) { 385 } else if (!m_resource->wasCanceled()) {
379 executeScript(source); 386 executeScript(source);
380 dispatchLoadEvent(); 387 dispatchLoadEvent();
381 } 388 }
382 m_resource = 0; 389 m_resource = 0;
383 } 390 }
384 391
385 void ScriptLoader::notifyFinished(Resource* resource) 392 void ScriptLoader::notifyFinished(Resource* resource)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 { 455 {
449 if (isHTMLScriptLoader(element)) 456 if (isHTMLScriptLoader(element))
450 return toHTMLScriptElement(element)->loader(); 457 return toHTMLScriptElement(element)->loader();
451 458
452 if (isSVGScriptLoader(element)) 459 if (isSVGScriptLoader(element))
453 return toSVGScriptElement(element)->loader(); 460 return toSVGScriptElement(element)->loader();
454 461
455 return 0; 462 return 0;
456 } 463 }
457 464
458 } 465 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptLoader.h ('k') | Source/core/dom/ScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698