Bug 161363

Summary: Add runtime flag for using URLParser
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: mcatanzaro, ossy, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Alex Christensen 2016-08-29 17:06:22 PDT
Add compile flag for using URLParser
Comment 1 Alex Christensen 2016-08-29 17:14:37 PDT
Created attachment 287355 [details]
Patch
Comment 2 Alex Christensen 2016-08-29 21:03:06 PDT
Created attachment 287370 [details]
Patch
Comment 3 Sam Weinig 2016-08-30 10:12:16 PDT
Is there anyway to do this without using a compile time flag? I would really like this to be runtime switchable for testing.
Comment 4 Alex Christensen 2016-08-30 13:45:09 PDT
Created attachment 287424 [details]
Patch
Comment 5 Alex Christensen 2016-08-30 14:26:33 PDT
Created attachment 287431 [details]
Patch
Comment 6 Brady Eidson 2016-08-30 15:10:10 PDT
Comment on attachment 287431 [details]
Patch

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

> Source/WebCore/platform/cocoa/URLParserCocoa.mm:35
> +bool URLParser::URLParserEnabled()
> +{
> +    static bool use = [[NSUserDefaults standardUserDefaults] boolForKey:@"URLParserEnabled"];
> +    return use;
> +}

Doesn't this already happen in your WK2 code? Should it happen? (I thought common wisdom was NO)

> Source/WebKit2/Shared/Cocoa/WebKit2InitializeCocoa.mm:40
> +        WTFLogAlways("ENABLED %d", getpid());

NOPE

> Source/WebKit2/Shared/Cocoa/WebKit2InitializeCocoa.mm:41
> +        URLParser::setEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"URLParserEnabled"]);

I thought nope...?
Comment 7 Alex Christensen 2016-08-30 15:54:29 PDT
Created attachment 287443 [details]
Patch
Comment 8 Alex Christensen 2016-08-31 09:39:04 PDT
Created attachment 287515 [details]
Patch
Comment 9 Alex Christensen 2016-08-31 12:46:20 PDT
I don't know why efl builds and gtk doesn't.
Comment 10 Michael Catanzaro 2016-08-31 12:58:47 PDT
(In reply to comment #9)
> I don't know why efl builds and gtk doesn't.

The new file needs to be added to PluginProcessGTK2_SOURCES in WebKit2/PlatformGTK.cmake. It has to be built twice, unfortunately.
Comment 11 Alex Christensen 2016-08-31 13:18:38 PDT
Created attachment 287533 [details]
Patch
Comment 12 Alex Christensen 2016-08-31 13:21:47 PDT
http://trac.webkit.org/changeset/205266
Comment 13 Csaba Osztrogonác 2016-09-01 08:49:01 PDT
(In reply to comment #12)
> http://trac.webkit.org/changeset/205266

The build is broken on Apple Mac cmake bot:

/Volumes/Data/slave/elcapitan-cmake-debug/build/Source/WebCore/platform/cocoa/URLParserCocoa.mm:31:17: error: out-of-line definition of 'URLParserEnabled' does not match any declaration in 'WebCore::URLParser'
bool URLParser::URLParserEnabled()
                ^~~~~~~~~~~~~~~~
Comment 14 Alex Christensen 2016-09-01 11:40:20 PDT
r205302