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

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

Issue 1666093002: Reorder ScriptLoader fields to help diagnose object inconsistency. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/dom/ScriptLoader.h ('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) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 ScriptLoader::ScriptLoader(Element* element, bool parserInserted, bool alreadySt arted) 60 ScriptLoader::ScriptLoader(Element* element, bool parserInserted, bool alreadySt arted)
61 : m_element(element) 61 : m_element(element)
62 , m_startLineNumber(WTF::OrdinalNumber::beforeFirst()) 62 , m_startLineNumber(WTF::OrdinalNumber::beforeFirst())
63 , m_parserInserted(parserInserted) 63 , m_parserInserted(parserInserted)
64 , m_isExternalScript(false) 64 , m_isExternalScript(false)
65 , m_alreadyStarted(alreadyStarted) 65 , m_alreadyStarted(alreadyStarted)
66 , m_haveFiredLoad(false) 66 , m_haveFiredLoad(false)
67 , m_willBeParserExecuted(false) 67 , m_willBeParserExecuted(false)
68 , m_readyToBeParserExecuted(false) 68 , m_readyToBeParserExecuted(false)
69 , m_willExecuteInOrder(false)
69 , m_willExecuteWhenDocumentFinishedParsing(false) 70 , m_willExecuteWhenDocumentFinishedParsing(false)
70 , m_forceAsync(!parserInserted) 71 , m_forceAsync(!parserInserted)
71 , m_willExecuteInOrder(false)
72 { 72 {
73 ASSERT(m_element); 73 ASSERT(m_element);
74 if (parserInserted && element->document().scriptableDocumentParser() && !ele ment->document().isInDocumentWrite()) 74 if (parserInserted && element->document().scriptableDocumentParser() && !ele ment->document().isInDocumentWrite())
75 m_startLineNumber = element->document().scriptableDocumentParser()->line Number(); 75 m_startLineNumber = element->document().scriptableDocumentParser()->line Number();
76 #if ENABLE(OILPAN) 76 #if ENABLE(OILPAN)
77 ThreadState::current()->registerPreFinalizer(this); 77 ThreadState::current()->registerPreFinalizer(this);
78 #endif 78 #endif
79 } 79 }
80 80
81 ScriptLoader::~ScriptLoader() 81 ScriptLoader::~ScriptLoader()
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 if (client->hasSourceAttribute() && client->deferAttributeValue() && m_parse rInserted && !client->asyncAttributeValue()) { 251 if (client->hasSourceAttribute() && client->deferAttributeValue() && m_parse rInserted && !client->asyncAttributeValue()) {
252 m_willExecuteWhenDocumentFinishedParsing = true; 252 m_willExecuteWhenDocumentFinishedParsing = true;
253 m_willBeParserExecuted = true; 253 m_willBeParserExecuted = true;
254 } else if (client->hasSourceAttribute() && m_parserInserted && !client->asyn cAttributeValue()) { 254 } else if (client->hasSourceAttribute() && m_parserInserted && !client->asyn cAttributeValue()) {
255 m_willBeParserExecuted = true; 255 m_willBeParserExecuted = true;
256 } else if (!client->hasSourceAttribute() && m_parserInserted && !elementDocu ment.isRenderingReady()) { 256 } else if (!client->hasSourceAttribute() && m_parserInserted && !elementDocu ment.isRenderingReady()) {
257 m_willBeParserExecuted = true; 257 m_willBeParserExecuted = true;
258 m_readyToBeParserExecuted = true; 258 m_readyToBeParserExecuted = true;
259 } else if (client->hasSourceAttribute() && !client->asyncAttributeValue() && !m_forceAsync) { 259 } else if (client->hasSourceAttribute() && !client->asyncAttributeValue() && !m_forceAsync) {
260 m_pendingScript = PendingScript::create(m_element, m_resource.get());
260 m_willExecuteInOrder = true; 261 m_willExecuteInOrder = true;
261 m_pendingScript = PendingScript::create(m_element, m_resource.get());
262 contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRun ner::IN_ORDER_EXECUTION); 262 contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRun ner::IN_ORDER_EXECUTION);
263 // Note that watchForLoad can immediately call notifyFinished. 263 // Note that watchForLoad can immediately call notifyFinished.
264 m_pendingScript->watchForLoad(this); 264 m_pendingScript->watchForLoad(this);
265 } else if (client->hasSourceAttribute()) { 265 } else if (client->hasSourceAttribute()) {
266 m_pendingScript = PendingScript::create(m_element, m_resource.get()); 266 m_pendingScript = PendingScript::create(m_element, m_resource.get());
267 LocalFrame* frame = m_element->document().frame(); 267 LocalFrame* frame = m_element->document().frame();
268 if (frame) { 268 if (frame) {
269 ScriptState* scriptState = ScriptState::forMainWorld(frame); 269 ScriptState* scriptState = ScriptState::forMainWorld(frame);
270 if (scriptState) 270 if (scriptState)
271 ScriptStreamer::startStreaming(m_pendingScript.get(), ScriptStre amer::Async, frame->settings(), scriptState, frame->frameScheduler()->loadingTas kRunner()); 271 ScriptStreamer::startStreaming(m_pendingScript.get(), ScriptStre amer::Async, frame->settings(), scriptState, frame->frameScheduler()->loadingTas kRunner());
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (isHTMLScriptLoader(element)) 525 if (isHTMLScriptLoader(element))
526 return toHTMLScriptElement(element)->loader(); 526 return toHTMLScriptElement(element)->loader();
527 527
528 if (isSVGScriptLoader(element)) 528 if (isSVGScriptLoader(element))
529 return toSVGScriptElement(element)->loader(); 529 return toSVGScriptElement(element)->loader();
530 530
531 return 0; 531 return 0;
532 } 532 }
533 533
534 } // namespace blink 534 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698