Title: [196659] trunk/Source/WebKit2
Revision
196659
Author
[email protected]
Date
2016-02-16 14:43:19 -0800 (Tue, 16 Feb 2016)

Log Message

Remove unused environment variable classes
https://bugs.webkit.org/show_bug.cgi?id=154308

Reviewed by Tim Horton.

* UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h: Removed.
* UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm: Removed.
(WebKit::DynamicLinkerEnvironmentExtractor::DynamicLinkerEnvironmentExtractor): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processEnvironmentVariable): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommand): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommands): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processSingleArchitecture): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processFatFile): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::getExtractedEnvironmentVariables): Deleted.
* UIProcess/Launcher/mac/EnvironmentVariables.cpp: Removed.
(WebKit::EnvironmentVariables::EnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::~EnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::set): Deleted.
(WebKit::EnvironmentVariables::get): Deleted.
(WebKit::EnvironmentVariables::appendValue): Deleted.
(WebKit::EnvironmentVariables::valueIfVariableHasName): Deleted.
(WebKit::EnvironmentVariables::createStringForVariable): Deleted.
(WebKit::EnvironmentVariables::copyEnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::dump): Deleted.
* UIProcess/Launcher/mac/EnvironmentVariables.h: Removed.
(WebKit::EnvironmentVariables::environmentPointer): Deleted.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (196658 => 196659)


--- trunk/Source/WebKit2/ChangeLog	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-16 22:43:19 UTC (rev 196659)
@@ -1,3 +1,34 @@
+2016-02-16  Anders Carlsson  <[email protected]>
+
+        Remove unused environment variable classes
+        https://bugs.webkit.org/show_bug.cgi?id=154308
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h: Removed.
+        * UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm: Removed.
+        (WebKit::DynamicLinkerEnvironmentExtractor::DynamicLinkerEnvironmentExtractor): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::processEnvironmentVariable): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommand): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommands): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::processSingleArchitecture): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::processFatFile): Deleted.
+        (WebKit::DynamicLinkerEnvironmentExtractor::getExtractedEnvironmentVariables): Deleted.
+        * UIProcess/Launcher/mac/EnvironmentVariables.cpp: Removed.
+        (WebKit::EnvironmentVariables::EnvironmentVariables): Deleted.
+        (WebKit::EnvironmentVariables::~EnvironmentVariables): Deleted.
+        (WebKit::EnvironmentVariables::set): Deleted.
+        (WebKit::EnvironmentVariables::get): Deleted.
+        (WebKit::EnvironmentVariables::appendValue): Deleted.
+        (WebKit::EnvironmentVariables::valueIfVariableHasName): Deleted.
+        (WebKit::EnvironmentVariables::createStringForVariable): Deleted.
+        (WebKit::EnvironmentVariables::copyEnvironmentVariables): Deleted.
+        (WebKit::EnvironmentVariables::dump): Deleted.
+        * UIProcess/Launcher/mac/EnvironmentVariables.h: Removed.
+        (WebKit::EnvironmentVariables::environmentPointer): Deleted.
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2016-02-16  Alex Christensen  <[email protected]>
 
         Add checks before redirecting with NetworkSession

Deleted: trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h (196658 => 196659)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h	2016-02-16 22:43:19 UTC (rev 196659)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef DynamicLinkerEnvironmentExtractor_h
-#define DynamicLinkerEnvironmentExtractor_h
-
-#include <mach/machine.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
-
-namespace WebKit {
-
-class EnvironmentVariables;
-
-class DynamicLinkerEnvironmentExtractor {
-    WTF_MAKE_NONCOPYABLE(DynamicLinkerEnvironmentExtractor);
-
-public:
-    DynamicLinkerEnvironmentExtractor(NSString *executablePath, cpu_type_t architecture);
-
-    void getExtractedEnvironmentVariables(EnvironmentVariables&) const;
-
-private:
-    void processSingleArchitecture(const void* data, size_t length);
-    void processFatFile(const void* data, size_t length);
-    void processLoadCommands(const void* data, size_t length, int32_t numberOfCommands, bool shouldByteSwap);
-    size_t processLoadCommand(const void* data, size_t length, bool shouldByteSwap);
-    void processEnvironmentVariable(const char* environmentString);
-
-    RetainPtr<NSString> m_executablePath;
-    cpu_type_t m_architecture;
-
-    Vector<std::pair<CString, CString>> m_extractedVariables;
-};
-
-} // namespace WebKit
-
-#endif // DynamicLinkerEnvironmentExtractor_h

Deleted: trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm (196658 => 196659)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm	2016-02-16 22:43:19 UTC (rev 196659)
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2011 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 "DynamicLinkerEnvironmentExtractor.h"
-
-#include "EnvironmentVariables.h"
-#include <mach-o/loader.h>
-#include <mach-o/swap.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebKit {
-
-DynamicLinkerEnvironmentExtractor::DynamicLinkerEnvironmentExtractor(NSString *executablePath, cpu_type_t architecture)
-    : m_executablePath(executablePath)
-    , m_architecture(architecture)
-{
-    NSData *mainExecutableData = [NSData dataWithContentsOfFile:m_executablePath.get() options:NSDataReadingMappedIfSafe error:0];
-    if (!mainExecutableData)
-        return;
-
-    const void* mainExecutableBytes = [mainExecutableData bytes];
-    size_t length = [mainExecutableData length];
-    if (length < sizeof(uint32_t))
-        return;
-
-    uint32_t magicValue = *static_cast<const uint32_t*>(mainExecutableBytes);
-    if (magicValue == FAT_MAGIC || magicValue == FAT_CIGAM) {
-        processFatFile(mainExecutableBytes, length);
-        return;
-    }
-
-    processSingleArchitecture(mainExecutableBytes, length);
-}
-
-#define DEFINE_BYTE_SWAPPER(type) inline type byteSwapIfNeeded(const type& data, bool shouldByteSwap) \
-{ \
-    type swapped = data; \
-    if (shouldByteSwap) \
-        swap_##type(&swapped, NX_UnknownByteOrder); \
-    return swapped; \
-}
-
-DEFINE_BYTE_SWAPPER(load_command)
-DEFINE_BYTE_SWAPPER(dylinker_command)
-DEFINE_BYTE_SWAPPER(mach_header)
-DEFINE_BYTE_SWAPPER(mach_header_64)
-
-#undef DEFINE_BYTE_SWAPPER
-
-void DynamicLinkerEnvironmentExtractor::processEnvironmentVariable(const char* environmentString)
-{
-    const char* equalsLocation = strchr(environmentString, '=');
-    if (!equalsLocation)
-        return;
-
-    size_t nameLength = equalsLocation - environmentString;
-    String name(environmentString, nameLength);
-
-    // LC_DYLD_ENVIRONMENT only respects DYLD_*_PATH variables.
-    if (!name.startsWith("DYLD_") || !name.endsWith("_PATH"))
-        return;
-
-    CString value(equalsLocation + 1);
-    m_extractedVariables.append(std::make_pair(name.latin1(), value));
-}
-
-size_t DynamicLinkerEnvironmentExtractor::processLoadCommand(const void* data, size_t length, bool shouldByteSwap)
-{
-    if (length < sizeof(load_command))
-        return 0;
-
-    const load_command* rawLoadCommand = static_cast<const load_command*>(data);
-    load_command loadCommand = byteSwapIfNeeded(*rawLoadCommand, shouldByteSwap);
-
-    if (length < loadCommand.cmdsize)
-        return 0;
-
-    if (loadCommand.cmd == LC_DYLD_ENVIRONMENT) {
-        if (length < sizeof(dylinker_command))
-            return 0;
-
-        dylinker_command environmentCommand = byteSwapIfNeeded(*reinterpret_cast<const dylinker_command*>(rawLoadCommand), shouldByteSwap);
-        if (loadCommand.cmdsize < environmentCommand.name.offset)
-            return 0;
-
-        size_t environmentStringLength = loadCommand.cmdsize - environmentCommand.name.offset;
-        Vector<char, 256> environmentString;
-        environmentString.reserveCapacity(environmentStringLength + 1);
-        environmentString.append(reinterpret_cast<const char*>(rawLoadCommand) + environmentCommand.name.offset, environmentStringLength);
-        environmentString.append(0);
-
-        processEnvironmentVariable(environmentString.data());
-    }
-
-    return loadCommand.cmdsize;
-}
-
-void DynamicLinkerEnvironmentExtractor::processLoadCommands(const void* data, size_t length, int32_t numberOfCommands, bool shouldByteSwap)
-{
-    const void* dataRemaining = data;
-    size_t lengthRemaining = length;
-    for (int i = 0; i < numberOfCommands; i++) {
-        size_t commandLength = processLoadCommand(dataRemaining, lengthRemaining, shouldByteSwap);
-        if (!commandLength || lengthRemaining < commandLength)
-            return;
-
-        dataRemaining = static_cast<const char*>(dataRemaining) + commandLength;
-        lengthRemaining -= commandLength;
-    }
-}
-
-void DynamicLinkerEnvironmentExtractor::processSingleArchitecture(const void* data, size_t length)
-{
-    if (length < sizeof(mach_header))
-        return;
-
-    const mach_header* header = static_cast<const mach_header*>(data);
-    if (header->magic == MH_MAGIC || header->magic == MH_CIGAM) {
-        bool shouldByteSwap = header->magic == MH_CIGAM;
-        mach_header swappedHeader = byteSwapIfNeeded(*header, shouldByteSwap);
-        if (swappedHeader.cputype == m_architecture)
-            processLoadCommands(static_cast<const char*>(data) + sizeof(*header), length - sizeof(*header), swappedHeader.ncmds, shouldByteSwap);
-        return;
-    }
-
-    if (length < sizeof(mach_header_64))
-        return;
-
-    const mach_header_64* header64 = static_cast<const mach_header_64*>(data);
-    bool shouldByteSwap = header->magic == MH_CIGAM_64;
-    mach_header_64 swappedHeader64 = byteSwapIfNeeded(*header64, shouldByteSwap);
-    if (swappedHeader64.cputype == m_architecture)
-        processLoadCommands(static_cast<const char*>(data) + sizeof(*header64), length - sizeof(*header64), swappedHeader64.ncmds, shouldByteSwap);
-}
-
-void DynamicLinkerEnvironmentExtractor::processFatFile(const void* data, size_t length)
-{
-    if (length < sizeof(fat_header))
-        return;
-
-    const fat_header* header = static_cast<const fat_header*>(data);
-
-    size_t numberOfArchitectures = OSSwapBigToHostInt32(header->nfat_arch);
-
-    // Ensure that we have enough data remaining for numberOfArchitectures fat_arch structs.
-    if ((length - sizeof(fat_header)) / sizeof(fat_arch) < numberOfArchitectures)
-        return;
-
-    const fat_arch* archs = reinterpret_cast<const fat_arch*>(reinterpret_cast<const char*>(data) + sizeof(*header));
-    for (uint32_t i = 0; i < numberOfArchitectures; i++) {
-        uint32_t architectureOffset = OSSwapBigToHostInt32(archs[i].offset);
-        uint32_t architectureSize = OSSwapBigToHostInt32(archs[i].size);
-        if (length < architectureOffset + architectureSize)
-            return;
-
-        processSingleArchitecture(static_cast<const char*>(data) + architectureOffset, architectureSize);
-    }
-}
-
-void DynamicLinkerEnvironmentExtractor::getExtractedEnvironmentVariables(EnvironmentVariables& environmentVariables) const
-{
-    size_t extractedVariableCount = m_extractedVariables.size();
-    for (size_t i = 0; i < extractedVariableCount; ++i) {
-        const CString& name = m_extractedVariables[i].first;
-
-        // Preserve any existing environment variable by this name so that it will take
-        // precedence over what we extracted from the executable file.
-        if (environmentVariables.get(name.data()))
-            continue;
-
-        environmentVariables.set(name.data(), m_extractedVariables[i].second.data());
-    }
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.cpp (196658 => 196659)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.cpp	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.cpp	2016-02-16 22:43:19 UTC (rev 196659)
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 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 "EnvironmentVariables.h"
-
-#include <crt_externs.h>
-
-namespace WebKit {
-
-EnvironmentVariables::EnvironmentVariables()
-    : m_environmentPointer(*_NSGetEnviron())
-{
-}
-
-EnvironmentVariables::~EnvironmentVariables()
-{
-    size_t size = m_allocatedStrings.size();
-    for (size_t i = 0; i < size; ++i)
-        fastFree(m_allocatedStrings[i]);
-}
-
-void EnvironmentVariables::set(const char* name, const char* value)
-{
-    // Check if we need to copy the environment.
-    if (m_environmentPointer == *_NSGetEnviron())
-        copyEnvironmentVariables();
-
-    // Allocate a string for the name and value.
-    const char* nameAndValue = createStringForVariable(name, value);
-
-    for (size_t i = 0; i < m_environmentVariables.size() - 1; ++i) {
-        if (valueIfVariableHasName(m_environmentVariables[i], name)) {
-            // Just replace the environment variable.
-            m_environmentVariables[i] = const_cast<char*>(nameAndValue);
-            return;
-        }
-    }
-
-    // Append the new string.
-    ASSERT(!m_environmentVariables.last());
-    m_environmentVariables.last() = const_cast<char*>(nameAndValue);
-    m_environmentVariables.append(static_cast<char*>(0));
-
-    m_environmentPointer = m_environmentVariables.data();
-}
-
-const char* EnvironmentVariables::get(const char* name) const
-{
-    for (size_t i = 0; m_environmentPointer[i]; ++i) {
-        if (const char* value = valueIfVariableHasName(m_environmentPointer[i], name))
-            return value;
-    }
-    return 0;
-}
-
-void EnvironmentVariables::appendValue(const char* name, const char* value, char separator)
-{
-    const char* existingValue = get(name);
-    if (!existingValue || !strlen(existingValue)) {
-        set(name, value);
-        return;
-    }
-
-    Vector<char, 128> newValue;
-    newValue.append(existingValue, strlen(existingValue));
-    newValue.append(separator);
-    newValue.append(value, strlen(value) + 1);
-
-    set(name, newValue.data());
-}
-
-const char* EnvironmentVariables::valueIfVariableHasName(const char* environmentVariable, const char* name) const
-{
-    // Find the environment variable name.
-    const char* equalsLocation = strchr(environmentVariable, '=');
-    ASSERT(equalsLocation);
-
-    size_t nameLength = equalsLocation - environmentVariable;
-    if (strlen(name) != nameLength)
-        return 0;
-    if (memcmp(environmentVariable, name, nameLength))
-        return 0;
-
-    return equalsLocation + 1;
-}
-
-const char* EnvironmentVariables::createStringForVariable(const char* name, const char* value)
-{
-    int nameLength = strlen(name);
-    int valueLength = strlen(value);
-
-    // Allocate enough room to hold 'name=value' and the null character.
-    char* string = static_cast<char*>(fastMalloc(nameLength + 1 + valueLength + 1));
-    memcpy(string, name, nameLength);
-    string[nameLength] = '=';
-    memcpy(string + nameLength + 1, value, valueLength);
-    string[nameLength + 1 + valueLength] = '\0';
-
-    m_allocatedStrings.append(string);
-
-    return string;
-}
-
-void EnvironmentVariables::copyEnvironmentVariables()
-{
-    for (size_t i = 0; (*_NSGetEnviron())[i]; i++)
-        m_environmentVariables.append((*_NSGetEnviron())[i]);
-
-    // Null-terminate the array.
-    m_environmentVariables.append(static_cast<char*>(0));
-
-    // Update the environment pointer.
-    m_environmentPointer = m_environmentVariables.data();
-}
-
-void EnvironmentVariables::dump()
-{
-    for (size_t i = 0; (*_NSGetEnviron())[i]; i++)
-        printf("%s\n", (*_NSGetEnviron())[i]);
-
-    printf("\n\n\n");
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.h (196658 => 196659)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.h	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/EnvironmentVariables.h	2016-02-16 22:43:19 UTC (rev 196659)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 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.
- */
-
-#ifndef EnvironmentVariables_h
-#define EnvironmentVariables_h
-
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebKit {
-
-class EnvironmentVariables {
-    WTF_MAKE_NONCOPYABLE(EnvironmentVariables);
-
-public:
-    EnvironmentVariables();
-    ~EnvironmentVariables();
-
-    void set(const char* name, const char* value);
-    const char* get(const char* name) const;
-
-    // Will append the value with the given separator if the environment variable already exists.
-    void appendValue(const char* name, const char* value, char separator);
-
-    char** environmentPointer() const { return m_environmentPointer; }
-
-    static void dump();
-
-private:
-    const char* valueIfVariableHasName(const char* environmentVariable, const char* name) const;
-    const char* createStringForVariable(const char* name, const char* value);
-    void copyEnvironmentVariables();
-
-    char** m_environmentPointer;
-    Vector<char*> m_environmentVariables;
-
-    // These allocated strings will be freed in the destructor.
-    Vector<char*> m_allocatedStrings;
-};
-
-} // namespace WebKit
-
-#endif // EnvironmentVariables_h

Modified: trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm (196658 => 196659)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2016-02-16 22:43:19 UTC (rev 196659)
@@ -26,8 +26,6 @@
 #import "config.h"
 #import "ProcessLauncher.h"
 
-#import "DynamicLinkerEnvironmentExtractor.h"
-#import "EnvironmentVariables.h"
 #import <WebCore/CFBundleSPI.h>
 #import <WebCore/ServersSPI.h>
 #import <WebCore/SoftLinking.h>

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (196658 => 196659)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-02-16 22:01:37 UTC (rev 196658)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-02-16 22:43:19 UTC (rev 196659)
@@ -303,8 +303,6 @@
 		1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */; };
 		1A7C0DF61B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */; };
 		1A7C0DF71B7D1F1000A9B848 /* WKWindowFeaturesRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C0DF51B7D1F1000A9B848 /* WKWindowFeaturesRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */; };
-		1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */; };
 		1A7E377518E4A33A003D0FFF /* WKScriptMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7E377418E4A33A003D0FFF /* WKScriptMessageHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		1A7E377818E4A4FE003D0FFF /* WKScriptMessage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A7E377618E4A4FE003D0FFF /* WKScriptMessage.mm */; };
 		1A7E377918E4A4FE003D0FFF /* WKScriptMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7E377718E4A4FE003D0FFF /* WKScriptMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1056,8 +1054,6 @@
 		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 */; };
-		5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */; };
-		5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */; };
 		6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
 		659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
 		65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2255,8 +2251,6 @@
 		1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManagerMessages.h; sourceTree = "<group>"; };
 		1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWindowFeaturesRef.cpp; sourceTree = "<group>"; };
 		1A7C0DF51B7D1F1000A9B848 /* WKWindowFeaturesRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWindowFeaturesRef.h; sourceTree = "<group>"; };
-		1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvironmentVariables.cpp; sourceTree = "<group>"; };
-		1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvironmentVariables.h; sourceTree = "<group>"; };
 		1A7DA54D1AFD8B380018239D /* Info-OSX-10.9-10.10.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-OSX-10.9-10.10.plist"; sourceTree = "<group>"; };
 		1A7E377418E4A33A003D0FFF /* WKScriptMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKScriptMessageHandler.h; sourceTree = "<group>"; };
 		1A7E377618E4A4FE003D0FFF /* WKScriptMessage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKScriptMessage.mm; sourceTree = "<group>"; };
@@ -3082,8 +3076,6 @@
 		5CBC9B891C6524A500A8FDCF /* NetworkDataTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkDataTask.h; path = NetworkProcess/NetworkDataTask.h; sourceTree = "<group>"; };
 		5CBC9B8B1C65257300A8FDCF /* NetworkDataTaskCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkDataTaskCocoa.mm; path = NetworkProcess/cocoa/NetworkDataTaskCocoa.mm; sourceTree = "<group>"; };
 		5D442A5516D5856700AC3331 /* PluginService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PluginService.entitlements; sourceTree = "<group>"; };
-		5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLinkerEnvironmentExtractor.h; sourceTree = "<group>"; };
-		5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DynamicLinkerEnvironmentExtractor.mm; sourceTree = "<group>"; };
 		5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
 		6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageResourceLoadClient.cpp; sourceTree = "<group>"; };
 		6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
@@ -6218,10 +6210,6 @@
 		BC111B19112F5FC500337BAB /* mac */ = {
 			isa = PBXGroup;
 			children = (
-				5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */,
-				5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */,
-				1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */,
-				1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */,
 				BC111B1B112F5FE600337BAB /* ProcessLauncherMac.mm */,
 			);
 			path = mac;
@@ -7361,11 +7349,9 @@
 				1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */,
 				BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */,
 				1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */,
-				5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */,
 				E105FE5418D7B9DE008F57A8 /* EditingRange.h in Headers */,
 				1AA41AB512C02EC4002BE67B /* EditorState.h in Headers */,
 				51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */,
-				1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */,
 				1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
 				00B9661A18E25AE100CE1F88 /* FindClient.h in Headers */,
 				1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
@@ -8815,10 +8801,8 @@
 				1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */,
 				BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */,
 				1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */,
-				5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */,
 				8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */,
 				51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */,
-				1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */,
 				1AA575FA1496B52600A4EE06 /* EventDispatcher.cpp in Sources */,
 				1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
 				00B9661918E25AE100CE1F88 /* FindClient.mm in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to