Bug 87829 - [EFL] Ewk_Intent_Request's postResult/postFailure should take serialized script values in argument
Summary: [EFL] Ewk_Intent_Request's postResult/postFailure should take serialized scri...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks: 86868
  Show dependency treegraph
 
Reported: 2012-05-30 00:25 PDT by Chris Dumez
Modified: 2012-05-30 13:47 PDT (History)
6 users (show)

See Also:


Attachments
Patch (9.03 KB, patch)
2012-05-30 00:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.03 KB, patch)
2012-05-30 08:40 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 2012-05-30 00:25:22 PDT
The ewk_intent_request_result_post() and ewk_intent_request_failure_post() methods currently take "const char*" results in argument, which are then converted internally into SerializedScriptValues.
As a consequence, only string type results can be passed in argument, which is not according to the spec. The client should be able to post results of any type, not just string.
We should therefore use WebCore::SerializedScriptValue as argument type and make those methods private.
Comment 1 Chris Dumez 2012-05-30 00:32:14 PDT
Created attachment 144734 [details]
Patch
Comment 2 Greg Billock 2012-05-30 08:13:50 PDT
Comment on attachment 144734 [details]
Patch

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

> Source/WebKit/efl/ewk/ewk_intent_request.cpp:107
> + * The serialied payload data will be passed to the error callback registered by the

serialized
Comment 3 Chris Dumez 2012-05-30 08:40:20 PDT
Created attachment 144828 [details]
Patch

Fix typo reported by Greg, thanks.
Comment 4 Greg Billock 2012-05-30 08:46:28 PDT
This looks good to me.
Comment 5 Adam Barth 2012-05-30 11:26:00 PDT
Comment on attachment 144828 [details]
Patch

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

> Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:676
> +        ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));

Should we send a serialization of null instead?  It seems strange to have this hard-coded error string.
Comment 6 Greg Billock 2012-05-30 11:33:21 PDT
Comment on attachment 144828 [details]
Patch

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

>> Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:676
>> +        ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
> 
> Should we send a serialization of null instead?  It seems strange to have this hard-coded error string.

Could do. It's basically just "some string that we can check for to make sure the postFailure pathway got called."
Comment 7 Chris Dumez 2012-05-30 11:40:20 PDT
(In reply to comment #5)
> (From update of attachment 144828 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=144828&action=review
> 
> > Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:676
> > +        ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
> 
> Should we send a serialization of null instead?  It seems strange to have this hard-coded error string.

This is matching the chromium port implementation:
v8::Handle<v8::Value> v8value = v8::String::New("ERROR");
request->postFailure(WebKit::WebSerializedScriptValue::serialize(v8value));
Comment 8 Adam Barth 2012-05-30 13:10:58 PDT
Comment on attachment 144828 [details]
Patch

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

>>>> Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp:676
>>>> +        ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
>>> 
>>> Should we send a serialization of null instead?  It seems strange to have this hard-coded error string.
>> 
>> Could do. It's basically just "some string that we can check for to make sure the postFailure pathway got called."
> 
> This is matching the chromium port implementation:
> v8::Handle<v8::Value> v8value = v8::String::New("ERROR");
> request->postFailure(WebKit::WebSerializedScriptValue::serialize(v8value));

Ah, ok.  Makes sense.  Thanks!
Comment 9 WebKit Review Bot 2012-05-30 13:47:21 PDT
Comment on attachment 144828 [details]
Patch

Clearing flags on attachment: 144828

Committed r118962: <http://trac.webkit.org/changeset/118962>
Comment 10 WebKit Review Bot 2012-05-30 13:47:28 PDT
All reviewed patches have been landed.  Closing bug.