Bug 36874

Summary: Cleanup RedirectScheduler
Product: WebKit Reporter: Adam Barth <abarth>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, darin, dglazkov, mjs, webkit-ews, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Adam Barth 2010-03-31 00:40:15 PDT
Looking at RedirectScheduler last night with othermaciej, it occurred to us that the psuedo-union ScheduleRedirection is really ugly.  Othermaciej asked me to clean up the class, so here it is in a less ugly form.
Comment 1 Adam Barth 2010-03-31 00:44:38 PDT
Created attachment 52138 [details]
Patch
Comment 2 Maciej Stachowiak 2010-03-31 01:29:39 PDT
Comment on attachment 52138 [details]
Patch

* Suggested renames:

- AbstractRedirect --> ScheduledNavigation
- SimpleRedirect --> ScheduledURLNavigation

* It may or may not be helpful to also add "Scheduled" back to the concrete classes too.

* Odd that locationChangePending is true for classes other than LocationChange. Also: even if the API on the scheduler is locationChangePending(), shouldn't the boolean method on an individual AbstractRedirect (or ScheduledNavigation) object be isLocationChange or countsAsLocationChange or something? It's only telling you about what it is, not what is pending.

That's my style comments. r- to consider those. I will have to do another pass to check behavior-preservingness of the refactoring (since the lines got moved around a lot, was hard to check that with a linear scan).
Comment 3 Adam Barth 2010-03-31 01:53:53 PDT
Created attachment 52142 [details]
Patch
Comment 4 Early Warning System Bot 2010-03-31 02:00:06 PDT
Attachment 52142 [details] did not build on qt:
Build output: http://webkit-commit-queue.appspot.com/results/1621116
Comment 5 WebKit Review Bot 2010-03-31 02:00:42 PDT
Attachment 52142 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/1572099
Comment 6 Adam Barth 2010-03-31 02:04:32 PDT
Created attachment 52144 [details]
Patch
Comment 7 Darin Fisher (:fishd, Google) 2010-03-31 10:01:46 PDT
Comment on attachment 52144 [details]
Patch

> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> +        Cleanup RedirectScheduler
> +        https://bugs.webkit.org/show_bug.cgi?id=36874
> +
> +       Removed the nutty ScheduledRedirection struct in favor of a hierarchy

^^^ bad indentation

otherwise, this all looks good to me.  given the naming of the file, it seems
like it would be nice if the base interface were named ScheduledRedirect, but
I realize why you chose not to do that.
Comment 8 Adam Barth 2010-03-31 11:05:32 PDT
Yeah, the better solution is probably to rename the class.  :)
Comment 9 Adam Barth 2010-03-31 11:08:12 PDT
Created attachment 52188 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2010-03-31 16:22:29 PDT
Comment on attachment 52188 [details]
Patch for landing

Clearing flags on attachment: 52188

Committed r56875: <http://trac.webkit.org/changeset/56875>
Comment 11 WebKit Commit Bot 2010-03-31 16:22:35 PDT
All reviewed patches have been landed.  Closing bug.