Ignore:
Timestamp:
02/17/12 10:17:34 (3 years ago)
Author:
adamk@chromium.org
Message:

Merge 107170 - DOM mutations should not be delivered on worker threads
https://bugs.webkit.org/show_bug.cgi?id=77898

Reviewed by Dmitry Titov.

Source/WebCore:

In V8RecursionScope, only call WebKitMutationObserver::deliverAllMutations
if in a Document context.

This is accomplished through a change to V8Proxy::instrumentedCallFunction
(which now takes a Frame* instead of a Page*), requiring an update to all
callers of that function (accounting for the majority of files changed
in this patch).

Added ASSERT(isMainThread()) in a deliverAllMutations to confirm that
it's no longer called on worker threads, and in enqueueMutationRecord,
where the same global store of active observers is accessed.

See also http://crbug.com/112586, where the problem was initially
reported.

  • bindings/v8/ScriptFunctionCall.cpp:

(WebCore::ScriptCallback::call):

  • bindings/v8/V8NodeFilterCondition.cpp:

(WebCore::V8NodeFilterCondition::acceptNode):

  • bindings/v8/V8Proxy.cpp:

(WebCore::V8Proxy::runScript):
(WebCore::V8Proxy::callFunction):
(WebCore::V8Proxy::instrumentedCallFunction):

  • bindings/v8/V8Proxy.h:

(WebCore):
(V8Proxy):

  • bindings/v8/V8RecursionScope.cpp:

(WebCore::V8RecursionScope::didLeaveScriptContext):

  • bindings/v8/V8RecursionScope.h:

(WebCore):
(WebCore::V8RecursionScope::V8RecursionScope):
(V8RecursionScope):
(WebCore::V8RecursionScope::~V8RecursionScope):

  • bindings/v8/V8WindowErrorHandler.cpp:

(WebCore::V8WindowErrorHandler::callListenerFunction):

  • bindings/v8/custom/V8CustomVoidCallback.cpp:

(WebCore::invokeCallback):

  • bindings/v8/custom/V8CustomXPathNSResolver.cpp:

(WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):

  • dom/WebKitMutationObserver.cpp:

(WebCore::WebKitMutationObserver::enqueueMutationRecord):
(WebCore::WebKitMutationObserver::deliverAllMutations):

Source/WebKit/chromium:

  • src/WebDevToolsFrontendImpl.cpp:

(WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):

TBR=adamk@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9355009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/1025/Source/WebCore/dom/WebKitMutationObserver.cpp

    r103001 r108091  
    4242#include "Node.h" 
    4343#include <wtf/ListHashSet.h> 
     44#include <wtf/MainThread.h> 
    4445 
    4546namespace WebCore { 
     
    116117void WebKitMutationObserver::enqueueMutationRecord(PassRefPtr<MutationRecord> mutation) 
    117118{ 
     119    ASSERT(isMainThread()); 
    118120    m_records.append(mutation); 
    119121    activeMutationObservers().add(this); 
     
    133135void WebKitMutationObserver::deliverAllMutations() 
    134136{ 
     137    ASSERT(isMainThread()); 
    135138    static bool deliveryInProgress = false; 
    136139    if (deliveryInProgress) 
Note: See TracChangeset for help on using the changeset viewer.