WebProcessManx.cpp 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics. All rights reserved.
  3. * Copyright (C) 2012 Sony Computer Entertainment Inc.
  4. * Copyright (C) 2014 Sony Computer Entertainment Inc.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY MOTOROLA INC. AND ITS CONTRIBUTORS ``AS IS''
  16. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  17. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  18. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MOTOROLA INC. OR ITS CONTRIBUTORS
  19. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  20. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  21. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  23. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  25. * THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include "config.h"
  28. #include "WebProcess.h"
  29. #include "WebProcessCreationParameters.h"
  30. #include <WebCore/NotImplemented.h>
  31. #include <WebCore/RunLoop.h>
  32. #include <manx/NetworkProfile.h>
  33. #include <manx/NetworkUtility.h>
  34. #include <wtf/text/CString.h>
  35. namespace WebKit {
  36. void WebProcess::platformSetCacheModel(CacheModel)
  37. {
  38. notImplemented();
  39. }
  40. void WebProcess::platformClearResourceCaches(ResourceCachesToClear)
  41. {
  42. notImplemented();
  43. }
  44. void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder&)
  45. {
  46. CString userIDString = String::number(parameters.userID).ascii();
  47. setenv("WEBKIT_USER_ID", userIDString.data(), 1);
  48. setenv("WEBKIT_NET_SKIP_CLEAR_SESSCOOKIE", "1", 1);
  49. #if OS(ORBIS)
  50. const String cookieJarFile = parameters.cookieStorageDirectory + "/" COOKIE_JAR_FILENAME_DEFAULT;
  51. Manx::NetworkProfile::set(Manx::NetPropsCookieFilename, cookieJarFile.utf8().data());
  52. const char* secureWebProcess = getenv("MANX_SECURE_WEB_PROCESS");
  53. if (secureWebProcess && !strcmp(secureWebProcess, "1"))
  54. Manx::NetworkProfile::set(Manx::NetPropsMaximumHTTPConnectionCountPerHost, 8);
  55. #endif
  56. WebNetworkAccessManager::setup();
  57. }
  58. void WebProcess::platformTerminate()
  59. {
  60. WebNetworkAccessManager::cleanup();
  61. }
  62. void WebProcess::setPrivilegedNetworkBandwidth(uint32_t bandwidthMode)
  63. {
  64. Manx::NetworkUtility::setPrivilegedNetworkBandwidth(static_cast<Manx::NetworkUtility::BandwidthMode>(bandwidthMode));
  65. }
  66. void WebProcess::setIFilterHTTPProxy(bool enable, String server, int port, String userId, String password)
  67. {
  68. Manx::NetworkProfile::setIFilterHTTPProxy(enable,
  69. server.latin1().data(),
  70. server.length(),
  71. port,
  72. userId.latin1().data(),
  73. userId.length(),
  74. password.latin1().data(),
  75. password.length());
  76. }
  77. void WebProcess::setWebSecurityFilter(int filterMode)
  78. {
  79. Manx::NetworkProfile::set(Manx::NetPropWebSecurityFilterMode, static_cast<long>(filterMode));
  80. }
  81. } // namespace WebKit