[Webkit-unassigned] [Bug 55455] [EFL] HTML saving feature
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed May 18 02:30:25 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=55455
--- Comment #19 from Grzegorz <g.czajkowski at samsung.com> 2011-05-18 02:30:25 PST ---
(In reply to comment #17)
> (From update of attachment 93287 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=93287&action=review
>
> > Source/WebKit/efl/ewk/ewk_frame.cpp:2024
> > +Eina_Bool ewk_frame_source_get(Evas_Object* o, char** frame_source)
>
> To help saving this to a file (using fwrite() and friends), returning a positive size_t (= source_length) for success and a negative for error would be a good idea, wouldn't it?
That's a good idea - fixed.
>
> > Source/WebKit/efl/ewk/ewk_frame.cpp:2044
> > + WTF::String source = WTF::String("<html>") + // FIXME Html tag should be taken from webkit.
> > + sd->frame->document()->head()->outerHTML() +
> > + sd->frame->document()->body()->outerHTML() +
> > + WTF::String("</html>");
>
> Somehow I don't like that FIXME there -- does any other port offer similar feature? If so, how do they do it?
Ok, now html tag is taken for WebKit.
>
> > Source/WebKit/efl/ewk/ewk_frame.cpp:2047
> > + *frame_source = static_cast<char*> (malloc(sizeof(char) * source_length + 1));
>
> sizeof(char) is 1, by definition.
Fixed.
>
> > Source/WebKit/efl/ewk/ewk_frame.cpp:2104
> > + char* resource_location = static_cast<char*> (malloc(sizeof(char) * resources_location[index].length() + 1));
>
> sizeof(char) is 1, by definition.
>
> > Source/WebKit/efl/ewk/ewk_frame.cpp:2111
> > + if (!resource_location) {
> > + CRITICAL("Could not allocate memory.");
> > + *resources_location_list = tmp_list;
> > + if (list_count)
> > + *list_count = index;
> > + return EINA_FALSE;
> > + }
>
> What will happen if, say, you have 10 resources, you've successfully allocated memory for 7 of them, and the 8th one fails? The function'll return EINA_FALSE, so the callee won't know there are 7 valid resources on resource_location_list. Memory needs to be cleaned up here if allocation fails.
>
> Also, I think that returning a Eina_List would be easier here.
I agree with you, now function returns Eina_List.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list