Bug 112225

Summary: Replace static_casts with to* functions for document types
Product: WebKit Reporter: Abhishek Arya <inferno>
Component: DOMAssignee: Abhishek Arya <inferno>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, pdr, rniwa, webkit-ews, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Abhishek Arya 2013-03-12 20:26:53 PDT
Replace static_casts with to* functions for document types
Comment 1 Abhishek Arya 2013-03-12 21:12:42 PDT
Created attachment 192866 [details]
Patch
Comment 2 Abhishek Arya 2013-03-12 21:29:26 PDT
Created attachment 192867 [details]
Patch
Comment 3 Early Warning System Bot 2013-03-12 21:38:12 PDT
Comment on attachment 192867 [details]
Patch

Attachment 192867 [details] did not pass qt-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17160215
Comment 4 Early Warning System Bot 2013-03-12 21:38:51 PDT
Comment on attachment 192867 [details]
Patch

Attachment 192867 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17010936
Comment 5 EFL EWS Bot 2013-03-12 21:55:17 PDT
Comment on attachment 192867 [details]
Patch

Attachment 192867 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17080442
Comment 6 Abhishek Arya 2013-03-12 21:56:22 PDT
Created attachment 192868 [details]
Patch
Comment 7 Early Warning System Bot 2013-03-12 22:07:01 PDT
Comment on attachment 192868 [details]
Patch

Attachment 192868 [details] did not pass qt-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17060722
Comment 8 Early Warning System Bot 2013-03-12 22:09:29 PDT
Comment on attachment 192868 [details]
Patch

Attachment 192868 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17060725
Comment 9 Build Bot 2013-03-12 23:49:23 PDT
Comment on attachment 192868 [details]
Patch

Attachment 192868 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17208050

New failing tests:
userscripts/user-script-plugin-document.html
http/tests/security/contentSecurityPolicy/object-src-url-allowed.html
plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html
plugins/plugin-document-back-forward.html
fast/frames/iframe-plugin-load-remove-document-crash.html
plugins/iframe-plugin-bgcolor.html
http/tests/security/contentSecurityPolicy/object-src-url-blocked.html
fast/loader/reload-zero-byte-plugin.html
Comment 10 Abhishek Arya 2013-03-13 00:15:59 PDT
Created attachment 192875 [details]
Patch
Comment 11 Ryosuke Niwa 2013-03-13 10:17:53 PDT
Comment on attachment 192875 [details]
Patch

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

Please be sure to run tests by a debug build yourself before landing it.

> Source/WebCore/html/ImageDocument.h:88
> +// This will catch anyone doing an unnecessary cast.
> +void toImageDocument(const ImageDocument*);

I'm not sure if this is really useful.

> Source/WebCore/html/MediaDocument.h:71
> +// This will catch anyone doing an unnecessary cast.
> +void toMediaDocument(const MediaDocument*);

Ditto.
Comment 12 Abhishek Arya 2013-03-13 10:45:48 PDT
(In reply to comment #11)
> (From update of attachment 192875 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192875&action=review
> 
> Please be sure to run tests by a debug build yourself before landing it.

Sure.

> 
> > Source/WebCore/html/ImageDocument.h:88
> > +// This will catch anyone doing an unnecessary cast.
> > +void toImageDocument(const ImageDocument*);
> 
> I'm not sure if this is really useful.
> 

actually it helped twice yesterday since compile will fail if something is already the same type and we try to call static_cast on it.

> > Source/WebCore/html/MediaDocument.h:71
> > +// This will catch anyone doing an unnecessary cast.
> > +void toMediaDocument(const MediaDocument*);
> 
> Ditto.
Comment 13 Philip Rogers 2013-03-13 10:52:19 PDT
Comment on attachment 192875 [details]
Patch

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

> Source/WebCore/Modules/notifications/Notification.cpp:261
>      ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument());

This is no longer necessary (here, and elsewhere). Do you mind removing these extra assertions?
Comment 14 Abhishek Arya 2013-03-13 10:53:30 PDT
(In reply to comment #13)
> (From update of attachment 192875 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192875&action=review
> 
> > Source/WebCore/Modules/notifications/Notification.cpp:261
> >      ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument());
> 
> This is no longer necessary (here, and elsewhere). Do you mind removing these extra assertions?

Yes, forgot some of those, will remove before landing.
Comment 15 Abhishek Arya 2013-03-13 12:52:41 PDT
Created attachment 192968 [details]
Patch
Comment 16 WebKit Review Bot 2013-03-13 13:31:22 PDT
Comment on attachment 192968 [details]
Patch

Clearing flags on attachment: 192968

Committed r145745: <http://trac.webkit.org/changeset/145745>
Comment 17 WebKit Review Bot 2013-03-13 13:31:26 PDT
All reviewed patches have been landed.  Closing bug.