| 1 | /* |
| 2 | * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 | * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY MOTOROLA INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 16 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MOTOROLA INC. OR ITS CONTRIBUTORS |
| 18 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 24 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | */ |
| 26 | |
| 27 | #include "config.h" |
| 28 | #include "WebProcess.h" |
| 29 | |
| 30 | #include "WebProcessCreationParameters.h" |
| 31 | #include <WebCore/GStreamerCommon.h> |
| 32 | #include <WebCore/MemoryCache.h> |
| 33 | |
| 34 | #if PLATFORM(WAYLAND) |
| 35 | #include "WaylandCompositorDisplay.h" |
| 36 | #endif |
| 37 | |
| 38 | #if PLATFORM(WPE) |
| 39 | #include <WebCore/PlatformDisplayLibWPE.h> |
| 40 | #include <wpe/wpe.h> |
| 41 | #endif |
| 42 | |
| 43 | namespace WebKit { |
| 44 | |
| 45 | using namespace WebCore; |
| 46 | |
| 47 | void WebProcess::platformSetCacheModel(CacheModel cacheModel) |
| 48 | { |
| 49 | WebCore::MemoryCache::singleton().setDisabled(cacheModel == CacheModel::DocumentViewer); |
| 50 | } |
| 51 | |
| 52 | void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters) |
| 53 | { |
| 54 | #if PLATFORM(WPE) |
| 55 | if (!parameters.isServiceWorkerProcess) { |
| 56 | auto& implementationLibraryName = parameters.implementationLibraryName; |
| 57 | if (!implementationLibraryName.isNull() && implementationLibraryName.data()[0] != '\0') |
| 58 | wpe_loader_init(parameters.implementationLibraryName.data()); |
| 59 | |
| 60 | RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay())); |
| 61 | downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.releaseFileDescriptor()); |
| 62 | } |
| 63 | #endif |
| 64 | #if PLATFORM(WAYLAND) |
| 65 | m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName); |
| 66 | #endif |
| 67 | #if USE(GSTREAMER) |
| 68 | WebCore::initializeGStreamer(WTFMove(parameters.gstreamerOptions)); |
| 69 | #endif |
| 70 | } |
| 71 | |
| 72 | void WebProcess::platformSetWebsiteDataStoreParameters(WebProcessDataStoreParameters&&) |
| 73 | { |
| 74 | } |
| 75 | |
| 76 | void WebProcess::platformTerminate() |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | } // namespace WebKit |
| 81 | |