b4287409aee96ce73399d1440548498388978f76
[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     String diskCacheDirectory;
58     SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
59     bool shouldEnableNetworkCacheEfficacyLogging { false };
60 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
61     bool shouldEnableNetworkCacheSpeculativeRevalidation { false };
62 #endif
63 #if PLATFORM(MAC)
64     Vector<uint8_t> uiProcessCookieStorageIdentifier;
65 #endif
66 #if PLATFORM(IOS_FAMILY)
67     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
68     SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
69     SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
70 #endif
71     bool shouldSuppressMemoryPressureHandler { false };
72     bool shouldUseTestingNetworkSession { false };
73
74     Vector<String> urlSchemesRegisteredForCustomProtocols;
75
76 #if PLATFORM(COCOA)
77     String uiProcessBundleIdentifier;
78     uint32_t uiProcessSDKVersion { 0 };
79 #if PLATFORM(IOS_FAMILY)
80     String ctDataConnectionServiceType;
81 #endif
82     RetainPtr<CFDataRef> networkATSContext;
83     bool storageAccessAPIEnabled;
84     bool suppressesConnectionTerminationOnSystemChange;
85 #endif
86
87     WebsiteDataStoreParameters defaultDataStoreParameters;
88     
89 #if USE(SOUP)
90     HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicyAlways };
91     bool ignoreTLSErrors { false };
92     Vector<String> languages;
93     WebCore::SoupNetworkProxySettings proxySettings;
94 #endif
95
96     Vector<String> urlSchemesRegisteredAsSecure;
97     Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
98     Vector<String> urlSchemesRegisteredAsLocal;
99     Vector<String> urlSchemesRegisteredAsNoAccess;
100     Vector<String> urlSchemesRegisteredAsDisplayIsolated;
101     Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
102     Vector<String> urlSchemesRegisteredAsCORSEnabled;
103
104 #if ENABLE(PROXIMITY_NETWORKING)
105     unsigned wirelessContextIdentifier { 0 };
106 #endif
107
108 #if ENABLE(SERVICE_WORKER)
109     String serviceWorkerRegistrationDirectory;
110     SandboxExtension::Handle serviceWorkerRegistrationDirectoryExtensionHandle;
111     Vector<String> urlSchemesServiceWorkersCanHandle;
112     bool shouldDisableServiceWorkerProcessTerminationDelay { false };
113 #endif
114     bool shouldEnableITPDatabase { false };
115     uint32_t downloadMonitorSpeedMultiplier { 1 };
116 };
117
118 } // namespace WebKit