Bug 100031 - Make creating platform strategies easier
Summary: Make creating platform strategies easier
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks: 100043
  Show dependency treegraph
 
Reported: 2012-10-22 14:23 PDT by Alexey Proskuryakov
Modified: 2012-10-23 15:06 PDT (History)
7 users (show)

See Also:


Attachments
proposed patch (21.45 KB, patch)
2012-10-22 14:37 PDT, Alexey Proskuryakov
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
with build fixes (24.37 KB, patch)
2012-10-22 15:15 PDT, Alexey Proskuryakov
beidson: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2012-10-22 14:23:12 PDT
To create a platform strategy, one needs to touch every platform's override, even if most of the platforms will just use a default implementation. That's quite a bit of copy/paste code.

Also, the implementation uses an incorrect idiom - createXXXStrategy functions return a result that shouldn't be deleted despite having "create" in the name.
Comment 1 Alexey Proskuryakov 2012-10-22 14:37:09 PDT
Created attachment 169988 [details]
proposed patch
Comment 2 Early Warning System Bot 2012-10-22 14:43:49 PDT
Comment on attachment 169988 [details]
proposed patch

Attachment 169988 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14500235
Comment 3 Early Warning System Bot 2012-10-22 14:44:41 PDT
Comment on attachment 169988 [details]
proposed patch

Attachment 169988 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14487579
Comment 4 Build Bot 2012-10-22 15:09:47 PDT
Comment on attachment 169988 [details]
proposed patch

Attachment 169988 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14488577
Comment 5 Alexey Proskuryakov 2012-10-22 15:15:20 PDT
Created attachment 169998 [details]
with build fixes
Comment 6 Brady Eidson 2012-10-22 15:35:47 PDT
Comment on attachment 169998 [details]
with build fixes

Nit pick: For bonus points anyone who includes PlatformStrategies.h now no longer has to include the header for the specific strategy they meant to use.

R+ after EWS signs off.
Comment 7 Build Bot 2012-10-22 16:09:14 PDT
Comment on attachment 169998 [details]
with build fixes

Attachment 169998 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14492640
Comment 8 Adam Barth 2012-10-22 16:26:34 PDT
Comment on attachment 169998 [details]
with build fixes

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

> Source/WebCore/platform/PlatformStrategies.h:33
> +#include "PluginStrategy.h"

Isn't this a layering violation?  PluginStrategy.h isn't in the platform directory.
Comment 9 Adam Barth 2012-10-22 16:27:12 PDT
http://trac.webkit.org/browser/trunk/Source/WebCore/plugins/PluginStrategy.h

Notice that PluginStrategy.h depends on Page, which is a concept that isn't allowed in WebCore/platform.
Comment 10 Alexey Proskuryakov 2012-10-22 16:57:55 PDT
Thanks for catching this!

>Notice that PluginStrategy.h depends on Page, which is a concept that isn't allowed in WebCore/platform.

This Page dependency looks like a fake one - no port ever looks at this argument. But including PluginStrategy (or possibly even VisitedLinkStrategy) in PlatformStrategies seems flawed.

The design still has the flaws mentioned in description, but we need to approach improving it in some other way.
Comment 11 Alexey Proskuryakov 2012-10-23 15:06:52 PDT
> This Page dependency looks like a fake one - no port ever looks at this argument.

Not true - Qt does.