Bug 156890 - Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
Summary: Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-21 20:13 PDT by Chris Dumez
Modified: 2016-04-22 08:58 PDT (History)
3 users (show)

See Also:


Attachments
Patch (21.04 KB, patch)
2016-04-21 21:18 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.88 KB, patch)
2016-04-22 08:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-04-21 20:13:49 PDT
Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
Comment 1 Chris Dumez 2016-04-21 21:18:21 PDT
Created attachment 277005 [details]
Patch
Comment 2 Darin Adler 2016-04-21 22:26:09 PDT
Comment on attachment 277005 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277005&action=review

> Source/WebCore/bindings/js/JSMutationObserverCustom.cpp:58
> +    Ref<JSMutationCallback> callback = JSMutationCallback::create(object, jsConstructor->globalObject());
> +    JSObject* jsObserver = asObject(toJS(exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));

I would have used auto here or maybe even put everything on one line!

> Source/WebCore/dom/ChildListMutationScope.cpp:133
> +    Ref<NodeList> addedNodes = StaticNodeList::adopt(m_addedNodes);
> +    Ref<NodeList> removedNodes = StaticNodeList::adopt(m_removedNodes);
> +    Ref<MutationRecord> record = MutationRecord::createChildList(m_target, WTFMove(addedNodes), WTFMove(removedNodes), WTFMove(m_previousSibling), WTFMove(m_nextSibling));
> +    m_observers->enqueueMutationRecord(WTFMove(record));

I would have used auto here more. Or not used local variables so much. Or some of each.

> Source/WebCore/dom/MutationObserverInterestGroup.cpp:82
> +        observer->enqueueMutationRecord(*mutationWithNullOldValue);

This should be mutationWithNullOldValue.releaseNonNull().
Comment 3 Chris Dumez 2016-04-22 08:10:17 PDT
Comment on attachment 277005 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277005&action=review

>> Source/WebCore/dom/MutationObserverInterestGroup.cpp:82
>> +        observer->enqueueMutationRecord(*mutationWithNullOldValue);
> 
> This should be mutationWithNullOldValue.releaseNonNull().

I think this may change behavior since this is in a for loop and we check if mutationWithNullOldValue is null earlier.
Comment 4 Chris Dumez 2016-04-22 08:11:07 PDT
Created attachment 277061 [details]
Patch
Comment 5 WebKit Commit Bot 2016-04-22 08:58:50 PDT
Comment on attachment 277061 [details]
Patch

Clearing flags on attachment: 277061

Committed r199878: <http://trac.webkit.org/changeset/199878>
Comment 6 WebKit Commit Bot 2016-04-22 08:58:58 PDT
All reviewed patches have been landed.  Closing bug.