Changeset 268868 in webkit
- Timestamp:
- Oct 22, 2020, 9:23:07 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
dom/Document.cpp (modified) (1 diff)
-
dom/Document.h (modified) (1 diff)
-
dom/EmptyScriptExecutionContext.h (modified) (3 diffs)
-
dom/ScriptExecutionContext.cpp (modified) (1 diff)
-
dom/ScriptExecutionContext.h (modified) (1 diff)
-
workers/WorkerOrWorkletGlobalScope.cpp (modified) (1 diff)
-
workers/WorkerOrWorkletGlobalScope.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268866 r268868 1 2020-10-22 Chris Dumez <cdumez@apple.com> 2 3 Turn ScriptExecutionContext::vm() into a pure virtual function 4 https://bugs.webkit.org/show_bug.cgi?id=218057 5 6 Reviewed by Geoffrey Garen. 7 8 Turn ScriptExecutionContext::vm() into a pure virtual function instead of using a 9 non-virtual function that does type-checking inside. 10 11 * dom/Document.cpp: 12 (WebCore::Document::vm): 13 * dom/Document.h: 14 * dom/EmptyScriptExecutionContext.h: 15 * dom/ScriptExecutionContext.cpp: 16 (WebCore::ScriptExecutionContext::vm): Deleted. 17 * dom/ScriptExecutionContext.h: 18 * workers/WorkerOrWorkletGlobalScope.cpp: 19 (WebCore::WorkerOrWorkletGlobalScope::vm): 20 * workers/WorkerOrWorkletGlobalScope.h: 21 1 22 2020-10-22 Aditya Keerthi <akeerthi@apple.com> 2 23 -
trunk/Source/WebCore/dom/Document.cpp
r268774 r268868 8670 8670 } 8671 8671 8672 JSC::VM& Document::vm() 8673 { 8674 return commonVM(); 8675 } 8676 8672 8677 } // namespace WebCore 8673 8678 -
trunk/Source/WebCore/dom/Document.h
r268860 r268868 1596 1596 bool contains(const Node* node) const { return node && contains(*node); } 1597 1597 1598 WEBCORE_EXPORT JSC::VM& vm() final; 1599 1598 1600 protected: 1599 1601 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; -
trunk/Source/WebCore/dom/EmptyScriptExecutionContext.h
r264486 r268868 76 76 #endif 77 77 78 JSC::VM& vm() final { return m_vm; } 79 78 80 using RefCounted::ref; 79 81 using RefCounted::deref; … … 81 83 private: 82 84 EmptyScriptExecutionContext(JSC::VM& vm) 83 : m_origin(SecurityOrigin::createUnique()) 85 : m_vm(vm) 86 , m_origin(SecurityOrigin::createUnique()) 84 87 , m_eventLoop(EmptyEventLoop::create(vm)) 85 88 , m_eventLoopTaskGroup(makeUnique<EventLoopTaskGroup>(m_eventLoop)) … … 113 116 }; 114 117 118 Ref<JSC::VM> m_vm; 115 119 Ref<SecurityOrigin> m_origin; 116 120 URL m_url; -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r268801 r268868 478 478 } 479 479 480 JSC::VM& ScriptExecutionContext::vm()481 {482 if (is<Document>(*this))483 return commonVM();484 if (is<WorkerOrWorkletGlobalScope>(*this))485 return downcast<WorkerOrWorkletGlobalScope>(*this).script()->vm();486 487 RELEASE_ASSERT_NOT_REACHED();488 return commonVM();489 }490 491 480 RejectedPromiseTracker& ScriptExecutionContext::ensureRejectedPromiseTrackerSlow() 492 481 { -
trunk/Source/WebCore/dom/ScriptExecutionContext.h
r268700 r268868 212 212 DOMTimer* findTimeout(int timeoutId) { return m_timeouts.get(timeoutId); } 213 213 214 WEBCORE_EXPORT JSC::VM& vm();214 virtual JSC::VM& vm() = 0; 215 215 216 216 void adjustMinimumDOMTimerInterval(Seconds oldMinimumTimerInterval); -
trunk/Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp
r268822 r268868 65 65 } 66 66 67 JSC::VM& WorkerOrWorkletGlobalScope::vm() 68 { 69 return script()->vm(); 70 } 71 67 72 void WorkerOrWorkletGlobalScope::disableEval(const String& errorMessage) 68 73 { -
trunk/Source/WebCore/workers/WorkerOrWorkletGlobalScope.h
r268822 r268868 48 48 void clearScript(); 49 49 50 JSC::VM& vm() final; 51 50 52 unsigned long createUniqueIdentifier() { return m_uniqueIdentifier++; } 51 53
Note:
See TracChangeset
for help on using the changeset viewer.