[webkit-reviews] review granted: [Bug 200017] Fix inspector override conversion in InspectorPageAgent::overrideSetting : [Attachment 374643] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 22 16:00:59 PDT 2019


Devin Rousso <drousso at apple.com> has granted youenn fablet
<youennf at gmail.com>'s request for review:
Bug 200017: Fix inspector override conversion in
InspectorPageAgent::overrideSetting
https://bugs.webkit.org/show_bug.cgi?id=200017

Attachment 374643: Patch

https://bugs.webkit.org/attachment.cgi?id=374643&action=review




--- Comment #3 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 374643
  --> https://bugs.webkit.org/attachment.cgi?id=374643
Patch

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

r=me, nice catch!

> Source/WebCore/ChangeLog:15
> +	    Previously, the conversion for the mock capture value was implicit
from a bool pointer to an optional.
> +	    Make an explicit conversion as done for regular settings.

Style: there seems to be an extra space before each of these lines.

> Source/WebCore/inspector/agents/InspectorPageAgent.cpp:429
> +    return *value;

Style: I prefer using `.value()` with `WTF::Optional` so it's a bit clearer
that it's not a pointer.

> Source/WebCore/inspector/agents/InspectorPageAgent.cpp:445
> +    auto overrideValue = toOptionalBool(value);

NIT: Web Inspector typically uses `as*` instead of `to*` for it's type
conversions (see `asBool` in InspectorRuntimeAgent.cpp).

> Source/WebCore/inspector/agents/InspectorPageAgent.cpp:448
> +    case Inspector::Protocol::Page::Setting::name: { 		       
   \

NIT: we can remove the `{` and `}` and make this slightly simpler.


More information about the webkit-reviews mailing list