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

Side by Side Diff: Source/core/dom/ScriptRunner.h

Issue 496443008: Transfer pending async script loader to new document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Robustify new test wrt expected output Created 6 years, 3 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) 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ~ScriptRunner(); 51 ~ScriptRunner();
52 52
53 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; 53 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION };
54 void queueScriptForExecution(ScriptLoader*, ResourcePtr<ScriptResource>, Exe cutionType); 54 void queueScriptForExecution(ScriptLoader*, ResourcePtr<ScriptResource>, Exe cutionType);
55 bool hasPendingScripts() const { return !m_scriptsToExecuteSoon.isEmpty() || !m_scriptsToExecuteInOrder.isEmpty() || !m_pendingAsyncScripts.isEmpty(); } 55 bool hasPendingScripts() const { return !m_scriptsToExecuteSoon.isEmpty() || !m_scriptsToExecuteInOrder.isEmpty() || !m_pendingAsyncScripts.isEmpty(); }
56 void suspend(); 56 void suspend();
57 void resume(); 57 void resume();
58 void notifyScriptReady(ScriptLoader*, ExecutionType); 58 void notifyScriptReady(ScriptLoader*, ExecutionType);
59 void notifyScriptLoadError(ScriptLoader*, ExecutionType); 59 void notifyScriptLoadError(ScriptLoader*, ExecutionType);
60 60
61 void movePendingAsyncScript(ScriptRunner*, ScriptLoader*);
62
61 void trace(Visitor*); 63 void trace(Visitor*);
62 64
63 private: 65 private:
64 explicit ScriptRunner(Document*); 66 explicit ScriptRunner(Document*);
65 67
66 void timerFired(Timer<ScriptRunner>*); 68 void timerFired(Timer<ScriptRunner>*);
67 69
70 void addPendingAsyncScript(ScriptLoader*, const PendingScript&);
71
68 RawPtrWillBeMember<Document> m_document; 72 RawPtrWillBeMember<Document> m_document;
69 // FIXME: Oilpan: consider using heap vectors and hash map here; 73 // FIXME: Oilpan: consider using heap vectors and hash map here;
70 // PendingScript does have a (trivial) destructor, however. 74 // PendingScript does have a (trivial) destructor, however.
71 Vector<PendingScript> m_scriptsToExecuteInOrder; 75 Vector<PendingScript> m_scriptsToExecuteInOrder;
72 Vector<PendingScript> m_scriptsToExecuteSoon; // http://www.whatwg.org/specs /web-apps/current-work/#set-of-scripts-that-will-execute-as-soon-as-possible 76 Vector<PendingScript> m_scriptsToExecuteSoon; // http://www.whatwg.org/specs /web-apps/current-work/#set-of-scripts-that-will-execute-as-soon-as-possible
73 WillBeHeapHashMap<ScriptLoader*, PendingScript> m_pendingAsyncScripts; 77 WillBeHeapHashMap<ScriptLoader*, PendingScript> m_pendingAsyncScripts;
74 Timer<ScriptRunner> m_timer; 78 Timer<ScriptRunner> m_timer;
75 }; 79 };
76 80
77 } 81 }
78 82
79 #endif 83 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLScriptElement/resources/should-load.js ('k') | Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698