RESOLVED FIXED 200017
Fix inspector override conversion in InspectorPageAgent::overrideSetting
https://bugs.webkit.org/show_bug.cgi?id=200017
Summary Fix inspector override conversion in InspectorPageAgent::overrideSetting
youenn fablet
Reported 2019-07-22 15:26:57 PDT
Fix inspector override conversion in InspectorPageAgent::overrideSetting
Attachments
Patch (3.61 KB, patch)
2019-07-22 15:31 PDT, youenn fablet
no flags
Patch for landing (3.52 KB, patch)
2019-07-22 16:14 PDT, youenn fablet
no flags
Radar WebKit Bug Importer
Comment 1 2019-07-22 15:30:48 PDT
youenn fablet
Comment 2 2019-07-22 15:31:17 PDT
Devin Rousso
Comment 3 2019-07-22 16:00:59 PDT
Comment on attachment 374643 [details] 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.
youenn fablet
Comment 4 2019-07-22 16:14:21 PDT
Created attachment 374649 [details] Patch for landing
youenn fablet
Comment 5 2019-07-22 16:23:32 PDT
Done. > Style: I prefer using `.value()` with `WTF::Optional` so it's a bit clearer > that it's not a pointer. I like using pointer-like code, for instance "if(value) value->doSomething()" or "if(value) doSomething(*value)". The one case I am sometimes using .value() is when moving the value. "if (value) doSomething(WTFMove(*value))" seems a bit strange.
WebKit Commit Bot
Comment 6 2019-07-22 17:01:11 PDT
Comment on attachment 374649 [details] Patch for landing Clearing flags on attachment: 374649 Committed r247707: <https://trac.webkit.org/changeset/247707>
WebKit Commit Bot
Comment 7 2019-07-22 17:01:12 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.