Bug 151580 - Make usesNetworkProcess always true
Summary: Make usesNetworkProcess always true
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks: 151418
  Show dependency treegraph
 
Reported: 2015-11-23 21:33 PST by Alex Christensen
Modified: 2016-02-08 15:54 PST (History)
8 users (show)

See Also:


Attachments
Patch (72.78 KB, patch)
2015-11-23 21:33 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (72.18 KB, patch)
2015-11-23 21:47 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (73.27 KB, patch)
2015-11-23 21:56 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (73.48 KB, patch)
2015-11-23 22:13 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (73.67 KB, patch)
2015-11-24 11:49 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
EFL buildfix (2.07 KB, patch)
2015-11-30 07:38 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-11-23 21:33:27 PST
Make usesNetworkProcess always true
Comment 1 Alex Christensen 2015-11-23 21:33:55 PST
Created attachment 266114 [details]
Patch
Comment 2 Alex Christensen 2015-11-23 21:47:42 PST
Created attachment 266116 [details]
Patch
Comment 3 Alex Christensen 2015-11-23 21:56:20 PST
Created attachment 266117 [details]
Patch
Comment 4 Alex Christensen 2015-11-23 22:13:01 PST
Created attachment 266119 [details]
Patch
Comment 5 Carlos Garcia Campos 2015-11-24 00:28:07 PST
Comment on attachment 266119 [details]
Patch

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

> Source/WebKit2/Shared/WebProcessCreationParameters.cpp:-100
>      encoder << cookiePersistentStoragePath;
>      encoder << cookiePersistentStorageType;
>      encoder.encodeEnum(cookieAcceptPolicy);
> -    encoder << ignoreTLSErrors;

I think we can remove all other network parameters as well. At least diskCacheDirectory, cookiePersistentStoragePath, cookiePersistentStorageType, cookieAcceptPolicy and urlSchemesRegisteredForCustomProtocols

> Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:140
>  void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
>  {
> -    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
> -    if (parameters.usesNetworkProcess) {
> -        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
> -        m_messageQueue = nullptr;
> -        return;
> -    }
> -
> -    [NSURLProtocol registerClass:[WKCustomProtocol class]];
> -
> -    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
> -        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
> +    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty());
> +    m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
> +    m_messageQueue = nullptr;
>  }

I think we should remove this entirely and make CustomProtocolManager a NetworkProcessSupplement only.
Comment 6 Darin Adler 2015-11-24 09:17:37 PST
Comment on attachment 266119 [details]
Patch

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

>> Source/WebKit2/Shared/WebProcessCreationParameters.cpp:-100
>> -    encoder << ignoreTLSErrors;
> 
> I think we can remove all other network parameters as well. At least diskCacheDirectory, cookiePersistentStoragePath, cookiePersistentStorageType, cookieAcceptPolicy and urlSchemesRegisteredForCustomProtocols

Should return and delete even more of this unused stuff.

> Source/WebKit2/UIProcess/WebProcessPool.cpp:484
> +    if (networkProcess()) {

I don't understand why this file mixes networkProcess() and m_networkProcess.

> Source/WebKit2/UIProcess/WebProcessPool.cpp:1011
> +    ASSERT(m_networkProcess);

Assertion seems like overkill with nearly no value.

> Source/WebKit2/UIProcess/WebProcessPool.cpp:1012
> +    return m_networkProcess->createDownloadProxy(request);

Should just use the return value of ensureNetworkProcess.
Comment 7 Alex Christensen 2015-11-24 11:49:50 PST
Created attachment 266141 [details]
Patch
Comment 8 Alex Christensen 2015-11-24 11:54:36 PST
(In reply to comment #7)
> Created attachment 266141 [details]
> Patch

I addressed comments.  I plan to land this after Thanksgiving.  I'll be removing more code after that, too.
Comment 9 Carlos Garcia Campos 2015-11-24 23:09:12 PST
Comment on attachment 266141 [details]
Patch

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

> Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:54
>  void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
>  {
> -    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
> -    if (parameters.usesNetworkProcess) {
> -        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
> -        m_messageQueue = nullptr;
> -        return;
> -    }
> -    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
> -        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
> +    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty());
> +    m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
> +    m_messageQueue = nullptr;
>  }

This should be removed entirely as well, please do it before landing.
Comment 10 Csaba Osztrogonác 2015-11-30 07:33:19 PST
Comment on attachment 266141 [details]
Patch

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

> Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:97
>      parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
>      supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
>      parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
> -    parameters.ignoreTLSErrors = m_ignoreTLSErrors;
>      parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
>  }

I think these lines should be removed too to fix the EFL build.

../../Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:93:16: error: 'struct WebKit::WebProcessCreationParameters' has no member named 'urlSchemesRegisteredForCustomProtocols'
../../Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:94:80: error: 'struct WebKit::WebProcessCreationParameters' has no member named 'cookiePersistentStoragePath'
../../Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:94:120: error: 'struct WebKit::WebProcessCreationParameters' has no member named 'cookiePersistentStorageType'
../../Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:95:16: error: 'struct WebKit::WebProcessCreationParameters' has no member named 'cookieAcceptPolicy'
../../Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp:96:16: error: 'struct WebKit::WebProcessCreationParameters' has no member named 'diskCacheDirectory'
Comment 11 Csaba Osztrogonác 2015-11-30 07:38:58 PST
Created attachment 266244 [details]
EFL buildfix

This small patch fixed the EFL build for me, feel free to pick it up.
Comment 12 Csaba Osztrogonác 2015-11-30 07:40:21 PST
(In reply to comment #11)
> Created attachment 266244 [details]
> EFL buildfix
> 
> This small patch fixed the EFL build for me, feel free to pick it up.

But unfortunately tests are still failing with timeout as I mentioned 
it previously: https://bugs.webkit.org/show_bug.cgi?id=151418#c18
Comment 13 Csaba Osztrogonác 2015-11-30 07:48:00 PST
(In reply to comment #12)
> (In reply to comment #11)
> > Created attachment 266244 [details]
> > EFL buildfix
> > 
> > This small patch fixed the EFL build for me, feel free to pick it up.
> 
> But unfortunately tests are still failing with timeout as I mentioned 
> it previously: https://bugs.webkit.org/show_bug.cgi?id=151418#c18

It is a 15 months old regression, see bug137692 for details. It means that EFL
port didn't test enabled NetworkProcess at all nowadays. It's not so good. :-/
Comment 14 Carlos Garcia Campos 2015-11-30 08:12:27 PST
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > Created attachment 266244 [details]
> > > EFL buildfix
> > > 
> > > This small patch fixed the EFL build for me, feel free to pick it up.
> > 
> > But unfortunately tests are still failing with timeout as I mentioned 
> > it previously: https://bugs.webkit.org/show_bug.cgi?id=151418#c18
> 
> It is a 15 months old regression, see bug137692 for details. It means that
> EFL
> port didn't test enabled NetworkProcess at all nowadays. It's not so good.
> :-/

Looking at the patch proposed, it seems to me that it could be an integer overflow in a timer delay due to the std::chrono::milliseconds::max(). We had similar issues with std::chrono::microseconds::max(). The proposed patch seems to be more a workaround than a real fix.
Comment 15 Alex Christensen 2015-11-30 09:50:40 PST
Carlos and Ossy, thanks for looking into the build failures.
http://trac.webkit.org/changeset/192796
Comment 16 Csaba Osztrogonác 2015-11-30 11:20:03 PST
(In reply to comment #15)
> Carlos and Ossy, thanks for looking into the build failures.
> http://trac.webkit.org/changeset/192796

It made Networking completely broken on EFL - bug137692 .
And it made many http tests timeout on GTK too:
- before: https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Tests%29/builds/12445
- after: https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Tests%29/builds/12446
Comment 17 Michael Catanzaro 2015-11-30 11:42:01 PST
We never tested the network process until now, so the GTK tests are probably only now catching bugs that have always existed. Let's not block on those.
Comment 18 Carlos Garcia Campos 2015-12-01 00:10:01 PST
(In reply to comment #17)
> We never tested the network process until now, so the GTK tests are probably
> only now catching bugs that have always existed. Let's not block on those.

This is not true, we have run the layout tests with the network process enabled for long time, since r175776, see bug #138428
Comment 19 Carlos Garcia Campos 2015-12-01 09:39:06 PST
(In reply to comment #16)
> (In reply to comment #15)
> > Carlos and Ossy, thanks for looking into the build failures.
> > http://trac.webkit.org/changeset/192796
> 
> It made Networking completely broken on EFL - bug137692 .
> And it made many http tests timeout on GTK too:
> - before:
> https://build.webkit.org/builders/GTK%20Linux%2064-
> bit%20Release%20%28Tests%29/builds/12445
> - after:
> https://build.webkit.org/builders/GTK%20Linux%2064-
> bit%20Release%20%28Tests%29/builds/12446

GTK+ failures were because r192796 removed the m_ignoreTLSErrors initialization from WebProcessPool by mistake. Those tests use HTTPS and loads failed due to invalid certificate issues. It should be fixed now in r192885
Comment 20 Radar WebKit Bug Importer 2016-02-08 15:54:11 PST
<rdar://problem/24558287>