38e4c321ae01d795b785b3481075932db72592bf
[WebKit-https.git] / Source / WebKit / NetworkProcess / NetworkProcessCreationParameters.h
1 /*
2  * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "CacheModel.h"
29 #include "SandboxExtension.h"
30 #include "WebsiteDataStoreParameters.h"
31 #include <WebCore/Cookie.h>
32 #include <wtf/ProcessID.h>
33 #include <wtf/Vector.h>
34 #include <wtf/text/WTFString.h>
35
36 #if USE(SOUP)
37 #include "HTTPCookieAcceptPolicy.h"
38 #include <WebCore/SoupNetworkProxySettings.h>
39 #endif
40
41 namespace IPC {
42 class Decoder;
43 class Encoder;
44 }
45
46 namespace WebKit {
47
48 struct NetworkProcessCreationParameters {
49     NetworkProcessCreationParameters();
50
51     void encode(IPC::Encoder&) const;
52     static bool decode(IPC::Decoder&, NetworkProcessCreationParameters&);
53
54     CacheModel cacheModel { CacheModel::DocumentViewer };
55     bool canHandleHTTPSServerTrustEvaluation { true };
56
57 #if PLATFORM(MAC)
58     Vector<uint8_t> uiProcessCookieStorageIdentifier;
59 #endif
60 #if PLATFORM(IOS_FAMILY)
61     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
62     SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
63     SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
64 #endif
65     bool shouldSuppressMemoryPressureHandler { false };
66     bool shouldUseTestingNetworkSession { false };
67
68     Vector<String> urlSchemesRegisteredForCustomProtocols;
69
70 #if PLATFORM(COCOA)
71     String uiProcessBundleIdentifier;
72     uint32_t uiProcessSDKVersion { 0 };
73 #if PLATFORM(IOS_FAMILY)
74     String ctDataConnectionServiceType;
75 #endif
76     RetainPtr<CFDataRef> networkATSContext;
77     bool storageAccessAPIEnabled;
78     bool suppressesConnectionTerminationOnSystemChange;
79 #endif
80
81     WebsiteDataStoreParameters defaultDataStoreParameters;
82     Vector<WebsiteDataStoreParameters> nonDefaultDataStoreParameters;
83     
84 #if USE(SOUP)
85     HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicy::AlwaysAccept };
86     bool ignoreTLSErrors { false };
87     Vector<String> languages;
88     WebCore::SoupNetworkProxySettings proxySettings;
89 #endif
90
91     Vector<String> urlSchemesRegisteredAsSecure;
92     Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
93     Vector<String> urlSchemesRegisteredAsLocal;
94     Vector<String> urlSchemesRegisteredAsNoAccess;
95     Vector<String> urlSchemesRegisteredAsDisplayIsolated;
96     Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
97     Vector<String> urlSchemesRegisteredAsCORSEnabled;
98
99 #if ENABLE(SERVICE_WORKER)
100     String serviceWorkerRegistrationDirectory;
101     SandboxExtension::Handle serviceWorkerRegistrationDirectoryExtensionHandle;
102     Vector<String> urlSchemesServiceWorkersCanHandle;
103     bool shouldDisableServiceWorkerProcessTerminationDelay { false };
104 #endif
105     bool shouldEnableITPDatabase { false };
106     uint32_t downloadMonitorSpeedMultiplier { 1 };
107     bool enableAdClickAttributionDebugMode { false };
108     String hstsStorageDirectory;
109     SandboxExtension::Handle hstsStorageDirectoryExtensionHandle;
110     bool enableLegacyTLS { false };
111 };
112
113 } // namespace WebKit