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

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: ALLOW_UNUSED => ALLOW_UNUSED_LOCAL 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 , m_forceAsync(!parserInserted) 68 , m_forceAsync(!parserInserted)
69 , m_willExecuteInOrder(false) 69 , m_willExecuteInOrder(false)
70 { 70 {
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);
haraken 2014/10/17 12:35:29 This won't touch other on-heap objects, so looks s
79 } 79 }
80 80
81 void ScriptLoader::trace(Visitor* visitor)
82 {
83 visitor->trace(m_pendingScript);
84 }
85
81 void ScriptLoader::didNotifySubtreeInsertionsToDocument() 86 void ScriptLoader::didNotifySubtreeInsertionsToDocument()
82 { 87 {
83 if (!m_parserInserted) 88 if (!m_parserInserted)
84 prepareScript(); // FIXME: Provide a real starting line number here. 89 prepareScript(); // FIXME: Provide a real starting line number here.
85 } 90 }
86 91
87 void ScriptLoader::childrenChanged() 92 void ScriptLoader::childrenChanged()
88 { 93 {
89 if (!m_parserInserted && m_element->inDocument()) 94 if (!m_parserInserted && m_element->inDocument())
90 prepareScript(); // FIXME: Provide a real starting line number here. 95 prepareScript(); // FIXME: Provide a real starting line number here.
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 contextDocument->popCurrentScript(); 364 contextDocument->popCurrentScript();
360 } 365 }
361 } 366 }
362 367
363 void ScriptLoader::execute() 368 void ScriptLoader::execute()
364 { 369 {
365 ASSERT(!m_willBeParserExecuted); 370 ASSERT(!m_willBeParserExecuted);
366 ASSERT(m_pendingScript.resource()); 371 ASSERT(m_pendingScript.resource());
367 bool errorOccurred = false; 372 bool errorOccurred = false;
368 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred); 373 ScriptSourceCode source = m_pendingScript.getSource(KURL(), errorOccurred);
369 RefPtr<Element> element = m_pendingScript.releaseElementAndClear(); 374 RefPtrWillBeRawPtr<Element> element = m_pendingScript.releaseElementAndClear ();
375 ALLOW_UNUSED_LOCAL(element);
370 if (errorOccurred) { 376 if (errorOccurred) {
371 dispatchErrorEvent(); 377 dispatchErrorEvent();
372 } else if (!m_resource->wasCanceled()) { 378 } else if (!m_resource->wasCanceled()) {
373 executeScript(source); 379 executeScript(source);
374 dispatchLoadEvent(); 380 dispatchLoadEvent();
375 } 381 }
376 m_resource = 0; 382 m_resource = 0;
377 } 383 }
378 384
379 void ScriptLoader::notifyFinished(Resource* resource) 385 void ScriptLoader::notifyFinished(Resource* resource)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 { 448 {
443 if (isHTMLScriptLoader(element)) 449 if (isHTMLScriptLoader(element))
444 return toHTMLScriptElement(element)->loader(); 450 return toHTMLScriptElement(element)->loader();
445 451
446 if (isSVGScriptLoader(element)) 452 if (isSVGScriptLoader(element))
447 return toSVGScriptElement(element)->loader(); 453 return toSVGScriptElement(element)->loader();
448 454
449 return 0; 455 return 0;
450 } 456 }
451 457
452 } 458 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698