WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
202894
[GTK][WebInspector] Support for saving data
https://bugs.webkit.org/show_bug.cgi?id=202894
Summary
[GTK][WebInspector] Support for saving data
Philippe Normand
Reported
2019-10-13 08:26:30 PDT
Implementation of WebInspectorProxy::platformSave() is missing.
Attachments
Patch
(3.94 KB, patch)
2019-10-13 08:29 PDT
,
Philippe Normand
cgarcia
: review+
cgarcia
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2019-10-13 08:29:54 PDT
Created
attachment 380843
[details]
Patch
Carlos Garcia Campos
Comment 2
2019-10-14 00:41:13 PDT
Comment on
attachment 380843
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=380843&action=review
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:467 > + GTK_WINDOW(gtk_widget_get_toplevel(m_inspectorView)), GTK_FILE_CHOOSER_ACTION_SAVE, "Save", "Cancel"));
You need to check the toplevel before using it, you can use WebCore::widgetIsOnscreenToplevelWindow(toplevel) and pass nullptr if it returns false.
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:470 > + gtk_file_chooser_set_do_overwrite_confirmation(chooser, true);
TRUE
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:471 > + gtk_file_chooser_set_current_name(chooser, suggestedURL.utf8().data());
This expects a name not a URL.
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:479 > + if (!base64Decode(content, out, Base64ValidatePadding))
Do we want to decode UTF-16 here?
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:486 > + data = content.utf8().data();
We are saving UTF-8 here.
Philippe Normand
Comment 3
2019-10-14 01:53:47 PDT
Comment on
attachment 380843
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=380843&action=review
>> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:471 >> + gtk_file_chooser_set_current_name(chooser, suggestedURL.utf8().data()); > > This expects a name not a URL.
Actually the argument is not an URL, it's a filename. I'll rename it.
Adrian Perez
Comment 4
2019-10-14 02:01:14 PDT
Comment on
attachment 380843
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=380843&action=review
> Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:487 > + dataLength = strlen(data);
You could use “content.utf8().length()” here instead which is O(1), and avoid the call to strlen() which is O(n).
Philippe Normand
Comment 5
2019-10-14 02:21:22 PDT
Committed
r251069
: <
https://trac.webkit.org/changeset/251069
>
Philippe Normand
Comment 6
2019-10-14 02:21:48 PDT
(In reply to Adrian Perez from
comment #4
)
> Comment on
attachment 380843
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=380843&action=review
> > > Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp:487 > > + dataLength = strlen(data); > > You could use “content.utf8().length()” here instead which is O(1), and avoid > the call to strlen() which is O(n).
Indeed, good tip :P
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug