Bug 112810 - [Qt][WK2] Use C API to enable Navigator Qt Object.
Summary: [Qt][WK2] Use C API to enable Navigator Qt Object.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Brüning
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 07:28 PDT by Michael Brüning
Modified: 2013-04-09 04:47 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.14 KB, patch)
2013-03-20 07:46 PDT, Michael Brüning
no flags Details | Formatted Diff | Diff
Patch (2.12 KB, patch)
2013-03-21 07:30 PDT, Michael Brüning
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Brüning 2013-03-20 07:28:42 PDT
[Qt][WK2] Use C API to enable Navigator Qt Object.
Comment 1 Michael Brüning 2013-03-20 07:46:21 PDT
Created attachment 194053 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2013-03-20 07:48:12 PDT
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...?
Comment 3 Michael Brüning 2013-03-20 07:51:13 PDT
(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 4 Jocelyn Turcotte 2013-03-21 07:23:59 PDT
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
Comment 5 Michael Brüning 2013-03-21 07:30:05 PDT
Created attachment 194258 [details]
Patch
Comment 6 Michael Brüning 2013-04-09 04:47:35 PDT
Committed r148008: <http://trac.webkit.org/changeset/148008>