[Qt][WK2] Use C API to enable Navigator Qt Object.
Created attachment 194053 [details] Patch
Comment on attachment 194053 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=194053&action=review > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:845 > + static WKStringRef messageName = WKStringCreateWithUTF8CString("SetNavigatorQtObjectEnabled"); > + WKRetainPtr<WKBooleanRef> enabledRef = adoptWK(WKBooleanCreate(enabled)); > + WKPagePostMessageToInjectedBundle(webPage.get(), messageName, enabledRef.get()); Why is this static? why not use WKRetainPtr = adoptWK...?
(In reply to comment #2) > (From update of attachment 194053 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=194053&action=review > > > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:845 > > + static WKStringRef messageName = WKStringCreateWithUTF8CString("SetNavigatorQtObjectEnabled"); > > + WKRetainPtr<WKBooleanRef> enabledRef = adoptWK(WKBooleanCreate(enabled)); > > + WKPagePostMessageToInjectedBundle(webPage.get(), messageName, enabledRef.get()); > > Why is this static? why not use WKRetainPtr = adoptWK...? To prevent reinitialization and to follow the same pattern used in https://bugs.webkit.org/show_bug.cgi?id=108826 .
Comment on attachment 194053 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=194053&action=review > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:844 > + WKRetainPtr<WKBooleanRef> enabledRef = adoptWK(WKBooleanCreate(enabled)); Nit: Maybe call it wkEnabled (since it's actually a WKRetainPtr). Otherwise LGTM
Created attachment 194258 [details] Patch
Committed r148008: <http://trac.webkit.org/changeset/148008>