+2016-08-31 Alex Christensen <achristensen@webkit.org>
+
+ Add runtime flag for using URLParser
+ https://bugs.webkit.org/show_bug.cgi?id=161363
+
+ Reviewed by Sam Weinig.
+
+ No new tests. No change in default behavior.
+
+ * PlatformMac.cmake:
+ * platform/URL.cpp:
+ (WebCore::URL::URL):
+ (WebCore::URL::init):
+ (WebCore::URL::setProtocol):
+ (WebCore::URL::setHost):
+ (WebCore::URL::removePort):
+ (WebCore::URL::setPort):
+ (WebCore::URL::setHostAndPort):
+ (WebCore::URL::setUser):
+ (WebCore::URL::setPass):
+ (WebCore::URL::setFragmentIdentifier):
+ (WebCore::URL::removeFragmentIdentifier):
+ (WebCore::URL::setQuery):
+ (WebCore::URL::setPath):
+ (WebCore::URL::parse):
+ * platform/URLParser.cpp:
+ (WebCore::URLParser::parse):
+ (WebCore::URLParser::setEnabled):
+ (WebCore::URLParser::enabled):
+ * platform/URLParser.h:
+ * platform/cf/URLCF.cpp:
+ (WebCore::URL::URL):
+ * platform/cocoa/URLParserCocoa.mm: Added.
+ (WebCore::URLParser::URLParserEnabled):
+ * platform/mac/URLMac.mm:
+ (WebCore::URL::URL):
+
2016-08-31 Youenn Fablet <youenn@apple.com>
[Fetch API] Fetch API should be able to load data URL in Same Origin mode
platform/cocoa/SystemVersion.mm
platform/cocoa/TelephoneNumberDetectorCocoa.cpp
platform/cocoa/ThemeCocoa.mm
+ platform/cocoa/URLParserCocoa.mm
platform/cocoa/VNodeTrackerCocoa.cpp
platform/cocoa/WebCoreNSErrorExtras.mm
#include "DecodeEscapeSequences.h"
#include "MIMETypeRegistry.h"
#include "TextEncoding.h"
+#include "URLParser.h"
#include "UUID.h"
#include <stdio.h>
#include <unicode/uidna.h>
URL::URL(ParsedURLStringTag, const String& url)
{
- parse(url);
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(url);
+ ASSERT(url.isEmpty() && m_string.isEmpty() || url == m_string); // FIXME: Investigate parsing non-null empty ParsedURLStrings.
+ } else {
+ parse(url);
#if OS(WINDOWS)
- // FIXME(148598): Work around Windows local file handling bug in CFNetwork
- ASSERT(isLocalFile() || url == m_string);
+ // FIXME(148598): Work around Windows local file handling bug in CFNetwork
+ ASSERT(isLocalFile() || url == m_string);
#else
- ASSERT(url == m_string);
+ ASSERT(url == m_string);
#endif
+ }
}
URL::URL(const URL& base, const String& relative)
{
- init(base, relative, UTF8Encoding());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(relative, base);
+ } else
+ init(base, relative, UTF8Encoding());
}
URL::URL(const URL& base, const String& relative, const TextEncoding& encoding)
{
- // For UTF-{7,16,32}, we want to use UTF-8 for the query part as
- // we do when submitting a form. A form with GET method
- // has its contents added to a URL as query params and it makes sense
- // to be consistent.
- init(base, relative, encoding.encodingForFormSubmission());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(relative, base, encoding);
+ } else {
+ // For UTF-{7,16,32}, we want to use UTF-8 for the query part as
+ // we do when submitting a form. A form with GET method
+ // has its contents added to a URL as query params and it makes sense
+ // to be consistent.
+ init(base, relative, encoding.encodingForFormSubmission());
+ }
}
static bool shouldTrimFromURL(UChar c)
void URL::init(const URL& base, const String& relative, const TextEncoding& encoding)
{
+ if (URLParser::enabled())
+ ASSERT_NOT_REACHED();
+
// Allow resolutions with a null or empty base URL, but not with any other invalid one.
// FIXME: Is this a good rule?
if (!base.m_isValid && !base.isEmpty()) {
return false;
if (!m_isValid) {
- parse(newProtocol + ':' + m_string);
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(newProtocol, ":", m_string));
+ } else
+ parse(newProtocol + ':' + m_string);
return true;
}
- parse(newProtocol + m_string.substring(m_schemeEnd));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(newProtocol, m_string.substring(m_schemeEnd)));
+ } else
+ parse(newProtocol + m_string.substring(m_schemeEnd));
+
return true;
}
builder.append(StringView(encodedHostName.data(), encodedHostName.size()));
builder.append(m_string.substring(m_hostEnd));
- parse(builder.toString());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(builder.toString());
+ } else
+ parse(builder.toString());
}
void URL::removePort()
{
if (m_hostEnd == m_portEnd)
return;
- parse(m_string.left(m_hostEnd) + m_string.substring(m_portEnd));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(m_string.left(m_hostEnd) + m_string.substring(m_portEnd));
+ } else
+ parse(m_string.left(m_hostEnd) + m_string.substring(m_portEnd));
}
void URL::setPort(unsigned short i)
bool colonNeeded = m_portEnd == m_hostEnd;
unsigned portStart = (colonNeeded ? m_hostEnd : m_hostEnd + 1);
- parse(m_string.left(portStart) + (colonNeeded ? ":" : "") + String::number(i) + m_string.substring(m_portEnd));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(portStart), (colonNeeded ? ":" : ""), String::number(i), m_string.substring(m_portEnd)));
+ } else
+ parse(m_string.left(portStart) + (colonNeeded ? ":" : "") + String::number(i) + m_string.substring(m_portEnd));
}
void URL::setHostAndPort(const String& hostAndPort)
}
builder.append(m_string.substring(m_portEnd));
- parse(builder.toString());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(builder.toString());
+ } else
+ parse(builder.toString());
}
void URL::setUser(const String& user)
// Add '@' if we didn't have one before.
if (end == m_hostEnd || (end == m_passwordEnd && m_string[end] != '@'))
u.append('@');
- parse(m_string.left(m_userStart) + u + m_string.substring(end));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_userStart), u, m_string.substring(end)));
+ } else
+ parse(m_string.left(m_userStart) + u + m_string.substring(end));
} else {
// Remove '@' if we now have neither user nor password.
if (m_userEnd == m_passwordEnd && end != m_hostEnd && m_string[end] == '@')
end += 1;
// We don't want to parse in the extremely common case where we are not going to make a change.
- if (m_userStart != end)
- parse(m_string.left(m_userStart) + m_string.substring(end));
+ if (m_userStart != end) {
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_userStart), m_string.substring(end)));
+ } else
+ parse(m_string.left(m_userStart) + m_string.substring(end));
+ }
}
}
// Eat the existing '@' since we are going to add our own.
if (end != m_hostEnd && m_string[end] == '@')
end += 1;
- parse(m_string.left(m_userEnd) + p + m_string.substring(end));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_userEnd), p, m_string.substring(end)));
+ } else
+ parse(m_string.left(m_userEnd) + p + m_string.substring(end));
} else {
// Remove '@' if we now have neither user nor password.
if (m_userStart == m_userEnd && end != m_hostEnd && m_string[end] == '@')
end += 1;
// We don't want to parse in the extremely common case where we are not going to make a change.
- if (m_userEnd != end)
- parse(m_string.left(m_userEnd) + m_string.substring(end));
+ if (m_userEnd != end) {
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_userEnd), m_string.substring(end)));
+ } else
+ parse(m_string.left(m_userEnd) + m_string.substring(end));
+ }
}
}
return;
// FIXME: Non-ASCII characters must be encoded and escaped to match parse() expectations.
- parse(m_string.left(m_queryEnd) + "#" + s);
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_queryEnd), "#", s));
+ } else
+ parse(m_string.left(m_queryEnd) + "#" + s);
}
void URL::removeFragmentIdentifier()
{
if (!m_isValid)
return;
- parse(m_string.left(m_queryEnd));
+ if (URLParser::enabled()) {
+ // FIXME: We shouldn't need to parse here.
+ URLParser parser;
+ *this = parser.parse(m_string.left(m_queryEnd));
+ } else
+ parse(m_string.left(m_queryEnd));
}
void URL::setQuery(const String& query)
// Usually, the query is encoded using document encoding, not UTF-8, but we don't have
// access to the document in this function.
// https://webkit.org/b/161176
- if ((query.isEmpty() || query[0] != '?') && !query.isNull())
- parse(m_string.left(m_pathEnd) + "?" + query + m_string.substring(m_queryEnd));
- else
- parse(m_string.left(m_pathEnd) + query + m_string.substring(m_queryEnd));
+ if ((query.isEmpty() || query[0] != '?') && !query.isNull()) {
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_pathEnd), "?", query, m_string.substring(m_queryEnd)));
+ } else
+ parse(m_string.left(m_pathEnd) + "?" + query + m_string.substring(m_queryEnd));
+ } else {
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_pathEnd), query, m_string.substring(m_queryEnd)));
+ } else
+ parse(m_string.left(m_pathEnd) + query + m_string.substring(m_queryEnd));
+ }
}
if (path.isEmpty() || path[0] != '/')
path = "/" + path;
- parse(m_string.left(m_portEnd) + encodeWithURLEscapeSequences(path) + m_string.substring(m_pathEnd));
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(makeString(m_string.left(m_portEnd), encodeWithURLEscapeSequences(path), m_string.substring(m_pathEnd)));
+ } else
+ parse(m_string.left(m_portEnd) + encodeWithURLEscapeSequences(path) + m_string.substring(m_pathEnd));
}
String decodeURLEscapeSequences(const String& string)
void URL::parse(const String& string)
{
+ if (URLParser::enabled())
+ ASSERT_NOT_REACHED();
checkEncodedString(string);
CharBuffer buffer(string.length() + 1);
void URL::parse(const char* url, const String* originalString)
{
+ if (URLParser::enabled())
+ ASSERT_NOT_REACHED();
if (!url || url[0] == '\0') {
// valid URL must be non-empty
m_string = originalString ? *originalString : url;
URL URLParser::parse(const String& input, const URL& base, const TextEncoding&)
{
+ LOG(URLParser, "Parsing URL <%s> base <%s>", input.utf8().data(), base.string().utf8().data());
m_url = { };
m_buffer.clear();
m_authorityOrHostBuffer.clear();
m_url.m_string = m_buffer.toString();
m_url.m_isValid = true;
+ LOG(URLParser, "Parsed URL <%s>", m_url.m_string.utf8().data());
return m_url;
}
&& a.m_fragmentEnd == b.m_fragmentEnd;
}
+static bool urlParserEnabled = false;
+
+void URLParser::setEnabled(bool enabled)
+{
+ urlParserEnabled = enabled;
+}
+
+bool URLParser::enabled()
+{
+ return urlParserEnabled;
+}
+
} // namespace WebCore
public:
WEBCORE_EXPORT URL parse(const String&, const URL& = { }, const TextEncoding& = UTF8Encoding());
WEBCORE_EXPORT static bool allValuesEqual(const URL&, const URL&);
+
+ WEBCORE_EXPORT static bool enabled();
+ WEBCORE_EXPORT static void setEnabled(bool);
private:
URL m_url;
StringBuilder m_buffer;
#include "URL.h"
#include "CFURLExtras.h"
+#include "URLParser.h"
#include <CoreFoundation/CFURL.h>
#include <wtf/text/CString.h>
// FIXME: Why is it OK to ignore base URL here?
CString urlBytes;
getURLBytes(url, urlBytes);
- parse(urlBytes.data());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ parser.parse(urlBytes.data());
+ } else
+ parse(urlBytes.data());
}
#if !USE(FOUNDATION)
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "URLParser.h"
+
+namespace WebCore {
+
+bool URLParser::URLParserEnabled()
+{
+ static bool use = [[NSUserDefaults standardUserDefaults] boolForKey:@"URLParserEnabled"];
+ return use;
+}
+
+}
#import "URL.h"
#import "CFURLExtras.h"
+#import "URLParser.h"
#import <wtf/ObjcRuntimeExtras.h>
#import <wtf/text/CString.h>
// FIXME: Why is it OK to ignore base URL here?
CString urlBytes;
getURLBytes(reinterpret_cast<CFURLRef>(url), urlBytes);
- parse(urlBytes.data());
+ if (URLParser::enabled()) {
+ URLParser parser;
+ *this = parser.parse(urlBytes.data());
+ } else
+ parse(urlBytes.data());
}
URL::operator NSURL *() const
+2016-08-31 Alex Christensen <achristensen@webkit.org>
+
+ Add runtime flag for using URLParser
+ https://bugs.webkit.org/show_bug.cgi?id=161363
+
+ Reviewed by Sam Weinig.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::initializeNetworkProcess):
+ * NetworkProcess/NetworkProcessCreationParameters.cpp:
+ (WebKit::NetworkProcessCreationParameters::encode):
+ (WebKit::NetworkProcessCreationParameters::decode):
+ * NetworkProcess/NetworkProcessCreationParameters.h:
+ * PlatformEfl.cmake:
+ * PlatformGTK.cmake:
+ * PlatformMac.cmake:
+ * Shared/Cocoa/WebKit2InitializeCocoa.mm: Added.
+ (WebKit::platformInitializeWebKit2):
+ * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
+ (WebKit::XPCServiceInitializer):
+ * Shared/WebKit2Initialize.cpp:
+ (WebKit::InitializeWebKit2):
+ * Shared/WebKit2Initialize.h:
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * Shared/efl/WebKit2InitializeEFL.cpp: Added.
+ (WebKit::platformInitializeWebKit2):
+ * Shared/gtk/WebKit2InitializeGTK.cpp: Added.
+ (WebKit::platformInitializeWebKit2):
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::ensureNetworkProcess):
+ (WebKit::WebProcessPool::createNewWebProcess):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+
2016-08-30 Anders Carlsson <andersca@apple.com>
Use Connection::sendWithReply for the SecItem shim messages
#include <WebCore/SecurityOriginData.h>
#include <WebCore/SecurityOriginHash.h>
#include <WebCore/SessionID.h>
+#include <WebCore/URLParser.h>
#include <wtf/OptionSet.h>
#include <wtf/RunLoop.h>
#include <wtf/text/CString.h>
void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& parameters)
{
+ URLParser::setEnabled(parameters.urlParserEnabled);
+
platformInitializeNetworkProcess(parameters);
WTF::setCurrentThreadIsUserInitiated();
#endif
encoder << shouldSuppressMemoryPressureHandler;
encoder << shouldUseTestingNetworkSession;
+ encoder << urlParserEnabled;
encoder << urlSchemesRegisteredForCustomProtocols;
#if PLATFORM(COCOA)
encoder << parentProcessName;
return false;
if (!decoder.decode(result.shouldUseTestingNetworkSession))
return false;
+ if (!decoder.decode(result.urlParserEnabled))
+ return false;
if (!decoder.decode(result.urlSchemesRegisteredForCustomProtocols))
return false;
#if PLATFORM(COCOA)
#endif
bool shouldSuppressMemoryPressureHandler { false };
bool shouldUseTestingNetworkSession;
+ bool urlParserEnabled { false };
Vector<String> urlSchemesRegisteredForCustomProtocols;
Shared/efl/NativeWebWheelEventEfl.cpp
Shared/efl/ProcessExecutablePathEfl.cpp
Shared/efl/WebEventFactory.cpp
+ Shared/efl/WebKit2InitializeEFL.cpp
Shared/linux/WebMemorySamplerLinux.cpp
Shared/gtk/ProcessExecutablePathGtk.cpp
Shared/gtk/WebContextMenuItemGtk.cpp
Shared/gtk/WebEventFactory.cpp
+ Shared/gtk/WebKit2InitializeGTK.cpp
Shared/linux/WebMemorySamplerLinux.cpp
Shared/gtk/NativeWebWheelEventGtk.cpp
Shared/gtk/ProcessExecutablePathGtk.cpp
Shared/gtk/WebEventFactory.cpp
+ Shared/gtk/WebKit2InitializeGTK.cpp
Shared/soup/WebCoreArgumentCodersSoup.cpp
Shared/Cocoa/CompletionHandlerCallChecker.mm
Shared/Cocoa/DataDetectionResult.mm
Shared/Cocoa/LoadParametersCocoa.mm
+ Shared/Cocoa/WebKit2InitializeCocoa.mm
Shared/Cocoa/WKNSArray.mm
Shared/Cocoa/WKNSData.mm
Shared/Cocoa/WKNSDictionary.mm
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebKit2Initialize.h"
+
+#import <WebCore/RuntimeApplicationChecks.h>
+#import <WebCore/URLParser.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void platformInitializeWebKit2(ProcessType processType)
+{
+ static dispatch_once_t initOnce;
+
+ // We don't want to use NSUserDefaults in the child processes.
+ if (processType == UIProcess) {
+ dispatch_once(&initOnce, ^ {
+ URLParser::setEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"URLParserEnabled"]);
+ });
+ }
+}
+
+}
// so ensure that we have an outstanding transaction here.
xpc_transaction_begin();
- InitializeWebKit2();
+ InitializeWebKit2(ChildProcess);
if (!delegate.checkEntitlements())
exit(EXIT_FAILURE);
#include "LogInitialization.h"
#include <WebCore/LogInitialization.h>
+#include <WebCore/URLParser.h>
#include <runtime/InitializeThreading.h>
#include <wtf/MainThread.h>
#include <wtf/RunLoop.h>
namespace WebKit {
-void InitializeWebKit2()
+void InitializeWebKit2(ProcessType processType)
{
#if PLATFORM(COCOA)
InitWebCoreSystemInterface();
#endif
+ platformInitializeWebKit2(processType);
#if PLATFORM(IOS)
InitWebCoreThreadSystemInterface();
#endif
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKit2Initialize_h
-#define WebKit2Initialize_h
+#pragma once
namespace WebKit {
-void InitializeWebKit2();
-
+enum ProcessType {
+ ChildProcess,
+ UIProcess,
};
-#endif // WebKit2Initialize_h
+void InitializeWebKit2(ProcessType = UIProcess);
+void platformInitializeWebKit2(ProcessType);
+
+};
encoder << uiProcessBundleResourcePathExtensionHandle;
encoder << shouldEnableJIT;
encoder << shouldEnableFTLJIT;
+ encoder << urlParserEnabled;
encoder << !!bundleParameterData;
if (bundleParameterData)
encoder << bundleParameterData->dataReference();
return false;
if (!decoder.decode(parameters.shouldEnableFTLJIT))
return false;
+ if (!decoder.decode(parameters.urlParserEnabled))
+ return false;
bool hasBundleParameterData;
if (!decoder.decode(hasBundleParameterData))
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebProcessCreationParameters_h
-#define WebProcessCreationParameters_h
+#pragma once
#include "CacheModel.h"
#include "SandboxExtension.h"
bool shouldSuppressMemoryPressureHandler { false };
bool shouldUseFontSmoothing;
bool resourceLoadStatisticsEnabled { false };
+ bool urlParserEnabled { false };
Vector<String> fontWhitelist;
};
} // namespace WebKit
-
-#endif // WebProcessCreationParameters_h
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebKit2Initialize.h"
+
+namespace WebKit {
+
+void platformInitializeWebKit2(ProcessType)
+{
+}
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebKit2Initialize.h"
+
+namespace WebKit {
+
+void platformInitializeWebKit2(ProcessType)
+{
+}
+
+}
#include <WebCore/LogInitialization.h>
#include <WebCore/ResourceRequest.h>
#include <WebCore/SessionID.h>
+#include <WebCore/URLParser.h>
#include <runtime/JSCInlines.h>
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
+ parameters.urlParserEnabled = URLParser::enabled();
+
// Add any platform specific parameters
platformInitializeNetworkProcess(parameters);
WebProcessCreationParameters parameters;
+ parameters.urlParserEnabled = URLParser::enabled();
+
parameters.injectedBundlePath = injectedBundlePath();
if (!parameters.injectedBundlePath.isEmpty())
SandboxExtension::createHandle(parameters.injectedBundlePath, SandboxExtension::ReadOnly, parameters.injectedBundlePathExtensionHandle);
5C20CBA01BB1ECD800895BB1 /* NetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */; };
5C298DA01C3DF02100470AFE /* PendingDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */; };
5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */; };
+ 5C79439B1D762D62003102D4 /* WebKit2InitializeCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C79439A1D762CDF003102D4 /* WebKit2InitializeCocoa.mm */; };
5C85C7881C3F23CE0061A4FA /* PendingDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */; };
5CBC9B8D1C65279C00A8FDCF /* NetworkDataTaskCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CBC9B8B1C65257300A8FDCF /* NetworkDataTaskCocoa.mm */; };
5CBC9B8E1C652CA000A8FDCF /* NetworkDataTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */; };
5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkSession.h; path = NetworkProcess/NetworkSession.h; sourceTree = "<group>"; };
5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDownload.h; path = NetworkProcess/Downloads/PendingDownload.h; sourceTree = "<group>"; };
5C7706731D111D8B0012700F /* WebSocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketProvider.cpp; path = Network/WebSocketProvider.cpp; sourceTree = "<group>"; };
+ 5C79439A1D762CDF003102D4 /* WebKit2InitializeCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKit2InitializeCocoa.mm; sourceTree = "<group>"; };
5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketProvider.h; path = Network/WebSocketProvider.h; sourceTree = "<group>"; };
5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PendingDownload.cpp; path = NetworkProcess/Downloads/PendingDownload.cpp; sourceTree = "<group>"; };
5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkDataTask.h; path = NetworkProcess/NetworkDataTask.h; sourceTree = "<group>"; };
37C4C0901814B37B003688B9 /* cocoa */ = {
isa = PBXGroup;
children = (
+ 5C79439A1D762CDF003102D4 /* WebKit2InitializeCocoa.mm */,
1A1EF1971A1D5B420023200A /* APIDataCocoa.mm */,
378E1A3B181ED6FF0031007A /* APIObject.mm */,
37BEC4DF19491486008B4286 /* CompletionHandlerCallChecker.h */,
BC407605124FF0270068F20A /* WKString.cpp in Sources */,
BC407619124FF0370068F20A /* WKStringCF.mm in Sources */,
26F10BE919187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m in Sources */,
+ 5C79439B1D762D62003102D4 /* WebKit2InitializeCocoa.mm in Sources */,
2DD67A361BD861060053B251 /* WKTextFinderClient.mm in Sources */,
0FCB4E6918BBE3D9000FCFC9 /* WKTextInputWindowController.mm in Sources */,
BC407607124FF0270068F20A /* WKType.cpp in Sources */,
#include <WebCore/SchemeRegistry.h>
#include <WebCore/SecurityOrigin.h>
#include <WebCore/Settings.h>
+#include <WebCore/URLParser.h>
#include <WebCore/UserGestureIndicator.h>
#include <unistd.h>
#include <wtf/CurrentTime.h>
void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
{
+ URLParser::setEnabled(parameters.urlParserEnabled);
+
ASSERT(m_pageMap.isEmpty());
#if OS(LINUX)