Changeset 107149 in webkit
- Timestamp:
- Feb 8, 2012, 4:24:07 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bindings/js/JSMainThreadExecState.cpp (modified) (1 diff)
-
bindings/js/JSMainThreadExecState.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107148 r107149 1 2012-02-08 Adam Klein <adamk@chromium.org> 2 3 Simplify and correct mutation delivery timing for JSC 4 https://bugs.webkit.org/show_bug.cgi?id=78172 5 6 Reviewed by Adam Barth. 7 8 Instead of keeping a static recursion counter in JSMainThreadExecState, 9 simply wait for a state change from non-null ExecState to null ExecState. 10 Because s_mainThreadState is initially null, this equivalent to 11 waiting for s_recursionLevel to rewind to zero. 12 13 This also properly handles the usage of JSMainThreadNullState (and 14 does not do mutation delivery), since that class is only used by 15 non-JS bindings. Now fast/mutation/end-of-task-delivery.html properly 16 fails, whereas it was passing before due to usage of the ObjC DOM API 17 from DumpRenderTree. 18 19 * bindings/js/JSMainThreadExecState.cpp: 20 (WebCore): 21 * bindings/js/JSMainThreadExecState.h: Added a comment explaining the purpose of JSMainThreadNullState. 22 (WebCore::JSMainThreadExecState::JSMainThreadExecState): 23 (WebCore::JSMainThreadExecState::~JSMainThreadExecState): 24 (JSMainThreadExecState): 25 (WebCore): 26 1 27 2012-02-08 Kentaro Hara <haraken@chromium.org> 2 28 -
trunk/Source/WebCore/bindings/js/JSMainThreadExecState.cpp
r107008 r107149 33 33 34 34 #if ENABLE(MUTATION_OBSERVERS) 35 int JSMainThreadExecState::s_recursionLevel = 0;36 37 35 void JSMainThreadExecState::didLeaveScriptContext() 38 36 { -
trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h
r107008 r107149 92 92 ASSERT(isMainThread()); 93 93 s_mainThreadState = exec; 94 95 #if ENABLE(MUTATION_OBSERVERS)96 ASSERT(s_recursionLevel >= 0);97 ++s_recursionLevel;98 #endif99 94 }; 100 95 … … 102 97 { 103 98 ASSERT(isMainThread()); 99 100 #if ENABLE(MUTATION_OBSERVERS) 101 bool didExitJavaScript = s_mainThreadState && !m_previousState; 102 #endif 103 104 104 s_mainThreadState = m_previousState; 105 105 106 106 #if ENABLE(MUTATION_OBSERVERS) 107 ASSERT(s_recursionLevel > 0); 108 if (!--s_recursionLevel) 107 if (didExitJavaScript) 109 108 didLeaveScriptContext(); 110 109 #endif … … 117 116 #if ENABLE(MUTATION_OBSERVERS) 118 117 static void didLeaveScriptContext(); 119 static int s_recursionLevel;120 118 #endif 121 119 }; 122 120 123 121 // Null state prevents origin security checks. 122 // Used by non-JavaScript bindings (ObjC, GObject). 124 123 class JSMainThreadNullState : private JSMainThreadExecState { 125 124 public:
Note:
See TracChangeset
for help on using the changeset viewer.