WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
178824
Add downcast support for FullscreenClient.
https://bugs.webkit.org/show_bug.cgi?id=178824
Summary
Add downcast support for FullscreenClient.
Jeremy Jones
Reported
2017-10-25 13:22:00 PDT
Add downcast support for FullscreenClient.
Attachments
Patch
(5.31 KB, patch)
2017-10-25 13:24 PDT
,
Jeremy Jones
no flags
Details
Formatted Diff
Diff
Patch
(4.87 KB, patch)
2017-11-06 16:38 PST
,
Jeremy Jones
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jeremy Jones
Comment 1
2017-10-25 13:24:28 PDT
Created
attachment 324878
[details]
Patch
Simon Fraser (smfr)
Comment 2
2017-10-25 14:16:30 PDT
Comment on
attachment 324878
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=324878&action=review
> Source/WebKit/UIProcess/Cocoa/FullscreenClient.h:44 > + static int type; > + bool isType(void* target) const override { return target == &type || API::FullscreenClient::isType(target);};
This is really weird. Why the generic types (int and void*) and not enums and classes?
Jeremy Jones
Comment 3
2017-10-26 13:02:47 PDT
(In reply to Simon Fraser (smfr) from
comment #2
)
> Comment on
attachment 324878
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=324878&action=review
> > > Source/WebKit/UIProcess/Cocoa/FullscreenClient.h:44 > > + static int type; > > + bool isType(void* target) const override { return target == &type || API::FullscreenClient::isType(target);}; > > This is really weird. Why the generic types (int and void*) and not enums > and classes?
Are you suggesting something like: typedef int Type; typedef void* TypeRef; ... static Type type; bool isType(TypeRef target); Or are you suggesting API::FullscreenClient have something like: enum FullscreenClientType { APIFullscreenClientType, WebKitFullscreenClientType }; ... bool isType(FullscreenClientType type); In the latter case, it seems weird to me for the base class to be aware of all derived classes.
Simon Fraser (smfr)
Comment 4
2017-10-26 13:09:52 PDT
> Are you suggesting something like: > > typedef int Type; > typedef void* TypeRef; > ... > static Type type; > bool isType(TypeRef target); > > > Or are you suggesting API::FullscreenClient have something like: > > enum FullscreenClientType { > APIFullscreenClientType, > WebKitFullscreenClientType > }; > ... > bool isType(FullscreenClientType type); > > In the latter case, it seems weird to me for the base class to be aware of > all derived classes.
The latter. We do this all over the place.
Jeremy Jones
Comment 5
2017-11-06 16:38:10 PST
Created
attachment 326167
[details]
Patch
WebKit Commit Bot
Comment 6
2017-11-07 16:01:48 PST
Comment on
attachment 326167
[details]
Patch Clearing flags on attachment: 326167 Committed
r224558
: <
https://trac.webkit.org/changeset/224558
>
WebKit Commit Bot
Comment 7
2017-11-07 16:01:50 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8
2017-11-15 13:02:55 PST
<
rdar://problem/35568682
>
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