Changeset 101490 in webkit
- Timestamp:
- Nov 30, 2011 4:57:12 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101488 r101490 1 2011-11-30 Rafael Weinstein <rafaelw@chromium.org> 2 3 [MutationObservers] V8 bindings don't properly wrap all calls into JS 4 https://bugs.webkit.org/show_bug.cgi?id=72063 5 6 Reviewed by Adam Barth. 7 8 This patch changes cleans up script invocation in V8Proxy. It removes callFunctionWithoutFrame 9 and changes callers to simply call instrumentedFunctionCall with a null Page. Also, it implements 10 the non-static callFunction to be implemented in terms of instrumentedFunctionCall. 11 12 No new tests. 13 14 * bindings/v8/ScriptFunctionCall.cpp: 15 (WebCore::ScriptCallback::call): 16 * bindings/v8/V8NodeFilterCondition.cpp: 17 (WebCore::V8NodeFilterCondition::acceptNode): 18 * bindings/v8/V8Proxy.cpp: 19 (WebCore::V8Proxy::callFunction): 20 (WebCore::V8Proxy::instrumentedCallFunction): 21 * bindings/v8/V8Proxy.h: 22 * bindings/v8/custom/V8CustomXPathNSResolver.cpp: 23 (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI): 24 1 25 2011-11-30 Sheriff Bot <webkit.review.bot@gmail.com> 2 26 -
trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp
r95901 r101490 198 198 args[i] = m_arguments[i].v8Value(); 199 199 200 v8::Handle<v8::Value> result = V8Proxy:: callFunctionWithoutFrame(function, object, m_arguments.size(), args.get());200 v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(0 /* page */, function, object, m_arguments.size(), args.get()); 201 201 202 202 if (exceptionCatcher.HasCaught()) { -
trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp
r95901 r101490 84 84 args[0] = toV8(node); 85 85 86 v8::Handle<v8::Value> result = V8Proxy:: callFunctionWithoutFrame(callback, object, 1, args.get());86 v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(0 /* page */, callback, object, 1, args.get()); 87 87 88 88 if (exceptionCatcher.HasCaught()) { -
trunk/Source/WebCore/bindings/v8/V8Proxy.cpp
r101480 r101490 431 431 v8::Local<v8::Value> V8Proxy::callFunction(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]) 432 432 { 433 // Keep Frame (and therefore ScriptController and V8Proxy) alive. 434 RefPtr<Frame> protect(frame()); 435 return V8Proxy::instrumentedCallFunction(m_frame->page(), function, receiver, argc, args); 436 } 437 438 v8::Local<v8::Value> V8Proxy::instrumentedCallFunction(Page* page, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]) 439 { 433 440 V8GCController::checkMemoryUsage(); 434 441 … … 436 443 return handleMaxRecursionDepthExceeded(); 437 444 438 // Keep Frame (and therefore ScriptController and V8Proxy) alive.439 RefPtr<Frame> protect(frame());440 441 v8::Local<v8::Value> result;442 {443 V8RecursionScope recursionScope;444 result = V8Proxy::instrumentedCallFunction(m_frame->page(), function, receiver, argc, args);445 }446 447 didLeaveScriptContext();448 449 if (v8::V8::IsDead())450 handleFatalErrorInV8();451 452 return result;453 }454 455 v8::Local<v8::Value> V8Proxy::callFunctionWithoutFrame(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])456 {457 V8GCController::checkMemoryUsage();458 v8::Local<v8::Value> result = function->Call(receiver, argc, args);459 460 if (v8::V8::IsDead())461 handleFatalErrorInV8();462 463 return result;464 }465 466 v8::Local<v8::Value> V8Proxy::instrumentedCallFunction(Page* page, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])467 {468 445 InspectorInstrumentationCookie cookie; 469 446 if (InspectorInstrumentation::hasFrontends()) { … … 477 454 cookie = InspectorInstrumentation::willCallFunction(page, resourceName, lineNumber); 478 455 } 479 v8::Local<v8::Value> result = function->Call(receiver, argc, args); 456 457 v8::Local<v8::Value> result; 458 { 459 V8RecursionScope recursionScope; 460 result = function->Call(receiver, argc, args); 461 } 462 463 // FIXME: Instrument any work that takes place when script exits to c++ (e.g. Mutation Observers). 464 didLeaveScriptContext(); 465 480 466 InspectorInstrumentation::didCallFunction(cookie); 467 468 if (v8::V8::IsDead()) 469 handleFatalErrorInV8(); 470 481 471 return result; 482 472 } -
trunk/Source/WebCore/bindings/v8/V8Proxy.h
r101480 r101490 165 165 v8::Local<v8::Value> callFunction(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]); 166 166 167 // Call the function with the given receiver and arguments.168 static v8::Local<v8::Value> callFunctionWithoutFrame(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);169 170 167 // call the function with the given receiver and arguments and report times to DevTools. 171 168 static v8::Local<v8::Value> instrumentedCallFunction(Page*, v8::Handle<v8::Function>, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]); -
trunk/Source/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
r97771 r101490 79 79 v8::Handle<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Handle<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc; 80 80 81 v8::Handle<v8::Value> retval = V8Proxy:: callFunctionWithoutFrame(function, m_resolver, argc, argv);81 v8::Handle<v8::Value> retval = V8Proxy::instrumentedCallFunction(0 /* page */, function, m_resolver, argc, argv); 82 82 83 83 // Eat exceptions from namespace resolver and return an empty string. This will most likely cause NAMESPACE_ERR.
Note: See TracChangeset
for help on using the changeset viewer.