Bug 150058 - Add SPI for reloading without content blockers
Summary: Add SPI for reloading without content blockers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-12 15:53 PDT by Alex Christensen
Modified: 2015-10-14 13:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (27.71 KB, patch)
2015-10-12 15:59 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (27.84 KB, patch)
2015-10-12 16:02 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (28.80 KB, patch)
2015-10-13 16:02 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (30.23 KB, patch)
2015-10-14 11:39 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-10-12 15:53:36 PDT
Add SPI for reloading without content blockers
Comment 1 Alex Christensen 2015-10-12 15:59:50 PDT
Created attachment 262934 [details]
Patch
Comment 2 Alex Christensen 2015-10-12 16:02:45 PDT
Created attachment 262936 [details]
Patch
Comment 3 Alex Christensen 2015-10-13 16:02:54 PDT
Created attachment 263032 [details]
Patch
Comment 4 WebKit Commit Bot 2015-10-13 16:04:44 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Carlos Garcia Campos 2015-10-13 22:59:28 PDT
Comment on attachment 263032 [details]
Patch

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

> Source/WebKit2/UIProcess/WebFrameProxy.cpp:251
> -            page->reload(false);
> +            page->reload(false, true);

I think this would be easier to read now if we use flags instead of booleans.
Comment 6 Sam Weinig 2015-10-14 10:20:22 PDT
(In reply to comment #5)
> Comment on attachment 263032 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=263032&action=review
> 
> > Source/WebKit2/UIProcess/WebFrameProxy.cpp:251
> > -            page->reload(false);
> > +            page->reload(false, true);
> 
> I think this would be easier to read now if we use flags instead of booleans.

Agreed. Perhaps it would be nicer for reload to take a ReloadOptions object.
Comment 7 Alex Christensen 2015-10-14 11:24:54 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > Comment on attachment 263032 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=263032&action=review
> > 
> > > Source/WebKit2/UIProcess/WebFrameProxy.cpp:251
> > > -            page->reload(false);
> > > +            page->reload(false, true);
> > 
> > I think this would be easier to read now if we use flags instead of booleans.
> 
> Agreed. Perhaps it would be nicer for reload to take a ReloadOptions object.
I agree, but these are passed as parameters all over WebKit2 with IPC and WebCore.  This is the only place that is hard to read.  I think something like this would make it easier to read without requiring a newly defined type:
const bool reloadFromOrigin = false;
const bool contentBlockersEnabled = true;
page->reload(reloadFromOrigin, contentBlockersEnabled);
Comment 8 Alex Christensen 2015-10-14 11:39:46 PDT
Created attachment 263092 [details]
Patch
Comment 9 Alex Christensen 2015-10-14 11:41:22 PDT
Comment on attachment 263092 [details]
Patch

I named all the booleans at the call sites.  That achieves the readability without mucking up the code too much.  If we feel that there are too many parameters, we can wrap the bools in a struct or flags, but I think that's too invasive for this change.
Comment 10 Alex Christensen 2015-10-14 13:04:14 PDT
http://trac.webkit.org/changeset/191063