diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
commit | 08d4a74d56ca431877819fc4566e27eafe150342 (patch) | |
tree | ebd8530838ab390c015c6b7e659a22852c1663ae /Source/WebKit2/Shared | |
parent | 1de6cd4794bbd5a52189384189a2b8df1848b39b (diff) | |
download | qtwebkit-08d4a74d56ca431877819fc4566e27eafe150342.tar.gz |
Imported WebKit commit 0fbd41c4e13f5a190faf160bf993eee614e6e18e (http://svn.webkit.org/repository/webkit/trunk@123477)
New snapshot that adapts to latest Qt API changes
Diffstat (limited to 'Source/WebKit2/Shared')
21 files changed, 350 insertions, 414 deletions
diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp deleted file mode 100755 index 9a3e9fcc5..000000000 --- a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "WKURLRequestEfl.h" - -#include "WKAPICast.h" -#include "WebURLRequestEfl.h" - -using namespace WebKit; - -WKStringRef WKURLRequestEflCopyCookies(WKURLRequestRef requestRef) -{ - RefPtr<WebURLRequestEfl> requestEfl = WebURLRequestEfl::create(toImpl(requestRef)); - return toCopiedAPI(requestEfl->cookies()); -} diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h deleted file mode 100755 index 62688dd54..000000000 --- a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WKURLRequestEfl_h -#define WKURLRequestEfl_h - -#include <WebKit2/WKBase.h> - -#ifdef __cplusplus -extern "C" { -#endif - -WK_EXPORT WKStringRef WKURLRequestEflCopyCookies(WKURLRequestRef); - -#ifdef __cplusplus -} -#endif - -#endif /* WKURLRequestEfl_h */ diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp deleted file mode 100755 index abe01d77b..000000000 --- a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "WKURLResponseEfl.h" - -#include "WKAPICast.h" -#include "WebURLResponseEfl.h" - -using namespace WebKit; - -WKStringRef WKURLResponseEflCopyContentType(WKURLResponseRef responseRef) -{ - RefPtr<WebURLResponseEfl> responseEfl = WebURLResponseEfl::create(toImpl(responseRef)); - return toCopiedAPI(responseEfl->contentType()); -} diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h deleted file mode 100755 index bae655c64..000000000 --- a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WKURLResponseEfl_h -#define WKURLResponseEfl_h - -#include <WebKit2/WKBase.h> - -#ifdef __cplusplus -extern "C" { -#endif - -WK_EXPORT WKStringRef WKURLResponseEflCopyContentType(WKURLResponseRef); - -#ifdef __cplusplus -} -#endif - -#endif /* WKURLResponseEfl_h */ diff --git a/Source/WebKit2/Shared/APIClientTraits.h b/Source/WebKit2/Shared/APIClientTraits.h index d218078c6..e2cce1781 100644 --- a/Source/WebKit2/Shared/APIClientTraits.h +++ b/Source/WebKit2/Shared/APIClientTraits.h @@ -38,7 +38,7 @@ template <typename ClientInterface> struct APIClientTraits { template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) }; template<> struct APIClientTraits<WKBundlePageLoaderClient> { - static const size_t interfaceSizesByVersion[3]; + static const size_t interfaceSizesByVersion[4]; }; template<> struct APIClientTraits<WKBundlePageResourceLoadClient> { diff --git a/Source/WebKit2/Shared/OriginAndDatabases.cpp b/Source/WebKit2/Shared/OriginAndDatabases.cpp index ab09581af..0ad0549ad 100644 --- a/Source/WebKit2/Shared/OriginAndDatabases.cpp +++ b/Source/WebKit2/Shared/OriginAndDatabases.cpp @@ -26,6 +26,8 @@ #include "config.h" #include "OriginAndDatabases.h" +#if ENABLE(SQL_DATABASE) + #include "WebCoreArgumentCoders.h" using namespace WebCore; @@ -55,3 +57,5 @@ bool OriginAndDatabases::decode(CoreIPC::ArgumentDecoder* decoder, OriginAndData } } // namespace WebKit + +#endif // ENABLE(SQL_DATABASE) diff --git a/Source/WebKit2/Shared/OriginAndDatabases.h b/Source/WebKit2/Shared/OriginAndDatabases.h index 03f7261d8..51ef4fae7 100644 --- a/Source/WebKit2/Shared/OriginAndDatabases.h +++ b/Source/WebKit2/Shared/OriginAndDatabases.h @@ -26,6 +26,8 @@ #ifndef OriginAndDatabases_h #define OriginAndDatabases_h +#if ENABLE(SQL_DATABASE) + #include <WebCore/DatabaseDetails.h> #include <wtf/Vector.h> #include <wtf/text/WTFString.h> @@ -49,4 +51,6 @@ struct OriginAndDatabases { } // namespace WebKit +#endif // ENABLE(SQL_DATABASE) + #endif // OriginAndDatabases_h diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp index 542fd3ff8..9b0448ae8 100644 --- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp +++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp @@ -495,7 +495,7 @@ bool ArgumentCoder<CompositionUnderline>::decode(ArgumentDecoder* decoder, Compo return true; } - +#if ENABLE(SQL_DATABASE) void ArgumentCoder<DatabaseDetails>::encode(ArgumentEncoder* encoder, const DatabaseDetails& details) { encoder->encode(details.name()); @@ -525,6 +525,7 @@ bool ArgumentCoder<DatabaseDetails>::decode(ArgumentDecoder* decoder, DatabaseDe details = DatabaseDetails(name, displayName, expectedUsage, currentUsage); return true; } +#endif void ArgumentCoder<DictationAlternative>::encode(ArgumentEncoder* encoder, const DictationAlternative& dictationAlternative) { diff --git a/Source/WebKit2/Shared/WebIntentData.cpp b/Source/WebKit2/Shared/WebIntentData.cpp new file mode 100644 index 000000000..96128dbe2 --- /dev/null +++ b/Source/WebKit2/Shared/WebIntentData.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2012 Intel Corporation. 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 "WebIntentData.h" + +#if ENABLE(WEB_INTENTS) + +#include "ImmutableArray.h" +#include "ImmutableDictionary.h" +#include "WebString.h" +#include "WebURL.h" + +namespace WebKit { + +WebIntentData::WebIntentData(const IntentData& store) + : m_store(store) +{ +} + +PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const +{ + Vector<uint8_t> dataCopy = m_store.data; + return WebSerializedScriptValue::adopt(dataCopy); +} + +PassRefPtr<ImmutableArray> WebIntentData::suggestions() const +{ + const size_t numSuggestions = m_store.suggestions.size(); + Vector<RefPtr<APIObject> > wkSuggestions(numSuggestions); + for (unsigned i = 0; i < numSuggestions; ++i) + wkSuggestions[i] = WebURL::create(m_store.suggestions[i]); + return ImmutableArray::adopt(wkSuggestions); +} + +String WebIntentData::extra(const String& key) const +{ + return m_store.extras.get(key); +} + +PassRefPtr<ImmutableDictionary> WebIntentData::extras() const +{ + ImmutableDictionary::MapType wkExtras; + HashMap<String, String>::const_iterator end = m_store.extras.end(); + for (HashMap<String, String>::const_iterator it = m_store.extras.begin(); it != end; ++it) + wkExtras.set(it->first, WebString::create(it->second)); + return ImmutableDictionary::adopt(wkExtras); +} + +} // namespace WebKit + +#endif // ENABLE(WEB_INTENTS) + diff --git a/Source/WebKit2/Shared/WebIntentData.h b/Source/WebKit2/Shared/WebIntentData.h new file mode 100644 index 000000000..decf4ae4f --- /dev/null +++ b/Source/WebKit2/Shared/WebIntentData.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2012 Intel Corporation. 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. + */ + +#ifndef WebIntentData_h +#define WebIntentData_h + +#if ENABLE(WEB_INTENTS) + +#include "APIObject.h" +#include "IntentData.h" +#include "WebSerializedScriptValue.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebIntentData : public APIObject { +public: + static const Type APIType = TypeIntentData; + + static PassRefPtr<WebIntentData> create(const IntentData& store) + { + return adoptRef(new WebIntentData(store)); + } + + virtual ~WebIntentData() { } + + const String& action() const { return m_store.action; } + const String& payloadType() const { return m_store.type; } + const WebCore::KURL& service() const { return m_store.service; } + PassRefPtr<WebSerializedScriptValue> data() const; + String extra(const String& key) const; + PassRefPtr<ImmutableDictionary> extras() const; + PassRefPtr<ImmutableArray> suggestions() const; + + const IntentData& store() const { return m_store; } + +private: + WebIntentData(const IntentData&); + + virtual Type type() const { return APIType; } + + IntentData m_store; +}; + +} // namespace WebKit + +#endif // ENABLE(WEB_INTENTS) + +#endif // WebIntentData_h diff --git a/Source/WebKit2/Shared/WebIntentServiceInfo.cpp b/Source/WebKit2/Shared/WebIntentServiceInfo.cpp new file mode 100644 index 000000000..84329c5e7 --- /dev/null +++ b/Source/WebKit2/Shared/WebIntentServiceInfo.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 Intel Corporation. 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 "WebIntentServiceInfo.h" + +#if ENABLE(WEB_INTENTS_TAG) + +namespace WebKit { + +WebIntentServiceInfo::WebIntentServiceInfo(const IntentServiceInfo& store) + : m_store(store) +{ +} + +} // namespace WebKit + +#endif // ENABLE(WEB_INTENTS_TAG) diff --git a/Source/WebKit2/Shared/WebIntentServiceInfo.h b/Source/WebKit2/Shared/WebIntentServiceInfo.h new file mode 100644 index 000000000..8694601f0 --- /dev/null +++ b/Source/WebKit2/Shared/WebIntentServiceInfo.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 Intel Corporation. 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. + */ + +#ifndef WebIntentServiceInfo_h +#define WebIntentServiceInfo_h + +#if ENABLE(WEB_INTENTS_TAG) + +#include "APIObject.h" +#include "IntentServiceInfo.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebIntentServiceInfo : public APIObject { +public: + static const Type APIType = TypeIntentServiceInfo; + + static PassRefPtr<WebIntentServiceInfo> create(const IntentServiceInfo& store) + { + return adoptRef(new WebIntentServiceInfo(store)); + } + + virtual ~WebIntentServiceInfo() { } + + const String& action() const { return m_store.action; } + const String& payloadType() const { return m_store.type; } + const WebCore::KURL& href() const { return m_store.href; } + const String& title() const { return m_store.title; } + const String& disposition() const { return m_store.disposition; } + +private: + WebIntentServiceInfo(const IntentServiceInfo&); + + virtual Type type() const { return APIType; } + + IntentServiceInfo m_store; +}; + +} // namespace WebKit + +#endif // ENABLE(WEB_INTENTS_TAG) + +#endif // WebIntentServiceInfo_h diff --git a/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp b/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp new file mode 100644 index 000000000..618ab2a14 --- /dev/null +++ b/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2012 Samsung Electronics + * + * 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 "ProcessExecutablePath.h" + +#include "FileSystem.h" +#include <libgen.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> +#include <wtf/StdLibExtras.h> +#include <wtf/text/CString.h> + +namespace WebKit { + +static String findProcessPath(const char* processName) +{ +#if OS(UNIX) + char readLinkBuffer[PATH_MAX] = {0}; + +#if OS(LINUX) + ssize_t result = readlink("/proc/self/exe", readLinkBuffer, PATH_MAX); +#else + ssize_t result = readlink("/proc/curproc/file", readLinkBuffer, PATH_MAX); +#endif + if (result > 0) { + char* executablePathPtr = dirname(readLinkBuffer); + String executablePath = WebCore::pathByAppendingComponent(String(executablePathPtr), processName); + + // Checks whether process exist on the current path. + struct stat fileStat; + if (!stat(executablePath.utf8().data(), &fileStat)) + return executablePath; + } +#endif + + return WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName); +} + +String executablePathOfWebProcess() +{ + DEFINE_STATIC_LOCAL(const String, webKitWebProcessName, (findProcessPath(WEBPROCESSNAME))); + + return webKitWebProcessName; +} + +String executablePathOfPluginProcess() +{ + DEFINE_STATIC_LOCAL(const String, webKitPluginProcessName, (findProcessPath(PLUGINPROCESSNAME))); + + return webKitPluginProcessName; +} + +} // namespace WebKit diff --git a/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp b/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp deleted file mode 100755 index a964883bb..000000000 --- a/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "WebCoreArgumentCoders.h" - -#include <WebCore/ResourceError.h> -#include <WebCore/ResourceRequest.h> -#include <WebCore/ResourceResponse.h> - -using namespace WebCore; - -namespace CoreIPC { - -void ArgumentCoder<ResourceRequest>::encode(ArgumentEncoder* encoder, const ResourceRequest& resourceRequest) -{ - encoder->encode(resourceRequest.url().string()); - encoder->encode(resourceRequest.httpHeaderField("Cookie")); -} - -bool ArgumentCoder<ResourceRequest>::decode(ArgumentDecoder* decoder, ResourceRequest& resourceRequest) -{ - ResourceRequest request; - - String url; - if (!decoder->decode(url)) - return false; - request.setURL(KURL(KURL(), url)); - - String cookie; - if (!decoder->decode(cookie)) - return false; - request.setHTTPHeaderField("Cookie", cookie); - - resourceRequest = request; - return true; -} - - -void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const ResourceResponse& resourceResponse) -{ - encoder->encode(resourceResponse.mimeType()); -} - -bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceResponse& resourceResponse) -{ - ResourceResponse response; - - String mimeType; - if (!decoder->decode(mimeType)) - return false; - response.setMimeType(mimeType); - - resourceResponse = response; - return true; -} - - -void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const ResourceError& resourceError) -{ - encoder->encode(resourceError.domain()); - encoder->encode(resourceError.errorCode()); - encoder->encode(resourceError.failingURL()); - encoder->encode(resourceError.localizedDescription()); -} - -bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder* decoder, ResourceError& resourceError) -{ - String domain; - if (!decoder->decode(domain)) - return false; - - int errorCode; - if (!decoder->decode(errorCode)) - return false; - - String failingURL; - if (!decoder->decode(failingURL)) - return false; - - String localizedDescription; - if (!decoder->decode(localizedDescription)) - return false; - - resourceError = ResourceError(domain, errorCode, failingURL, localizedDescription); - return true; -} - -} // namespace CoreIPC diff --git a/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp b/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp deleted file mode 100755 index 2a498c441..000000000 --- a/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "WebURLRequestEfl.h" - -using namespace WebCore; - -namespace WebKit { - -WebURLRequestEfl::WebURLRequestEfl(const WebURLRequest* request) - : m_request(request) -{ -} - -const String WebURLRequestEfl::cookies() const -{ - if (!m_request) - return String(); - - return m_request->resourceRequest().httpHeaderField("Cookie"); -} - -} // namespace WebKit diff --git a/Source/WebKit2/Shared/efl/WebURLRequestEfl.h b/Source/WebKit2/Shared/efl/WebURLRequestEfl.h deleted file mode 100755 index 8057db28f..000000000 --- a/Source/WebKit2/Shared/efl/WebURLRequestEfl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WebURLRequestEfl_h -#define WebURLRequestEfl_h - -#include "WebURLRequest.h" -#include <wtf/Forward.h> -#include <wtf/RefCounted.h> - -namespace WebKit { - -class WebURLRequestEfl : public RefCounted<WebURLRequestEfl> { -public: - static PassRefPtr<WebURLRequestEfl> create(const WebURLRequest* request) - { - return adoptRef(new WebURLRequestEfl(request)); - } - - const String cookies() const; - -private: - explicit WebURLRequestEfl(const WebURLRequest*); - - const WebURLRequest* m_request; -}; - -} // namespace WebKit - -#endif // WebURLRequestEfl_h diff --git a/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp b/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp deleted file mode 100755 index 55128a420..000000000 --- a/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "WebURLResponseEfl.h" - -namespace WebKit { - -WebURLResponseEfl::WebURLResponseEfl(const WebURLResponse* response) - : m_response(response) -{ -} - -const String& WebURLResponseEfl::contentType() const -{ - if (!m_response) - return String(); - - return m_response->resourceResponse().mimeType(); -} - -} // namespace WebKit diff --git a/Source/WebKit2/Shared/efl/WebURLResponseEfl.h b/Source/WebKit2/Shared/efl/WebURLResponseEfl.h deleted file mode 100755 index 1193a8023..000000000 --- a/Source/WebKit2/Shared/efl/WebURLResponseEfl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 Samsung Electronics - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WebURLResponseEfl_h -#define WebURLResponseEfl_h - -#include "WebURLResponse.h" -#include <wtf/Forward.h> -#include <wtf/RefCounted.h> - -namespace WebKit { - -class WebURLResponseEfl : public RefCounted<WebURLResponseEfl> { -public: - static PassRefPtr<WebURLResponseEfl> create(const WebURLResponse* response) - { - return adoptRef(new WebURLResponseEfl(response)); - } - - const String& contentType() const; - -private: - explicit WebURLResponseEfl(const WebURLResponse*); - - const WebURLResponse* m_response; -}; - -} // namespace WebKit - -#endif // WebURLResponseEfl_h diff --git a/Source/WebKit2/Shared/qt/QtNetworkRequestData.h b/Source/WebKit2/Shared/qt/QtNetworkRequestData.h index 940bf815f..9bcaac767 100644 --- a/Source/WebKit2/Shared/qt/QtNetworkRequestData.h +++ b/Source/WebKit2/Shared/qt/QtNetworkRequestData.h @@ -34,8 +34,10 @@ class ArgumentEncoder; class ArgumentDecoder; }; +QT_BEGIN_NAMESPACE class QNetworkRequest; class QNetworkReply; +QT_END_NAMESPACE namespace WebKit { diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.h b/Source/WebKit2/Shared/qt/WebEventFactoryQt.h index deecc25d4..f1c24fb00 100644 --- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.h +++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.h @@ -29,6 +29,8 @@ #include "WebEvent.h" +QT_BEGIN_NAMESPACE + #if ENABLE(TOUCH_EVENTS) class QTouchEvent; #endif @@ -37,6 +39,8 @@ class QMouseEvent; class QWheelEvent; class QKeyEvent; +QT_END_NAMESPACE + namespace WebKit { class WebEventFactory { diff --git a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp b/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp index 9d6e25c66..dbe2c51cd 100644 --- a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp +++ b/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp @@ -27,10 +27,10 @@ #include "config.h" #include "WebCoreArgumentCoders.h" -#include <wtf/text/CString.h> #include <WebCore/ResourceError.h> #include <WebCore/ResourceRequest.h> #include <WebCore/ResourceResponse.h> +#include <wtf/text/CString.h> using namespace WebCore; @@ -190,7 +190,7 @@ void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const Resour encoder->encode(resourceError.domain()); encoder->encode(resourceError.errorCode()); - encoder->encode(resourceError.failingURL()); + encoder->encode(resourceError.failingURL()); encoder->encode(resourceError.localizedDescription()); } @@ -219,9 +219,10 @@ bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder* decoder, ResourceErro String localizedDescription; if (!decoder->decode(localizedDescription)) return false; - + resourceError = ResourceError(domain, errorCode, failingURL, localizedDescription); return true; } } + |