Bug 112905 - Nit: Cleanup casts in XSSAuditorDelegate::didBlockScript.
Summary: Nit: Cleanup casts in XSSAuditorDelegate::didBlockScript.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mike West
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-21 05:36 PDT by Mike West
Modified: 2021-09-21 14:37 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.91 KB, patch)
2013-03-21 05:39 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (1.97 KB, patch)
2013-03-28 05:01 PDT, Mike West
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2013-03-21 05:36:44 PDT
Nit: Don't rely on implicit conversion from KURL to String in XSSAuditorDelegate::didBlockScript.
Comment 1 Mike West 2013-03-21 05:39:27 PDT
Created attachment 194240 [details]
Patch
Comment 2 Mike West 2013-03-28 05:01:02 PDT
Created attachment 195534 [details]
Patch
Comment 3 Thomas Sepez 2013-03-29 15:36:53 PDT
(In reply to comment #2)
> Created an attachment (id=195534) [details]
> Patch

I thought blankURL() was "about:blank"
Comment 4 Mike West 2013-03-30 01:20:51 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=195534) [details] [details]
> > Patch
> 
> I thought blankURL() was "about:blank"

'blankURL()' wraps 'about:blank' in a static KURL: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/KURL.cpp#L1746.

*shrug* not a big deal, just a little nitpicky thing I want to fix. :) Actually... It would probably be worthwhile to have KURL static constants for things like 'about:blank' and 'data:<p></p>' if we're using them as strings in multiple places.
Comment 5 Brent Fulgham 2013-05-31 22:56:55 PDT
Comment on attachment 195534 [details]
Patch

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

I think this is probably okay, but I'd like clarification before we commit this.

> Source/WebCore/ChangeLog:16
> +            pass in 'String()' explicitly. We can also drop the String() cast

Is this really the same thing?  Wouldn't the String produced by blankURL be a string containing the "about:blank" characters?  Does scheduleLocationChange treat this identically to a blank string?

> Source/WebCore/html/parser/XSSAuditorDelegate.cpp:114
> +        m_document->frame()->navigationScheduler()->scheduleLocationChange(m_document->securityOrigin(), "data:text/html,<p></p>", String());

So you are saying that String() in this context will behave the same as the "about:blank" behavior of blankURL()?
Comment 6 Brent Fulgham 2021-09-21 14:37:34 PDT
The XSSAuditor is removed in Bug 230499.