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

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

Issue 656413003: Revert of Oilpan: move ScriptLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
87 void ScriptLoader::didNotifySubtreeInsertionsToDocument() 81 void ScriptLoader::didNotifySubtreeInsertionsToDocument()
88 { 82 {
89 if (!m_parserInserted) 83 if (!m_parserInserted)
90 prepareScript(); // FIXME: Provide a real starting line number here. 84 prepareScript(); // FIXME: Provide a real starting line number here.
91 } 85 }
92 86
93 void ScriptLoader::childrenChanged() 87 void ScriptLoader::childrenChanged()
94 { 88 {
95 if (!m_parserInserted && m_element->inDocument()) 89 if (!m_parserInserted && m_element->inDocument())
96 prepareScript(); // FIXME: Provide a real starting line number here. 90 prepareScript(); // FIXME: Provide a real starting line number here.
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 contextDocument->popCurrentScript(); 359 contextDocument->popCurrentScript();
366 } 360 }
367 } 361 }
368 362
369 void ScriptLoader::execute() 363 void ScriptLoader::execute()
370 { 364 {
371 ASSERT(!m_willBeParserExecuted); 365 ASSERT(!m_willBeParserExecuted);
372 ASSERT(m_pendingScript.resource()); 366 ASSERT(m_pendingScript.resource());
373 bool errorOccurred = false; 367 bool errorOccurred = false;
374 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred); 368 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred);
375 RefPtrWillBeRawPtr<Element> element = m_pendingScript.releaseElementAndClear (); 369 RefPtr<Element> element = m_pendingScript.releaseElementAndClear();
376 ALLOW_UNUSED_LOCAL(element);
377 if (errorOccurred) { 370 if (errorOccurred) {
378 dispatchErrorEvent(); 371 dispatchErrorEvent();
379 } else if (!m_resource->wasCanceled()) { 372 } else if (!m_resource->wasCanceled()) {
380 executeScript(source); 373 executeScript(source);
381 dispatchLoadEvent(); 374 dispatchLoadEvent();
382 } 375 }
383 m_resource = 0; 376 m_resource = 0;
384 } 377 }
385 378
386 void ScriptLoader::notifyFinished(Resource* resource) 379 void ScriptLoader::notifyFinished(Resource* resource)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 { 442 {
450 if (isHTMLScriptLoader(element)) 443 if (isHTMLScriptLoader(element))
451 return toHTMLScriptElement(element)->loader(); 444 return toHTMLScriptElement(element)->loader();
452 445
453 if (isSVGScriptLoader(element)) 446 if (isSVGScriptLoader(element))
454 return toSVGScriptElement(element)->loader(); 447 return toSVGScriptElement(element)->loader();
455 448
456 return 0; 449 return 0;
457 } 450 }
458 451
459 } // namespace blink 452 }
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